/* =========================================================
   ARTICLE DETAILS — Independent page stylesheet
   Path: static/site/css/pages/article-details.css
   ========================================================= */

.article-details {
    --ad-bg: #070b16;
    --ad-panel: rgba(16, 25, 46, .78);
    --ad-panel-strong: rgba(18, 30, 55, .94);
    --ad-text: #edf4ff;
    --ad-muted: #9aaac4;
    --ad-blue: #5aa9ff;
    --ad-cyan: #55e3e6;
    --ad-purple: #9a7bff;
    --ad-line: rgba(147, 180, 230, .16);
    position: relative;
    isolation: isolate;
    overflow: clip;
    min-height: 100vh;
    padding: 0 0 100px;
    color: var(--ad-text);
    background:
        radial-gradient(ellipse at 12% 8%, rgba(43, 105, 202, .18), transparent 34rem),
        radial-gradient(ellipse at 88% 22%, rgba(124, 75, 220, .15), transparent 30rem),
        linear-gradient(180deg, #080d1b 0%, #070b16 58%, #090e1b 100%);
}

.article-details::before,
.article-details::after {
    position: absolute;
    z-index: -1;
    pointer-events: none;
    content: "";
    border-radius: 50%;
    filter: blur(2px);
}

.article-details::before {
    top: 16rem;
    left: -15rem;
    width: 28rem;
    height: 28rem;
    border: 1px solid rgba(85, 227, 230, .1);
    box-shadow: 0 0 90px rgba(50, 150, 255, .08), inset 0 0 70px rgba(50, 150, 255, .04);
}

.article-details::after {
    top: 48rem;
    right: -18rem;
    width: 34rem;
    height: 34rem;
    border: 1px solid rgba(154, 123, 255, .1);
    box-shadow: 0 0 100px rgba(154, 123, 255, .08), inset 0 0 80px rgba(154, 123, 255, .04);
}

.article-details .container {
    width: min(1120px, calc(100% - 40px));
    margin-inline: auto;
}

.article-details .article-single {
    position: relative;
    padding-top: clamp(42px, 7vw, 88px);
}

.article-details .article-heading {
    max-width: 900px;
    margin: 0 auto 34px;
    text-align: center;
}

.article-details .article-category {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    padding: 8px 16px;
    color: #aeeeff;
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    background: rgba(47, 157, 210, .12);
    border: 1px solid rgba(85, 227, 230, .3);
    border-radius: 999px;
    box-shadow: 0 0 28px rgba(85, 227, 230, .09);
}

.article-details .article-category::before {
    width: 6px;
    height: 6px;
    content: "";
    background: var(--ad-cyan);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--ad-cyan);
}

.article-details h1 {
    margin: 0;
    color: #f5f8ff;
    font-size: clamp(2.1rem, 5.3vw, 4.45rem);
    font-weight: 850;
    line-height: 1.16;
    letter-spacing: -.045em;
    text-wrap: balance;
    text-shadow: 0 8px 38px rgba(75, 145, 255, .16);
}

.article-details .article-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 22px;
    margin-top: 25px;
    color: var(--ad-muted);
    font-size: .92rem;
}

.article-details .article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.article-details .article-meta span + span::before {
    width: 4px;
    height: 4px;
    margin-inline-end: 5px;
    content: "";
    background: var(--ad-cyan);
    border-radius: 50%;
}

.article-details .article-excerpt {
    max-width: 760px;
    margin: 24px auto 0;
    color: #bdcbe0;
    font-size: clamp(1rem, 1.7vw, 1.18rem);
    line-height: 1.9;
}

.article-details .article-single-cover {
    position: relative;
    width: min(100%, 1040px);
    height: clamp(230px, 48vw, 540px);
    margin: 0 auto 46px;
    overflow: hidden;
    background: #111c32;
    border: 1px solid rgba(150, 190, 255, .2);
    border-radius: 26px;
    box-shadow: 0 28px 90px rgba(0, 0, 0, .42), 0 0 55px rgba(61, 145, 255, .12);
}

.article-details .article-single-cover::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    background: linear-gradient(180deg, transparent 55%, rgba(4, 9, 20, .25));
}

.article-details .article-single-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}

.article-details .article-single-cover:hover img {
    transform: scale(1.035);
}

.article-details .article-reading-shell {
    width: min(850px, 100%);
    margin: 0 auto;
    padding: clamp(22px, 5vw, 54px);
    background: linear-gradient(145deg, rgba(18, 29, 52, .88), rgba(11, 18, 34, .92));
    border: 1px solid var(--ad-line);
    border-radius: 24px;
    box-shadow: 0 24px 75px rgba(0, 0, 0, .25), inset 0 1px rgba(255, 255, 255, .035);
    backdrop-filter: blur(18px);
}

