/* =========================================================================
   Institute CMS — public theme
   A newspaper structure carrying an Islamic-philosophical character:
   parchment ground, deep green masthead, gold hairlines, girih ornament.
   Layered over Bootstrap 5 (RTL or LTR build, chosen per language).
   ========================================================================= */

:root {
    /* Ground and ink */
    --paper: #faf7f1;
    --surface: #ffffff;
    --ink: #17201d;
    --ink-soft: #4a5450;
    --muted: #7a7a6d;

    /* The institute's green — the colour of the masthead and footer */
    --green-900: #0c2620;
    --green-800: #103428;
    --green-700: #16493a;
    --green-600: #1d6250;
    --green-100: #e5efea;

    /* Gold — used only for rules, ornament and accents, never for large fills */
    --gold: #b08d2d;
    --gold-bright: #c9a227;
    --gold-soft: #ece0bd;

    --line: #e5ded0;
    --line-strong: #d5cbb6;

    --danger: #9b2c2c;

    --radius: 3px;
    --shadow-card: 0 1px 2px rgba(23, 32, 29, .05);
    --shadow-raised: 0 6px 24px -12px rgba(12, 38, 32, .35);

    --font-ui: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    --font-display: 'Noto Naskh Arabic', 'Vazirmatn', serif;
    --font-body: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;

    --measure: 68ch;
}

/* The English site is a Latin-serif publication rather than a Naskh one. */
html[lang="en"] {
    --font-ui: 'Inter', 'Segoe UI', Arial, sans-serif;
    --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

html[lang="ar"] {
    --font-display: 'Amiri', 'Noto Naskh Arabic', serif;
    --font-body: 'Noto Naskh Arabic', 'Vazirmatn', serif;
}

/* -------------------------------------------------------------------------
   Girih ornament. An eight-point star tile, inlined as a data URI so the
   masthead and footer carry the motif without an extra request.
   ------------------------------------------------------------------------- */
:root {
    --girih: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='.6' stroke-opacity='.28'%3E%3Cpath d='M30 4 38 14 52 14 52 28 60 30 52 32 52 46 38 46 30 56 22 46 8 46 8 32 0 30 8 28 8 14 22 14Z'/%3E%3Cpath d='M30 14 41 30 30 46 19 30Z'/%3E%3C/g%3E%3C/svg%3E");
}

/* -------------------------------------------------------------------------
   Base
   ------------------------------------------------------------------------- */
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.9;
    -webkit-font-smoothing: antialiased;
}

html[lang="en"] body { line-height: 1.65; }

a { color: var(--green-700); text-decoration: none; }
a:hover { color: var(--gold); text-decoration: none; }

h1, h2, h3, h4, h5, h6, .display-font {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.5;
    color: var(--green-900);
}

::selection { background: var(--gold-soft); color: var(--green-900); }

.container-site { max-width: 1200px; margin-inline: auto; padding-inline: 1rem; }

/* -------------------------------------------------------------------------
   Utility bar — language switcher, date, search
   ------------------------------------------------------------------------- */
.utility-bar {
    background: var(--green-900);
    color: rgba(255, 255, 255, .72);
    font-size: .8125rem;
    border-bottom: 1px solid rgba(201, 162, 39, .25);
}

.utility-bar a { color: rgba(255, 255, 255, .72); }
.utility-bar a:hover { color: var(--gold-bright); }

.utility-bar .inner {
    display: flex; align-items: center; gap: 1rem;
    min-height: 38px; flex-wrap: wrap;
}

.lang-switch { display: flex; gap: .25rem; align-items: center; }

.lang-switch a {
    padding: .1rem .55rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    line-height: 1.7;
}

.lang-switch a.active {
    border-color: rgba(201, 162, 39, .55);
    color: var(--gold-bright);
}

/* -------------------------------------------------------------------------
   Masthead
   ------------------------------------------------------------------------- */
