/* =========================================================================
   Schorsch.app — Journal / Scrapbook theme
   Theme tokens are injected from Theme::get(...). See public/partials/theme_vars.php
   ========================================================================= */

:root {
    --bg:        #f6efe1;
    --surface:   #efe6d2;
    --text:      #2a2622;
    --muted:     #7a6f5f;
    --accent:    #3f5a3a;
    --accent-alt:#c66b3d;
    --card-green:var(--accent);
    --card-orange:var(--accent-alt);
    --radius:    14px;
    --font-head: 'Caveat', 'Pacifico', cursive;
    --font-body: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, monospace;

    --shadow-soft: 0 6px 24px rgba(56, 38, 22, 0.08);
    --shadow-tape: 0 4px 14px rgba(0, 0, 0, 0.10);
    --paper-grain:
        radial-gradient(circle at 12% 18%, rgba(180,150,90,0.06) 0 1px, transparent 1.5px),
        radial-gradient(circle at 78% 62%, rgba(180,150,90,0.05) 0 1px, transparent 1.5px),
        radial-gradient(circle at 42% 88%, rgba(120, 90, 50, 0.05) 0 1px, transparent 1.5px);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    background-image: var(--paper-grain);
    background-attachment: fixed;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}

/* -------------------------------------------------------------------------
   Page decorations: plants, trees, stamps — fixed-positioned SVG layer
   ------------------------------------------------------------------------- */
.page-decor {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    color: var(--muted);
    mix-blend-mode: multiply;
}
.decor {
    position: absolute;
    opacity: .32;
    transition: opacity .25s ease;
}
body.is-dark .page-decor {
    color: var(--accent);
    opacity: .55;
    mix-blend-mode: screen;
}
body.decor-off .page-decor { display: none; }

/* Bottom-left plant cluster */
.decor--plant-bl {
    left: -28px;
    bottom: -20px;
    width: 200px;
    height: 360px;
    transform: rotate(-3deg);
    color: var(--muted);
}

/* Bottom-right round stamp */
.decor--stamp-br {
    right: 24px;
    bottom: 60px;
    width: 180px;
    height: 180px;
    color: var(--accent-alt);
    transform: rotate(8deg);
    opacity: .42;
}
body.is-dark .decor--stamp-br { color: var(--accent-alt); opacity: .55; }

/* Mid-right pine trio */
.decor--trees-r {
    right: 18px;
    top: 38%;
    width: 96px;
    height: 160px;
    color: var(--accent);
    transform: rotate(-4deg);
    opacity: .35;
}

/* Mid-left leaf sprig */
.decor--leaf-l {
    left: 12px;
    top: 28%;
    width: 80px;
    height: 160px;
    color: var(--muted);
    transform: rotate(6deg);
    opacity: .28;
}

@media (max-width: 1024px) {
    .decor--stamp-br { width: 130px; height: 130px; right: 12px; bottom: 40px; }
    .decor--trees-r  { width: 70px;  height: 120px; right: 8px;  top: 40%; }
    .decor--leaf-l   { width: 60px;  height: 120px; left: 6px;   top: 30%; }
    .decor--plant-bl { width: 140px; height: 260px; left: -22px; bottom: -16px; }
}
@media (max-width: 640px) {
    .decor--trees-r, .decor--leaf-l { display: none; }
    .decor--stamp-br { width: 96px;  height: 96px;  right: 8px; bottom: 24px; opacity: .25; }
    .decor--plant-bl { width: 110px; height: 200px; left: -18px; bottom: -10px; opacity: .22; }
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* Make sure content sits above the decor layer */
.container, .site-footer { position: relative; z-index: 1; }

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 600;
    margin: 0 0 .4em;
    letter-spacing: .2px;
    color: var(--text);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 28px; }

/* -------------------------------------------------------------------------
   Site header
   ------------------------------------------------------------------------- */