.article-details .reading-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--ad-line);
}

.article-details .reading-label {
    color: var(--ad-muted);
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.article-details .reading-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-details .reading-controls button {
    display: inline-grid;
    min-width: 40px;
    height: 38px;
    padding: 0 11px;
    place-items: center;
    color: #dceaff;
    font: inherit;
    font-size: .9rem;
    font-weight: 750;
    cursor: pointer;
    background: rgba(91, 145, 220, .1);
    border: 1px solid rgba(125, 170, 230, .2);
    border-radius: 11px;
    transition: .2s ease;
}

.article-details .reading-controls button:hover {
    color: #fff;
    background: rgba(67, 160, 220, .22);
    border-color: rgba(85, 227, 230, .55);
    box-shadow: 0 0 22px rgba(85, 227, 230, .1);
    transform: translateY(-2px);
}

.article-details .article-body {
    color: #d4deed;
    font-size: var(--article-reading-size, 1.08rem);
    line-height: 2.05;
    overflow-wrap: anywhere;
    transition: font-size .2s ease;
}

.article-details .article-body p {
    margin: 0 0 1.45em;
}

.article-details .article-body p:last-child {
    margin-bottom: 0;
}

.article-details .article-body strong,
.article-details .article-body b {
    color: #f2f7ff;
    font-weight: 800;
}

.article-details .article-body a {
    color: #72dce8;
    text-decoration: underline;
    text-decoration-color: rgba(114, 220, 232, .4);
    text-underline-offset: 4px;
}

.article-details .article-body a:hover {
    color: #b0f7ff;
}

.article-details .article-body h2,
.article-details .article-body h3,
.article-details .article-body h4 {
    margin: 2em 0 .8em;
    color: #f1f6ff;
    font-weight: 800;
    line-height: 1.35;
}

.article-details .article-body h2 {
    font-size: 1.65em;
}

.article-details .article-body h3 {
    font-size: 1.35em;
}

.article-details .article-body h4 {
    font-size: 1.15em;
}

.article-details .article-body ul,
.article-details .article-body ol {
    margin: 0 0 1.5em;
    padding-inline-start: 1.6em;
}

.article-details .article-body li {
    margin-bottom: .55em;
    padding-inline-start: .25em;
}

.article-details .article-body blockquote {
    margin: 1.8em 0;
    padding: 1.1em 1.4em;
    color: #c9e7f3;
    background: rgba(65, 153, 205, .09);
    border-inline-start: 3px solid var(--ad-cyan);
    border-radius: 12px;
}

.article-details .article-body code {
    padding: .16em .42em;
    color: #a8eff2;
    font-size: .88em;
    background: rgba(72, 150, 190, .14);
    border: 1px solid rgba(85, 227, 230, .12);
    border-radius: 6px;
}

.article-details .article-body pre {
    max-width: 100%;
    margin: 1.6em 0;
    padding: 20px;
    overflow-x: auto;
    color: #d8eaff;
    direction: ltr;
    text-align: left;
    background: #080f1e;
    border: 1px solid var(--ad-line);
    border-radius: 14px;
}

.article-details .article-body pre code {
    padding: 0;
    color: inherit;
    background: none;
    border: 0;
}

.article-details .article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.8em auto;
    border: 1px solid var(--ad-line);
    border-radius: 14px;
}

.article-details .article-back {
    display: flex;
    justify-content: center;
    margin-top: 42px;
}

.article-details .article-back a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 24px;
    color: #f5fbff;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(110deg, rgba(52, 135, 224, .24), rgba(120, 91, 220, .22));
    border: 1px solid rgba(105, 177, 255, .38);
    border-radius: 999px;
    box-shadow: 0 10px 34px rgba(42, 116, 220, .12);
    transition: .25s ease;
}

.article-details .article-back a:hover {
    background: linear-gradient(110deg, rgba(52, 135, 224, .42), rgba(120, 91, 220, .38));
    border-color: rgba(85, 227, 230, .65);
    box-shadow: 0 12px 38px rgba(42, 150, 230, .2);
    transform: translateY(-3px);
}

.article-reading-progress {
    position: fixed;
    z-index: 9999;
    top: 0;
    inset-inline: 0;
    height: 3px;
    pointer-events: none;
    background: rgba(120, 160, 220, .12);
}

.article-reading-progress span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--ad-blue, #5aa9ff), #55e3e6, #9a7bff);
    box-shadow: 0 0 14px rgba(85, 227, 230, .75);
    transition: width .08s linear;
}