.masthead {
    background: linear-gradient(180deg, var(--green-800), var(--green-900));
    background-image: var(--girih), linear-gradient(180deg, var(--green-800), var(--green-900));
    background-size: 60px 60px, auto;
    color: #fff;
    border-bottom: 3px solid var(--gold);
}

.masthead .inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.5rem; padding-block: 1.5rem; flex-wrap: wrap;
}

.wordmark { display: flex; align-items: center; gap: .9rem; color: #fff; }
.wordmark:hover { color: #fff; }

.wordmark .seal {
    width: 46px; height: 46px; flex: none;
    border: 1.5px solid var(--gold);
    transform: rotate(45deg);
    border-radius: 4px;
    display: grid; place-items: center;
}

.wordmark .seal::after {
    content: ""; width: 20px; height: 20px;
    border: 1.5px solid rgba(201, 162, 39, .6);
    border-radius: 2px;
}

.wordmark .title {
    font-family: var(--font-display);
    font-size: 1.55rem; font-weight: 700; color: #fff; line-height: 1.35;
}

.wordmark .tagline {
    display: block; font-family: var(--font-ui);
    font-size: .8125rem; font-weight: 400;
    color: rgba(255, 255, 255, .6); line-height: 1.6;
}

.masthead-search .form-control {
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .18);
    color: #fff; min-width: 220px;
}

.masthead-search .form-control::placeholder { color: rgba(255, 255, 255, .45); }

.masthead-search .form-control:focus {
    background: rgba(255, 255, 255, .13);
    border-color: var(--gold);
    box-shadow: none; color: #fff;
}

.masthead-search .btn { border-color: var(--gold); color: var(--gold-bright); }
.masthead-search .btn:hover { background: var(--gold); color: var(--green-900); }

/* -------------------------------------------------------------------------
   Primary navigation
   ------------------------------------------------------------------------- */
.site-nav {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-card);
    position: sticky; top: 0; z-index: 1020;
}

.site-nav .nav-list {
    display: flex; align-items: stretch; gap: 0;
    list-style: none; margin: 0; padding: 0; flex-wrap: wrap;
}

.site-nav .nav-list > li > a {
    display: block; padding: .85rem 1.05rem;
    font-family: var(--font-ui); font-size: .95rem; font-weight: 500;
    color: var(--ink); border-bottom: 3px solid transparent;
}

.site-nav .nav-list > li > a:hover,
.site-nav .nav-list > li > a.active {
    color: var(--green-700);
    border-bottom-color: var(--gold);
    background: linear-gradient(180deg, transparent, rgba(201, 162, 39, .07));
}

.site-nav .dropdown-menu {
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    box-shadow: var(--shadow-raised); font-size: .92rem; padding: .35rem;
}

.site-nav .dropdown-item:hover { background: var(--green-100); color: var(--green-800); }

/* -------------------------------------------------------------------------
   Section headings — the gold rule with a star at the start
   ------------------------------------------------------------------------- */
.section-head {
    display: flex; align-items: center; gap: .75rem;
    margin: 2.25rem 0 1.15rem;
}

.section-head h2 {
    font-size: 1.3rem; margin: 0; white-space: nowrap;
    color: var(--green-800);
}

.section-head .star {
    width: 15px; height: 15px; flex: none;
    background: var(--gold); opacity: .85;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.section-head .rule {
    flex: 1 1 auto; height: 1px;
    background: linear-gradient(90deg, var(--gold-soft), transparent);
}

html[dir="rtl"] .section-head .rule {
    background: linear-gradient(270deg, var(--gold-soft), transparent);
}

.section-head .more {
    font-family: var(--font-ui); font-size: .85rem;
    color: var(--muted); white-space: nowrap;
}

.section-head .more:hover { color: var(--gold); }

/* -------------------------------------------------------------------------
   Cards
   ------------------------------------------------------------------------- */
.story {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    height: 100%;
    display: flex; flex-direction: column;
    overflow: hidden;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.story:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-raised);
    transform: translateY(-2px);
}

