/* ==========================================================================
   Sequel Blog — Ghost theme
   Tokens extracted from https://sequel.id (see DESIGN-TOKENS.md).
   Vanilla CSS. No build step, no external requests.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts — self-hosted Inter (variable: one file covers weights 400–700)
   -------------------------------------------------------------------------- */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+??, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329,
        U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('../fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+100-2BA, U+2BD-2C5, U+2C7-2CC, U+2CE-2D7, U+2DD-2FF, U+304, U+308, U+329,
        U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113,
        U+2C60-2C7F, U+A720-A7FF;
}

/* --------------------------------------------------------------------------
   2. Design tokens
   HSL channel triplets so hsl(var(--x) / alpha) works, matching sequel.id's
   own pattern. Hex in comments is the measured, painted colour.
   -------------------------------------------------------------------------- */

:root,
:root.light {
    --background: 0 0% 100%;            /* #ffffff */
    --foreground: 0 0% 3.92%;           /* #0a0a0a */
    --card: 0 0% 100%;                  /* #ffffff */
    --card-foreground: 0 0% 3.92%;      /* #0a0a0a */
    --popover: 0 0% 100%;               /* #ffffff */
    --popover-foreground: 0 0% 3.92%;   /* #0a0a0a */
    --primary: 203.69 78.95% 48.43%;    /* #1a90dd — brand blue */
    --primary-foreground: 0 0% 98.04%;  /* #fafafa */
    --secondary: 204 79.44% 58.04%;     /* #3fa5e9 */
    --secondary-foreground: 0 0% 100%;  /* #ffffff */
    --muted: 0 0% 96.08%;               /* #f5f5f5 */
    --muted-foreground: 0 0% 35.29%;    /* #5a5a5a */
    --accent: 204 76.92% 94.9%;         /* #e8f4fc */
    --accent-foreground: 0 0% 9.02%;    /* #171717 */
    --destructive: 357.14 100% 45.29%;  /* #e7000b */
    --destructive-foreground: 0 0% 100%;/* #ffffff */
    --border: 0 0% 89.8%;               /* #e5e5e5 */
    --input: 0 0% 89.8%;                /* #e5e5e5 */
    --ring: 211.64 100% 78.43%;         /* #91c5ff */

    --code-bg: 0 0% 96.08%;
    --shadow-color: 0 0% 0%;
}

:root.dark {
    --background: 0 0% 3.92%;           /* #0a0a0a */
    --foreground: 0 0% 98.04%;          /* #fafafa */
    --card: 0 0% 9.02%;                 /* #171717 */
    --card-foreground: 0 0% 98.04%;     /* #fafafa */
    --popover: 0 0% 14.9%;              /* #262626 */
    --popover-foreground: 0 0% 98.04%;  /* #fafafa */
    --primary: 203.69 78.95% 48.43%;    /* #1a90dd — identical in both modes */
    --primary-foreground: 0 0% 9.02%;   /* #171717 */
    --secondary: 202.11 100% 40.98%;    /* #0084d1 */
    --secondary-foreground: 0 0% 98.04%;/* #fafafa */
    --muted: 0 0% 14.9%;                /* #262626 */
    --muted-foreground: 0 0% 70.2%;     /* #b3b3b3 */
    --accent: 0 0% 25.1%;               /* #404040 */
    --accent-foreground: 0 0% 98.04%;   /* #fafafa */
    --destructive: 358.84 100% 69.61%;  /* #ff6467 */
    --destructive-foreground: 0 0% 98.04%;
    --border: 0 0% 15.69%;              /* #282828 */
    --input: 0 0% 20.39%;               /* #343434 */
    --ring: 0 0% 45.1%;                 /* #737373 */

    --code-bg: 0 0% 12%;
    --shadow-color: 0 0% 0%;
}

:root {
    /* Radius — base 0.625rem, shadcn-derived scale */
    --radius: 0.625rem;
    --radius-sm: calc(var(--radius) - 4px);   /* 6px */
    --radius-md: calc(var(--radius) - 2px);   /* 8px — most common on sequel.id */
    --radius-lg: var(--radius);               /* 10px */
    --radius-xl: calc(var(--radius) + 4px);   /* 14px */

    /* Shadows — stock Tailwind scale, unmodified */
    --shadow-sm: 0 1px 2px 0 hsl(var(--shadow-color) / 0.05);
    --shadow: 0 1px 3px 0 hsl(var(--shadow-color) / 0.1), 0 1px 2px -1px hsl(var(--shadow-color) / 0.1);
    --shadow-md: 0 4px 6px -1px hsl(var(--shadow-color) / 0.1), 0 2px 4px -2px hsl(var(--shadow-color) / 0.1);
    --shadow-lg: 0 10px 15px -3px hsl(var(--shadow-color) / 0.1), 0 4px 6px -4px hsl(var(--shadow-color) / 0.1);
    --shadow-xl: 0 20px 25px -5px hsl(var(--shadow-color) / 0.1), 0 8px 10px -6px hsl(var(--shadow-color) / 0.1);

    /* Layout — 1280px page shell, 672px prose (both measured on sequel.id) */
    --container: 80rem;      /* 1280px */
    --container-prose: 42rem;/* 672px  */
    --measure: min(68ch, var(--container-prose));
    --gutter: 1rem;
    --header-height: 65px;

    --font-sans: 'Inter', -apple-system, system-ui, 'Segoe UI', 'Helvetica Neue', Arial,
        'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

    --transition: 150ms ease;
}

@media (min-width: 640px) {
    :root { --gutter: 1.5rem; }
}
@media (min-width: 1024px) {
    :root { --gutter: 2rem; }
}

/* --------------------------------------------------------------------------
   3. Reset & base
   -------------------------------------------------------------------------- */

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

* { margin: 0; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 1rem);
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: hsl(var(--foreground));
    background-color: hsl(var(--background));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-synthesis-weight: none;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }

