/* Cyberpunk Monochrome Articles CSS */
/* Adapted from writeups.css — inherits variables from static/styles.css */

/* =============================================
   LAYOUT & CONTAINER
   ============================================= */

.articles-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

/* Centered reading column */
.article-col {
    max-width: 850px;
    margin: 0 auto;
    padding: 0 0 3rem;
}

.back-link {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    color: #FFFFFF !important;
    text-decoration: none;
    font-family: 'Zalando Sans', sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
    transition: opacity 0.3s;
}

.back-link svg {
    margin-right: 12px !important;
    transition: margin-right 0.3s ease;
}

.back-link:hover {
    opacity: 0.8;
    color: #FFFFFF !important;
}

.back-link:hover svg {
    margin-right: 6px !important;
}

/* =============================================
   ARTICLE HEADER
   ============================================= */

.article-header {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.article-tag {
    font-family: 'Zalando Sans Expanded', sans-serif;
    font-size: 0.62rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #000;
    background: var(--accent-color);
    padding: 3px 10px;
}

.article-date {
    font-family: 'Zalando Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--dim-text);
    letter-spacing: 1px;
    border: 1px solid var(--border-color);
    padding: 2px 8px;
}

.article-title {
    font-family: 'Zalando Sans Expanded', sans-serif;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 0.5rem 0;
    letter-spacing: 0.5px;
    line-height: 1.2;
    text-transform: none;
}

.article-subtitle {
    font-family: 'Zalando Sans', sans-serif;
    font-size: 1rem;
    color: var(--dim-text);
    margin: 0;
    font-style: italic;
}

/* =============================================
   ARTICLE CONTENT (mirrors .writeup-content)
   ============================================= */

.article-content {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    color: var(--text-color);
    font-family: 'Zalando Sans', sans-serif;
}

.article-content h1,
.article-content h2,
.article-content h3 {
    font-family: 'Zalando Sans Expanded', sans-serif;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.article-content h1 {
    font-size: 2.2rem;
    color: #ffffff;
    border-left: 4px solid var(--accent-color);
    padding-left: 1.2rem;
    letter-spacing: 2px;
}

.article-content h2 {
    font-size: 1.5rem;
    color: var(--accent-color);
    padding-bottom: 0.3rem;
    margin-top: 3rem;
    letter-spacing: 1px;
}

.article-content h3 {
    font-size: 1.3rem;
    color: #e0e0e0;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.article-content p,
.article-content li {
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-color);
    text-align: justify;
}

.article-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid var(--dim-text);
    transition: border-color 0.2s;
}

.article-content a:hover {
    border-bottom-color: var(--accent-color);
}

/* =============================================
   CODE BLOCKS (identical to writeups)
   ============================================= */

.article-content code {
    font-family: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
    font-size: 0.92em;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    padding: 0.2em 0.4em;
    border-radius: 4px;
}

.article-content pre.code {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
}

.article-content pre.code code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.95em;
}

/* Standalone pre (not .code-window wrapped) */
.article-content pre:not(.code) {
    background: #050505;
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-color);
    padding: 1rem 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content pre:not(.code) code {
    background: none;
    padding: 0;
    color: #e0e0e0;
}