.story .thumb {
    display: block; aspect-ratio: 16 / 9;
    background: var(--green-100) var(--girih); background-size: 60px 60px;
    overflow: hidden;
}

.story .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.story .body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; flex: 1 1 auto; }

.story .kicker {
    font-family: var(--font-ui); font-size: .75rem; font-weight: 600;
    letter-spacing: .02em; color: var(--gold);
    text-transform: uppercase; margin-bottom: .35rem;
}

.story h3 { font-size: 1.05rem; margin: 0 0 .45rem; line-height: 1.65; }
.story h3 a { color: var(--green-900); }
.story h3 a:hover { color: var(--gold); }

.story p.dek {
    font-size: .9rem; color: var(--ink-soft); margin: 0 0 .75rem;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
    overflow: hidden;
}

.story .meta {
    margin-top: auto; font-family: var(--font-ui); font-size: .78rem;
    color: var(--muted); display: flex; gap: .75rem; flex-wrap: wrap; align-items: center;
}

/* The lead story — larger type, image bled to the card edge */
.story-lead .thumb { aspect-ratio: 21 / 9; }
.story-lead h3 { font-size: 1.75rem; line-height: 1.5; }
.story-lead p.dek { font-size: 1rem; -webkit-line-clamp: 4; }
.story-lead .body { padding: 1.25rem 1.4rem 1.5rem; }

/* A compact horizontal card for sidebars and dense rails */
.story-row {
    display: flex; gap: .8rem; align-items: flex-start;
    padding: .7rem 0; border-bottom: 1px dashed var(--line);
}

.story-row:last-child { border-bottom: 0; }
.story-row .thumb { width: 86px; flex: none; aspect-ratio: 4 / 3; border-radius: var(--radius); }
.story-row h3 { font-size: .95rem; margin: 0 0 .25rem; }
.story-row .meta { font-size: .75rem; }

/* A numbered list, used for "most viewed" */
.rank-list { list-style: none; margin: 0; padding: 0; counter-reset: rank; }

.rank-list li {
    counter-increment: rank;
    display: flex; gap: .7rem; align-items: baseline;
    padding: .55rem 0; border-bottom: 1px dashed var(--line);
}

.rank-list li:last-child { border-bottom: 0; }

.rank-list li::before {
    content: counter(rank);
    font-family: var(--font-display); font-size: 1.15rem; font-weight: 700;
    color: var(--gold-soft); flex: none; min-width: 1.4rem;
}

.rank-list a { font-size: .93rem; color: var(--green-900); line-height: 1.7; }
.rank-list a:hover { color: var(--gold); }

/* -------------------------------------------------------------------------
   Type badges — one per content type
   ------------------------------------------------------------------------- */
.type-badge {
    display: inline-flex; align-items: center; gap: .3rem;
    font-family: var(--font-ui); font-size: .72rem; font-weight: 600;
    padding: .12rem .5rem; border-radius: 2rem;
    background: var(--green-100); color: var(--green-700);
    border: 1px solid rgba(29, 98, 80, .18);
}

