/* Ceramics Fundraiser — modern gallery styling */
:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --ink: #1d1c1a;
  --ink-2: #57534c;
  --ink-3: #8a857c;
  --line: #e4e0d8;
  --line-2: #d3cdc2;
  --accent: #c2410c;          /* Cal High orange, deepened for readable text and buttons */
  --school-orange: #ef5423;   /* Cal High orange (decorative) */
  --accent-ink: #ffffff;
  --ok: #3e6b4f;
  --ok-bg: #e7efe8;
  --warn: #9a6a12;
  --warn-bg: #f8eed8;
  --bad: #a23b2c;
  --bad-bg: #f8e3df;
  --info-bg: #e6ecf2;
  --info: #2e5476;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(29, 28, 26, .05), 0 8px 24px rgba(29, 28, 26, .06);
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 1180px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-variant-numeric: lining-nums; font-family: var(--serif); font-weight: 500; letter-spacing: -.01em; line-height: 1.15; margin: 0 0 .4em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.eyebrow { font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--radius);
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  font-weight: 500; font-size: .95rem; text-decoration: none; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
}
.btn:hover { background: #34322e; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(0,0,0,.04); border-color: var(--ink-3); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(.93); background: var(--accent); }
.btn-danger { background: transparent; color: var(--bad); border-color: #e3b9b2; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn-block { width: 100%; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: inherit; }

/* Forms */
label { display: block; font-size: .875rem; font-weight: 500; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: var(--radius); background: var(--surface);
}
textarea { min-height: 90px; resize: vertical; }
[aria-invalid=true] { border-color: var(--bad) !important; background: #fdf6f5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(29,28,26,.08); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
.req { color: var(--bad); }

/* Header */
.site-header { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand .school { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.brand .name { font-family: var(--serif); font-size: 1.45rem; font-weight: 500; }
.nav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav a, .nav button.navlink { text-decoration: none; padding: 8px 12px; border-radius: var(--radius); font-size: .92rem; color: var(--ink-2); background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button.navlink:hover { color: var(--ink); background: rgba(0,0,0,.04); }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.badge-count { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 600; align-items: center; justify-content: center; }
@media (max-width: 560px) {
  .brand .name { font-size: 1.2rem; }
  .nav a, .nav button.navlink { padding: 8px 8px; font-size: .88rem; }
  .nav .hide-sm { display: none; }
}

.banner { padding: 10px 20px; text-align: center; font-size: .9rem; }
.banner-demo { background: #2b2a27; color: #e9e4da; }
.banner-demo a, .banner-demo button { color: #fff; }
.banner-closed { background: var(--warn-bg); color: var(--warn); }

/* Hero */
.hero { padding: clamp(40px, 7vw, 88px) 0 clamp(28px, 4vw, 44px); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: end; }
.hero p.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 56ch; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; } }
.goal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.goal .amount { font-variant-numeric: lining-nums tabular-nums; font-family: var(--serif); font-size: 2.2rem; line-height: 1; }
.progress { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 14px 0 10px; }
.progress > span { display: block; height: 100%; background: var(--school-orange); border-radius: 4px; transition: width .6s ease; }

/* Filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; padding: 6px 0 26px; border-top: 1px solid var(--line); padding-top: 22px; align-items: center; }
.chip { border: 1px solid var(--line-2); background: transparent; border-radius: 999px; padding: 7px 14px; font-size: .86rem; cursor: pointer; color: var(--ink-2); min-height: 36px; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed=true] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Gallery grid */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 44px 28px; padding-bottom: 80px; }
@media (max-width: 560px) { .gallery { grid-template-columns: 1fr 1fr; gap: 28px 14px; } }
.card { text-decoration: none; display: block; }
.card .ph { position: relative; aspect-ratio: 4 / 5; background: #ece8e0; overflow: hidden; border-radius: 3px; }
.card .ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .ph img { transform: scale(1.03); }
.card.is-sold .ph img { opacity: .55; filter: grayscale(.4); }
.card .meta { padding-top: 14px; }
.card .title { font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; }
.card .artist { font-size: .88rem; color: var(--ink-2); margin-top: 2px; }
.card .price { font-size: .9rem; margin-top: 6px; }
@media (max-width: 560px) { .card .title { font-size: 1.1rem; } .card .artist, .card .price { font-size: .8rem; } }
.status { position: absolute; top: 12px; left: 12px; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; padding: 5px 9px; border-radius: 3px; background: rgba(255,255,255,.92); color: var(--ink); }
.status-held { background: var(--warn-bg); color: var(--warn); }
.status-sold { background: var(--ink); color: #fff; }
.status-left { background: rgba(255,255,255,.92); }

/* Piece detail */
.detail { display: grid; grid-template-columns: 1.15fr 1fr; gap: 56px; padding: 36px 0 90px; }
@media (max-width: 820px) { .detail { grid-template-columns: 1fr; gap: 28px; padding-top: 16px; } }
.detail .main-ph { aspect-ratio: 4 / 5; background: #ece8e0; overflow: hidden; border-radius: 3px; cursor: zoom-in; border: 0; padding: 0; width: 100%; }
.detail .main-ph img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 10px; margin-top: 12px; }
.thumbs button { width: 72px; aspect-ratio: 4/5; padding: 0; border: 1px solid transparent; border-radius: 3px; overflow: hidden; cursor: pointer; background: #ece8e0; }
.thumbs button[aria-current=true] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail .info { position: sticky; top: 100px; align-self: start; }
.detail .price-lg { font-size: 1.35rem; margin: 18px 0 4px; }
.qty { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.qty button { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 1.2rem; }
.qty input { width: 52px; text-align: center; border: 0; min-height: 44px; padding: 0; -moz-appearance: textfield; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--ink-2); text-decoration: none; font-size: .9rem; margin-top: 24px; }
.back:hover { color: var(--ink); }

.lightbox { position: fixed; inset: 0; background: rgba(20,19,17,.92); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-height: 92vh; max-width: 92vw; object-fit: contain; }

/* Panels & cart */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.page { padding: 36px 0 90px; }
.cart-grid { display: grid; grid-template-columns: 1fr 420px; gap: 40px; align-items: start; }
@media (max-width: 900px) { .cart-grid { grid-template-columns: 1fr; } }
.line-item { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line-item img { width: 76px; aspect-ratio: 4/5; object-fit: cover; border-radius: 3px; background: #ece8e0; }
.line-item .t { font-family: var(--serif); font-size: 1.2rem; line-height: 1.2; }
.totals { display: flex; justify-content: space-between; padding: 16px 0; font-size: 1.05rem; }
.note { background: var(--info-bg); color: var(--info); border-radius: var(--radius); padding: 12px 14px; font-size: .9rem; }
.note-warn { background: var(--warn-bg); color: var(--warn); }
.note-bad { background: var(--bad-bg); color: var(--bad); }
.note-ok { background: var(--ok-bg); color: var(--ok); }

.center-card { max-width: 440px; margin: 9vh auto; padding: 0 20px; text-align: center; }
.center-card .panel { text-align: left; margin-top: 26px; }
.empty { text-align: center; padding: 70px 20px; color: var(--ink-2); }

.footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-3); font-size: .85rem; }

/* Toasts */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); font-size: .92rem; transition: opacity .4s, transform .4s; }
.toast-error { background: var(--bad); }
.toast-ok { background: var(--ok); }
.toast.out { opacity: 0; transform: translateY(8px); }

.spinner { width: 28px; height: 28px; border: 2px solid var(--line-2); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── Admin ───────────── */
.admin body, body.admin { background: #f3f1ec; }
.admin-shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.admin-side { background: var(--ink); color: #cfc9be; padding: 22px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.admin-side .brand .name { color: #fff; font-size: 1.3rem; }
.admin-side .brand .school { color: #9c958a; }
.admin-nav { margin-top: 28px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: var(--radius); text-decoration: none; font-size: .93rem; color: #cfc9be; }
.admin-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.admin-nav a[aria-current=page] { background: rgba(255,255,255,.1); color: #fff; }
.admin-nav .badge-count { background: #e0a43a; color: #1d1c1a; }
.admin-side .foot { margin-top: auto; font-size: .82rem; }
.admin-side .foot a, .admin-side .foot button { color: #cfc9be; }
.admin-main { padding: 28px clamp(16px, 3vw, 40px) 80px; min-width: 0; }
.admin-main h1 { font-size: 2.1rem; }
.admin-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-top h1 { margin: 0; }
@media (max-width: 860px) {
  .admin-shell { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: static; height: auto; padding: 14px; min-width: 0; }
  .admin-nav { flex-direction: row; overflow-x: auto; margin-top: 12px; gap: 4px; }
  .admin-nav a { white-space: nowrap; gap: 6px; }
  .admin-side .foot { margin-top: 10px; }
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 22px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.tile .k { font-size: .8rem; color: var(--ink-3); }
.tile .v { font-family: var(--serif); font-size: 2rem; line-height: 1.1; margin-top: 6px; font-variant-numeric: lining-nums tabular-nums; }
.tile .s { font-size: .8rem; color: var(--ink-2); margin-top: 4px; }

.alert-new { background: #fff8e8; border: 1px solid #f0d9a4; border-radius: var(--radius); padding: 18px; margin-bottom: 22px; }
.alert-new h2 { font-size: 1.3rem; margin: 0 0 10px; }

table.list { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .92rem; }
table.list th { text-align: left; font-weight: 500; font-size: .78rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 12px 14px; border-bottom: 1px solid var(--line); background: #faf9f6; }
table.list td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: #faf8f4; }
table.list .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.unread-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #e0a43a; margin-right: 8px; vertical-align: middle; }
.thumb-sm { width: 44px; height: 55px; object-fit: cover; border-radius: 3px; background: #ece8e0; }

.pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill-new { background: #fdf0d3; color: #8a5a00; }
.pill-invoice_sent { background: var(--info-bg); color: var(--info); }
.pill-paid { background: var(--ok-bg); color: var(--ok); }
.pill-released { background: #ece9e3; color: var(--ink-2); }
.pill-overdue { background: var(--bad-bg); color: var(--bad); }
.pill-hidden { background: #ece9e3; color: var(--ink-2); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; text-decoration: none; color: var(--ink-2); font-size: .92rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a[aria-current=true] { color: var(--ink); border-bottom-color: var(--ink); font-weight: 500; }
.tabs .n { color: var(--ink-3); font-size: .8rem; margin-left: 4px; }

.order-grid { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
@media (max-width: 1000px) { .order-grid { grid-template-columns: 1fr; } }
dl.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; font-size: .93rem; }
dl.kv dt { color: var(--ink-3); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.timeline { list-style: none; padding: 0; margin: 0; font-size: .86rem; }
.timeline li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.section-title { font-family: var(--sans); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 12px; }

.photo-edit { display: flex; gap: 12px; flex-wrap: wrap; }
.photo-edit .ph { position: relative; width: 110px; aspect-ratio: 4/5; border-radius: 4px; overflow: hidden; background: #ece8e0; }
.photo-edit .ph img { width: 100%; height: 100%; object-fit: cover; }
.photo-edit .ph .ctrl { position: absolute; inset: auto 4px 4px 4px; display: flex; gap: 4px; justify-content: space-between; }
.photo-edit .ph .ctrl button { background: rgba(255,255,255,.92); border: 0; border-radius: 3px; font-size: .75rem; padding: 3px 6px; cursor: pointer; }
.photo-add { width: 110px; aspect-ratio: 4/5; border: 1.5px dashed var(--line-2); border-radius: 4px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: .82rem; color: var(--ink-2); cursor: pointer; padding: 8px; }
.photo-add:hover { border-color: var(--ink-3); color: var(--ink); }

.settings-section { margin-bottom: 22px; }
.settings-section h2 { font-size: 1.4rem; }
.pickup-row { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.pickup-row:last-child { border-bottom: 0; }

dialog { border: 0; border-radius: 10px; padding: 0; max-width: min(560px, 94vw); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,19,17,.45); }
dialog .dlg-body { padding: 24px; }
dialog .dlg-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 24px 24px; }

/* ───────────── Cal High branding ───────────── */
.school-band { background: #000; display: flex; justify-content: center; padding: 10px 16px; }
.school-band img { height: 64px; width: auto; max-width: 100%; object-fit: contain; }
@media (max-width: 560px) { .school-band img { height: 40px; } }
.logo { border-radius: 50%; background: #fff; object-fit: cover; }
.logo-sm { width: 72px; height: 72px; }
.logo-lg { width: 200px; height: 200px; margin: 0 auto 18px; box-shadow: var(--shadow); }
.brand-logo { flex-direction: row; align-items: center; gap: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.site-header { border-bottom: 3px solid var(--school-orange); }
@media (max-width: 560px) { .logo-sm { width: 52px; height: 52px; } }

.how { margin: 18px 0 14px; padding-left: 22px; color: var(--ink-2); }
.how li { margin: 4px 0; }

.save-alert { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: #fff4ec; border: 2px solid var(--school-orange); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 28px; }
.save-alert div { flex: 1; min-width: 240px; }
.next-steps p a { color: var(--accent); }
.guard { cursor: default; }

.print-only { display: none; }
.print-head { display: none; align-items: center; gap: 14px; margin-bottom: 18px; }

@media print {
  .no-print, .site-header, .footer, .banner, #toasts, .lightbox { display: none !important; }
  .print-only { display: block; }
  .print-head { display: flex !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .page { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }
  .panel { border: 1px solid #999; box-shadow: none; }
  .line-item img { width: 50px; }
  a { color: #000; }
  .next-steps a::after { content: ""; }
}

.pill-picked { background: #e3e8f4; color: #2e4476; }

.pickup-days { list-style: none; padding: 0; margin: 10px 0 8px; font-family: var(--serif); font-size: 1.5rem; line-height: 1.3; }
