/* Ghost Theme — base styles ported from the Next.js globals.css.
   Tailwind utilities are provided by the Play CDN (see ghost_head.hbs). */

@font-face {
    font-family: "ASV";
    src: url("/assets/fonts/asv.woff2") format("woff2");
    font-weight: 300 700;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: "CS";
    src: url("/assets/fonts/cs.woff2") format("woff2");
    font-weight: 400 500;
    font-style: normal;
    font-display: swap;
    font-stretch: normal;
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    /* Ghost custom font support — these are overridden by the publisher's
       font choices in Ghost Admin; otherwise the theme's own fonts apply. */
    --gh-font-heading: "ASV", serif;
    --gh-font-body: "CS", "Inter", sans-serif;
}

html {
    font-family: var(--gh-font-body, "CS", "Inter", sans-serif);
    scroll-behavior: smooth;
}

body {
    font-family: var(--gh-font-body, "CS", "Inter", sans-serif);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--gh-font-heading, "ASV", serif);
}

.font-sans {
    font-family: var(--gh-font-body, "CS", "Inter", sans-serif) !important;
}

/* The Next.js theme overrides Tailwind's responsive container with a fixed
   max width. The Tailwind container core plugin is disabled in the CDN config,
   so this definition is authoritative. */
.container {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ----------------------------------------------------------------------------
   Koenig editor card styles. Required so post/page content cards (wide & full
   width images, galleries, etc.) render correctly inside the .prose content.
   ------------------------------------------------------------------------- */
.kg-width-wide {
    position: relative;
    width: 85vw;
    min-width: 100%;
    margin: 1.5em 0;
    left: 50%;
    transform: translateX(-50%);
}

.kg-width-full {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    margin: 1.5em 0;
}

.kg-width-full img {
    max-width: 100vw;
}

figure.kg-card {
    margin: 1.5em 0;
}

.kg-card figcaption {
    text-align: center;
    font-size: 0.85em;
    color: #64748b;
    padding: 0.75em 0;
}

/* Image gallery card */
.kg-gallery-container {
    display: flex;
    flex-direction: column;
    max-width: 1040px;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
}

.kg-gallery-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
}

.kg-gallery-image img {
    display: block;
    margin: 0;
    width: 100%;
    height: 100%;
}

.kg-gallery-row:not(:first-of-type) {
    margin: 0.75em 0 0 0;
}

.kg-gallery-image:not(:first-of-type) {
    margin: 0 0 0 0.75em;
}

/* Bookmark card */
.kg-bookmark-card {
    width: 100%;
    margin: 1.5em 0;
}

.kg-bookmark-container {
    display: flex;
    min-height: 148px;
    color: inherit;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    overflow: hidden;
}

.kg-bookmark-content {
    flex-grow: 1;
    padding: 20px;
}

.kg-bookmark-title {
    font-weight: 600;
    color: #0f172a;
}

.kg-bookmark-description {
    color: #64748b;
    margin-top: 0.5em;
}

.kg-bookmark-thumbnail {
    position: relative;
    min-width: 33%;
    max-height: 100%;
}

.kg-bookmark-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Button card */
.kg-button-card {
    display: flex;
    margin: 1.5em 0;
}

.kg-button-card.kg-align-center {
    justify-content: center;
}

.kg-btn {
    display: inline-flex;
    align-items: center;
    padding: 0 1.2em;
    height: 2.8em;
    border-radius: 9999px;
    font-weight: 700;
    background: #3b82f6;
    color: #fff;
    text-decoration: none;
}

/* ----------------------------------------------------------------------------
   Revamp design system — shared utilities for the redesigned templates
   (home, blog, …). Use the .rv wrapper to opt a page into the paper/ink look.
   ------------------------------------------------------------------------- */
.rv { background-color: #F6F2EA; }
.rv ::selection { background: #FF4D23; color: #fff; }
.rv section { position: relative; z-index: 2; }

/* Film grain overlay for depth */
.rv-grain::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.045;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Load reveal (staggered via --d) */
@keyframes hb-rise-kf { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
.hb-rise { opacity: 0; animation: hb-rise-kf 0.95s cubic-bezier(.16,1,.3,1) forwards; animation-delay: var(--d, 0s); }

/* Scroll reveal (only hides when JS is present) */
.js .reveal { opacity: 0; transform: translateY(32px); transition: opacity .85s cubic-bezier(.16,1,.3,1), transform .85s cubic-bezier(.16,1,.3,1); transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }

/* Marquee */
@keyframes hb-marquee-kf { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.hb-marquee { animation: hb-marquee-kf 48s linear infinite; }
.hb-marquee-track:hover .hb-marquee { animation-play-state: paused; }

/* Display tracking + animated link underline */
.hb-display { letter-spacing: -0.025em; line-height: 0.98; }
.hb-link-underline { background-image: linear-gradient(currentColor, currentColor); background-size: 0% 1px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .4s cubic-bezier(.16,1,.3,1); }
.group:hover .hb-link-underline, .hb-link-underline:hover { background-size: 100% 1px; }

@media (prefers-reduced-motion: reduce) {
    .hb-rise, .js .reveal { animation: none !important; opacity: 1 !important; transform: none !important; transition: none !important; }
    .hb-marquee { animation: none !important; }
}

/* Editorial prose palette — recolors Tailwind Typography to the paper/ink/accent
   system. Use: class="prose prose-lg prose-rv max-w-none" */
.prose-rv {
    --tw-prose-body: #3f3a33;
    --tw-prose-headings: #161310;
    --tw-prose-lead: #57514a;
    --tw-prose-links: #FF4D23;
    --tw-prose-bold: #161310;
    --tw-prose-counters: #8a8178;
    --tw-prose-bullets: #FF4D23;
    --tw-prose-hr: rgba(22, 19, 16, 0.1);
    --tw-prose-quotes: #161310;
    --tw-prose-quote-borders: #FF4D23;
    --tw-prose-captions: #8a8178;
    --tw-prose-code: #161310;
    --tw-prose-pre-code: #F6F2EA;
    --tw-prose-pre-bg: #161310;
    --tw-prose-th-borders: rgba(22, 19, 16, 0.15);
    --tw-prose-td-borders: rgba(22, 19, 16, 0.1);
}
.prose-rv :where(h1,h2,h3,h4,h5,h6) { font-family: var(--gh-font-heading, "ASV", serif); letter-spacing: -0.02em; }
.prose-rv :where(blockquote) { font-family: var(--gh-font-heading, "ASV", serif); font-style: normal; }

/* Primary navigation link (desktop) — mono label with animated accent underline */
.nav-link {
    position: relative;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: #322C25;
    transition: color 0.3s ease;
}
.nav-link:hover { color: #161310; }
.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -0.375rem;
    height: 1px;
    width: 0;
    background: #FF4D23;
    transition: width 0.3s ease;
}
.nav-link:hover::after,
.nav-link.nav-current::after { width: 100%; }
.nav-link.nav-current { color: #161310; }