.site-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 40;
    background: linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,0));
    border-bottom: 1px solid transparent;
    transition: background .25s ease, border-color .25s ease, color .25s ease, backdrop-filter .25s ease;
    color: #f7efd9;
}
.site-header.is-scrolled {
    position: fixed;
    background: rgba(246, 239, 225, 0.88);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(120, 90, 50, 0.10);
    color: var(--text);
}
.site-header .inner {
    display: flex; align-items: center; gap: 24px;
    padding: 14px 28px;
    max-width: 1300px; margin: 0 auto;
}
.brand {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 700;
    color: inherit;
    letter-spacing: .3px;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.site-header.is-scrolled .brand { text-shadow: none; }
.brand .dot { color: var(--accent-alt); }
.brand-logo {
    max-height: 44px;
    max-width: 180px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    /* If the logo is a wordmark on a transparent background, the
       default drop-shadow is enough; remove the text-shadow in that
       case so the image doesn't get a halo. */
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.18));
}
.site-header.is-scrolled .brand-logo { filter: none; }

.nav { display: flex; gap: 26px; margin-left: 28px; flex-wrap: wrap; }
.nav a {
    font-family: var(--font-body);
    font-size: 14px;
    color: inherit;
    opacity: .85;
    padding: 6px 2px;
    position: relative;
    transition: opacity .2s;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.site-header.is-scrolled .nav a { text-shadow: none; }
.nav a:hover, .nav a.is-active { opacity: 1; }
.nav a.is-active::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0;
    height: 2px; background: currentColor;
    border-radius: 2px;
}

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.theme-toggle {
    display: inline-flex; gap: 6px; align-items: center;
    background: transparent; border: none; cursor: pointer;
    color: inherit; opacity: .85;
}
.theme-toggle:hover { opacity: 1; }

.search-trigger, .nav-toggle {
    background: transparent; border: none; cursor: pointer;
    color: inherit; opacity: .85; padding: 4px;
}
.search-trigger:hover, .nav-toggle:hover { opacity: 1; }

.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--accent);
    color: #f7f1e1;
    border: none;
    font: 500 14px/1 var(--font-body);
    cursor: pointer;
    transition: transform .15s, box-shadow .2s, background .2s;
    text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn--ghost {
    background: transparent;
    color: inherit;
    border: 1px solid currentColor;
}
.btn--accent-alt { background: var(--accent-alt); }
.btn--lg { padding: 13px 26px; font-size: 15px; }
.btn .arrow { transition: transform .15s; }
.btn:hover .arrow { transform: translateX(3px); }

/* -------------------------------------------------------------------------
   Hero
   ------------------------------------------------------------------------- */
