/* ===========================================================================
   Pulse — Tech news & magazine theme for Ghost
   Plain CSS, no build step. Light + dark via [data-theme] on <html>.
   ========================================================================= */

/* ----------------------------------------------------------------------- */
/*  Design tokens                                                          */
/* ----------------------------------------------------------------------- */
:root {
    --accent: #2563eb;            /* overridable via @custom.accent_color */
    --accent-2: #06b6d4;
    --accent-soft: rgba(37, 99, 235, 0.12);

    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: "Sora", var(--font-sans);
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --maxw: 1240px;
    --maxw-narrow: 720px;
    --radius: 14px;
    --radius-sm: 9px;
    --gap: 28px;

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
    --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, 0.35);

    --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light palette (default) */
:root,
[data-theme="light"] {
    --bg: #ffffff;
    --bg-soft: #f5f7fb;
    --bg-elev: #ffffff;
    --surface: #ffffff;
    --border: #e6e9f0;
    --border-strong: #d3d8e4;
    --text: #0f172a;
    --text-soft: #475569;
    --text-mute: #7c879b;
    --heading: #0b1220;
    --overlay: linear-gradient(180deg, rgba(7, 12, 26, 0) 0%, rgba(7, 12, 26, 0.85) 100%);
}

/* Dark palette */
[data-theme="dark"] {
    --bg: #0b0f1a;
    --bg-soft: #11172680;
    --bg-elev: #131a2b;
    --surface: #131a2b;
    --border: #232c40;
    --border-strong: #303a52;
    --text: #e7ecf5;
    --text-soft: #aab4c8;
    --text-mute: #7e8aa3;
    --heading: #f4f7fc;
    --overlay: linear-gradient(180deg, rgba(3, 6, 14, 0) 0%, rgba(3, 6, 14, 0.92) 100%);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 16px 40px -18px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.8);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background var(--transition), color var(--transition);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--heading); line-height: 1.2; margin: 0 0 0.5em; letter-spacing: -0.01em; }

p { margin: 0 0 1.1em; }

::selection { background: var(--accent); color: #fff; }

.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-main { flex: 1; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container-narrow { width: 100%; max-width: var(--maxw-narrow); margin: 0 auto; padding: 0 24px; }

.section { padding: 56px 0; }
.section-alt { background: var(--bg-soft); }
.section-top { padding-top: 40px; }

.empty-state { color: var(--text-mute); text-align: center; padding: 60px 0; }

.gradient-text {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

/* ----------------------------------------------------------------------- */
/*  Buttons                                                                */
/* ----------------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem;
    padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
    cursor: pointer; white-space: nowrap; transition: all var(--transition);
}
.btn-primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { color: #fff; filter: brightness(1.07); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { width: 100%; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.link-arrow svg { transition: transform var(--transition); }
.link-arrow:hover svg { transform: translateX(3px); }

/* ----------------------------------------------------------------------- */
/*  Header / navigation                                                    */
/* ----------------------------------------------------------------------- */
.site-header {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }

.nav-inner { display: flex; align-items: center; gap: 20px; height: 68px; }

.nav-brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.nav-brand-text { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: var(--heading); letter-spacing: -0.02em; }
.nav-logo { height: 34px; width: auto; }

.nav-menu { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-item a {
    display: block; padding: 8px 14px; border-radius: var(--radius-sm);
    color: var(--text-soft); font-weight: 600; font-size: 0.95rem;
}
.nav-item a:hover { color: var(--heading); background: var(--bg-soft); }
.nav-item--active a { color: var(--accent); }

.nav-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px; cursor: pointer;
    background: transparent; border: 1px solid var(--border); color: var(--text-soft);
    transition: all var(--transition);
}
.icon-btn:hover { color: var(--heading); border-color: var(--border-strong); background: var(--bg-soft); }

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

.nav-cta { margin-left: 4px; }

.nav-burger { display: none; flex-direction: column; gap: 5px; width: 42px; height: 40px; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; }
.nav-burger span { display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }

/* Search panel */
.search-panel { border-top: 1px solid var(--border); background: var(--bg); padding: 14px 0; }
.search-cta {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 12px 16px; border-radius: var(--radius-sm);
    background: var(--bg-soft); border: 1px solid var(--border);
    color: var(--text-mute); font-family: var(--font-sans); font-size: 0.95rem; cursor: pointer;
}
.search-cta:hover { border-color: var(--accent); color: var(--text); }

/* ----------------------------------------------------------------------- */
/*  Section heads                                                          */
/* ----------------------------------------------------------------------- */
.section-eyebrow {
    display: inline-block; font-family: var(--font-mono); font-size: 0.74rem;
    font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--accent); margin-bottom: 10px;
}
.section-head { margin-bottom: 28px; }
.section-head--row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); margin: 0; }
.section-lead { color: var(--text-soft); max-width: 60ch; margin-top: 8px; }
.section-foot { text-align: center; margin-top: 36px; }