/* The reset above overrides the browser's native [hidden]{display:none} — any author rule
   setting display, even with lower specificity, wins over a UA-stylesheet default. Without
   this, the mobile drawer's open/close icon swap (main.js sets/clears the hidden attribute)
   showed both icons stacked at once instead of toggling. */
[hidden] { display: none !important; }

input, button, textarea, select { font: inherit; color: inherit; }

p, h1, h2, h3, h4, h5, h6 { overflow-wrap: break-word; }

h1, h2, h3, h4, h5, h6 {
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: hsl(var(--primary));
    text-decoration: none;
    transition: color var(--transition);
}

hr {
    border: 0;
    border-top: 1px solid hsl(var(--border));
    margin: 2.5rem 0;
}

ul, ol { padding-left: 1.25rem; }

blockquote { margin: 0; }

:focus-visible {
    outline: 2px solid hsl(var(--primary));
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

::selection {
    background-color: hsl(var(--primary) / 0.25);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    padding: 0.75rem 1.25rem;
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-radius: 0 0 var(--radius-md) 0;
    font-weight: 600;
}
.skip-link:focus {
    left: 0;
}

.site-main { flex: 1 0 auto; }

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

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */

.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.container--prose {
    max-width: var(--container-prose);
}

/* --------------------------------------------------------------------------
   5. Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 2.25rem;
    padding: 0 0.875rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition),
        border-color var(--transition), opacity var(--transition);
}

.btn svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.btn--primary {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}
.btn--primary:hover { background-color: hsl(var(--primary) / 0.9); }

.btn--outline {
    background-color: transparent;
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}
.btn--outline:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn--ghost {
    background-color: transparent;
    color: hsl(var(--foreground));
}
.btn--ghost:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.btn--icon {
    width: 2.25rem;
    padding: 0;
}

.btn--lg {
    height: 2.75rem;
    padding: 0 1.5rem;
    font-size: 1rem;
}

/* --------------------------------------------------------------------------
   6. Header — solid, sticky, permanent bottom border (matches sequel.id;
   the live site has no blur and no scroll-state change)
   -------------------------------------------------------------------------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    border-bottom: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
}

.site-header__inner {
    display: flex;
    align-items: center;
    /* Logo + nav grouped together on the left (matches sequel.id) — space-between spread
       the nav out toward the middle of the header instead of anchoring it to the logo. */
    justify-content: flex-start;
    gap: 2rem;
    height: var(--header-height);
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.site-header__brand img {
    width: 2.25rem;
    height: 2.5rem;
    object-fit: contain;
}

/* Desktop navigation */
.nav {
    display: none;
    align-items: center;
    gap: 0.25rem;
}
@media (min-width: 1024px) {
    .nav { display: flex; }
}

.nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--foreground));
    background-color: transparent;
    border: 0;
    cursor: pointer;
    transition: background-color var(--transition), color var(--transition);
}
.nav__link:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}
/* aria-current is "page" on the blog index and "true" elsewhere in the blog,
   so match on presence rather than value. */
.nav__link[aria-current] {
    color: hsl(var(--primary));
    font-weight: 600;
}

.nav__chevron {
    width: 0.75rem;
    height: 0.75rem;
    transition: transform var(--transition);
}
.nav__item--dropdown[data-open='true'] .nav__chevron { transform: rotate(180deg); }

/* Products dropdown */
.nav__item { position: relative; }

.nav__dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 60;
    min-width: 20rem;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.125rem;
    background-color: hsl(var(--popover));
    color: hsl(var(--popover-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}
.nav__item--dropdown[data-open='true'] .nav__dropdown { display: flex; }

.nav__dropdown-link {
    display: block;
    padding: 0.625rem 0.75rem;
    border-radius: var(--radius-md);
    color: inherit;
    transition: background-color var(--transition);
}
.nav__dropdown-link:hover { background-color: hsl(var(--accent)); }

.nav__dropdown-title {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.4;
}
.nav__dropdown-desc {
    display: block;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.4;
}

/* Header actions */
.site-header__actions {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
@media (min-width: 1024px) {
    .site-header__actions { display: flex; }
}

.site-header__mobile-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}
@media (min-width: 1024px) {
    .site-header__mobile-actions { display: none; }
}

/* Mobile drawer */
.drawer {
    position: fixed;
    inset: var(--header-height) 0 0 0;
    z-index: 45;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem var(--gutter) 2rem;
    background-color: hsl(var(--background));
    border-top: 1px solid hsl(var(--border));
    overflow-y: auto;
    overscroll-behavior: contain;
}
.drawer[data-open='true'] { display: flex; }
@media (min-width: 1024px) {
    .drawer, .drawer[data-open='true'] { display: none; }
}

.drawer__link {
    display: block;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    color: hsl(var(--foreground));
}
.drawer__link:hover { background-color: hsl(var(--accent)); }
.drawer__link[aria-current] { color: hsl(var(--primary)); font-weight: 600; }

.drawer__section-title {
    padding: 1rem 0.5rem 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: hsl(var(--muted-foreground));
}

.drawer__sub {
    display: block;
    padding: 0.625rem 0.5rem 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    color: hsl(var(--foreground));
}
.drawer__sub:hover { background-color: hsl(var(--accent)); }
.drawer__sub small {
    display: block;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.drawer__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid hsl(var(--border));
}
.drawer__actions .btn { width: 100%; height: 2.75rem; }

body.is-drawer-open { overflow: hidden; }

/* Theme toggle */
.theme-toggle__icon--sun { display: none; }
.theme-toggle__icon--moon { display: block; }
:root.dark .theme-toggle__icon--sun { display: block; }
:root.dark .theme-toggle__icon--moon { display: none; }

/* --------------------------------------------------------------------------
   7. Page hero
   -------------------------------------------------------------------------- */

.page-hero {
    padding-block: 3rem 2rem;
    border-bottom: 1px solid hsl(var(--border));
}
@media (min-width: 768px) {
    .page-hero { padding-block: 4.5rem 3rem; }
}

.page-hero__title {
    font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
    letter-spacing: -0.03em;
}

.page-hero__subtitle {
    margin-top: 0.75rem;
    max-width: 42rem;
    font-size: 1.0625rem;
    color: hsl(var(--muted-foreground));
}

/* --------------------------------------------------------------------------
   8. Post cards & grid
   -------------------------------------------------------------------------- */

.post-feed {
    padding-block: 3rem 4rem;
}

.post-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}
@media (min-width: 640px) {
    .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 2rem; }
}

