/* ==========================================================================
   Ghafari v2 — articles: the list, the reading page and every block an article can contain.
   Loaded only by the article pages (@push('styles')).
   ========================================================================== */

/* ---- Category filter ---- */
.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--s4);
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0.4rem 1.1rem;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-full);
    background: var(--paper);
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 700;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip[aria-current='page'] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---- Cards ---- */
.card__meta-top { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.card__meta-top:empty { display: none; }

.article-card--featured {
    margin-bottom: var(--s4);
}

.article-card--featured .media { min-height: 220px; }

@media (min-width: 900px) {
    .article-card--featured { display: grid; grid-template-columns: 1.15fr 1fr; }
    .article-card--featured .card__body { justify-content: center; padding: var(--s5); }
    .article-card--featured .card__title { font-size: var(--text-2xl); }
    .article-card--featured .media { min-height: 360px; }
    .article-card--featured .media img { position: absolute; inset: 0; }
}

.article-card--featured .card__text { font-size: var(--text-base); }

/* ---- Preview banner ---- */
.preview-bar {
    padding-block: 0.7rem;
    background: #fff4d6;
    border-bottom: 1px solid #f0d58a;
    color: #5c4300;
    font-size: var(--text-sm);
}

/* ---- Article header ---- */
.article-head {
    padding-block: clamp(2rem, 1rem + 4vw, 4rem) clamp(1.5rem, 1rem + 2vw, 2.5rem);
    background: var(--paper);
}

.crumbs--light li,
.crumbs--light a { color: var(--slate); }
.crumbs--light a:hover { color: var(--brand); text-decoration-color: currentColor; }
.crumbs--light [aria-current] { color: var(--ink); }

.article-head h1 {
    margin: var(--s2) 0 0;
    font-size: var(--text-3xl);
    line-height: 1.12;
    text-wrap: balance;
}

.article-head__lead {
    margin: var(--s2) 0 0;
    color: var(--slate);
    font-size: var(--text-lg);
    line-height: 1.55;
}

.article-head .meta-line { margin: var(--s3) 0 0; }

.article-cover {
    margin-top: calc(var(--s3) * -1);
    padding-top: 0;
}

.article-cover figure {
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    background: var(--pebble);
}

.article-cover img { width: 100%; max-height: 560px; object-fit: cover; }

/* ---- Reading column ---- */
.article-layout { padding-block: var(--s5) var(--section); }

.article-body {
    max-width: none;
    font-size: clamp(1.0625rem, 1.03rem + 0.15vw, 1.1875rem);
    line-height: 1.75;
}

.article-body > * + * { margin-top: 1.2em; }
.article-body > .article-heading { margin-top: 2.2em; scroll-margin-top: calc(var(--header-h) + 16px); }
.article-body > .article-heading + * { margin-top: 0.7em; }
.article-body > h2.article-heading { font-size: var(--text-2xl); line-height: 1.2; }
.article-body > h3.article-heading { font-size: var(--text-xl); line-height: 1.25; }
.article-body p { max-width: 70ch; }

/* ---- Table of contents ---- */
.article-toc {
    margin-bottom: var(--s5);
    padding: var(--s2) var(--s3);
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
}

.article-toc summary {
    display: flex;
    align-items: center;
    min-height: 44px;
    cursor: pointer;
    color: var(--ink);
    font-size: var(--text-sm);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    list-style: none;
}

.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary::after { content: '+'; margin-left: auto; font-size: 1.4rem; color: var(--brand); }
.article-toc details[open] summary::after { content: '\2212'; }

.article-toc ol { margin: 0 0 var(--s1); padding: 0; list-style: none; counter-reset: toc; }
.article-toc li { counter-increment: toc; }
.article-toc li + li { margin-top: 2px; }

.article-toc a {
    display: block;
    padding: 0.4rem 0;
    color: var(--ink);
    font-weight: 650;
}

.article-toc a:hover { color: var(--brand); }
.article-toc .article-toc__l3 { padding-left: 1.2rem; }
.article-toc .article-toc__l3 a { color: var(--slate); font-weight: 600; font-size: var(--text-sm); }

/* ---- Figures ---- */
.article-figure { margin: var(--s4) 0; }
.article-body > .article-figure { margin-top: var(--s4); }

.article-figure img {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    background: var(--pebble);
}

.article-figure figcaption,
.article-audio p {
    margin-top: 0.7rem;
    color: var(--slate);
    font-size: var(--text-sm);
    line-height: 1.5;
}

@media (min-width: 900px) {
    .article-figure--wide,
    .article-figure--full {
        position: relative;
        left: 50%;
        transform: translateX(-50%);
        width: min(1000px, calc(100vw - 2 * var(--gutter)));
    }

    .article-figure--full { width: min(1200px, calc(100vw - 2 * var(--gutter))); }
}

/* ---- Gallery ---- */
.article-gallery { display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); }
.article-gallery a { display: block; overflow: hidden; border-radius: var(--radius-md); }
.article-gallery img { aspect-ratio: 4 / 3; object-fit: cover; border-radius: 0; transition: transform 0.5s var(--ease); }
.article-gallery a:hover img { transform: scale(1.04); }

@media (min-width: 700px) {
    .article-gallery--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Video ---- */
.article-video,
.article-embed {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--ink);
}

