/* ==========================================================================
   Wiki Umroh — modern pilgrimage journal
   ========================================================================== */

:root {
    --paper: #f7f2e8;
    --paper-2: #efe7d6;
    --surface: #fffcf5;
    --ink: #121a16;
    --ink-2: #46524b;
    --ink-3: #6e7a72;
    --green: #0a4634;
    --green-2: #0e5c44;
    --deep: #07251c;
    --gold: #b98a3e;
    --gold-2: #d8b26a;
    --line: #e2d8c4;
    --line-strong: #cdbfa4;

    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 2px 6px rgba(7, 37, 28, 0.06), 0 24px 60px -36px rgba(7, 37, 28, 0.45);

    --serif: "Fraunces", Georgia, "Times New Roman", "Noto Naskh Arabic", serif;
    --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Naskh Arabic", sans-serif;
    --arabic: "Noto Naskh Arabic", "Amiri", serif;

    --wrap: 1200px;
    --header-h: 78px;
}

[data-theme="dark"] .hero-search { border-color: rgba(247, 242, 232, 0.18); }

[data-theme="dark"] {
    --paper: #0b1210;
    --paper-2: #111c17;
    --surface: #0f1815;
    --ink: #f2ebdd;
    --ink-2: #b7c0b9;
    --ink-3: #8b968f;
    --green: #8fd9b9;
    --green-2: #6fc6a2;
    --deep: #06110d;
    --gold: #d8b26a;
    --gold-2: #e6c98e;
    --line: #22302a;
    --line-strong: #35463d;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.5), 0 30px 70px -40px rgba(0, 0, 0, 0.95);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scrollbar-color: var(--line-strong) transparent;
    scrollbar-width: thin;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border: 3px solid var(--paper);
    border-radius: 999px;
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16.5px;
    line-height: 1.68;
    font-kerning: normal;
    -webkit-font-smoothing: antialiased;
    caret-color: var(--green-2);
}

img, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }

::selection { background: var(--green); color: #f7f2e8; }

:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Layout ---------- */
.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 28px;
}

.site-main { display: block; }

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 16px; top: -60px;
    z-index: 300;
    padding: 10px 16px;
    background: var(--green);
    color: var(--paper);
    border-radius: 8px;
    font-weight: 700;
    transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

.sep { color: var(--line-strong); padding-inline: 3px; }

kbd {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: var(--paper-2);
    color: var(--ink-3);
    font-family: var(--sans);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.6;
}

.text-link {
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--green-2);
    white-space: nowrap;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
}
.text-link:hover { border-bottom-color: var(--green-2); }

.linkish {
    padding: 0;
    border: 0;
    background: none;
    color: var(--green-2);
    font: inherit;
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
    cursor: pointer;
}

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
}

.home-template .site-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: transparent;
    border-bottom: 0;
    color: #f7f2e8;
}

.home-template .site-header:not(.is-fixed) .nav-link,
.home-template .site-header:not(.is-fixed) .brand-name,
.home-template .site-header:not(.is-fixed) .brand-tag {
    text-shadow: 0 1px 16px rgba(0, 0, 0, 0.7);
}
.home-template .site-header.is-fixed {
    position: fixed;
    background: var(--paper);
    color: var(--ink);
    border-bottom: 1px solid var(--line);
    animation: header-in 0.28s ease-out;
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 26px;
    height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

.brand-mark { color: var(--gold-2); }
.home-template .site-header.is-fixed .brand-mark,
.site-header:not(.is-fixed) .brand-mark { color: var(--gold-2); }
.home-template .site-header.is-fixed .brand-mark { color: var(--green); }
.brand-mark svg { width: 34px; height: 34px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.08; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.16rem; letter-spacing: -0.02em; }
.brand-tag {
    font-size: 0.6rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0.65;
    font-weight: 700;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.82;
    padding-block: 4px;
    border-bottom: 1px solid transparent;
}
.nav-link:hover { opacity: 1; border-bottom-color: currentColor; }
.nav-link.is-current { opacity: 1; border-bottom-color: currentColor; }

.header-actions { display: flex; align-items: center; gap: 2px; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 40px; height: 40px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    cursor: pointer;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: min(88vh, 820px);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--deep);
    color: #f7f2e8;
}