.hero {
    position: relative;
    min-height: 620px;
    margin-top: 0;
    padding-top: 80px;
    overflow: hidden;
    /* The hero image fills the hero edge-to-edge on any width:
       - `background-size: cover` scales the image to cover the entire
         container (cropping if needed) — this prevents tiling on very
         wide viewports where the source image is narrower than 100%.
       - `background-position: center center` keeps the focal point centered.
       - `background-repeat: no-repeat` is belt-and-suspenders: even if the
         rendered size ever slipped below the container, no tile would show.
       The radial-gradient is a dark fallback shown only during loading or
       for browsers that don't support multiple background layers. */
    background:
        linear-gradient(180deg, rgba(20,18,16,.12), rgba(20,18,16,.32)),
        var(--hero-img) center center / cover no-repeat,
        radial-gradient(circle at 30% 70%, #4b3520 0%, #1a1411 100%);
    background-color: #1a1411;
    color: #f7efd9;
}
.hero .container {
    position: relative;
    min-height: 620px;
    display: flex;
    align-items: center;
    padding-top: 30px;
    padding-bottom: 110px;
}

.hero-card {
    background: #f3e8ce;
    color: var(--text);
    padding: 44px 44px 40px;
    max-width: 500px;
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    position: relative;
    transform: rotate(-1deg);
    background-image:
        radial-gradient(circle at 90% 10%, rgba(170,140,80,.08) 0 1px, transparent 1.5px),
        var(--paper-grain);
}
.hero-card::before {
    content: '';
    position: absolute;
    top: -16px; left: 32%;
    width: 110px; height: 26px;
    background: rgba(255, 245, 200, .55);
    border: 1px dashed rgba(120, 90, 50, .25);
    transform: rotate(-4deg);
    box-shadow: var(--shadow-tape);
}
.hero-card .leaf-deco {
    position: absolute;
    left: -28px; bottom: 18px;
    width: 70px; opacity: .55;
}
.hero-card .kicker {
    font-family: var(--font-head);
    font-size: 36px;
    line-height: 1; color: var(--text);
    margin-bottom: 4px;
}
.hero-card .title {
    font-family: var(--font-head);
    font-size: 76px;
    line-height: 1; color: var(--accent-alt);
    margin: 0 0 18px;
    font-style: italic;
    text-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.hero-card p { margin: 0 0 22px; color: var(--muted); font-size: 15px; line-height: 1.55; }

.hero-location {
    position: absolute;
    right: 6%;
    bottom: 14%;
    background: #f3e8ce;
    color: var(--text);
    padding: 18px 22px 16px;
    border-radius: 3px;
    box-shadow: var(--shadow-soft);
    max-width: 260px;
    font-size: 13px;
    transform: rotate(2deg);
    background-image: var(--paper-grain);
}
.hero-location::before {
    content: ''; position: absolute;
    top: -14px; left: 28%;
    width: 80px; height: 22px;
    background: rgba(255, 245, 200, .55);
    border: 1px dashed rgba(120, 90, 50, .25);
    transform: rotate(3deg);
}
.hero-location .pin { color: var(--accent-alt); margin-right: 4px; }
.hero-location .place { font-weight: 600; color: var(--text); display: block; margin-bottom: 4px; }

/* -------------------------------------------------------------------------
   Section header
   ------------------------------------------------------------------------- */
.section { padding: 70px 0; }
.section--tight { padding: 48px 0; }
.section--dark { background: var(--accent); color: #f7efd9; }
.section-title {
    font-family: var(--font-head);
    font-size: 30px;
    margin: 0 0 28px;
    display: inline-block;
    border-bottom: 2px solid var(--accent-alt);
    padding-bottom: 4px;
}

/* -------------------------------------------------------------------------
   Featured + grid (homepage middle row)
   ------------------------------------------------------------------------- */
.feature-row {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr;
    gap: 22px;
    align-items: stretch;
}
.feature-card {
    background: var(--card-green);
    color: #f7efd9;
    padding: 26px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 360px;
    position: relative;
    background-image: var(--paper-grain);
    transform: rotate(-0.5deg);
}
.feature-card .kicker {
    font-family: var(--font-head);
    font-size: 22px; opacity: .9;
    border-bottom: 1px solid rgba(255,255,255,.25);
    padding-bottom: 8px; margin-bottom: 14px;
}
.feature-card h3 {
    font-family: var(--font-head);
    color: #f7efd9;
    font-size: 42px;
    line-height: 1.05;
    margin: 0 0 16px;
}
.feature-card p { color: rgba(247,239,217,.85); font-size: 13px; }
.feature-card .read-link {
    margin-top: 16px;
    color: #f7efd9;
    font-size: 13px;
    display: inline-flex; gap: 6px; align-items: center;
}

.feature-photo {
    background: #efe6d2;
    padding: 14px 14px 38px;
    box-shadow: var(--shadow-soft);
    transform: rotate(1deg);
    position: relative;
    border-radius: 2px;
}
.feature-photo img { width: 100%; height: 240px; object-fit: cover; border-radius: 1px; }
.feature-photo .stamp {
    position: absolute;
    top: 18px; right: 18px;
    width: 78px; height: 78px;
    border: 1px solid rgba(0,0,0,.6);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-head);
    font-size: 13px;
    text-align: center;
    color: rgba(0,0,0,.65);
    line-height: 1.1;
    background: rgba(255, 245, 200, .4);
    transform: rotate(-8deg);
}

.notes-card {
    background: var(--surface);
    padding: 22px;
    border-radius: 4px;
    box-shadow: var(--shadow-soft);
    transform: rotate(-0.5deg);
}
.notes-card .label {
    font-family: var(--font-head);
    font-size: 24px;
    color: var(--text);
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(0,0,0,.08);
    padding-bottom: 6px;
}
.note-row {
    display: grid;
    grid-template-columns: 48px 1fr 20px;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0,0,0,.06);
    align-items: center;
}
.note-row:last-child { border-bottom: none; }
.note-row .icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: rgba(63,90,58,.08);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent);
    font-size: 20px;
}
.note-row strong { display: block; font-family: var(--font-body); font-size: 13px; }
.note-row small { color: var(--muted); font-size: 12px; }
.note-row .arrow { color: var(--muted); }