/* ----------------------------------------------------------------------- */
/*  Grids                                                                  */
/* ----------------------------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* Magazine layout with sidebar */
.content-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.content-main { min-width: 0; }

/* ----------------------------------------------------------------------- */
/*  Featured hero                                                          */
/* ----------------------------------------------------------------------- */
.featured-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: var(--gap); }
.featured-side { display: flex; flex-direction: column; gap: 18px; }

.featured-card { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-md); height: 100%; min-height: 420px; }
.featured-card-link { display: block; height: 100%; }
.featured-card-image { width: 100%; height: 100%; object-fit: cover; min-height: 420px; transition: transform 500ms ease; }
.featured-card:hover .featured-card-image { transform: scale(1.04); }
.featured-card-overlay {
    position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
    padding: 28px; background: var(--overlay); color: #fff;
}
.featured-card-title { color: #fff; font-size: clamp(1.4rem, 2.6vw, 2.1rem); margin: 10px 0 8px; }
.featured-card-excerpt { color: rgba(255, 255, 255, 0.85); margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ----------------------------------------------------------------------- */
/*  Category bar                                                           */
/* ----------------------------------------------------------------------- */
.category-bar { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--bg); }
.category-bar-inner { display: flex; align-items: center; gap: 10px; padding-top: 14px; padding-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.category-bar-inner::-webkit-scrollbar { display: none; }
.category-bar-label { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mute); flex-shrink: 0; }
.category-chip {
    flex-shrink: 0; padding: 7px 14px; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
    color: var(--text-soft); background: var(--bg-soft); border: 1px solid var(--border);
}
.category-chip:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

/* ----------------------------------------------------------------------- */
/*  Post card (vertical)                                                   */
/* ----------------------------------------------------------------------- */
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.post-card-image-link { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-soft); }
.post-card-image { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.post-card:hover .post-card-image { transform: scale(1.05); }
.post-card-image--placeholder { display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; color: var(--text-mute); background: linear-gradient(135deg, var(--bg-soft), var(--border)); }

.post-card-tag {
    position: absolute; top: 12px; left: 12px; z-index: 2;
    padding: 5px 11px; border-radius: 999px; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.03em; text-transform: uppercase; color: #fff;
    background: var(--accent); box-shadow: var(--shadow-sm);
}
.post-card-tag--inline { position: static; display: inline-block; margin-bottom: 8px; background: var(--accent-soft); color: var(--accent); }

.post-card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.post-card-title { font-size: 1.18rem; line-height: 1.3; margin: 0 0 8px; }
.post-card-title a { color: var(--heading); }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt { color: var(--text-soft); font-size: 0.95rem; margin: 0 0 16px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.post-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.82rem; color: var(--text-mute); }
.post-card-meta > * + *::before { content: "·"; margin-right: 8px; color: var(--border-strong); }
.post-card-author { font-weight: 600; color: var(--text-soft); }
.post-card-meta--light { color: rgba(255, 255, 255, 0.8); }
.post-card-meta--light .post-card-author { color: #fff; }
.post-card-meta--light > * + *::before { color: rgba(255, 255, 255, 0.5); }
.post-card--no-author .post-card-author { display: none; }
.post-card--no-author .post-card-author + *::before { content: none; }

/* ----------------------------------------------------------------------- */
/*  Post card (horizontal list)                                            */
/* ----------------------------------------------------------------------- */
.post-list-card { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; }
.post-list-card-image-link { display: block; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 4 / 3; background: var(--bg-soft); }
.post-list-card-image { width: 100%; height: 100%; object-fit: cover; transition: transform 400ms ease; }
.post-list-card:hover .post-list-card-image { transform: scale(1.06); }
.post-list-card-title { font-size: 1.02rem; line-height: 1.35; margin: 0 0 6px; }
.post-list-card-title a { color: var(--heading); }
.post-list-card-title a:hover { color: var(--accent); }

/* ----------------------------------------------------------------------- */
/*  Sidebar widgets                                                        */
/* ----------------------------------------------------------------------- */
.sidebar { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 28px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.widget-title { font-size: 1.05rem; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); position: relative; }
.widget-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 42px; height: 2px; background: var(--accent); }

.trending-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; counter-reset: trend; }
.trending-item { display: flex; gap: 14px; align-items: flex-start; }
.trending-rank { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; line-height: 1; color: var(--border-strong); min-width: 26px; }
.trending-body { display: flex; flex-direction: column; gap: 2px; }
.trending-tag { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.trending-link { font-family: var(--font-display); font-weight: 600; font-size: 0.96rem; line-height: 1.3; color: var(--heading); }
.trending-link:hover { color: var(--accent); }
.trending-meta { font-size: 0.78rem; color: var(--text-mute); }

.category-list { list-style: none; margin: 0; padding: 0; }
.category-list li + li { border-top: 1px solid var(--border); }
.category-list a { display: flex; align-items: center; justify-content: space-between; padding: 11px 0; color: var(--text-soft); font-weight: 600; font-size: 0.95rem; }
.category-list a:hover { color: var(--accent); }
.category-count { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-mute); background: var(--bg-soft); border-radius: 6px; padding: 2px 9px; }