.hero-media { position: absolute; inset: 0; }
.hero-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 38%;
    animation: hero-zoom 9s ease-out forwards;
}
.hero-media::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(5, 16, 11, 0.84) 0%, rgba(5, 16, 11, 0.35) 14%, transparent 26%);
}
.hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(90deg, rgba(5, 16, 11, 0.9) 0%, rgba(5, 16, 11, 0.62) 40%, rgba(5, 16, 11, 0.16) 72%, rgba(5, 16, 11, 0.28) 100%),
        linear-gradient(180deg, rgba(5, 16, 11, 0.05) 40%, rgba(5, 16, 11, 0.92) 100%);
}

.hero-inner {
    position: relative;
    z-index: 2;
    padding-block: 160px 68px;
}

.hero h1 {
    font-family: var(--serif);
    text-shadow: 0 2px 28px rgba(0, 0, 0, 0.35);
    font-size: clamp(3rem, 6.6vw, 5.9rem);
    line-height: 0.98;
    letter-spacing: -0.045em;
    font-weight: 500;
    max-width: 13ch;
    text-wrap: balance;
    text-shadow: 0 2px 30px rgba(0, 0, 0, 0.18);
}

.hero-lede {
    margin-top: 22px;
    max-width: 52ch;
    font-size: 1.05rem;
    line-height: 1.7;
    color: rgba(247, 242, 232, 0.82);
}

.hero-search {
    display: flex;
    border: 1px solid transparent;
    align-items: center;
    gap: 12px;
    width: min(100%, 540px);
    margin-top: 30px;
    padding: 15px 18px;
    border: 0;
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink-3);
    font-size: 0.94rem;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 20px 50px -24px rgba(0, 0, 0, 0.55);
}
.hero-search:hover { color: var(--ink); }
.hero-search svg { width: 19px; height: 19px; flex-shrink: 0; color: var(--green-2); }
.hero-search span { flex: 1; }
.hero-search kbd { background: var(--paper-2); }

.hero-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-top: 26px;
    font-size: 0.84rem;
    font-weight: 600;
    color: rgba(247, 242, 232, 0.78);
}
.hero-topics a {
    padding-right: 14px;
    margin-right: 14px;
    border-right: 1px solid rgba(247, 242, 232, 0.3);
}
.hero-topics a:last-child { border-right: 0; margin-right: 0; padding-right: 0; }
.hero-topics a:hover { color: #fff; }

/* ---------- Start strip ---------- */
.start-strip {
    background: var(--paper-2);
    border-bottom: 1px solid var(--line);
}

.start-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
    gap: 56px;
    padding-block: 46px;
    align-items: start;
}

.start-intro h2 {
    font-family: var(--serif);
    font-size: 1.6rem;
    line-height: 1.15;
    letter-spacing: -0.02em;
    font-weight: 600;
}
.start-intro p { margin-top: 10px; font-size: 0.88rem; color: var(--ink-2); max-width: 34ch; }

.start-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }

.start-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 22px 0 0;
    border-top: 1px solid var(--ink);
    min-height: 116px;
}
.start-item + .start-item { padding-left: 22px; border-left: 1px solid var(--line-strong); }
.start-num {
    font-family: var(--serif);
    font-size: 0.86rem;
    color: var(--gold);
}
.start-title { font-family: var(--serif); font-size: 1.06rem; line-height: 1.28; font-weight: 600; }
.start-item:hover .start-title { color: var(--green-2); }
.start-meta { margin-top: auto; font-size: 0.72rem; color: var(--ink-3); }

/* ---------- Sections ---------- */
.section { padding-block: 76px; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}
.section-head h2 {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 3.2vw, 2.7rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    font-weight: 600;
}