.type-badge.video { background: #fdeeee; color: #9b2c2c; border-color: rgba(155, 44, 44, .18); }
.type-badge.audio { background: #f3eefd; color: #553c9a; border-color: rgba(85, 60, 154, .18); }
.type-badge.document { background: #fdf6e3; color: #8a6d1f; border-color: rgba(138, 109, 31, .22); }
.type-badge.gallery { background: #eef6fd; color: #2c5282; border-color: rgba(44, 82, 130, .18); }
.type-badge.conference { background: #fdf0e6; color: #9c4221; border-color: rgba(156, 66, 33, .2); }
.type-badge.question { background: #edf7f0; color: #276749; border-color: rgba(39, 103, 73, .2); }
.type-badge.news { background: #f6f2ea; color: #7a5c14; border-color: rgba(122, 92, 20, .2); }

/* -------------------------------------------------------------------------
   Panels and sidebar
   ------------------------------------------------------------------------- */
.panel {
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow-card);
    margin-bottom: 1.25rem;
}

.panel > .panel-head {
    padding: .7rem 1rem; border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, #fdfbf7, var(--surface));
    display: flex; align-items: center; gap: .5rem;
}

.panel > .panel-head h3 {
    margin: 0; font-size: 1rem; color: var(--green-800);
}

.panel > .panel-head .star {
    width: 12px; height: 12px; background: var(--gold); flex: none;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

.panel > .panel-body { padding: .85rem 1rem 1rem; }

/* Tag cloud — five weights (spec §2) */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .4rem; }

.tag-cloud a {
    font-family: var(--font-ui);
    padding: .18rem .6rem; border-radius: 2rem;
    border: 1px solid var(--line-strong); color: var(--ink-soft);
    background: #fdfcf9; line-height: 1.9;
}

.tag-cloud a:hover { border-color: var(--gold); color: var(--gold); background: #fffdf6; }

.tag-cloud a.w1 { font-size: .78rem; }
.tag-cloud a.w2 { font-size: .85rem; }
.tag-cloud a.w3 { font-size: .93rem; }
.tag-cloud a.w4 { font-size: 1.02rem; font-weight: 500; }
.tag-cloud a.w5 { font-size: 1.12rem; font-weight: 600; color: var(--green-700); }

/* -------------------------------------------------------------------------
   Article page
   ------------------------------------------------------------------------- */
.article-header { margin-bottom: 1.5rem; }

.article-header h1 {
    font-size: 2.1rem; line-height: 1.55; margin: .5rem 0 .75rem;
}

.article-header .standfirst {
    font-size: 1.08rem; color: var(--ink-soft); line-height: 2;
    padding-inline-start: 1rem; border-inline-start: 3px solid var(--gold-soft);
}

.byline {
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
    font-family: var(--font-ui); font-size: .875rem; color: var(--muted);
    padding-block: .8rem; border-block: 1px solid var(--line); margin-block: 1.25rem;
}

.byline .avatar {
    width: 38px; height: 38px; border-radius: 50%; object-fit: cover;
    border: 2px solid var(--gold-soft);
}

.byline .author-name { color: var(--green-800); font-weight: 600; }

.prose { max-width: var(--measure); font-size: 1.06rem; line-height: 2.15; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.4rem; margin-top: 2em; color: var(--green-800); }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; }
.prose p { margin-bottom: 0; text-align: justify; }
.prose a { color: var(--green-600); border-bottom: 1px solid var(--gold-soft); }
.prose a:hover { color: var(--gold); border-bottom-color: var(--gold); }
.prose img, .prose figure img { max-width: 100%; height: auto; border-radius: var(--radius); }
.prose figure { margin-block: 1.75em; }
.prose figcaption {
    font-family: var(--font-ui); font-size: .82rem; color: var(--muted);
    text-align: center; margin-top: .5rem;
}

.prose blockquote {
    margin-inline: 0; padding: 1.1rem 1.35rem;
    background: linear-gradient(180deg, #fdfbf4, #fbf8ef);
    border-inline-start: 3px solid var(--gold);
    border-radius: var(--radius);
    font-family: var(--font-display); font-size: 1.1rem;
    color: var(--green-800); line-height: 2;
}

.prose ul, .prose ol { padding-inline-start: 1.5rem; }
.prose li + li { margin-top: .4em; }

.prose table {
    width: 100%; border-collapse: collapse; font-size: .95rem;
    font-family: var(--font-ui);
}

.prose table th, .prose table td {
    border: 1px solid var(--line-strong); padding: .5rem .7rem;
}

.prose table th { background: var(--green-100); color: var(--green-800); font-weight: 600; }

/* Wide content must scroll inside itself rather than the page */
.prose .table-wrap, .prose pre { overflow-x: auto; }

.prose pre {
    background: #f5f2ea; border: 1px solid var(--line);
    padding: .9rem 1.1rem; border-radius: var(--radius);
    direction: ltr; text-align: left;
}

/* -------------------------------------------------------------------------
   Media players
   ------------------------------------------------------------------------- */
.video-frame {
    position: relative; aspect-ratio: 16 / 9; width: 100%;
    background: #000; border-radius: var(--radius); overflow: hidden;
    border: 1px solid var(--line-strong);
}

.video-frame iframe, .video-frame video {
    position: absolute; inset: 0; width: 100%; height: 100%; border: 0;
}

.audio-player {
    background: linear-gradient(135deg, var(--green-800), var(--green-900));
    background-image: var(--girih), linear-gradient(135deg, var(--green-800), var(--green-900));
    background-size: 60px 60px, auto;
    border-radius: var(--radius); padding: 1.15rem 1.25rem; color: #fff;
    border: 1px solid rgba(201, 162, 39, .3);
}

.audio-player audio { width: 100%; }

.transcript-toggle {
    font-family: var(--font-ui); font-size: .9rem;
    color: var(--green-700); background: none; border: 0; padding: 0;
    border-bottom: 1px dashed var(--gold);
}

/* Gallery grid and lightbox */
.gallery-grid {
    display: grid; gap: .6rem;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.gallery-grid a {
    display: block; aspect-ratio: 1; overflow: hidden;
    border-radius: var(--radius); border: 1px solid var(--line);
}

.gallery-grid img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .3s ease;
}

.gallery-grid a:hover img { transform: scale(1.06); }

/* Document library */
.doc-card {
    display: flex; gap: 1rem; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: 1rem; height: 100%;
}

.doc-card .cover {
    width: 72px; flex: none; aspect-ratio: 3 / 4;
    background: var(--green-100) var(--girih); background-size: 40px 40px;
    border: 1px solid var(--line-strong); border-radius: 2px;
    object-fit: cover;
}

/* -------------------------------------------------------------------------
   Conference programme
   ------------------------------------------------------------------------- */
.programme-day {
    font-family: var(--font-ui); font-weight: 600; color: var(--green-800);
    background: var(--green-100); padding: .5rem .85rem;
    border-inline-start: 3px solid var(--gold); border-radius: var(--radius);
    margin-block: 1.25rem .75rem;
}

.session {
    display: flex; gap: 1rem; padding: .9rem 0;
    border-bottom: 1px dashed var(--line);
}

.session .time {
    font-family: var(--font-ui); font-size: .85rem; font-weight: 600;
    color: var(--gold); flex: none; min-width: 6.5rem; padding-top: .15rem;
}

.session h4 { font-size: 1rem; margin: 0 0 .3rem; }
.session .hall { font-family: var(--font-ui); font-size: .78rem; color: var(--muted); }

.speaker-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    font-family: var(--font-ui); font-size: .82rem;
    background: #fdfcf9; border: 1px solid var(--line);
    border-radius: 2rem; padding: .15rem .6rem .15rem .15rem;
}

html[dir="rtl"] .speaker-chip { padding: .15rem .15rem .15rem .6rem; }

.speaker-chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }

.seat-meter { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.seat-meter > span { display: block; height: 100%; background: var(--green-600); }

/* -------------------------------------------------------------------------
   Comments
   ------------------------------------------------------------------------- */
.comment {
    padding: .9rem 0; border-bottom: 1px dashed var(--line);
}

.comment .head {
    display: flex; align-items: baseline; gap: .6rem;
    font-family: var(--font-ui); font-size: .85rem; margin-bottom: .35rem;
}

.comment .head .name { font-weight: 600; color: var(--green-800); }
.comment .head .when { color: var(--muted); font-size: .78rem; }
.comment .text { font-size: .95rem; color: var(--ink-soft); line-height: 1.95; margin: 0; }

.comment .replies {
    margin-top: .8rem; padding-inline-start: 1.15rem;
    border-inline-start: 2px solid var(--green-100);
}

/* -------------------------------------------------------------------------
   Forms and buttons
   ------------------------------------------------------------------------- */
.btn-gold {
    background: var(--gold); border: 1px solid var(--gold); color: var(--green-900);
    font-family: var(--font-ui); font-weight: 600;
}

.btn-gold:hover { background: var(--gold-bright); border-color: var(--gold-bright); color: var(--green-900); }

.btn-green {
    background: var(--green-700); border: 1px solid var(--green-700); color: #fff;
    font-family: var(--font-ui); font-weight: 500;
}

.btn-green:hover { background: var(--green-800); border-color: var(--green-800); color: #fff; }

.btn-outline-green {
    border: 1px solid var(--green-600); color: var(--green-700);
    font-family: var(--font-ui);
}

.btn-outline-green:hover { background: var(--green-700); color: #fff; }

.form-control, .form-select {
    border: 1px solid var(--line-strong); border-radius: var(--radius);
    font-family: var(--font-ui); font-size: .95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--green-600);
    box-shadow: 0 0 0 .18rem rgba(29, 98, 80, .12);
}

.form-label { font-family: var(--font-ui); font-size: .875rem; font-weight: 500; color: var(--ink-soft); }

/* -------------------------------------------------------------------------
   Pagination and breadcrumbs
   ------------------------------------------------------------------------- */
.pagination { font-family: var(--font-ui); }
.page-link { color: var(--green-700); border-color: var(--line-strong); }
.page-link:hover { background: var(--green-100); color: var(--green-800); }
.page-item.active .page-link { background: var(--green-700); border-color: var(--green-700); }

.breadcrumb {
    font-family: var(--font-ui); font-size: .82rem;
    background: none; padding: 0; margin-bottom: 1rem;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb-item.active { color: var(--green-800); }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
    margin-top: 3.5rem;
    background: linear-gradient(180deg, var(--green-800), var(--green-900));
    background-image: var(--girih), linear-gradient(180deg, var(--green-800), var(--green-900));
    background-size: 60px 60px, auto;
    color: rgba(255, 255, 255, .75);
    border-top: 3px solid var(--gold);
    font-size: .9rem;
}

.site-footer h4 {
    color: var(--gold-bright); font-size: .98rem; margin-bottom: .85rem;
    font-family: var(--font-ui); font-weight: 600;
}

.site-footer a { color: rgba(255, 255, 255, .75); }
.site-footer a:hover { color: var(--gold-bright); }

.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding-block: .2rem; }

.site-footer .colophon {
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin-top: 1.75rem; padding-block: 1rem;
    font-size: .82rem; color: rgba(255, 255, 255, .5);
}

/* -------------------------------------------------------------------------
   The three per-language layout variants (spec addendum)
   ------------------------------------------------------------------------- */

/* Journal — one wide feature above a single reverse-chronological river */
.layout-journal .story-lead h3 { font-size: 2rem; }
.layout-journal .river .story { flex-direction: row; }
.layout-journal .river .story .thumb { width: 34%; aspect-ratio: 4 / 3; }

/* Digest — the lightest arrangement, for a language with little content yet */
.layout-digest .story .thumb { display: none; }
.layout-digest .story { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.layout-digest .story:hover { transform: none; box-shadow: none; }
.layout-digest .story .body { padding-inline: 0; }

/* -------------------------------------------------------------------------
   Print (spec §10)
   ------------------------------------------------------------------------- */
@media print {
    .utility-bar, .site-nav, .masthead-search, .site-footer,
    .no-print, aside, .comments-section { display: none !important; }

    body { background: #fff; font-size: 11.5pt; }
    .masthead { background: none; color: #000; border-bottom: 2px solid #000; }
    .wordmark .title, .wordmark .tagline { color: #000; }
    .prose { max-width: none; }
    a { color: #000; }
    .prose a::after { content: " (" attr(href) ")"; font-size: .8em; color: #555; }
}

/* -------------------------------------------------------------------------
   Accessibility (spec §10)
   ------------------------------------------------------------------------- */
:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.skip-link {
    position: absolute; inset-inline-start: -9999px; top: 0; z-index: 2000;
    background: var(--gold); color: var(--green-900);
    padding: .6rem 1.1rem; font-family: var(--font-ui); font-weight: 600;
}

.skip-link:focus { inset-inline-start: 0; }

.visually-hidden-focusable:not(:focus):not(:focus-within) {
    position: absolute !important; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0);
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* -------------------------------------------------------------------------
   Dark reading mode (spec §10)
   ------------------------------------------------------------------------- */
html[data-theme="dark"] {
    --paper: #121715;
    --surface: #182220;
    --ink: #e8e4da;
    --ink-soft: #b9b5aa;
    --muted: #8d8a80;
    --line: #2a3532;
    --line-strong: #3a4744;
    --green-100: #1c2b27;
    --gold-soft: #4a3f22;
}

html[data-theme="dark"] body { background: var(--paper); color: var(--ink); }

html[data-theme="dark"] h1, html[data-theme="dark"] h2,
html[data-theme="dark"] h3, html[data-theme="dark"] h4,
html[data-theme="dark"] .story h3 a { color: #f0ecdf; }

html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .panel > .panel-head h3 { color: var(--gold-bright); }

html[data-theme="dark"] .panel > .panel-head {
    background: linear-gradient(180deg, #1d2926, var(--surface));
}

html[data-theme="dark"] .prose blockquote {
    background: #1c2724; color: #e8e4da;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select {
    background: #1c2724; border-color: var(--line-strong); color: var(--ink);
}

html[data-theme="dark"] .tag-cloud a { background: #1c2724; }

html[data-theme="dark"] a { color: #7fc0aa; }
html[data-theme="dark"] a:hover { color: var(--gold-bright); }

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
    .story-lead h3 { font-size: 1.4rem; }
    .article-header h1 { font-size: 1.65rem; }
    .layout-journal .river .story { flex-direction: column; }
    .layout-journal .river .story .thumb { width: 100%; aspect-ratio: 16 / 9; }
}

@media (max-width: 575.98px) {
    .masthead .inner { padding-block: 1.1rem; }
    .wordmark .title { font-size: 1.2rem; }
    .masthead-search { width: 100%; }
    .masthead-search .form-control { min-width: 0; }
    .session { flex-direction: column; gap: .3rem; }
    .session .time { min-width: 0; }
}

/* -------------------------------------------------------------------------
   Conference month calendar (spec §3)
   The grid is the same in all three languages; only the week's first day and
   the digits differ, and both are decided server-side.
   ------------------------------------------------------------------------- */
.calendar-grid {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    table-layout: fixed;
}

.calendar-grid th {
    font-size: .78rem;
    font-weight: 600;
    color: var(--muted);
    padding: .4rem .3rem;
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.calendar-grid td {
    height: 92px;
    vertical-align: top;
    border: 1px solid var(--line);
    padding: .25rem;
}

.calendar-grid td.empty { background: color-mix(in srgb, var(--line) 22%, transparent); border-color: transparent; }
.calendar-grid td.today { box-shadow: inset 0 0 0 2px var(--gold); }
.calendar-grid td.has-events { background: color-mix(in srgb, var(--green) 5%, transparent); }

.calendar-grid .daynum {
    display: block;
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .2rem;
}

.calendar-grid .cal-event {
    display: block;
    font-size: .72rem;
    line-height: 1.35;
    padding: .15rem .3rem;
    margin-bottom: .15rem;
    border-radius: 3px;
    border-inline-start: 3px solid var(--green);
    background: color-mix(in srgb, var(--green) 10%, transparent);

    /* A long conference title must not stretch the cell out of the grid. */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-grid .cal-event.past {
    border-inline-start-color: var(--muted);
    background: color-mix(in srgb, var(--muted) 10%, transparent);
    opacity: .75;
}

@media (max-width: 575.98px) {
    .calendar-grid td { height: 74px; }
}