.widget-newsletter { background: linear-gradient(160deg, var(--accent-soft), transparent); }
.widget-newsletter-text { color: var(--text-soft); font-size: 0.92rem; margin: 0 0 14px; }

/* ----------------------------------------------------------------------- */
/*  Signup forms                                                           */
/* ----------------------------------------------------------------------- */
.signup-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.signup-form--stack { flex-direction: column; align-items: stretch; }
.signup-input {
    flex: 1; min-width: 0; padding: 12px 16px; font-size: 0.95rem; font-family: var(--font-sans);
    color: var(--text); background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.signup-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.signup-message { font-size: 0.85rem; color: #dc2626; flex-basis: 100%; }
.signup-message--success { color: #16a34a; display: none; }

/* ----------------------------------------------------------------------- */
/*  Page hero                                                              */
/* ----------------------------------------------------------------------- */
.page-hero { position: relative; padding: 64px 0 40px; text-align: center; overflow: hidden; }
.page-hero--compact { padding: 48px 0 28px; }
.page-hero-title { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 12px; }
.page-hero-sub { color: var(--text-soft); font-size: 1.1rem; max-width: 62ch; margin: 0 auto; }

.page-hero--category { color: #fff; padding: 88px 0 64px; }
.page-hero--category .section-eyebrow { color: rgba(255, 255, 255, 0.85); }
.page-hero--category .page-hero-title { color: #fff; }
.page-hero--category .page-hero-sub { color: rgba(255, 255, 255, 0.88); }
.page-hero--category .page-hero-bg { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; }
.page-hero--category::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(135deg, rgba(7, 12, 26, 0.82), rgba(7, 12, 26, 0.6)); }
.page-hero--category:not(:has(.page-hero-bg)) { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }

.page-feature-image { margin: 0 auto 8px; max-width: 1000px; }
.page-feature-image img { border-radius: var(--radius); }

/* ----------------------------------------------------------------------- */
/*  Single post                                                            */
/* ----------------------------------------------------------------------- */
.post { padding-top: 48px; }
.post-header { text-align: center; }
.post-tag { display: inline-block; font-family: var(--font-mono); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; color: var(--accent); margin-bottom: 14px; }
.post-title { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 16px; }
.post-subtitle { font-size: 1.2rem; color: var(--text-soft); margin: 0 0 22px; }
.post-meta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.9rem; color: var(--text-mute); justify-content: center; }
.post-meta > * + *::before { content: "·"; margin-right: 10px; color: var(--border-strong); }
.post-meta-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text-soft); }
.post-meta-avatar { border-radius: 50%; }
.post--no-author .post-meta-author { display: none; }
.post--no-author .post-meta-author + *::before { content: none; }

.post-feature-image { margin: 40px auto; max-width: 1100px; }
.post-feature-image img { border-radius: var(--radius); width: 100%; }
.post-feature-image figcaption { text-align: center; font-size: 0.85rem; color: var(--text-mute); margin-top: 10px; }

/* ----------------------------------------------------------------------- */
/*  Post content typography (gh-content)                                   */
/* ----------------------------------------------------------------------- */
.post-content { font-size: 1.12rem; line-height: 1.75; color: var(--text); }
.gh-content > * { margin-bottom: 1.4em; }
.gh-content h2 { font-size: 1.7rem; margin-top: 1.8em; }
.gh-content h3 { font-size: 1.35rem; margin-top: 1.5em; }
.gh-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent-soft); }
.gh-content a:hover { text-decoration-color: var(--accent); }
.gh-content img { border-radius: var(--radius); margin-left: auto; margin-right: auto; }
.gh-content figcaption { text-align: center; font-size: 0.85rem; color: var(--text-mute); margin-top: 8px; }
.gh-content blockquote { margin: 1.6em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--accent); color: var(--text-soft); font-size: 1.15rem; font-style: italic; }
.gh-content ul, .gh-content ol { padding-left: 1.4em; }
.gh-content li { margin-bottom: 0.5em; }
.gh-content hr { border: none; border-top: 1px solid var(--border); margin: 2.4em 0; }
.gh-content code { font-family: var(--font-mono); font-size: 0.9em; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 6px; padding: 2px 6px; }
.gh-content pre { font-family: var(--font-mono); background: #0d1117; color: #e6edf3; border-radius: var(--radius-sm); padding: 18px 20px; overflow-x: auto; font-size: 0.92rem; line-height: 1.6; }
.gh-content pre code { background: none; border: none; padding: 0; color: inherit; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.gh-content th, .gh-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.gh-content th { background: var(--bg-soft); }

/* Ghost cards */
.kg-card { margin-bottom: 1.6em; }
.kg-width-wide { width: 100%; }
.kg-width-full { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.kg-bookmark-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.kg-bookmark-container { display: flex; color: var(--text); text-decoration: none; }
.kg-bookmark-content { flex: 1; padding: 20px; }
.kg-bookmark-title { font-weight: 700; color: var(--heading); }
.kg-bookmark-description { color: var(--text-soft); font-size: 0.92rem; }

/* Post footer */
.post-footer { margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--border); }
.post-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.tag-pill { padding: 6px 14px; border-radius: 999px; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); background: var(--bg-soft); border: 1px solid var(--border); }
.tag-pill:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

.post-share { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.post-share-label { font-family: var(--font-mono); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-mute); }
.post-share-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; font-size: 0.82rem; font-weight: 700; color: var(--text-soft); background: var(--bg-soft); border: 1px solid var(--border); }
.post-share-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