/* ---------- Category tiles ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.cat-tile {
    position: relative;
    display: block;
    min-height: 250px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--deep);
    color: #f7f2e8;
    isolation: isolate;
}
.cat-tile:nth-child(1) { grid-column: span 2; min-height: 360px; }
.cat-tile:nth-child(4) { grid-column: span 2; }

.cat-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.cat-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 16, 11, 0.02) 28%, rgba(5, 16, 11, 0.94) 100%);
}
.cat-tile:hover img { transform: scale(1.04); }

.cat-tile-body {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    z-index: 2;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 22px 24px;
}
.cat-tile-name {
    font-family: var(--serif);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
    font-size: clamp(1.5rem, 2.4vw, 2.15rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    font-weight: 600;
}
.cat-tile-meta { font-size: 0.74rem; color: rgba(247, 242, 232, 0.75); white-space: nowrap; }

/* ---------- Feature ---------- */
.feature {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.65fr);
    grid-template-rows: repeat(4, auto);
    gap: 0 44px;
    align-content: start;
}

.feature-main { grid-column: 1; grid-row: 1 / span 4; }

.feature-media {
    display: block;
    aspect-ratio: 16 / 11;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-2);
}
.feature-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.feature-main:hover .feature-media img { transform: scale(1.025); }

.feature-body { padding-top: 20px; }
.feature-body h3 {
    font-family: var(--serif);
    font-size: clamp(1.75rem, 3vw, 2.65rem);
    line-height: 1.06;
    letter-spacing: -0.03em;
    font-weight: 600;
    margin-top: 8px;
    max-width: 20ch;
}
.feature-body h3 a:hover { color: var(--green-2); }
.feature-body p { margin-top: 14px; max-width: 54ch; color: var(--ink-2); font-size: 0.94rem; }

.feature-small {
    grid-column: 2;
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}
.feature-small:nth-child(2) { padding-top: 0; }
.feature-thumb {
    display: block;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--paper-2);
}
.feature-thumb img { width: 100%; height: 100%; object-fit: cover; }
.feature-small h3 {
    font-family: var(--serif);
    font-size: 1.12rem;
    line-height: 1.28;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-top: 4px;
}
.feature-small h3 a:hover { color: var(--green-2); }

/* ---------- Meta ---------- */
.entry-tag {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
}
.entry-tag a:hover { color: var(--green-2); }

.entry-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-size: 0.73rem;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

/* ---------- Cards ---------- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 34px 26px;
}
.card-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.post-card { display: flex; flex-direction: column; }
.post-card-media {
    display: block;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--paper-2);
    margin-bottom: 16px;
}
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.post-card:hover .post-card-media img { transform: scale(1.04); }
.post-card h3 {
    font-family: var(--serif);
    font-size: 1.3rem;
    line-height: 1.22;
    letter-spacing: -0.015em;
    font-weight: 600;
    margin-top: 6px;
}
.post-card h3 a:hover { color: var(--green-2); }
.post-card p { margin-top: 8px; font-size: 0.85rem; color: var(--ink-2); }

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: 0.83rem;
}
.pagination a { font-weight: 700; color: var(--green-2); }
.pagination a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pagination .page-number { color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Madzhab ---------- */
.madzhab {
    background: var(--deep);
    color: #f7f2e8;
    border-top: 0;
}
.madzhab .wrap { padding-block: 68px; }
.madzhab-head { display: flex; align-items: baseline; justify-content: space-between; gap: 40px; }
.madzhab-head h2 {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 3.2vw, 2.7rem);
    letter-spacing: -0.03em;
    font-weight: 600;
}
.madzhab-head p { max-width: 46ch; font-size: 0.9rem; color: rgba(247, 242, 232, 0.72); }

.madzhab-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 34px;
    border-top: 1px solid rgba(247, 242, 232, 0.25);
}
.madzhab-grid a {
    padding: 22px 20px 6px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-right: 1px solid rgba(247, 242, 232, 0.18);
}
.madzhab-grid a:last-child { border-right: 0; }
.madzhab-grid a + a { padding-left: 20px; }
.madzhab-name { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; }
.madzhab-count { font-size: 0.72rem; color: rgba(247, 242, 232, 0.6); }
.madzhab-grid a:hover .madzhab-name { color: var(--gold-2); }