/* Code Window */
.code-window {
    background: #050505;
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.window-header {
    background: #111;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.window-title {
    font-family: 'Zalando Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--dim-text);
    letter-spacing: 1px;
    font-weight: bold;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--dim-text);
    color: var(--dim-text);
    font-family: 'Zalando Sans', sans-serif;
    font-size: 0.7rem;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.copy-btn:hover, .copy-btn.copied {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* Syntax Highlighting */
code[class*="language-"],
pre[class*="language-"] {
    color: #e0e0e0;
    text-shadow: none;
    font-family: 'Cascadia Code', 'SFMono-Regular', Consolas, Monaco, monospace;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    line-height: 1.5;
    tab-size: 4;
    hyphens: none;
}

.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #5c6370; font-style: italic; }
.token.punctuation { color: #abb2bf; }
.token.namespace { opacity: .7; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #d19a66; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #98c379; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #56b6c2; }
.token.atrule, .token.attr-value, .token.keyword { color: #c678dd; }
.token.function, .token.class-name { color: #61afef; }
.token.regex, .token.important, .token.variable { color: #e06c75; }

/* =============================================
   IMAGES
   ============================================= */

.article-content figure {
    margin: 2rem 0;
    text-align: center;
}

.article-content img {
    width: 100%;
    max-height: 90vh;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

/* =============================================
   BLOCKQUOTE
   ============================================= */

.article-content blockquote {
    border-left: 3px solid var(--accent-color);
    margin: 1.5rem 0;
    padding: 1rem 1.2rem;
    background: rgba(255,255,255,0.03);
}

.article-content blockquote p {
    text-align: left;
    color: var(--dim-text);
    font-style: italic;
    margin: 0.4rem 0;
}

.article-content blockquote p:first-child {
    color: var(--text-color);
    font-style: normal;
    font-weight: 600;
    font-family: 'Zalando Sans Expanded', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

/* =============================================
   HR
   ============================================= */

.article-content hr {
    border: none;
    border-top: 1px dashed var(--border-color);
    margin: 2.5rem 0;
}

/* =============================================
   LINK INTEGRATIONS (identical to writeups)
   ============================================= */

.article-content .link-integration {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    margin: 1.5rem 0;
    transition: all 0.2s;
    text-decoration: none;
    max-width: 100%;
    box-sizing: border-box;
}

.article-content .link-integration:hover {
    border-color: var(--accent-color);
    transform: translateX(5px);
}

.article-content .link-integration .site-favicon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    filter: grayscale(0%);
    flex-shrink: 0;
}

.article-content .link-integration a {
    color: var(--text-color);
    font-family: 'Zalando Sans', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    border-bottom: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-content .link-integration:hover a {
    color: var(--accent-color);
}

/* =============================================
   REFERENCES
   ============================================= */

.article-refs {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.article-refs-title {
    font-family: 'Zalando Sans Expanded', sans-serif;
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.article-refs-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: var(--accent-color);
}

.refs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.ref-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.2s;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.ref-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
    transform-origin: bottom;
}

.ref-card:hover::before {
    transform: scaleY(1);
}

.ref-card:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.ref-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Zalando Sans Expanded', sans-serif;
    font-size: 0.7rem;
    color: var(--dim-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ref-card-header img {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.2s;
}

.ref-card:hover .ref-card-header img {
    filter: grayscale(0%);
    opacity: 1;
}

.ref-card-title {
    font-family: 'Zalando Sans', sans-serif;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.4;
    word-break: break-word;
    transition: color 0.2s;
}

.ref-card:hover .ref-card-title {
    color: var(--accent-color);
}

/* =============================================
   MOBILE
   ============================================= */

@media (max-width: 768px) {
    .article-col { padding: 0 0 2rem; }
    .article-title { font-size: 1.4rem; }

    .article-content p,
    .article-content li { font-size: 0.95rem; text-align: justify; }

    .article-content h1 { font-size: 1.5rem; padding-left: 0.8rem; }
    .article-content h2 { font-size: 1.2rem; }
    .article-content h3 { font-size: 1.1rem; }

    .article-content img { max-height: 60vh; }

    .article-content pre.code { padding: 0.8rem; font-size: 0.8rem; }

    .back-link { font-size: 0.9rem; margin-bottom: 1rem; }
}

/* Navigation Buttons in Modal */
.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0);
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    padding: 10px;
    cursor: pointer;
    z-index: 1001;
    transition: all 0.2s;
    user-select: none;
}

.modal-nav:hover {
    background: var(--accent-color);
    color: #000;
}

.modal-nav-prev { left: 5vw; }
.modal-nav-next { right: 5vw; }

/* Remove old overlays */
body.writeups-mode::before,
body.writeups-mode::after {
    display: none;
}

/* =============================================
   LAYOUT & CONTAINER
   ============================================= */

/* We assume writeups pages will also be wrapped in .wrapper > .interface-frame 
   If not, we style the container to fit.
*/

.writeups-container {
    width: 100%;
    margin: 0 auto;
    padding: 0;
}

.writeups-title {
    font-family: 'Zalando Sans Expanded', sans-serif;
    font-size: 2.5rem;
    color: var(--accent-color);
    text-transform: uppercase;
    text-align: center;
    margin-bottom: 2rem;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

.back-link {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
    color: #FFFFFF !important; /* User Request: "blanc sous toutes circonstances" */
    text-decoration: none;
    font-family: 'Zalando Sans', sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
    transition: opacity 0.3s;
}

.back-link svg {
    margin-right: 12px !important; /* Start further away */
    transition: margin-right 0.3s ease;
}

.back-link:hover {
    opacity: 0.8;
    color: #FFFFFF !important;
}

.back-link:hover svg {
    margin-right: 6px !important; /* Move closer on hover */
}

/* =============================================
   CARDS (Data Blocks)
   ============================================= */

.writeups-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.writeup-card {
    background: rgba(255, 255, 255, 0);
    border: 1px solid var(--writeup-border);
    padding: 1.5rem;
    text-decoration: none;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.writeup-card::before {
    /* Corner accent */
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 20px;
    height: 20px;
    border-top: 2px solid var(--writeup-border);
    border-right: 2px solid var(--writeup-border);
    transition: all 0.2s;
}

.writeup-card:hover {
    background: rgba(255, 255, 255, 0);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.writeup-card:hover::before {
    border-color: var(--accent-color);
}

.writeup-card::after {
    /* Bottom-Left Corner accent */
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 20px;
    height: 20px;
    border-bottom: 2px solid var(--writeup-border);
    border-left: 2px solid var(--writeup-border);
    transition: all 0.2s;
}

.writeup-card:hover::after {
    border-color: var(--accent-color);
}

.writeup-card h3 {
    font-family: 'Zalando Sans Expanded', sans-serif;
    font-size: 1.4rem;
    color: var(--accent-color);
    margin: 0;
    letter-spacing: 1px;
}

.writeup-card p {
    font-size: 0.9rem;
    color: var(--dim-text);
    margin: 0;
    font-family: 'Zalando Sans', sans-serif;
}

/* Badges */
.card-badges {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: auto; /* Push to bottom */
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0);
}

.badge {
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border: 1px solid var(--dim-text);
    color: var(--dim-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.htb-badge {
    background: transparent;
    border-color: var(--accent-color); /* White */
    color: var(--accent-color);
}

.badge.easy {
    background: transparent;
    border-color: #a3d900;
    color: #a3d900;
}

.badge.medium {
    background: transparent;
    border-color: #ff8a00;
    color: #ff8a00;
}

.badge.hard {
    background: transparent;
    border-color: #ff3333;
    color: #ff3333;
}

/* Second Date Badge Definition Removed to fix duplication */

/* Date Badge */
.writeup-date {
    display: inline-block;
    font-family: 'Zalando Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--dim-text);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    margin-bottom: 0.5rem;
    background: rgba(0,0,0,0);
    letter-spacing: 1px;
}

.os-icon {
    width: 16px;
    height: 16px;
    opacity: 0.9;
    /* Force en blanc pur/lumineux */
    filter: brightness(0) invert(1);
}

/* =============================================
   ARTICLE CONTENT
   ============================================= */

.writeup-content {
    background: transparent; /* Handled by layout now */
    border: none;
    padding: 0;
    box-shadow: none;
    color: var(--text-color);
    font-family: 'Zalando Sans', sans-serif;
}

.writeup-content .page-title {
    font-family: 'Zalando Sans Expanded', sans-serif;
    font-size: 2.5rem;
    color: var(--accent-color);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 2rem;
    background: none;
}

/* Removed ::after pseudo-element for cleaner look */

.writeup-content h1, 
.writeup-content h2, 
.writeup-content h3 {
    font-family: 'Zalando Sans Expanded', sans-serif;
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

.writeup-content h1 { 
    font-size: 2.2rem; 
    color: #ffffff;
    border-left: 4px solid var(--accent-color); 
    padding-left: 1.2rem; 
    text-transform: none;
    letter-spacing: 2px;
}

.writeup-content h2 { 
    font-size: 1.5rem; 
    color: var(--accent-color);
    padding-bottom: 0.3rem; 
    margin-top: 3rem;
    letter-spacing: 1px;
    text-transform: none;
}

.writeup-content h3 { 
    font-size: 1.3rem; 
    color: #e0e0e0;
    margin-top: 2rem;
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.writeup-content p, .writeup-content li {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-color);
}

.writeup-content a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px solid var(--dim-text);
    transition: border-color 0.2s;
}

.writeup-content a:hover {
    border-bottom-color: var(--accent-color);
}

/* Code Window Styling */
.code-window {
    background: #050505;
    border: 1px solid var(--border-color);
    margin: 1.5rem 0;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

.window-header {
    background: #111;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.window-title {
    font-family: 'Zalando Sans', sans-serif;
    font-size: 0.8rem;
    color: var(--dim-text);
    letter-spacing: 1px;
    font-weight: bold;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--dim-text);
    color: var(--dim-text);
    font-family: 'Zalando Sans', sans-serif;
    font-size: 0.7rem;
    padding: 2px 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.copy-btn:hover, .copy-btn.copied {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(255,255,255,0);
}

/* Code Blocks */
.writeup-content pre.code {
    background: transparent; /* Background handled by window */
    border: none; /* Border handled by window */
    border-radius: 0;
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
}

.writeup-content code {
    /* User Request: "Caskadia" (Cascadia Code) and "meme taille" */
    font-family: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
    font-size: 0.92em; /* Same size as surrounding text (usually 1rem) */
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    padding: 0.2em 0.4em; /* Slightly tighter padding for inline */
    border-radius: 4px;
}

.writeup-content pre.code code {
    background: none;
    padding: 0;
    color: inherit;
    font-size: 0.95em; /* Block code can be slightly smaller for density, or 1em if strict */
}

/* Syntax Highlighting - Cyberpunk Neon */
code[class*="language-"],
pre[class*="language-"] {
    color: #e0e0e0;
    text-shadow: none;
    font-family: 'Cascadia Code', 'SFMono-Regular', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    line-height: 1.5;
    tab-size: 4;
    hyphens: none;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #5c6370; /* Grey */
    font-style: italic;
}

.token.punctuation {
    color: #abb2bf; /* Light Grey */
}

.token.namespace {
    opacity: .7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #d19a66; /* Orange */
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #98c379; /* Green */
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #56b6c2; /* Cyan */
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #c678dd; /* Purple */
}

.token.function,
.token.class-name {
    color: #61afef; /* Blue */
}

.token.regex,
.token.important,
.token.variable {
    color: #e06c75; /* Red */
}

/* Callouts & Link Integrations */
.writeup-content .link-integration {
    display: inline-flex; /* Changed from flex to inline-flex to fit content */
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    margin: 1.5rem 0;
    transition: all 0.2s;
    text-decoration: none;
    max-width: 100%; /* Ensure it doesn't overflow on small screens */
    box-sizing: border-box;
}

.writeup-content .link-integration:hover {
    background: rgba(255, 255, 255, 0);
    border-color: var(--accent-color);
    transform: translateX(5px);
}

.writeup-content .link-integration .site-favicon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    /* User request: "toujours en couleur" */
    filter: grayscale(0%);
    transition: filter 0.2s;
}

.writeup-content .link-integration:hover .site-favicon {
    filter: grayscale(0%);
}

.writeup-content .link-integration a {
    color: var(--text-color);
    font-family: 'Zalando Sans', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    text-decoration: none;
    border-bottom: none;
}

.writeup-content .link-integration:hover a {
    color: var(--accent-color);
}

/* Image Encapsulation & Styling */
/* Image Encapsulation & Styling */
.writeup-content figure.image {
    margin: 2rem 0;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0;
    display: block;
    max-width: 100%;
}

.writeup-content img {
    max-width: 100%;
    /* User Request: "hauteur maximale pour les images des writeups est limitée a 50vh" */
    max-height: 50vh; 
    width: auto;      /* Maintain aspect ratio */
    height: auto;
    object-fit: contain; /* Ensure integrity */
    
    display: inline-block; /* Ensure it wraps tighter than block */
    vertical-align: middle;
    margin: 0;
    
    /* Frame on the image itself */
    border: 1px solid var(--border-color);
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
    transition: border-color 0.3s;
    cursor: zoom-in;
}

.writeup-content img:hover {
    border-color: var(--accent-color);
}

/* Optional: Add a caption style if needed later */
.writeup-content figcaption {
    font-size: 0.8rem;
    color: var(--dim-text);
    margin-top: 0.5rem;
    font-style: italic;
}
/* =============================================
   LIGHTBOX / FOCUS MODE
   ============================================= */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    cursor: zoom-out;
}

.modal-content {
    margin: auto;
    display: block;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
    width: fit-content;
    max-width: 95%;
    max-height: 95vh;
}

.modal-image {
    display: block;
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    border: none;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Cursor on writeup images to indicate they are clickable */
.writeup-content img {
    cursor: zoom-in;
}

/* =============================================
   MOBILE RESPONSIVENESS (Writeups)
   ============================================= */

@media (max-width: 768px) {
    /* Container & Layout */
    .writeups-container {
        width: 100%;
        padding: 0;
    }

    /* Typography */
    .writeups-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    /* Grid - Force 1 column for better readability */
    .writeups-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    /* Writeup Card — touch-optimized */
    .writeup-card {
        padding: 1rem;
        min-height: 48px; /* Min touch target height */
        transition: all 0.15s ease;
    }

    .writeup-card:active {
        transform: scale(0.98);
        border-color: var(--accent-color);
    }

    .writeup-card h3 {
        font-size: 1.2rem;
    }

    .writeup-card p {
        font-size: 0.85rem;
    }

    /* Badges — wrap on small screens */
    .card-badges {
        flex-wrap: wrap;
        gap: 0.4rem;
        padding-top: 0.8rem;
    }

    .badge {
        font-size: 0.65rem;
        padding: 2px 5px;
    }

    /* Code Blocks - Ensure horizontal scroll */
    .code-wrap {
        font-size: 0.72rem;
        padding: 0.8rem;
        margin: 1rem 0;
        border-radius: 0;
        overflow-x: auto;
        max-width: 100%;
        white-space: pre;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Ensure the pre block doesn't push the layout width */
    .page-body pre {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Code window */
    .code-window {
        margin: 1rem 0;
    }

    .writeup-content pre.code {
        padding: 0.8rem;
        font-size: 0.8rem;
    }

    /* Content typography */
    .writeup-content h1 {
        font-size: 1.5rem;
        padding-left: 0.8rem;
        margin-top: 2rem;
    }

    .writeup-content h2 {
        font-size: 1.2rem;
        margin-top: 2rem;
    }

    .writeup-content h3 {
        font-size: 1.1rem;
    }

    .writeup-content p, .writeup-content li {
        font-size: 0.95rem;
        line-height: 1.6;
    }

    /* Images */
    .writeup-content img, .page-body img {
        max-width: 100%;
        max-height: 40vh;
        height: auto;
        border-radius: 0;
    }

    /* Link integrations */
    .writeup-content .link-integration {
        padding: 10px 14px;
        gap: 10px;
        margin: 1rem 0;
    }

    .writeup-content .link-integration a {
        font-size: 0.95rem;
    }
    
    /* Back Link */
    .back-link {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    /* Modal on mobile */
    .modal-nav {
        display: none !important;
    }

    .modal-image {
        max-width: 95%;
        max-height: 80vh;
    }
}