/* Tag sections vary in post count (whatever's tagged) — a fixed column count leaves a
   lone (or short) row of cards pinned to a narrow fraction with a bare gap alongside it.
   auto-fit lets a short row's card(s) grow to fill the row instead, capped so they don't
   blow up huge when alone; unaffected sections (Latest, Terpopuler) always have their
   full configured count, so this only visibly changes the sparse tag-section case. */
@media (min-width: 640px) {
    .tag-section .post-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
    .tag-section .post-card { max-width: 34rem; }
}

.post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: hsl(var(--card));
    color: hsl(var(--card-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.post-card:hover {
    border-color: hsl(var(--primary) / 0.4);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-card__image-link {
    display: block;
    aspect-ratio: 16 / 9;
    background-color: hsl(var(--muted));
    overflow: hidden;
}
.post-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease;
}
.post-card:hover .post-card__image { transform: scale(1.03); }

.post-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.625rem;
    padding: 1.25rem;
}

.post-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: -0.015em;
}
.post-card__title a { color: inherit; }
.post-card__title a:hover { color: hsl(var(--primary)); }

.post-card__excerpt {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.post-card__meta-sep::before { content: '·'; }

.post-card__author {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: inherit;
}
.post-card__avatar {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 9999px;
    object-fit: cover;
    background-color: hsl(var(--muted));
}

/* Tag pill */
.tag-pill {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 0.1875rem 0.625rem;
    border-radius: 9999px;
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: background-color var(--transition);
}
.tag-pill:hover { background-color: hsl(var(--primary) / 0.15); }

/* Hero section — full-width band, PRD §4.1 item 1. Sequel's actual palette (extracted in
   DESIGN-TOKENS.md) is white/near-black with a single blue accent — no brand black — so
   this uses the theme's own tokens (adapts with light/dark mode) instead of a fixed dark
   background: white/blue in light mode, near-black/blue in dark mode. The grid of squares
   is a deliberate nod to Sequel's rack/VM infrastructure ("kotak-kotak"), not decoration
   for its own sake. */
.hero-section {
    position: relative;
    padding-block: 3.5rem 3rem;
    text-align: center;
    overflow: hidden;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(hsl(var(--primary) / 0.12) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--primary) / 0.12) 1px, transparent 1px);
    background-size: 96px 96px;
    -webkit-mask-image: radial-gradient(ellipse 75% 100% at 50% 0%, #000 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 75% 100% at 50% 0%, #000 40%, transparent 100%);
}
.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 60% at 15% -10%, hsl(var(--primary) / 0.22), transparent 60%),
        radial-gradient(ellipse 60% 55% at 100% 0%, hsl(var(--secondary) / 0.2), transparent 60%);
}
.hero-section > .container {
    position: relative;
}
@media (min-width: 768px) {
    .hero-section { padding-block: 5rem 4rem; }
}

.hero-section__title {
    font-size: clamp(2rem, 1.4rem + 3vw, 3rem);
    letter-spacing: -0.03em;
}

.hero-section__tagline {
    margin: 0.875rem auto 0;
    max-width: 42rem;
    font-size: 1.0625rem;
    color: hsl(var(--muted-foreground));
}

/* Hero row — featured post + Kategori/CTA sidebar, side by side on desktop (§4.1 item 2) */
.hero-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-block: 2.5rem 3.5rem;
}
@media (min-width: 1024px) {
    .hero-row {
        grid-template-columns: 1.5fr 1fr;
        /* Stretch so both columns end at the same height — the leftover space is absorbed
           as a gap before the sidebar's last box (see .hero-sidebar > *:last-child), not by
           any individual box growing into a stretched, half-empty card. */
        align-items: stretch;
    }
}

/* Shared "read more" link — hero post, post cards, tag-section cards */
.card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--primary));
}
.card-readmore svg { width: 1rem; height: 1rem; }
.card-readmore:hover { text-decoration: underline; }

/* "Kembali ke beranda" — tag.hbs, so visitors don't have to fight the browser back button
   to get from a "Lihat semua" tag page back to the curated homepage. */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
}
.back-link svg { width: 1rem; height: 1rem; }
.back-link:hover { color: hsl(var(--primary)); }

/* Hero post (featured card) */
.hero-post {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.hero-post:hover {
    border-color: hsl(var(--primary) / 0.4);
    box-shadow: var(--shadow-lg);
}

.hero-post__image-link {
    display: block;
    aspect-ratio: 16 / 9;
    background-color: hsl(var(--muted));
    overflow: hidden;
}
.hero-post__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-post__body {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    padding: 1.75rem;
}
@media (min-width: 640px) {
    .hero-post__body { padding: 2.25rem; }
}

.hero-post__label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: hsl(var(--primary));
}

.hero-post__title {
    font-size: clamp(1.375rem, 1.05rem + 1.3vw, 1.875rem);
    letter-spacing: -0.025em;
}
.hero-post__title a { color: inherit; }
.hero-post__title a:hover { color: hsl(var(--primary)); }