/* ---------- Post ---------- */
.post-hero-media {
    height: clamp(300px, 44vh, 480px);
    overflow: hidden;
    background: var(--deep);
}
.post-hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }

.post-hero-inner { padding-block: 40px 34px; }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    color: var(--ink-3);
    margin-bottom: 26px;
}
.breadcrumb a:hover { color: var(--green-2); }
.breadcrumb-current { max-width: 46ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.post-kicker {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 14px;
}
.post-kicker a:hover { color: var(--green-2); }

.post-hero h1 {
    font-family: var(--serif);
    font-size: clamp(2.2rem, 4.8vw, 4rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    font-weight: 600;
    max-width: 20ch;
    text-wrap: balance;
}

.post-dek {
    margin-top: 18px;
    max-width: 62ch;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--ink-2);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 0.75rem;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}

.post-body-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 64px;
    align-items: start;
    padding-block: 40px 90px;
}

.post-content { min-width: 0; }
.post-content .gh-content { max-width: 68ch; }

/* TOC */
.toc { position: sticky; top: calc(var(--header-h) + 28px); }
.toc-title {
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 10px;
}
.toc ol { display: flex; flex-direction: column; gap: 1px; }
.toc a {
    display: block;
    padding: 5px 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--ink-2);
    border-bottom: 1px solid transparent;
}
.toc a:hover { color: var(--green-2); }
.toc a.is-active { color: var(--green-2); font-weight: 700; }
.toc .toc-h3 a { padding-left: 14px; font-size: 0.75rem; color: var(--ink-3); }
.toc-top {
    margin-top: 16px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.73rem;
    font-weight: 700;
    color: var(--green-2);
    cursor: pointer;
}

.toc-mobile { display: none; }

/* Article body */
.gh-content {
    font-size: 1.06rem;
    line-height: 1.82;
    color: var(--ink);
}
.gh-content > * + * { margin-top: 1.1em; }

.gh-content h2,
.gh-content h3,
.gh-content h4 {
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    scroll-margin-top: calc(var(--header-h) + 28px);
    text-wrap: balance;
}
.gh-content h2 { font-size: 1.72rem; margin-top: 2.2em; }
.gh-content h3 { font-size: 1.28rem; margin-top: 1.9em; }
.gh-content h4 { font-size: 1.06rem; margin-top: 1.6em; }

.gh-content a {
    color: var(--green-2);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.gh-content a:hover { text-decoration-color: var(--green-2); }

.gh-content strong { font-weight: 700; }

.gh-content ul,
.gh-content ol { padding-left: 1.3em; }
.gh-content ul { list-style: none; }
.gh-content ul > li { position: relative; }
.gh-content ul > li::before {
    content: "";
    position: absolute;
    left: -1em;
    top: 0.72em;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--gold);
}
.gh-content ol { list-style: decimal; }
.gh-content li + li { margin-top: 0.34em; }
.gh-content li > ul,
.gh-content li > ol { margin-top: 0.34em; }

.gh-content blockquote {
    margin: 1.8em 0;
    padding: 4px 0 0;
    border-top: 1px solid var(--gold);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.18rem;
    line-height: 1.65;
}
.gh-content blockquote p + p { margin-top: 0.7em; }

.gh-content hr {
    margin: 2.6em 0;
    border: 0;
    height: 1px;
    background: var(--line-strong);
}

.gh-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
}
.gh-content th,
.gh-content td {
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}
.gh-content th {
    border-bottom: 1px solid var(--ink);
    font-weight: 700;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-2);
}
.table-wrap { overflow-x: auto; margin-block: 1.8em; }
.table-wrap table { margin: 0; min-width: 520px; }

.gh-content code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--paper-2);
    font-size: 0.87em;
}
.gh-content pre {
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--paper-2);
    overflow-x: auto;
    font-size: 0.84rem;
}

.gh-content img { border-radius: var(--radius-sm); }

.gh-content [dir="rtl"],
.gh-content :lang(ar) {
    font-family: var(--arabic);
    font-size: 1.5em;
    line-height: 2.05;
}