.quick-note {
    background: var(--card-orange);
    color: #f7efd9;
    padding: 26px;
    border-radius: 4px;
    min-height: 360px;
    display: flex; flex-direction: column; justify-content: space-between;
    transform: rotate(0.7deg);
    background-image: var(--paper-grain);
}
.quick-note .label {
    font-family: var(--font-head);
    font-size: 22px;
    border-bottom: 1px solid rgba(255,255,255,.25);
    padding-bottom: 8px;
}
.quick-note p { font-family: var(--font-head); font-size: 28px; line-height: 1.25; margin: 14px 0; }
.quick-note .treeline { opacity: .55; font-size: 56px; text-align: right; }

/* -------------------------------------------------------------------------
   Recent articles
   ------------------------------------------------------------------------- */
.section-header {
    display: flex; align-items: baseline; justify-content: space-between;
    margin-bottom: 22px;
}
.section-header h2 {
    font-family: var(--font-head);
    font-size: 30px;
    margin: 0;
}
.section-header a { color: var(--text); font-size: 13px; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.post-card {
    background: var(--surface);
    border-radius: 4px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 160px 1fr;
    box-shadow: var(--shadow-soft);
    transition: transform .2s;
}
.post-card:hover { transform: translateY(-2px); }
.post-card .img {
    background: #ddd center/cover no-repeat;
    min-height: 160px;
    position: relative;
}
.post-card .img .cat {
    position: absolute;
    top: 10px; left: 10px;
    background: rgba(63,90,58,.9);
    color: #f7efd9;
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.post-card .body { padding: 14px 16px; }
.post-card h3 {
    font-family: var(--font-body);
    font-size: 17px; font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
}
.post-card p { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.post-card .meta { color: var(--muted); font-size: 11px; display: flex; gap: 10px; }

/* -------------------------------------------------------------------------
   Snapshots strip
   ------------------------------------------------------------------------- */
.snapshots {
    background: var(--surface);
    padding: 50px 0;
}
.snapshots h2 {
    font-family: var(--font-head);
    font-size: 28px;
    margin: 0 0 22px;
}
.snap-strip {
    display: grid;
    grid-template-columns: 1.4fr repeat(4, 1fr) auto;
    gap: 16px;
    align-items: center;
}
.snap {
    aspect-ratio: 1 / 1;
    background: #ddd center/cover no-repeat;
    border-radius: 3px;
    box-shadow: var(--shadow-soft);
}
.snap--wide { aspect-ratio: 4 / 3; }
.snap-instagram {
    text-align: right;
    font-family: var(--font-head);
    font-size: 22px;
    color: var(--text);
    line-height: 1.2;
}
.snap-instagram a { color: var(--accent-alt); }

/* -------------------------------------------------------------------------
   Single post page
   ------------------------------------------------------------------------- */
.post-hero {
    position: relative;
    min-height: 320px;
    background: linear-gradient(180deg, rgba(20,18,16,.35), rgba(20,18,16,.55)),
                var(--post-hero-img, linear-gradient(135deg, #4b3520, #1a1411)) center/cover no-repeat;
    color: #f7efd9;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    padding: 80px 24px;
}
.post-hero h1 {
    font-family: var(--font-head);
    color: #f7efd9;
    font-size: 64px;
    max-width: 800px;
    line-height: 1;
    margin: 0 auto 14px;
}
.post-hero .meta { font-size: 13px; opacity: .85; }

.post-content {
    max-width: 720px;
    margin: 60px auto;
    padding: 0 24px;
    font-size: 17px;
    line-height: 1.8;
}
.post-content h2 { font-family: var(--font-head); font-size: 36px; margin-top: 1.4em; }
.post-content p, .post-content ul, .post-content ol { margin: 0 0 1em; }
.post-content img { border-radius: 4px; box-shadow: var(--shadow-soft); margin: 20px 0; }
.post-content blockquote {
    border-left: 3px solid var(--accent-alt);
    margin: 1.2em 0;
    padding: 6px 18px;
    color: var(--muted);
    font-style: italic;
}

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer {
    background: #2a2622;
    color: #d8cdb4;
    padding: 60px 0 30px;
}
.site-footer .row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 32px;
}
.site-footer h4 {
    font-family: var(--font-head);
    color: #f7efd9;
    font-size: 22px;
    margin: 0 0 12px;
}
.site-footer a { color: #d8cdb4; opacity: .8; }
.site-footer a:hover { opacity: 1; color: var(--accent-alt); }
.site-footer .bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 18px;
    margin-top: 36px;
    display: flex; justify-content: space-between;
    font-size: 12px;
    opacity: .7;
}

/* -------------------------------------------------------------------------
   Search overlay
   ------------------------------------------------------------------------- */
.search-overlay {
    position: fixed; inset: 0;
    background: rgba(20,18,16,.55);
    display: none;
    align-items: flex-start;
    justify-content: center;
    z-index: 100;
    padding-top: 14vh;
}
.search-overlay.is-open { display: flex; }
.search-overlay .panel {
    background: var(--bg);
    width: min(620px, 92vw);
    padding: 26px;
    border-radius: 6px;
    box-shadow: var(--shadow-soft);
    transform: rotate(-0.5deg);
}
.search-overlay input {
    width: 100%; padding: 14px 16px;
    border: 1px solid rgba(120,90,50,.25);
    border-radius: 4px;
    background: #fff;
    font: 15px var(--font-body);
    color: var(--text);
}

/* -------------------------------------------------------------------------
   Responsive
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .feature-row { grid-template-columns: 1fr; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .snap-strip { grid-template-columns: repeat(3, 1fr); }
    .snap-instagram { grid-column: 1 / -1; text-align: left; }
    .site-footer .row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .nav { display: none; }
    .nav.is-open { display: flex; flex-direction: column; gap: 14px; padding: 14px 0; }
    .hero .container { padding-top: 30px; padding-bottom: 40px; }
    .hero-card .title { font-size: 44px; }
    .hero-card .kicker { font-size: 26px; }
    .hero-location { position: static; margin-top: 22px; transform: rotate(0); max-width: none; }
    .cards-grid { grid-template-columns: 1fr; }
    .snap-strip { grid-template-columns: repeat(2, 1fr); }
    .site-footer .row { grid-template-columns: 1fr; }
    .feature-card h3, .post-hero h1 { font-size: 36px; }
}

/* -------------------------------------------------------------------------
   Dark mode (toggle from header)
   ------------------------------------------------------------------------- */
body.is-dark {
    --bg: #1c1a17;
    --surface: #25221e;
    --text: #ede2c8;
    --muted: #978a73;
    --accent: #7ea672;
    --accent-alt: #e08a55;
    background-image: radial-gradient(circle at 30% 40%, rgba(255,255,255,.02) 0 1px, transparent 1.5px);
}
body.is-dark .hero-card,
body.is-dark .hero-location,
body.is-dark .feature-photo,
body.is-dark .notes-card,
body.is-dark .post-card,
body.is-dark .quick-note,
body.is-dark .feature-card {
    background-color: #2a2622;
    color: #ede2c8;
}
body.is-dark .hero-card p,
body.is-dark .note-row small,
body.is-dark .post-card p,
body.is-dark .post-card .meta { color: #978a73; }
/* Header in dark mode: only goes opaque after scrolling off the hero */
body.is-dark .site-header { background: transparent; }
body.is-dark .site-header.is-scrolled { background: rgba(28,26,23,.86); }
body.is-dark .quick-note { color: #ede2c8; }