.hero-post__excerpt {
    font-size: 1rem;
    color: hsl(var(--muted-foreground));
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Empty state */
.no-posts {
    padding: 5rem 0;
    text-align: center;
    color: hsl(var(--muted-foreground));
}

/* Hero sidebar — search, Kategori box, banner, CTA box, stacked */
.hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
    /* Bottom-aligns with the taller hero-post column (align-items:stretch on .hero-row)
       by spreading any leftover height evenly across every gap — not by dumping it all
       into one gap via margin-top:auto on the last child, which made whichever box
       happened to be last (usually the banner) look disconnected from the one above it. */
    justify-content: space-between;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
    text-align: left;
    transition: border-color var(--transition), background-color var(--transition);
}
.search-box svg { width: 1.125rem; height: 1.125rem; flex-shrink: 0; }
.search-box__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.search-box:hover {
    border-color: hsl(var(--primary) / 0.4);
    background-color: hsl(var(--accent));
}

.sidebar-banner {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
}
.sidebar-banner__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sidebar-banner__tag {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 9999px;
    background-color: hsl(0 0% 0% / 0.55);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Kategori box — blue/white, matching sequel.id's actual palette (DESIGN-TOKENS.md), not a
   plain dark card. The faint grid echoes the hero band's "kotak-kotak" pattern at a smaller
   scale, tying the two together. */
.category-box {
    position: relative;
    padding: 1.5rem;
    overflow: hidden;
    /* Same treatment as .cta-box — a card base with a primary/secondary gradient overlay,
       not the flat --accent token. --accent resolves to a neutral grey in dark mode (no
       blue at all), so this box lost its blue tint and stood out against the other,
       consistently blue-tinted sidebar boxes. */
    background-color: hsl(var(--card));
    background-image: linear-gradient(135deg, hsl(var(--primary) / 0.18), hsl(var(--secondary) / 0.12));
    border: 1px solid hsl(var(--primary) / 0.25);
    border-radius: var(--radius-xl);
    color: hsl(var(--foreground));
}
/* A fixed-size corner accent, not a full-bleed texture — the box's aspect ratio varies a lot
   (narrow and tall on mobile, wide and short once pills wrap to fewer rows on tablet/desktop),
   and a mask sized in percentages of the box left hard, unfaded grid lines in whichever
   direction the box was long. A fixed pixel size anchored to one corner fades identically
   everywhere regardless of the box's own dimensions. */
.category-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 240px;
    height: 180px;
    background-image:
        linear-gradient(hsl(var(--primary) / 0.14) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--primary) / 0.14) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 100% 0%, #000 25%, transparent 100%);
    mask-image: radial-gradient(ellipse 100% 100% at 100% 0%, #000 25%, transparent 100%);
    pointer-events: none;
}
.category-box > * { position: relative; }

.category-box__heading {
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: hsl(var(--primary));
}

.category-box__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-box__pill {
    display: inline-block;
    max-width: 100%;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid hsl(var(--primary) / 0.25);
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: break-word;
    transition: border-color var(--transition), background-color var(--transition), color var(--transition);
}
.category-box__pill:hover {
    border-color: hsl(var(--primary));
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.cta-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.5rem;
    background-color: hsl(var(--card));
    background-image: linear-gradient(135deg, hsl(var(--primary) / 0.18), hsl(var(--secondary) / 0.12));
    border: 1px solid hsl(var(--primary) / 0.25);
    border-radius: var(--radius-xl);
}

.cta-box__text { flex: 1; min-width: 12rem; }

.cta-box__title {
    font-size: 1rem;
    font-weight: 700;
    color: hsl(var(--foreground));
}

.cta-box__form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    flex: 1;
    min-width: 15rem;
}

.cta-box__input {
    flex: 1;
    min-width: 10rem;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-md);
    border: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-size: 0.875rem;
}
.cta-box__input:focus-visible { outline: 2px solid hsl(var(--primary)); outline-offset: 1px; }

/* Latest posts */
.latest-posts { margin-bottom: 3rem; }

.latest-posts__title {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Tag section — "Lihat semua", capped to 2 tags on the homepage (§4.1 item 5) */
.tag-section {
    padding-block: 3rem;
    border-top: 1px solid hsl(var(--border));
}

.tag-section__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.tag-section__title {
    font-size: 1.375rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tag-section__link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--primary));
}
.tag-section__link svg { width: 1rem; height: 1rem; }
.tag-section__link:hover { text-decoration: underline; }

/* Tag sections past the 2nd are hidden until "Muat kategori lainnya" is clicked */
.tag-sections-wrap > .tag-section:nth-child(n+3) { display: none; }
.tag-sections-wrap.is-expanded > .tag-section:nth-child(n+3) { display: block; }

/* Manual mode (admin pinned tags render outside this wrapper, always visible) — every
   section in here is "the rest", so all of it starts hidden instead of the first 2. */
.tag-sections-wrap--manual > .tag-section { display: none; }
.tag-sections-wrap--manual.is-expanded > .tag-section { display: block; }

.tag-sections__loadmore-wrap {
    text-align: center;
    padding-bottom: 3rem;
}

.tag-sections__loadmore {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    border-radius: 9999px;
    /* Explicit transparent background — <button> otherwise falls back to the browser's
       native control background (white-ish) regardless of colour mode, which combined
       with --foreground text (near-white in dark mode) made this unreadable there. */
    background-color: transparent;
    border: 1px solid hsl(var(--border));
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    transition: border-color var(--transition), background-color var(--transition);
}
.tag-sections__loadmore:hover {
    border-color: hsl(var(--primary) / 0.4);
    background-color: hsl(var(--accent));
}

/* Promo banner — maintained from Ghost Admin → Settings → Design → Homepage */
.promo-banner-wrap {
    padding-block: 0.5rem 3rem;
}

.promo-banner {
    position: relative;
    display: block;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
}

.promo-banner__image {
    display: block;
    width: 100%;
    height: auto;
}