/* Dalil */
.gh-content table.dalil {
    display: block;
    margin: 1.8em 0;
    padding: 22px 24px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--paper-2);
    font-size: 1rem;
}
.gh-content table.dalil tbody,
.gh-content table.dalil tr { display: block; }
.gh-content table.dalil td {
    display: block;
    padding: 0;
    border: 0;
    text-align: left;
}
.gh-content table.dalil .dalil-arabic {
    font-family: var(--arabic);
    font-size: 1.6rem;
    line-height: 2.1;
    text-align: right;
    color: var(--ink);
    margin-bottom: 12px;
}
.gh-content table.dalil .dalil-translation {
    font-family: var(--serif);
    font-size: 1.05rem;
    line-height: 1.7;
}
.gh-content table.dalil .dalil-source {
    margin-top: 12px;
    padding-top: 9px;
    border-top: 1px solid var(--line-strong);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--ink-3);
}
.gh-content .dalil-note { margin-top: -0.8em; font-size: 0.76rem; color: var(--ink-3); }

/* Ghost cards */
.gh-content .kg-callout-card {
    display: flex;
    gap: 14px;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    background: var(--paper-2);
    font-size: 0.93rem;
}
.gh-content .kg-callout-card-green { background: rgba(10, 70, 52, 0.07); }
.gh-content .kg-callout-card-yellow { background: rgba(185, 138, 62, 0.1); }
.gh-content .kg-callout-card-red { background: rgba(143, 42, 42, 0.08); }
[data-theme="dark"] .gh-content .kg-callout-card-green { background: rgba(143, 217, 185, 0.08); }
[data-theme="dark"] .gh-content .kg-callout-card-yellow { background: rgba(216, 178, 106, 0.1); }
.gh-content .kg-callout-emoji { font-size: 1.25rem; line-height: 1.4; }
.gh-content .kg-callout-text { margin: 0; }
.gh-content .kg-callout-text p { margin: 0; }