.author-bio { display: flex; gap: 18px; align-items: flex-start; padding: 24px; background: var(--bg-soft); border-radius: var(--radius); }
.author-bio-avatar { border-radius: 50%; flex-shrink: 0; }
.author-bio-name { margin: 0 0 6px; font-size: 1.1rem; }
.author-bio-text p { margin: 0; color: var(--text-soft); font-size: 0.95rem; }

.post-subscribe { margin: 48px auto; }
.post-subscribe-card { padding: 32px; text-align: center; background: linear-gradient(160deg, var(--accent-soft), transparent); border: 1px solid var(--border); border-radius: var(--radius); }
.post-subscribe-card h3 { font-size: 1.4rem; margin: 0 0 6px; }
.post-subscribe-card p { color: var(--text-soft); margin: 0 0 18px; }
.post-subscribe-card .signup-form { justify-content: center; max-width: 460px; margin: 0 auto; }

.related-posts { margin-top: 60px; }

/* ----------------------------------------------------------------------- */
/*  Author hero                                                            */
/* ----------------------------------------------------------------------- */
.author-hero { padding: 56px 0 36px; }
.author-hero-inner { display: flex; align-items: center; gap: 24px; }
.author-hero-avatar { border-radius: 50%; flex-shrink: 0; box-shadow: var(--shadow-md); }
.author-hero-meta { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 0.92rem; color: var(--text-soft); }