.promo-banner__tag {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 9999px;
    background-color: hsl(0 0% 0% / 0.55);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* Closing CTA — bottom of the homepage, after the tag sections. Same blue/grid language as
   the hero band, reusing @custom.cta_* (post CTA panel, this section, sidebar CTA box all
   show the same message from one place in Ghost Admin). */
.final-cta {
    padding-block: 1rem 3.5rem;
}

/* Contained card (matches .post-cta's treatment) instead of a full-bleed edge-to-edge band —
   the blue background now stays inside a rounded card with visible page margins on both
   sides, not stretched across the whole viewport width. */
.final-cta__card {
    position: relative;
    overflow: hidden;
    padding: 2.5rem 1.5rem;
    text-align: center;
    border-radius: var(--radius-xl);
    background-color: hsl(var(--card));
    background-image: linear-gradient(135deg, hsl(var(--primary) / 0.18), hsl(var(--secondary) / 0.1));
    border: 1px solid hsl(var(--primary) / 0.2);
}
@media (min-width: 768px) {
    .final-cta__card { padding: 3.5rem 3rem; }
}
.final-cta__card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(hsl(var(--primary) / 0.1) 1px, transparent 1px),
        linear-gradient(90deg, hsl(var(--primary) / 0.1) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 70% 100% at 50% 50%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 70% 100% at 50% 50%, #000 30%, transparent 100%);
}
.final-cta__card > * { position: relative; }

.final-cta__title {
    max-width: 42rem;
    margin-inline: auto;
    font-size: clamp(1.75rem, 1.3rem + 2vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: hsl(var(--foreground));
}

.final-cta__description {
    max-width: 36rem;
    margin: 1rem auto 0;
    font-size: 1.0625rem;
    color: hsl(var(--muted-foreground));
}

.final-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}
.final-cta__actions .btn {
    height: 3rem;
    padding-inline: 1.75rem;
    font-size: 1rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   9. Pagination
   -------------------------------------------------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid hsl(var(--border));
}

.pagination__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--foreground));
    transition: border-color var(--transition), background-color var(--transition);
}
.pagination__arrow svg { width: 1.125rem; height: 1.125rem; }
.pagination__arrow:hover {
    border-color: hsl(var(--primary) / 0.4);
    background-color: hsl(var(--accent));
}
.pagination__arrow--disabled {
    opacity: 0.35;
    pointer-events: none;
}

.pagination__numbers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.375rem;
}

.pagination__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding-inline: 0.5rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    transition: background-color var(--transition), color var(--transition);
}
.pagination__number:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}
.pagination__number.is-current {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

.pagination__ellipsis {
    padding-inline: 0.25rem;
    color: hsl(var(--muted-foreground));
}

.pagination__label {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

/* --------------------------------------------------------------------------
   10. Post & page
   -------------------------------------------------------------------------- */

.post-header {
    padding-block: 3rem 2rem;
    text-align: center;
}
@media (min-width: 768px) {
    .post-header { padding-block: 4rem 2.5rem; }
}

.post-header__tag { margin-bottom: 1rem; }

.post-header__title {
    font-size: clamp(1.875rem, 1.2rem + 3.4vw, 3rem);
    letter-spacing: -0.03em;
    max-width: 20ch;
    margin-inline: auto;
}

.post-header__excerpt {
    margin-top: 1.125rem;
    margin-inline: auto;
    max-width: 44rem;
    font-size: 1.125rem;
    color: hsl(var(--muted-foreground));
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-top: 1.75rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.post-meta__author {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: hsl(var(--foreground));
}

.post-meta__avatar {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 9999px;
    object-fit: cover;
    background-color: hsl(var(--muted));
}

.post-meta__sep::before { content: '·'; }

.post-feature-image {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto 3rem;
    padding-inline: var(--gutter);
}
.post-feature-image img {
    width: 100%;
    border-radius: var(--radius-xl);
    background-color: hsl(var(--muted));
}
.post-feature-image figcaption {
    margin-top: 0.75rem;
    text-align: center;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

/* --------------------------------------------------------------------------
   11. Post content — comfortable measure, full-bleed escapes for Koenig cards
   -------------------------------------------------------------------------- */

.post-content {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--gutter);
    padding-bottom: 3rem;
    /* Grid gives Koenig cards a clean way to break out of the measure. */
    display: grid;
    grid-template-columns:
        [full-start] minmax(0, 1fr)
        [wide-start] minmax(0, 6rem)
        [main-start] minmax(0, var(--measure)) [main-end]
        minmax(0, 6rem) [wide-end]
        minmax(0, 1fr) [full-end];
}

.post-content > * {
    grid-column: main;
}

.post-content > p,
.post-content > ul,
.post-content > ol,
.post-content > dl,
.post-content > blockquote,
.post-content > h1,
.post-content > h2,
.post-content > h3,
.post-content > h4,
.post-content > h5,
.post-content > h6,
.post-content > pre,
.post-content > table,
.post-content > figure,
.post-content > .kg-card {
    margin-block: 0 1.5rem;
}

.post-content > h2,
.post-content > h3,
.post-content > h4 {
    margin-top: 2.5rem;
    margin-bottom: 0.875rem;
}

.post-content > h2 { font-size: 1.625rem; }
.post-content > h3 { font-size: 1.3125rem; }
.post-content > h4 { font-size: 1.125rem; }

.post-content p,
.post-content li {
    font-size: 1.0625rem;
    line-height: 1.75;
}

.post-content > ul,
.post-content > ol { padding-left: 1.5rem; }
.post-content li { margin-bottom: 0.5rem; }
.post-content li::marker { color: hsl(var(--muted-foreground)); }

/* Links inside prose are underlined so the affordance never depends on colour
   alone — brand blue is 3.46:1 on white (WCAG 1.4.1 satisfied, 1.4.3 knowingly
   not; see DESIGN-TOKENS.md §2). */
.post-content a:not(.kg-btn):not(.kg-bookmark-container) {
    color: hsl(var(--primary));
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-thickness: 1px;
}
.post-content a:not(.kg-btn):not(.kg-bookmark-container):hover {
    text-decoration-thickness: 2px;
}

.post-content strong { font-weight: 600; }

.post-content > blockquote {
    padding-left: 1.25rem;
    border-left: 3px solid hsl(var(--primary));
    font-size: 1.125rem;
    font-style: italic;
    color: hsl(var(--muted-foreground));
}

.post-content img { border-radius: var(--radius-md); }

.post-content > table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    display: block;
    overflow-x: auto;
}
.post-content th,
.post-content td {
    padding: 0.625rem 0.875rem;
    border: 1px solid hsl(var(--border));
    text-align: left;
}
.post-content th {
    background-color: hsl(var(--muted));
    font-weight: 600;
}

/* Inline code */
.post-content :not(pre) > code {
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    background-color: hsl(var(--code-bg));
    border: 1px solid hsl(var(--border));
    font-family: var(--font-mono);
    font-size: 0.875em;
    white-space: break-spaces;
}

/* Code blocks */
.post-content pre {
    padding: 1.125rem 1.25rem;
    border-radius: var(--radius-lg);
    background-color: hsl(var(--code-bg));
    border: 1px solid hsl(var(--border));
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    tab-size: 4;
}
.post-content pre code {
    padding: 0;
    background: none;
    border: 0;
    font-size: inherit;
}

/* --------------------------------------------------------------------------
   12. Koenig cards — the full set
   -------------------------------------------------------------------------- */

.kg-card { margin-bottom: 1.5rem; }

/* Width escapes */
.post-content .kg-width-wide { grid-column: wide; }
.post-content .kg-width-full { grid-column: full; }

.kg-width-full img { border-radius: 0; }
@media (min-width: 768px) {
    .kg-width-wide img { border-radius: var(--radius-lg); }
}

/* Image card */
.kg-image-card { text-align: center; }
.kg-image-card img { margin-inline: auto; }

.kg-card figcaption,
.kg-image-card figcaption,
.kg-gallery-card figcaption,
.kg-embed-card figcaption,
.kg-video-card figcaption,
.kg-audio-card figcaption {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: hsl(var(--muted-foreground));
    text-align: center;
}
.kg-card figcaption a { color: hsl(var(--primary)); }

/* Gallery card */
.kg-gallery-card,
.kg-gallery-container { position: relative; }

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}
.kg-gallery-row:not(:first-of-type) { margin-top: 0.5rem; }

.kg-gallery-image { flex: 1 1 auto; }
.kg-gallery-image:not(:first-of-type) { margin-left: 0.5rem; }
.kg-gallery-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
}