.gh-content .kg-toggle-card {
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.gh-content .kg-toggle-heading { font-weight: 700; }

.gh-content .kg-bookmark-card { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.gh-content .kg-bookmark-container { display: flex; gap: 16px; padding: 16px; align-items: center; }
.gh-content .kg-bookmark-content { flex: 1; }
.gh-content .kg-bookmark-title { font-weight: 700; }
.gh-content .kg-bookmark-description { font-size: 0.82rem; color: var(--ink-2); margin-top: 3px; }
.gh-content .kg-bookmark-thumbnail img { width: 90px; height: 70px; object-fit: cover; border-radius: 6px; }

.gh-content .kg-width-wide { width: min(100%, 900px); }
.gh-content .kg-width-full { width: 100vw; max-width: none; margin-left: 50%; transform: translateX(-50%); }

.gh-content .kg-gallery-container { display: flex; flex-direction: column; gap: 8px; }
.gh-content .kg-gallery-row { display: flex; gap: 8px; }
.gh-content .kg-gallery-image img { border-radius: 6px; }

/* Post footer */
.post-footer { margin-top: 52px; }

.post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 0;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 0.72rem;
}
.post-tags-label {
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-right: 12px;
}
.post-tags a { color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.post-tags a + a::before { content: "/"; color: var(--line-strong); padding-inline: 8px; }
.post-tags a:hover { color: var(--green-2); }

.post-share {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0;
    margin-top: 18px;
    font-size: 0.74rem;
    color: var(--ink-3);
}
.post-share > span { font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; margin-right: 12px; }
.share-btn {
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.75rem;
    color: var(--ink-2);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 3px;
}
.share-btn:hover { color: var(--green-2); }
.share-btn + .share-btn::before {
    content: "/";
    color: var(--line-strong);
    padding-inline: 8px;
    text-decoration: none;
}

.disclaimer {
    margin-top: 32px;
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    background: var(--paper-2);
    font-size: 0.83rem;
    color: var(--ink-2);
}
.disclaimer strong {
    display: block;
    margin-bottom: 4px;
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
}
.disclaimer p { margin: 0; line-height: 1.62; }

.related { margin-top: 56px; }
.block-title {
    font-family: var(--serif);
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 22px;
    letter-spacing: -0.02em;
}

.post-pager {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 44px;
}
.pager {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}
.pager span { font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3); }
.pager strong { font-family: var(--serif); font-size: 0.98rem; font-weight: 600; line-height: 1.35; }
.pager:hover { border-color: var(--green-2); }
.pager-next { text-align: right; align-items: flex-end; }

/* ---------- Tag / page / error ---------- */
.tag-hero {
    position: relative;
    min-height: 360px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    background: var(--deep);
    color: #f7f2e8;
}
.tag-hero-media { position: absolute; inset: 0; }
.tag-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.tag-hero-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(6, 20, 14, 0.25), rgba(6, 20, 14, 0.9));
}
.tag-hero-inner { position: relative; z-index: 2; padding-block: 70px 44px; }
.tag-hero h1 {
    font-family: var(--serif);
    font-size: clamp(2.2rem, 4.6vw, 3.7rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    font-weight: 600;
    max-width: 20ch;
}
.tag-desc { margin-top: 14px; max-width: 58ch; color: rgba(247, 242, 232, 0.8); font-size: 0.95rem; }
.tag-meta { margin-top: 16px; font-size: 0.72rem; color: rgba(247, 242, 232, 0.6); font-variant-numeric: tabular-nums; }

.page-hero {
    background: var(--deep);
    color: #f7f2e8;
    padding-block: 120px 54px;
}
.page-hero .breadcrumb { color: rgba(247, 242, 232, 0.55); }
.page-hero .breadcrumb a:hover { color: #fff; }
.page-hero h1 {
    font-family: var(--serif);
    font-size: clamp(2.1rem, 4.2vw, 3.4rem);
    line-height: 1.04;
    letter-spacing: -0.035em;
    font-weight: 600;
    max-width: 22ch;
}
.page-hero .post-dek { color: rgba(247, 242, 232, 0.75); }

.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 64px;
    align-items: start;
    padding-block: 48px 90px;
}
.page-single { padding-block: 48px 90px; max-width: 900px; }

.empty-state { padding: 40px 0 70px; color: var(--ink-2); }
.empty-state h2 { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 8px; color: var(--ink); }
.empty-state a { color: var(--green-2); text-decoration: underline; text-underline-offset: 3px; }

.error-page { padding-block: 120px; }
.error-inner { max-width: 620px; }
.error-inner h1 {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 3.6vw, 2.8rem);
    line-height: 1.1;
    margin-bottom: 14px;
    letter-spacing: -0.03em;
}
.error-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; font-size: 0.9rem; }
.error-actions a {
    padding: 11px 18px;
    border-radius: 999px;
    background: var(--green);
    color: var(--paper);
    font-weight: 700;
}
.error-actions a + a { background: transparent; color: var(--ink); border: 1px solid var(--line-strong); }

