/* LyfeCaddie shared styles. Every page links this file; a page can still add
   its own <style> block for one-off layouts. */

:root {
    --bg: #faf7f0;
    --card: #ffffff;
    --text: #1f2a24;
    --muted: #5a6660;
    --accent: #2f6b45;        /* fairway green */
    --accent-strong: #1f4d31;
    --accent-soft: #e6f0e8;
    --sand: #c8893b;          /* bunker sand */
    --sand-soft: #f7ecdc;
    --border: #e4ddd0;
    --shadow: 0 10px 30px rgba(31, 42, 36, 0.07);
    --radius: 14px;
    /* One clean system sans everywhere (Segoe UI on Windows, SF on Apple), as on PFBytes */
    --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: var(--font-ui);
    --font-read: var(--font-ui);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #141a17;
        --card: #1c2420;
        --text: #e8ece9;
        --muted: #a3ada7;
        --accent: #7cc494;
        --accent-strong: #a6dcb7;
        --accent-soft: #22362a;
        --sand: #e0a860;
        --sand-soft: #33291c;
        --border: #2e3833;
        --shadow: none;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-ui);
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; }

a { color: var(--accent); }
a:hover { color: var(--accent-strong); }

img { max-width: 100%; height: auto; }

.wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header / footer ---------- */

.site-header {
    border-bottom: 1px solid var(--border);
    background: var(--card);
}

.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
}

.brand img { width: 30px; height: 30px; margin-right: 10px; }
.brand span { color: var(--accent); }

.site-nav { display: flex; gap: 18px; flex-wrap: wrap; }

.site-nav a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--accent); }

.site-footer {
    margin-top: 64px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

.site-footer .wrap {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-top: 22px;
    padding-bottom: 32px;
}

.site-footer a { color: var(--muted); }

/* ---------- Homepage ---------- */

.hero {
    padding: 56px 0 36px;
}

.hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sand);
    margin: 0 0 10px;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    max-width: 18ch;
}

.hero p.lead {
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 58ch;
    margin: 0;
}

.section-title {
    font-size: 1.5rem;
    margin: 56px 0 18px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
}

/* The newest article is featured across the full row */
.card-grid > .card:first-child {
    grid-column: 1 / -1;
    padding: 30px 32px;
}

.card-grid > .card:first-child h3 {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    margin: 14px 0 10px;
}

.card-grid > .card:first-child p { font-size: 1.05rem; max-width: 60ch; }

.card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.15s ease, border-color 0.15s ease;
}

a.card:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--text); }

.card h3 { margin: 10px 0 8px; font-size: 1.2rem; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.promise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}

.promise {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.promise strong { display: block; margin-bottom: 4px; }
.promise p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.empty-state {
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

/* ---------- Tags ---------- */

.tags { display: flex; gap: 6px; flex-wrap: wrap; }

.tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    text-decoration: none;
}

/* ---------- Article ---------- */

.post {
    max-width: 780px;
    margin: 32px auto 0;
    padding: 0 20px;
}

/* Article hero: colored banner with the title and an illustration.
   Set --hero-accent inline to give a post its own color. */
.post-hero {
    --hero-accent: var(--accent-hero, #2f6b45);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    min-height: 260px;
    padding: 32px 34px;
    margin: 0 0 36px;
    border-radius: var(--radius);
    color: #fff;
    background:
        radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.14), transparent 45%),
        linear-gradient(155deg, var(--hero-accent), color-mix(in srgb, var(--hero-accent) 70%, black 30%));
}

.post-hero-text { position: relative; z-index: 1; max-width: 500px; }

.post-hero h1 {
    font-size: clamp(1.9rem, 4.4vw, 2.7rem);
    line-height: 1.12;
    letter-spacing: -0.02em;
    margin: 14px 0 12px;
    color: #fff;
}

.post-hero .tag { background: rgba(255, 255, 255, 0.18); color: #fff; }
.post-hero .post-meta { color: rgba(255, 255, 255, 0.85); }
.post-hero .badge-tested { background: rgba(255, 255, 255, 0.18); color: #fff; border-color: rgba(255, 255, 255, 0.35); }

/* Decorative art sits in the bottom-right corner and fades in from the left */
.post-hero-art {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 340px;
    z-index: 0;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 40%);
    mask-image: linear-gradient(to right, transparent, #000 40%);
}
.post-hero-art svg { display: block; width: 100%; height: auto; }

.post-meta {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.post-body {
    font-family: var(--font-read);
    font-size: 1.1rem;
    line-height: 1.8;
}

.post-body h2 {
    font-size: 1.45rem;
    line-height: 1.3;
    color: var(--accent-strong);
    border-left: 4px solid var(--accent);
    padding-left: 14px;
    margin: 48px 0 16px;
}

.post-body h3 {
    font-size: 1.25rem;
    margin: 36px 0 10px;
}

.post-body p { margin: 0 0 22px; }
.post-body li { margin-bottom: 6px; }

/* Pull quote: the one line to remember */
.post-body blockquote {
    margin: 32px 0;
    padding: 6px 0 6px 22px;
    border-left: 5px solid var(--sand);
    font-size: 1.4rem;
    line-height: 1.45;
    font-weight: 650;
    color: var(--accent-strong);
}

/* "Field Tested" badge: only on posts where the author actually tried it */
.badge-tested {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-ui);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--sand-soft);
    color: var(--sand);
    border: 1px solid color-mix(in srgb, var(--sand) 35%, transparent);
}

/* "Field notes": the author's own test and results */
.field-notes {
    font-family: var(--font-ui);
    font-size: 1rem;
    background: var(--sand-soft);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 28px 0;
}

.field-notes h2 { margin-top: 0; font-size: 1.1rem; }

/* "Your Next Shot": the one action every post ends with */
.next-shot {
    font-family: var(--font-ui);
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-left: 6px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin: 48px 0 24px;
}

.next-shot .label {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--accent);
    margin: 0 0 6px;
}