/* Embed card (YouTube, Twitter, etc.) */
.kg-embed-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}
.kg-embed-card iframe,
.kg-embed-card > :not(figcaption) {
    max-width: 100%;
}
.kg-embed-card iframe[src*='youtube'],
.kg-embed-card iframe[src*='vimeo'] {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border-radius: var(--radius-lg);
    border: 0;
}

/* Bookmark card */
.kg-bookmark-card { width: 100%; }
.kg-bookmark-card a.kg-bookmark-container,
.kg-bookmark-card a.kg-bookmark-container:hover {
    display: flex;
    flex-wrap: wrap;
    text-decoration: none;
    color: inherit;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: hsl(var(--card));
    transition: border-color var(--transition), box-shadow var(--transition);
}
.kg-bookmark-card a.kg-bookmark-container:hover {
    border-color: hsl(var(--primary) / 0.4);
    box-shadow: var(--shadow-md);
}
.kg-bookmark-content {
    flex: 1 1 60%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 1.25rem;
    min-width: 0;
}
.kg-bookmark-title {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    color: hsl(var(--foreground));
}
.kg-bookmark-description {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: hsl(var(--muted-foreground));
}
.kg-bookmark-metadata {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
}
.kg-bookmark-icon {
    width: 1.125rem;
    height: 1.125rem;
    margin-right: 0.25rem;
    border-radius: 2px;
}
.kg-bookmark-author::after {
    content: '·';
    margin: 0 0.25rem;
}
.kg-bookmark-publisher {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 240px;
}
.kg-bookmark-thumbnail {
    position: relative;
    flex: 1 1 30%;
    min-width: 33%;
}
.kg-bookmark-thumbnail img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}
@media (max-width: 600px) {
    .kg-bookmark-card a.kg-bookmark-container { flex-direction: column-reverse; }
    .kg-bookmark-thumbnail { flex-basis: auto; width: 100%; height: 12rem; }
    .kg-bookmark-thumbnail img { position: static; }
}

/* Callout card */
.kg-callout-card {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background-color: hsl(var(--muted));
}
.kg-callout-card-accent { background-color: hsl(var(--accent)); }
.kg-callout-emoji {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1.5;
}
.kg-callout-text {
    font-size: 1rem;
    line-height: 1.6;
}
:root.dark .kg-callout-card-accent {
    background-color: hsl(var(--primary) / 0.15);
}

/* Toggle card */
.kg-toggle-card {
    padding: 1rem 1.25rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    background-color: hsl(var(--card));
}
.kg-toggle-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
}
.kg-toggle-heading-text {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.4;
}
.kg-toggle-card-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    color: hsl(var(--muted-foreground));
    transition: transform var(--transition);
}
.kg-toggle-card[data-kg-toggle-state='close'] .kg-toggle-card-icon { transform: rotate(-90deg); }
.kg-toggle-card[data-kg-toggle-state='close'] .kg-toggle-content {
    display: none;
    opacity: 0;
    height: 0;
}
.kg-toggle-card[data-kg-toggle-state='open'] .kg-toggle-content {
    display: block;
    margin-top: 0.75rem;
    opacity: 1;
    height: auto;
}
.kg-toggle-content p:last-child { margin-bottom: 0; }

/* Button card */
.kg-button-card {
    display: flex;
    justify-content: center;
}
.kg-button-card.kg-align-left { justify-content: flex-start; }
.kg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    padding: 0 1.5rem;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: background-color var(--transition), color var(--transition);
}
.kg-btn-accent {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}
.kg-btn-accent:hover {
    background-color: hsl(var(--primary) / 0.9);
    color: hsl(var(--primary-foreground));
}