/* Index page */
.index-intro { margin-bottom: 38px; }
.hero-search-sm { margin-top: 0; background: var(--surface); color: var(--ink-3); border: 1px solid var(--line-strong); box-shadow: none; }
.hero-search-sm:hover { color: var(--ink); }
.index-section { margin-top: 38px; }
.index-heading {
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--ink);
    margin-bottom: 2px;
}
.index-heading a:hover { color: var(--green-2); }
.index-list li {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}
.index-list a:hover { color: var(--green-2); }
.index-list span { flex-shrink: 0; font-size: 0.72rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--deep);
    color: #f7f2e8;
    padding-top: 64px;
}
.footer-top { padding-bottom: 44px; border-bottom: 1px solid rgba(247, 242, 232, 0.18); }
.footer-wordmark {
    display: inline-block;
    font-family: var(--serif);
    font-size: clamp(2.4rem, 5.6vw, 4.4rem);
    line-height: 1;
    letter-spacing: -0.04em;
    font-weight: 500;
}
.footer-lead { margin-top: 16px; max-width: 46ch; color: rgba(247, 242, 232, 0.68); font-size: 0.92rem; }

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 40px;
    padding-block: 40px;
}
.footer-heading {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(247, 242, 232, 0.5);
    margin-bottom: 12px;
}
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col a { font-size: 0.86rem; color: rgba(247, 242, 232, 0.86); }
.footer-col a:hover { color: var(--gold-2); }
.footer-small { font-size: 0.78rem; line-height: 1.65; color: rgba(247, 242, 232, 0.6); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding-block: 20px 26px;
    border-top: 1px solid rgba(247, 242, 232, 0.18);
    font-size: 0.72rem;
    color: rgba(247, 242, 232, 0.55);
}
.footer-bottom a { text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Search ---------- */
.search-modal { position: fixed; inset: 0; z-index: 160; }
.search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 14, 10, 0.66);
    backdrop-filter: blur(5px);
}
.search-panel {
    position: relative;
    width: min(680px, calc(100vw - 32px));
    max-height: min(72vh, 620px);
    margin: 9vh auto 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    animation: panel-in 0.18s ease-out;
}
.search-head { padding: 16px 18px; border-bottom: 1px solid var(--line); }
.search-form { display: flex; align-items: center; gap: 12px; }
.search-form svg { width: 20px; height: 20px; color: var(--green-2); flex-shrink: 0; }
.search-form input {
    flex: 1;
    min-width: 0;
    padding: 6px 0;
    border: 0;
    background: none;
    color: var(--ink);
    font: inherit;
    font-size: 1.02rem;
    outline: none;
}
.search-form input::placeholder { color: var(--ink-3); }
.search-form input::-webkit-search-cancel-button { display: none; }

.search-body { overflow-y: auto; padding: 6px; }
.search-empty { padding: 34px 18px; }
.search-empty-title { font-family: var(--serif); font-size: 1.08rem; margin-bottom: 6px; }
.search-hint { font-size: 0.8rem; color: var(--ink-3); line-height: 1.7; }

.search-result { display: block; padding: 12px 14px; border-radius: 10px; }
.search-result:hover,
.search-result.is-active { background: var(--paper-2); }
.search-result-top { display: flex; align-items: baseline; gap: 10px; margin-bottom: 3px; }
.search-result h3 { font-family: var(--serif); font-size: 1rem; font-weight: 600; }
.search-result p { font-size: 0.78rem; color: var(--ink-2); line-height: 1.55; }
.search-result mark { background: rgba(185, 138, 62, 0.22); color: inherit; padding: 0 1px; }
.search-result .result-kind {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
}

.search-foot {
    display: flex;
    gap: 18px;
    padding: 10px 18px;
    border-top: 1px solid var(--line);
    font-size: 0.68rem;
    color: var(--ink-3);
}
.search-foot kbd { margin-right: 3px; }
.search-loading { padding: 38px; color: var(--ink-3); font-size: 0.84rem; }

/* ---------- Progress / to-top ---------- */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    z-index: 130;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--green-2), var(--gold-2));
}

.to-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 80;
    display: grid;
    place-items: center;
    width: 42px; height: 42px;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink-2);
    box-shadow: var(--shadow);
    cursor: pointer;
}
.to-top:hover { border-color: var(--green-2); color: var(--green-2); }
.to-top svg { width: 18px; height: 18px; }

/* ---------- Motion ---------- */
@keyframes hero-zoom {
    from { transform: scale(1.06); }
    to { transform: scale(1); }
}
@keyframes header-in {
    from { transform: translateY(-100%); }
    to { transform: none; }
}
@keyframes panel-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
    .post-body-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .toc { display: none; }
    .toc-mobile {
        display: block;
        margin-bottom: 28px;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface);
    }
    .toc-mobile summary {
        padding: 13px 16px;
        font-size: 0.8rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--green-2);
        cursor: pointer;
    }
    .toc-mobile nav { padding: 0 16px 14px; }
    .page-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .page-grid .toc { display: none; }
    .start-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
    .feature { gap: 30px; }
}