/* ----------------------------------------------------------------------- */
/*  Pagination                                                             */
/* ----------------------------------------------------------------------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.pagination-btn { font-weight: 600; padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); color: var(--text); }
.pagination-btn:hover { color: var(--accent); border-color: var(--accent); }
.pagination-btn.is-disabled { opacity: 0.4; pointer-events: none; }
.pagination-info { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-mute); }

/* ----------------------------------------------------------------------- */
/*  Footer                                                                 */
/* ----------------------------------------------------------------------- */
.footer-cta { padding: 56px 0; }
.footer-cta-card {
    display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
    padding: 40px; border-radius: var(--radius); border: 1px solid var(--border);
    background: linear-gradient(135deg, var(--accent-soft), transparent);
}
.footer-cta-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 6px 0 8px; }
.footer-cta-sub { color: var(--text-soft); margin: 0; max-width: 48ch; }
.footer-cta-card .signup-form { flex: 1; min-width: 280px; max-width: 460px; }

.site-footer { background: var(--bg-soft); border-top: 1px solid var(--border); padding-top: 48px; }
.footer-inner { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.footer-logo { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; color: var(--heading); }
.footer-tagline { color: var(--text-soft); margin-top: 10px; max-width: 42ch; font-size: 0.95rem; }
.footer-nav .nav-list { flex-direction: column; align-items: flex-start; gap: 2px; }
.footer-nav .nav-item a { padding: 5px 0; color: var(--text-soft); }
.footer-nav .nav-item a:hover { color: var(--accent); background: none; }
.footer-social { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; font-size: 0.8rem; font-weight: 700; color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); }
.footer-social a:hover { color: #fff; background: var(--accent); border-color: var(--accent); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 22px 0; border-top: 1px solid var(--border); color: var(--text-mute); font-size: 0.85rem; }
.footer-bottom p { margin: 0; }

/* ----------------------------------------------------------------------- */
/*  Error page                                                             */
/* ----------------------------------------------------------------------- */
.error-page { padding: 100px 0; text-align: center; }
.error-code { font-family: var(--font-display); font-size: clamp(4rem, 14vw, 9rem); font-weight: 800; line-height: 1; }
.error-title { font-size: 1.6rem; margin: 8px 0 12px; }
.error-sub { color: var(--text-soft); max-width: 44ch; margin: 0 auto 28px; }
.error-stack { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.85rem; }
.error-page .hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ----------------------------------------------------------------------- */
/*  Scroll reveal                                                          */
/* ----------------------------------------------------------------------- */
.no-js [data-reveal] { opacity: 1; }
[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity 500ms ease, transform 500ms ease; }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ----------------------------------------------------------------------- */
/*  Responsive                                                             */
/* ----------------------------------------------------------------------- */
@media (max-width: 1080px) {
    .content-with-sidebar { grid-template-columns: 1fr; gap: 40px; }
    .sidebar { position: static; flex-direction: row; flex-wrap: wrap; }
    .sidebar .widget { flex: 1; min-width: 260px; }
}

@media (max-width: 860px) {
    .nav-menu {
        position: fixed; inset: 68px 0 auto 0; margin: 0; background: var(--bg);
        border-bottom: 1px solid var(--border); box-shadow: var(--shadow-lg);
        max-height: 0; overflow: hidden; transition: max-height var(--transition);
    }
    .nav-menu.is-open { max-height: 70vh; overflow-y: auto; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 24px 16px; }
    .nav-item a { padding: 12px 4px; border-bottom: 1px solid var(--border); }
    .nav-burger { display: flex; }
    .nav-cta { display: none; }
    .featured-grid { grid-template-columns: 1fr; }
    .featured-card, .featured-card-image { min-height: 320px; }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
    body { font-size: 16px; }
    .section { padding: 40px 0; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .sidebar { flex-direction: column; }
    .footer-inner { grid-template-columns: 1fr; }
    .footer-cta-card { flex-direction: column; align-items: stretch; text-align: left; }
    .section-head--row { flex-direction: column; align-items: flex-start; gap: 8px; }
    .post-list-card { grid-template-columns: 110px 1fr; }
}
