/* Cash's List — no build step required. */
:root {
    --cream: #fbf7f0;
    --paper: #ffffff;
    --ink: #24302b;
    --muted: #6b746f;
    --line: #e6dfd3;
    --pine: #1f4d3a;
    --pine-dark: #163a2b;
    --pine-soft: #e7f0ea;
    --berry: #b23a48;
    --berry-soft: #fbecee;
    --gold: #c99a2e;
    --gold-soft: #fbf3df;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(36, 48, 43, .06), 0 4px 16px rgba(36, 48, 43, .05);
    color-scheme: light;
}

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

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

body {
    margin: 0;
    background: var(--cream);
    color: var(--ink);
    font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, h3 {
    font-family: Georgia, "Times New Roman", serif;
    line-height: 1.2;
    margin: 0 0 .5rem;
    text-wrap: balance;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
a { color: var(--pine); }
a:hover { color: var(--pine-dark); }

/* Layout */
.site-header {
    background: var(--pine);
    color: #fff;
    border-bottom: 4px solid var(--berry);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand {
    color: #fff;
    text-decoration: none;
    font-family: Georgia, serif;
    font-size: 1.3rem;
    font-weight: bold;
    letter-spacing: .01em;
}
.brand:hover { color: #fff; }
.brand span { color: #f4c9cf; }
.site-nav { display: flex; gap: 1rem; align-items: center; }
.site-nav a, .site-nav button {
    color: #e5efe9;
    text-decoration: none;
    background: none;
    border: 0;
    font: inherit;
    cursor: pointer;
    padding: 0;
}
.site-nav a:hover, .site-nav button:hover { color: #fff; text-decoration: underline; }

.container { width: min(100% - 2rem, 880px); margin-inline: auto; padding-block: 1rem; }
.container--narrow { width: min(100% - 2rem, 440px); }
main.container { padding-block: 2rem 4rem; }

.stack > * + * { margin-top: 1.5rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row--between { justify-content: space-between; }
.muted { color: var(--muted); }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.small { font-size: .875rem; }
.center { text-align: center; }

/* Cards */
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}
.card--tight { padding: 1rem 1.25rem; }
.hero { text-align: center; padding-block: 1rem 1.5rem; }
.hero__ornament { font-size: 2rem; line-height: 1; margin-bottom: .5rem; }
.hero p { max-width: 36rem; margin-inline: auto; }

/* Flash messages */
.flash {
    border-radius: 10px;
    padding: .85rem 1.1rem;
    border: 1px solid;
}
.flash--status { background: var(--pine-soft); border-color: #bcd5c5; color: var(--pine-dark); }
.flash--warning { background: var(--gold-soft); border-color: #ecd9a6; color: #6b5310; }
.flash--error { background: var(--berry-soft); border-color: #efc2c8; color: #7d2230; }

/* Forms */
label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field + .field { margin-top: 1rem; }
.field-hint { font-weight: normal; color: var(--muted); font-size: .875rem; }
input[type=text], input[type=email], input[type=password], input[type=url], textarea {
    width: 100%;
    font: inherit;
    color: inherit;
    padding: .6rem .75rem;
    border: 1px solid #cfc6b8;
    border-radius: 9px;
    background: #fff;
}
textarea { min-height: 5.5rem; resize: vertical; }
input:focus, textarea:focus, .btn:focus-visible, summary:focus-visible {
    outline: 3px solid rgba(31, 77, 58, .35);
    outline-offset: 1px;
    border-color: var(--pine);
}
.checkbox { display: flex; gap: .5rem; align-items: flex-start; font-weight: normal; }
.checkbox input { margin-top: .3rem; width: 1.05rem; height: 1.05rem; accent-color: var(--pine); }
.error { color: var(--berry); font-size: .875rem; margin-top: .3rem; }
.form-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .form-grid--2 { grid-template-columns: 2fr 1fr; }
}
.form-grid .field + .field { margin-top: 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    font: inherit;
    font-weight: 600;
    padding: .6rem 1.1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
    white-space: nowrap;
}
.btn--primary { background: var(--pine); color: #fff; }
.btn--primary:hover { background: var(--pine-dark); color: #fff; }
.btn--berry { background: var(--berry); color: #fff; }
.btn--berry:hover { background: #962f3c; color: #fff; }
.btn--ghost { background: #fff; color: var(--pine); border-color: #c9d7ce; }
.btn--ghost:hover { background: var(--pine-soft); color: var(--pine-dark); }
.btn--danger { background: #fff; color: var(--berry); border-color: #efc2c8; }
.btn--danger:hover { background: var(--berry-soft); }
.btn--small { padding: .35rem .75rem; font-size: .875rem; }
.btn--block { width: 100%; }
.link-button {
    background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
    color: var(--pine); text-decoration: underline;
}
.link-button--danger { color: var(--berry); }
.inline-form { display: inline; margin: 0; }

/* Badges */
.badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: var(--pine-soft);
    color: var(--pine);
    vertical-align: middle;
}
.badge--open { background: var(--pine-soft); color: var(--pine); }
.badge--closed { background: #eee9e1; color: var(--muted); }
.badge--bought { background: #ebe7e0; color: #5f655f; }
.badge--writein { background: var(--gold-soft); color: #7a5c0f; }

/* Gift list (family view) */
.gift-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.gift {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.25rem;
}
.gift__top { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; }
.gift__title { font-size: 1.1rem; font-weight: 650; margin: 0; }
.gift__price { color: var(--muted); font-weight: 600; white-space: nowrap; }
.gift__notes { margin: .35rem 0 0; color: var(--muted); }
.gift__actions { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.gift--purchased {
    background: #f4f1ec;
    box-shadow: none;
    border-style: dashed;
}
.gift--purchased .gift__title { color: #8a8f8b; text-decoration: line-through; text-decoration-color: #b5b0a7; }
.gift--purchased .gift__notes, .gift--purchased .gift__price { color: #a2a6a2; }

details.reveal > summary { list-style: none; }
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal[open] > summary { display: none; }
.gift__actions details.reveal[open] { flex-basis: 100%; }
.reveal__panel {
    padding: 1rem;
    border-radius: 10px;
    background: var(--cream);
    border: 1px solid var(--line);
}

.section-title { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .9rem; }
.section-title h2 { margin: 0; }

/* Admin */
.list-cards { display: grid; gap: 1rem; }
.list-card { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; }
.list-card h2 { margin: 0 0 .25rem; }
.list-card h2 a { color: var(--ink); text-decoration: none; }
.list-card h2 a:hover { text-decoration: underline; }

.progress { height: 8px; background: #ece6dc; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--pine); border-radius: 999px; }

.share-box { background: var(--pine-soft); border-color: #c8dccf; }
.share-grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .share-grid { grid-template-columns: 1fr auto; align-items: end; } }
.share-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: #fff;
    border: 1px solid #c8dccf;
    border-radius: 9px;
    padding: .55rem .75rem;
    overflow-wrap: anywhere;
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
tr.is-purchased td { color: #8a8f8b; }
.cell-actions { white-space: nowrap; text-align: right; }
.cell-actions > * + * { margin-left: .5rem; }
.move-buttons { display: inline-flex; flex-direction: column; gap: 2px; }
.move-buttons button {
    border: 1px solid var(--line); background: #fff; border-radius: 6px;
    width: 1.75rem; height: 1.25rem; line-height: 1; cursor: pointer; color: var(--muted); font-size: .7rem;
}
.move-buttons button:hover:not(:disabled) { background: var(--pine-soft); color: var(--pine); }
.move-buttons button:disabled { opacity: .35; cursor: default; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }

.preview-banner {
    background: var(--gold-soft);
    color: #6b5310;
    text-align: center;
    padding: .5rem 1rem;
    font-size: .9rem;
    border-bottom: 1px solid #ecd9a6;
}

.site-footer { text-align: center; color: var(--muted); font-size: .85rem; padding-bottom: 2rem; }