@media (max-width: 700px) {
    .article-details .container {
        width: min(100% - 28px, 1120px);
    }

    .article-details .article-single {
        padding-top: 36px;
    }

    .article-details .article-single-cover {
        margin-bottom: 30px;
        border-radius: 18px;
    }

    .article-details .article-reading-shell {
        padding: 22px 18px;
        border-radius: 18px;
    }

    .article-details .reading-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .article-details .article-meta {
        gap: 8px 14px;
        font-size: .82rem;
    }

    .article-details .article-body {
        line-height: 1.9;
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-details *,
    .article-details *::before,
    .article-details *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}











/* =========================================================
   ARTICLE DETAILS — PREMIUM LIGHT MODE
   Append at the END of article-details.css
   ========================================================= */

body:not(.dark-mode) .article-details {
    --ad-bg: #f4f7fc;
    --ad-panel: rgba(255, 255, 255, .82);
    --ad-panel-strong: #ffffff;
    --ad-text: #17243b;
    --ad-muted: #64748b;
    --ad-line: rgba(76, 105, 150, .16);

    color: var(--ad-text);

    background:
        radial-gradient(ellipse at 12% 8%, rgba(59, 130, 246, .12), transparent 34rem),
        radial-gradient(ellipse at 88% 22%, rgba(139, 92, 246, .10), transparent 30rem),
        linear-gradient(180deg, #f8faff 0%, #f1f5fb 58%, #f8faff 100%);
}

/* Decorative background */
body:not(.dark-mode) .article-details::before {
    border-color: rgba(37, 99, 235, .12);
    box-shadow:
        0 0 90px rgba(50, 120, 255, .07),
        inset 0 0 70px rgba(50, 120, 255, .035);
}

body:not(.dark-mode) .article-details::after {
    border-color: rgba(139, 92, 246, .12);
    box-shadow:
        0 0 100px rgba(139, 92, 246, .07),
        inset 0 0 80px rgba(139, 92, 246, .035);
}

/* Article category */
body:not(.dark-mode) .article-details .article-category {
    color: #075985;
    background: linear-gradient(
        135deg,
        rgba(14, 165, 233, .10),
        rgba(59, 130, 246, .08)
    );
    border-color: rgba(14, 165, 233, .25);
    box-shadow: 0 5px 22px rgba(14, 165, 233, .08);
}

body:not(.dark-mode) .article-details .article-category::before {
    background: #0891b2;
    box-shadow: 0 0 12px rgba(8, 145, 178, .55);
}

/* Main article title */
body:not(.dark-mode) .article-details h1 {
    color: #14213a;
    text-shadow: 0 8px 35px rgba(59, 130, 246, .10);
}

/* Article metadata */
body:not(.dark-mode) .article-details .article-meta {
    color: #64748b;
}

body:not(.dark-mode) .article-details .article-meta span + span::before {
    background: #0891b2;
}

/* Article summary / excerpt */
body:not(.dark-mode) .article-details .article-excerpt {
    color: #52647e;
    font-weight: 450;
}

/* Cover image */
body:not(.dark-mode) .article-details .article-single-cover {
    background: #e8eef8;
    border-color: rgba(100, 130, 180, .22);
    box-shadow:
        0 25px 65px rgba(36, 59, 100, .13),
        0 0 35px rgba(59, 130, 246, .07);
}

body:not(.dark-mode) .article-details .article-single-cover::after {
    background: linear-gradient(
        180deg,
        transparent 65%,
        rgba(15, 30, 55, .12)
    );
}

/* Reading panel */
body:not(.dark-mode) .article-details .article-reading-shell {
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, .97),
        rgba(246, 249, 255, .96)
    );
    border-color: rgba(100, 130, 180, .19);
    box-shadow:
        0 24px 65px rgba(36, 59, 100, .09),
        inset 0 1px rgba(255, 255, 255, .9);
}

/* Reading toolbar */
body:not(.dark-mode) .article-details .reading-toolbar {
    border-bottom-color: rgba(100, 130, 180, .19);
}

body:not(.dark-mode) .article-details .reading-label {
    color: #64748b;
}

/* Reading controls */
body:not(.dark-mode) .article-details .reading-controls button {
    color: #334b6d;
    background: rgba(59, 130, 246, .07);
    border-color: rgba(59, 130, 246, .19);
}

body:not(.dark-mode) .article-details .reading-controls button:hover {
    color: #075985;
    background: rgba(14, 165, 233, .12);
    border-color: rgba(14, 165, 233, .42);
    box-shadow: 0 0 20px rgba(14, 165, 233, .10);
}

/* Main article content */
body:not(.dark-mode) .article-details .article-body {
    color: #384a63;
}