/* Code card */
.kg-code-card { width: 100%; }
.kg-code-card pre { margin: 0; }

/* Header card */
.kg-header-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 4rem 1.5rem;
    text-align: center;
    background-color: hsl(var(--muted));
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-lg);
}
.kg-width-full.kg-header-card { border-radius: 0; }
.kg-header-card.kg-size-small { padding: 2.5rem 1.5rem; }
.kg-header-card.kg-size-large { padding: 6rem 1.5rem; }
.kg-header-card.kg-style-dark { background-color: hsl(0 0% 3.92%); color: hsl(0 0% 100%); }
.kg-header-card.kg-style-light { background-color: hsl(0 0% 96.08%); color: hsl(0 0% 3.92%); }
.kg-header-card.kg-style-accent { background-color: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.kg-header-card-header {
    font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.025em;
}
.kg-header-card-subheader {
    font-size: 1.0625rem;
    opacity: 0.85;
}
.kg-header-card-button { margin-top: 0.75rem; }

/* Product card */
.kg-product-card {
    display: flex;
    justify-content: center;
}
.kg-product-card-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 1.5rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    background-color: hsl(var(--card));
}
.kg-product-card-image {
    width: 100%;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
}
.kg-product-card-title-container {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
}
.kg-product-card-title {
    font-size: 1.25rem;
    font-weight: 600;
}
.kg-product-card-rating {
    display: flex;
    gap: 0.125rem;
    flex-shrink: 0;
}
.kg-product-card-rating-star svg {
    width: 1rem;
    height: 1rem;
    fill: hsl(var(--muted-foreground) / 0.35);
}
.kg-product-card-rating-active svg { fill: hsl(var(--primary)); }
.kg-product-card-description {
    margin-top: 0.625rem;
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
}
.kg-product-card-description p:last-child { margin-bottom: 0; }
.kg-product-card-button { margin-top: 1.25rem; }

/* Video & audio cards */
.kg-video-card, .kg-audio-card { width: 100%; }
.kg-video-container video { width: 100%; border-radius: var(--radius-lg); }
.kg-audio-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    background-color: hsl(var(--card));
}

/* Blockquote / alt blockquote cards */
.kg-blockquote-alt {
    padding-left: 1.25rem;
    border-left: 3px solid hsl(var(--primary));
    font-style: italic;
    color: hsl(var(--muted-foreground));
}

/* File card */
.kg-file-card { width: 100%; }
.kg-file-card-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-lg);
    background-color: hsl(var(--card));
    text-decoration: none;
    color: inherit;
}
.kg-file-card-title { font-weight: 600; font-size: 0.9375rem; }
.kg-file-card-caption, .kg-file-card-metadata {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

/* Nested content spacing */
.kg-card + .kg-card { margin-top: 0; }

/* --------------------------------------------------------------------------
   13. Syntax highlighting — self-hosted Prism, theme-aware
   Token colours are hand-tuned per mode so both stay legible.
   -------------------------------------------------------------------------- */

code[class*='language-'],
pre[class*='language-'] {
    color: hsl(var(--foreground));
    font-family: var(--font-mono);
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    hyphens: none;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata { color: hsl(0 0% 45%); font-style: italic; }

.token.punctuation { color: hsl(0 0% 45%); }

.token.property,
.token.tag,
.token.constant,
.token.symbol,
.token.deleted { color: hsl(340 65% 42%); }

.token.boolean,
.token.number { color: hsl(24 70% 40%); }

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted { color: hsl(150 55% 30%); }

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string { color: hsl(200 60% 35%); }

.token.atrule,
.token.attr-value,
.token.keyword { color: hsl(258 60% 50%); }

.token.function,
.token.class-name { color: hsl(210 75% 42%); }

.token.regex,
.token.important,
.token.variable { color: hsl(30 80% 40%); }

.token.important,
.token.bold { font-weight: 700; }
.token.italic { font-style: italic; }

:root.dark .token.comment,
:root.dark .token.prolog,
:root.dark .token.doctype,
:root.dark .token.cdata { color: hsl(0 0% 55%); }

:root.dark .token.punctuation { color: hsl(0 0% 65%); }

:root.dark .token.property,
:root.dark .token.tag,
:root.dark .token.constant,
:root.dark .token.symbol,
:root.dark .token.deleted { color: hsl(340 75% 72%); }

:root.dark .token.boolean,
:root.dark .token.number { color: hsl(28 85% 68%); }

:root.dark .token.selector,
:root.dark .token.attr-name,
:root.dark .token.string,
:root.dark .token.char,
:root.dark .token.builtin,
:root.dark .token.inserted { color: hsl(140 55% 65%); }

:root.dark .token.operator,
:root.dark .token.entity,
:root.dark .token.url,
:root.dark .language-css .token.string,
:root.dark .style .token.string { color: hsl(195 65% 70%); }

:root.dark .token.atrule,
:root.dark .token.attr-value,
:root.dark .token.keyword { color: hsl(265 85% 78%); }

:root.dark .token.function,
:root.dark .token.class-name { color: hsl(205 85% 70%); }

:root.dark .token.regex,
:root.dark .token.important,
:root.dark .token.variable { color: hsl(35 90% 70%); }

/* --------------------------------------------------------------------------
   14. Post footer — tags, CTA, related, author box
   -------------------------------------------------------------------------- */

.post-footer {
    max-width: var(--container-prose);
    margin: 0 auto;
    padding: 0 var(--gutter) 1rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 2rem;
    border-top: 1px solid hsl(var(--border));
}

.post-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 3rem;
    padding: 2rem;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius-xl);
    background-color: hsl(var(--accent));
}
:root.dark .post-cta {
    background-color: hsl(var(--card));
}
.post-cta__title {
    font-size: 1.375rem;
    letter-spacing: -0.02em;
}
.post-cta__text {
    color: hsl(var(--muted-foreground));
}
.post-cta__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.author-box {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid hsl(var(--border));
}
.author-box__avatar {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 9999px;
    object-fit: cover;
    flex-shrink: 0;
    background-color: hsl(var(--muted));
}
.author-box__name { font-size: 1.0625rem; font-weight: 600; }
.author-box__name a { color: inherit; }
.author-box__bio {
    margin-top: 0.25rem;
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
}