.article-embed { position: relative; background: linear-gradient(135deg, var(--ink), var(--brand-ink)); }
.article-embed img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; opacity: 0.85; }
.article-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.article-embed__play {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 700;
    cursor: pointer;
}

.article-embed__play svg {
    width: 76px;
    height: 76px;
    padding: 20px 16px 20px 24px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s var(--ease), background-color 0.2s;
}

.article-embed__play:hover svg { transform: scale(1.08); background: var(--brand-strong); }
.article-embed__play span { max-width: 80%; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.article-embed__fallback { position: absolute; inset: auto 1rem 1rem; color: #fff; }

/* ---- Audio ---- */
.article-audio {
    margin: var(--s4) 0;
    padding: var(--s3);
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
}

.article-audio figcaption {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 var(--s2);
    color: var(--ink);
    font-size: var(--text-base);
    font-weight: 700;
}

.article-audio figcaption svg { width: 20px; height: 20px; color: var(--brand); }
.article-audio audio { display: block; width: 100%; }

/* ---- Link, e-mail, file, location cards ---- */
.article-link,
.article-contact,
.article-file {
    display: flex;
    align-items: center;
    gap: var(--s2);
    margin-block: var(--s3);
    padding: var(--s2) var(--s3);
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    color: var(--ink);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.article-link:hover,
.article-file:hover { border-color: var(--brand); box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--ink); }

.article-link__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--brand);
}

.article-link__icon svg { width: 22px; height: 22px; }

.article-link__text { display: grid; gap: 2px; min-width: 0; flex: 1; font-size: var(--text-base); line-height: 1.45; }
.article-link__text strong { color: var(--ink); }
.article-link__text span { color: var(--slate); font-size: var(--text-sm); }
.article-link__text small { color: var(--brand); font-size: var(--text-xs); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-link__arrow { flex: none; width: 20px; height: 20px; color: var(--brand); }

.article-contact p { margin: 2px 0 6px; color: var(--slate); font-size: var(--text-base); }
.article-contact > div { display: grid; gap: 2px; min-width: 0; }
.article-contact .link-arrow { overflow-wrap: anywhere; }

.article-file__action {
    flex: none;
    padding: 0.35rem 0.9rem;
    border-radius: var(--radius-full);
    background: var(--ink);
    color: #fff;
    font-size: var(--text-xs);
    font-weight: 800;
}

.article-location {
    overflow: hidden;
    margin-block: var(--s4);
    background: var(--paper);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
}

.article-location iframe { display: block; width: 100%; height: 320px; border: 0; }

.article-location__body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--s2);
    padding: var(--s2) var(--s3);
}

.article-location__body > div { flex: 1 1 220px; display: grid; gap: 2px; }
.article-location address { color: var(--slate); font-size: var(--text-sm); font-style: normal; line-height: 1.5; }

/* ---- Quote, callout, divider ---- */
.article-quote { margin: var(--s4) 0; }

.article-quote blockquote {
    margin: 0;
    padding: 0.3em 0 0.3em 1.3em;
    border-left: 4px solid var(--green);
    color: var(--ink);
    font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem);
    font-weight: 700;
    line-height: 1.4;
}

.article-quote blockquote p { max-width: none; }
.article-quote figcaption { margin: 0.8rem 0 0 1.5rem; color: var(--slate); font-size: var(--text-sm); font-weight: 650; }
.article-quote figcaption::before { content: '\2014\00a0'; }

.article-callout {
    margin-block: var(--s3);
    padding: var(--s2) var(--s3);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-sm);
    background: var(--brand-soft);
    color: var(--ink);
}

.article-callout__label { display: block; margin-bottom: 0.2rem; font-size: var(--text-xs); letter-spacing: 0.07em; text-transform: uppercase; color: var(--brand-ink); }
.article-callout p { margin: 0; font-size: var(--text-base); }
.article-callout--tip { border-color: var(--green); background: var(--green-soft); }
.article-callout--tip .article-callout__label { color: var(--green-ink); }
.article-callout--warning { border-color: #d98a00; background: #fff4d6; }
.article-callout--warning .article-callout__label { color: #8a5600; }

.article-divider { border: 0; border-top: 1px solid var(--hairline); margin-block: var(--s5); }

/* ---- FAQ ---- */
.article-faq { margin-block: var(--s4); border-top: 1px solid var(--hairline); }
.article-faq details { border-bottom: 1px solid var(--hairline); }

.article-faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s2);
    min-height: 56px;
    padding-block: 0.8rem;
    color: var(--ink);
    font-size: var(--text-lg);
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    list-style: none;
}

.article-faq summary::-webkit-details-marker { display: none; }
.article-faq summary::after { content: '+'; flex: none; font-size: 1.6rem; line-height: 1; color: var(--brand); transition: transform 0.2s; }
.article-faq details[open] summary::after { transform: rotate(45deg); }
.article-faq details p { margin: 0 0 var(--s2); color: var(--slate); font-size: var(--text-base); }

/* ---- Tags and sharing ---- */
.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: var(--s5) 0 0; padding: 0; list-style: none; }

.article-share {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: var(--s4);
    padding-top: var(--s3);
    border-top: 1px solid var(--hairline);
}

.article-share__label { margin-right: 0.4rem; color: var(--slate); font-size: var(--text-sm); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

@media print {
    .site-header, .topbar, .site-footer, .article-share, .cta-band, .to-top, .preview-bar { display: none !important; }
    .article-body { font-size: 12pt; }
}