body:not(.dark-mode) .article-details .article-body strong,
body:not(.dark-mode) .article-details .article-body b {
    color: #172b49;
}

/* Article links */
body:not(.dark-mode) .article-details .article-body a {
    color: #087eaa;
    text-decoration-color: rgba(8, 126, 170, .35);
}

body:not(.dark-mode) .article-details .article-body a:hover {
    color: #075985;
}

/* Article headings */
body:not(.dark-mode) .article-details .article-body h2,
body:not(.dark-mode) .article-details .article-body h3,
body:not(.dark-mode) .article-details .article-body h4 {
    color: #172b49;
}

/* Lists */
body:not(.dark-mode) .article-details .article-body li::marker {
    color: #0891b2;
}

/* Blockquotes */
body:not(.dark-mode) .article-details .article-body blockquote {
    color: #36536f;
    background: linear-gradient(
        135deg,
        rgba(14, 165, 233, .08),
        rgba(59, 130, 246, .06)
    );
    border-inline-start-color: #0891b2;
}

/* Inline code */
body:not(.dark-mode) .article-details .article-body code {
    color: #075985;
    background: rgba(14, 165, 233, .08);
    border-color: rgba(14, 165, 233, .17);
}

/* Code blocks */
body:not(.dark-mode) .article-details .article-body pre {
    color: #e2edff;
    background: #17243b;
    border-color: rgba(100, 130, 180, .25);
}

/* Images inside article */
body:not(.dark-mode) .article-details .article-body img {
    border-color: rgba(100, 130, 180, .22);
    box-shadow: 0 12px 35px rgba(36, 59, 100, .09);
}

/* Back button */
body:not(.dark-mode) .article-details .article-back a {
    color: #16416e;
    background: linear-gradient(
        110deg,
        rgba(59, 130, 246, .12),
        rgba(139, 92, 246, .10)
    );
    border-color: rgba(59, 130, 246, .28);
    box-shadow: 0 10px 30px rgba(59, 130, 246, .08);
}

body:not(.dark-mode) .article-details .article-back a:hover {
    color: #075985;
    background: linear-gradient(
        110deg,
        rgba(59, 130, 246, .19),
        rgba(139, 92, 246, .16)
    );
    border-color: rgba(14, 165, 233, .48);
    box-shadow: 0 12px 35px rgba(59, 130, 246, .13);
}

/* Reading progress */
body:not(.dark-mode) .article-reading-progress {
    background: rgba(100, 130, 180, .15);
}













/* =========================================================
   ARTICLE DETAILS — RESPONSIVE IMAGE SYSTEM
   Path: static/site/css/pages/article-images.css
   ========================================================= */

/* Main image wrapper */
.article-details .article-single-cover {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #101a2c;
}

/* Cover image — any dimensions */
.article-details .article-single-cover img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 720px;
    object-fit: contain;
    object-position: center;
}

/* Images inside article content */
.article-details .article-body img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 850px;
    object-fit: contain;
    object-position: center;
    margin: 2.2rem auto;
    border-radius: 16px;
    border: 1px solid var(--ad-line);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .12);
}

/* Landscape images */
.article-details .article-body img[width],
.article-details .article-body img[height] {
    height: auto;
}

/* Portrait images */
.article-details .article-body img.portrait {
    width: auto;
    max-width: min(100%, 560px);
    max-height: 850px;
}

/* Wide images */
.article-details .article-body img.wide {
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* Image captions */
.article-details .article-body figure {
    max-width: 100%;
    margin: 2.5rem auto;
    text-align: center;
}

.article-details .article-body figure img {
    margin: 0 auto;
}

.article-details .article-body figcaption {
    margin-top: 12px;
    color: var(--ad-muted);
    font-size: .88rem;
    line-height: 1.7;
}

/* Prevent overflow from large images */
.article-details .article-body,
.article-details .article-reading-shell {
    min-width: 0;
}

.article-details .article-body img,
.article-details .article-single-cover img {
    vertical-align: middle;
}

/* Mobile */
@media (max-width: 700px) {
    .article-details .article-single-cover {
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: auto;
        border-radius: 16px;
    }

    .article-details .article-single-cover img {
        width: 100%;
        height: auto;
        max-height: 500px;
        object-fit: contain;
    }

    .article-details .article-body img {
        max-width: 100%;
        max-height: 650px;
        margin: 1.6rem auto;
        border-radius: 12px;
    }

    .article-details .article-body img.portrait {
        max-width: min(100%, 420px);
    }

    .article-details .article-body figure {
        margin: 1.8rem auto;
    }
}

/* Very small screens */
@media (max-width: 380px) {
    .article-details .article-body img {
        max-height: 500px;
    }
}