@media (max-width: 900px) {
    .hero { min-height: 76vh; }
    .hero h1 { max-width: 15ch; }
    .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cat-tile:nth-child(1), .cat-tile:nth-child(4) { grid-column: span 2; }
    .cat-tile:nth-child(2), .cat-tile:nth-child(3) { grid-column: span 1; }
    .feature { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; gap: 24px; }
    .feature-main { grid-column: auto; grid-row: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
    .feature-small { grid-column: auto; }
    .feature-body { padding-top: 0; }
    .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .madzhab-head { flex-direction: column; gap: 14px; }
    .madzhab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .madzhab-grid a:nth-child(2) { border-right: 0; }
    .madzhab-grid a:nth-child(3), .madzhab-grid a:nth-child(4) { border-top: 1px solid rgba(247, 242, 232, 0.18); }
    .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .start-list { grid-template-columns: minmax(0, 1fr); }
    .start-item { min-height: 0; padding: 12px 0; border-top: 1px solid var(--line); }
    .start-item + .start-item { padding-left: 0; border-left: 0; }
    .start-meta { margin-top: 2px; }
    .page-hero { padding-block: 110px 44px; }
}

@media (max-width: 720px) {
    :root { --header-h: 66px; }
    body { font-size: 16px; }
    .wrap { padding-inline: 20px; }
    .menu-btn { display: grid; }
    .site-nav {
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding: 8px 20px 18px;
        background: var(--paper);
        color: var(--ink);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
    }
    .site-nav.is-open { display: flex; }
    .nav-link { padding: 12px 0; font-size: 0.95rem; border-bottom: 1px solid var(--line); }
    .nav-link:last-child { border-bottom: 0; }
    .brand-tag { display: none; }
    .hero { min-height: 78vh; }
    .hero h1 { font-size: clamp(2.5rem, 11vw, 3.6rem); }
    .hero-inner { padding-block: 110px 46px; }
    .hero-lede { font-size: 0.98rem; }
    .hero-search { padding: 14px 15px; }
    .hero-search kbd { display: none; }
    .hero-topics { font-size: 0.8rem; }
    .section { padding-block: 54px; }
    .section-head { align-items: flex-start; flex-direction: column; gap: 8px; margin-bottom: 22px; }
    .cat-grid { grid-template-columns: minmax(0, 1fr); }
    .cat-tile, .cat-tile:nth-child(1), .cat-tile:nth-child(4) { grid-column: span 1; min-height: 220px; }
    .cat-tile:nth-child(1) { min-height: 300px; }
    .feature-main { grid-template-columns: minmax(0, 1fr); }
    .feature-body h3 { max-width: 24ch; }
    .card-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
    .madzhab-grid { grid-template-columns: minmax(0, 1fr); }
    .madzhab-grid a { border-right: 0; border-top: 1px solid rgba(247, 242, 232, 0.18); padding: 16px 0; }
    .madzhab-grid a + a { padding-left: 0; }
    .madzhab-grid a:first-child { border-top: 0; }
    .footer-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .footer-bottom { flex-direction: column; }
    .post-hero-media { height: 300px; }
    .post-hero h1 { font-size: 2.1rem; }
    .post-body-grid { padding-block: 28px 64px; }
    .gh-content { font-size: 1.01rem; }
    .gh-content h2 { font-size: 1.48rem; }
    .post-pager { grid-template-columns: minmax(0, 1fr); }
    .pager-next { text-align: left; align-items: flex-start; }
    .page-hero { padding-block: 102px 38px; }
    .page-hero h1 { font-size: 2.1rem; }
    .index-list li { flex-direction: column; gap: 2px; }
    .search-panel { margin-top: 5vh; max-height: 84vh; }
    .toc-mobile { display: block; }
}

@media (max-width: 480px) {
    .feature-small { grid-template-columns: 90px minmax(0, 1fr); }
    .hero-topics a { padding-right: 10px; margin-right: 10px; }
}

/* ---------- Print ---------- */
@media print {
    .site-header, .site-footer, .toc, .post-share, .to-top, .reading-progress,
    .toc-mobile, .post-pager, .related, .search-modal, .disclaimer { display: none !important; }
    body { background: #fff; color: #000; font-size: 11pt; }
    .post-hero-media { height: 220px; }
    .post-body-grid { display: block; }
    .gh-content { font-size: 11pt; max-width: none; line-height: 1.55; }
    a { text-decoration: none; color: #000; }
}