.related {
    padding-block: 3.5rem 4rem;
    border-top: 1px solid hsl(var(--border));
    margin-top: 3.5rem;
}
.related__title {
    margin-bottom: 1.75rem;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   15. Members / subscribe
   -------------------------------------------------------------------------- */

/* Only the shared error/status line remains — the standalone post-page subscribe
   card was removed (superseded by the post-cta panel); the homepage version lives
   entirely in partials/cta-box.hbs's own styles. */
.subscribe__message {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    min-height: 1.25rem;
}

/* --------------------------------------------------------------------------
   16. Footer
   -------------------------------------------------------------------------- */

.site-footer {
    flex-shrink: 0;
    border-top: 1px solid hsl(var(--border));
    background-color: hsl(var(--background));
}

.site-footer__inner {
    padding-block: 3rem 2rem;
}

.site-footer__cols {
    display: grid;
    /* 2 columns even on phones, on purpose — Products pairs with Company, Support pairs
       with Legal (column order in footer.hbs), not stacked into one. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}
@media (min-width: 768px) {
    .site-footer__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.site-footer__heading {
    margin-bottom: 0.875rem;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.site-footer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.site-footer__list a {
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}
.site-footer__list a:hover { color: hsl(var(--foreground)); }

.site-footer__bottom {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid hsl(var(--border));
}
@media (min-width: 768px) {
    .site-footer__bottom {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.site-footer__brand img {
    height: 2.5rem;
    width: auto;
}
:root.light .site-footer__wordmark--dark { display: none; }
:root.dark .site-footer__wordmark--light { display: none; }

.site-footer__tagline {
    margin-top: 0.625rem;
    font-size: 0.875rem;
    color: hsl(var(--muted-foreground));
}

.site-footer__copyright {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
}

.site-footer__social {
    display: flex;
    gap: 0.25rem;
}
.site-footer__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-md);
    color: hsl(var(--muted-foreground));
    transition: background-color var(--transition), color var(--transition);
}
.site-footer__social a:hover {
    background-color: hsl(var(--accent));
    color: hsl(var(--foreground));
}
.site-footer__social svg { width: 1.125rem; height: 1.125rem; }

/* --------------------------------------------------------------------------
   17. Error pages
   -------------------------------------------------------------------------- */

.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 6rem var(--gutter);
    text-align: center;
}
.error-page__code {
    font-size: clamp(3.5rem, 2rem + 7vw, 6rem);
    line-height: 1;
    letter-spacing: -0.04em;
    color: hsl(var(--primary));
}
.error-page__title { font-size: 1.5rem; }
.error-page__message { color: hsl(var(--muted-foreground)); max-width: 34rem; }
.error-page__actions { margin-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

/* --------------------------------------------------------------------------
   18. Site popups — promo popup (partials/promo-popup.hbs, admin-toggled) and
   the subscribe-success confirmation (partials/subscribe-success-popup.hbs).
   Same overlay/dialog chrome, different content; open/close logic in main.js.
   -------------------------------------------------------------------------- */

.site-popup {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.site-popup[hidden] { display: none; }

.site-popup__backdrop {
    position: absolute;
    inset: 0;
    background-color: hsl(0 0% 0% / 0.55);
}

.site-popup__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 26rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background-color: hsl(var(--card));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    animation: site-popup-in 0.2s ease-out;
}
@keyframes site-popup-in {
    from { opacity: 0; transform: translateY(0.5rem) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.site-popup__close {
    position: absolute;
    top: 0.625rem;
    right: 0.625rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background-color: hsl(var(--card));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition);
}
.site-popup__close svg { width: 1.125rem; height: 1.125rem; }
.site-popup__close:hover { background-color: hsl(var(--accent)); }

body.is-popup-open { overflow: hidden; }

/* Promo popup — full-bleed image, close button floats on top of it */
.site-popup__dialog--promo { padding: 0; }
.site-popup__promo-image-link,
.site-popup__promo-image {
    display: block;
    width: 100%;
}
.site-popup__promo-image {
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: inherit;
}

/* Subscribe success popup — icon + text card */
.site-popup__dialog--subscribe {
    padding: 2.5rem 1.75rem 1.75rem;
    text-align: center;
}
.site-popup__icon {
    width: 2.75rem;
    height: 2.75rem;
    padding: 0.625rem;
    margin: 0 auto 1rem;
    color: hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.1);
    border-radius: 999px;
    box-sizing: content-box;
}
.site-popup__title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}
.site-popup__body {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
}

@media (max-width: 480px) {
    .site-popup__dialog--subscribe { padding: 2.25rem 1.25rem 1.5rem; }
}

/* --------------------------------------------------------------------------
   19. Motion, forced colours, print
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .post-card:hover { transform: none; }
    .post-card:hover .post-card__image { transform: none; }
    .site-popup__dialog { animation: none; }
}

@media (forced-colors: active) {
    .btn, .post-card, .tag-pill, .kg-bookmark-card a.kg-bookmark-container {
        border: 1px solid currentColor;
    }
    :focus-visible { outline: 2px solid currentColor; }
}

@media print {
    .site-header, .site-footer, .post-cta, .related, .subscribe, .skip-link, .site-popup { display: none !important; }
    body { color: #000; background: #fff; }
    .post-content { display: block; max-width: none; }
    .post-content a { text-decoration: underline; }
    .post-content a[href^='http']::after {
        content: ' (' attr(href) ')';
        font-size: 0.85em;
        color: #555;
    }
}