.next-shot p { margin: 0; font-size: 1.08rem; line-height: 1.6; }

/* "From the Caddie Kit": a related checklist or tool */
.kit-link {
    font-family: var(--font-ui);
    display: flex;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    background: var(--card);
    margin: 0 0 24px;
}

.kit-link p { margin: 0; font-size: 0.98rem; }

.related {
    font-family: var(--font-ui);
    border-top: 1px solid var(--border);
    margin-top: 40px;
    padding-top: 20px;
}

.related h2 { font-size: 1.05rem; margin: 0 0 10px; }
.related ul { margin: 0; padding-left: 20px; }

/* ---------- Simple pages (about, privacy, 404) ---------- */

.page {
    max-width: 740px;
    margin: 40px auto 0;
    padding: 0 20px;
}

.page h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.2; margin: 0 0 16px; }
.page h2 { font-size: 1.25rem; margin: 32px 0 8px; }

/* ---------- Caddie Kit tools (public/kit/*) ---------- */

.tool {
    max-width: 780px;
    margin: 32px auto 0;
    padding: 0 20px;
}

.tool-head { margin: 0 0 28px; }
.tool-head .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sand);
    margin: 0 0 8px;
}
.tool-head h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 12px; }
.tool-head p { color: var(--muted); font-size: 1.08rem; margin: 0; max-width: 60ch; }
.tool-head p a { font-weight: 600; }

.tool-step {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    margin: 0 0 18px;
}

.tool-step > h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    margin: 0 0 6px;
}

.step-num {
    flex: none;
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--card);
    font-size: 0.9rem;
}

.tool-step > p.hint { color: var(--muted); margin: 0 0 14px; font-size: 0.97rem; }

.btn {
    font: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 9px 18px;
    border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--card);
    cursor: pointer;
}
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-soft); color: var(--accent-strong); }
.btn.small { padding: 5px 12px; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.field {
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    min-width: 0;
}
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Countdown timer */
.timer {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    margin: 4px 0 16px;
}
.timer-face {
    font-variant-numeric: tabular-nums;
    font-size: clamp(2.4rem, 8vw, 3.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--accent-strong);
}
.timer.done .timer-face { color: var(--sand); }
.timer-bar {
    height: 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    overflow: hidden;
    margin: 0 0 16px;
}
.timer-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.4s linear; }

/* Prompt / tip box */
.nudge {
    background: var(--sand-soft);
    border-radius: 10px;
    padding: 12px 16px;
    margin: 12px 0 0;
    font-size: 0.97rem;
}
.nudge strong { color: var(--sand); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }

.done-banner {
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-left: 6px solid var(--accent);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin: 0 0 18px;
}
.done-banner p { margin: 0; }
.done-banner strong { color: var(--accent-strong); }

.tool-note { color: var(--muted); font-size: 0.88rem; margin: 22px 0 0; }

[hidden] { display: none !important; }

@media print {
    .site-header, .site-footer, .btn, .btn-row, .no-print { display: none !important; }
    body { background: #fff; color: #000; }
    .tool-step { box-shadow: none; break-inside: avoid; }
}

@media (max-width: 640px) {
    .wrap, .post, .page, .tool { padding-left: 16px; padding-right: 16px; }
    .tool-step { padding: 18px; }
    .hero { padding-top: 36px; }
    .post { margin-top: 16px; }
    .post-hero { flex-direction: column; align-items: stretch; padding: 26px 22px 0; min-height: 0; }
    .post-hero-art { position: relative; width: auto; max-width: 340px; margin: 4px -22px 0 auto; }
    .post-body { font-size: 1.05rem; }
    .post-body h2 { font-size: 1.3rem; margin-top: 40px; }
    .post-body blockquote { font-size: 1.2rem; }
    .card-grid > .card:first-child { padding: 22px; }
}
