/* whitacres.net — one small stylesheet, light and dark */
:root {
  --bg: #f7f5f1;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5d6570;
  --border: #e3dfd8;
  --accent: #2f6f5e;
  --accent-soft: #e4f0ec;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 16px rgb(0 0 0 / .05);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --surface: #1d2126;
    --text: #e8e6e3;
    --muted: #9aa3ad;
    --border: #2c3238;
    --accent: #7cc4ad;
    --accent-soft: #1f3530;
    --shadow: none;
  }
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }

header.site { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
header.site nav a { color: var(--muted); text-decoration: none; margin-left: 1.25rem; font-size: .95rem; }
header.site nav a:hover { color: var(--text); }

main { flex: 1; padding: 3.5rem 0 3rem; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .25rem; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 2.5rem; max-width: 36rem; }

.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.card {
  display: block;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card p { margin: 0; color: var(--muted); font-size: .97rem; }
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  margin-top: .8rem; padding: .15rem .55rem;
  font-size: .8rem; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border-radius: 999px;
}
.tag svg { width: .8rem; height: .8rem; }

.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }

footer.site { border-top: 1px solid var(--border); padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; }

.center { text-align: center; }
.big { font-size: 4rem; font-weight: 800; color: var(--accent); margin: 0; line-height: 1; }

/* ---- comics ---- */
nav[aria-label] a, .subnav a { text-decoration: none; }
header.site nav a[aria-current] { color: var(--text); font-weight: 600; }
.subnav { display: flex; flex-wrap: wrap; gap: .5rem; margin: -1.5rem 0 2rem; }
.subnav a { padding: .3rem .8rem; border-radius: 999px; color: var(--muted); border: 1px solid var(--border); font-size: .92rem; }
.subnav a[aria-current] { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.warn { color: #b3261e; }
@media (prefers-color-scheme: dark) { .warn { color: #ff8a80; } }
.notice { padding: .75rem 1rem; border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 10px; }
.notice.warn { border-color: currentColor; background: transparent; }

.jump { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: -1rem 0 2rem; font-size: .92rem; }
.jump a.missing { color: var(--muted); text-decoration: line-through; }

.comic { margin: 0 0 2.5rem; scroll-margin-top: 1rem; }
.comic header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.comic h2 a { color: var(--text); text-decoration: none; }
.comic h2 a:hover { color: var(--accent); }
.comic header .tag { margin-top: 0; }
.comic img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 8px; background: #fff; }
.unavailable { padding: 2rem 1rem; text-align: center; color: var(--muted); border: 2px dashed var(--border); border-radius: 10px; }

.picker ol { list-style: none; padding: 0; margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.picker li { display: flex; align-items: center; gap: .75rem; padding: .55rem .9rem; border-top: 1px solid var(--border); }
.picker li:first-child { border-top: 0; }
.picker label { flex: 1; cursor: pointer; }
.picker input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); vertical-align: -2px; margin-right: .35rem; }
.moves { display: flex; gap: .25rem; }
button { font: inherit; cursor: pointer; }
.moves button { width: 2rem; height: 2rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); }
.moves button:hover { border-color: var(--accent); color: var(--accent); }
button.primary { padding: .6rem 1.6rem; border: 0; border-radius: 10px; background: var(--accent); color: var(--surface); font-weight: 600; }

/* ---- family albums ---- */
.albums { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); }
.album-card { display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.album-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.album-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--border); }
.album-text { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem 1rem; }
.crumbs { margin: -1.5rem 0 1.5rem; font-size: .92rem; }
.crumbs:last-child { margin: 2rem 0 0; }
.album-date { margin: -.4rem 0 1rem; }
.download { font-weight: 600; }
.outro { margin-top: 2rem; color: var(--muted); }

figure { margin: 0; }
figcaption { font-size: .95rem; color: var(--muted); margin-top: .5rem; }
.gallery { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); }
.gallery figure:has(video), .pairs video { grid-column: 1 / -1; }
.photo { display: block; border-radius: 8px; overflow: hidden; background: var(--border); }
.photo img { display: block; width: 100%; height: auto; transition: transform .2s; }
.gallery .photo img { aspect-ratio: 1; object-fit: cover; }
.photo:hover img { transform: scale(1.03); }
video { display: block; width: 100%; max-height: 70vh; border-radius: 8px; background: #000; }

.pairs { display: grid; gap: 2.25rem; }
.pair-photos { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.pairs .single { max-width: 36rem; margin: 0 auto; }
@media (max-width: 34rem) { .pair-photos { grid-template-columns: 1fr; } }

.viewer-open { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; gap: .5rem;
  padding: 1rem; background: rgb(10 12 14 / .94); color: #eee; }
.viewer[hidden] { display: none; }
.viewer figure { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; max-height: 100%; }
.viewer img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; border-radius: 6px; }
.viewer figcaption { color: #ddd; max-width: 46rem; text-align: center; margin-top: .75rem; }
.v-meta { display: block; font-size: .85rem; color: #aaa; margin-top: .3rem; }
.v-meta a { color: #9fd9c6; }
.viewer button { flex: none; border: 0; background: rgb(255 255 255 / .1); color: #fff; border-radius: 999px; }
.viewer button:hover, .viewer button:focus-visible { background: rgb(255 255 255 / .22); }
.v-prev, .v-next { width: 3rem; height: 3rem; font-size: 2rem; line-height: 1; }
.v-close { position: absolute; top: .75rem; right: .75rem; width: 2.75rem; height: 2.75rem; font-size: 1.8rem; line-height: 1; }
@media (max-width: 40rem) { .v-prev, .v-next { position: absolute; bottom: 1rem; } .v-prev { left: 1rem; } .v-next { right: 1rem; }
  .viewer img { max-height: calc(100vh - 11rem); } }
.pair-photos .photo img { aspect-ratio: 4 / 3; object-fit: cover; }
.center-block { margin: 0 auto 2rem; }
.icon-big { width: 3.5rem; height: 3.5rem; }

/* ---- admin ---- */
.admin-area { margin: 2.5rem 0; }
.admin-area h2 { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .75rem; }
table.users { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table.users th, table.users td { text-align: left; padding: .6rem .9rem; border-top: 1px solid var(--border); vertical-align: top; }
table.users thead th { border-top: 0; font-size: .85rem; color: var(--muted); font-weight: 600; }
table.users .actions { text-align: right; }
.row-actions { display: flex; gap: .5rem; justify-content: flex-end; align-items: flex-start; flex-wrap: wrap; }
details summary { cursor: pointer; color: var(--accent); font-size: .92rem; }
details[open] summary { margin-bottom: .6rem; }
.adduser { margin-top: 1rem; }
.adduser summary { font-weight: 600; }
.pwform { display: grid; gap: .6rem; max-width: 22rem; text-align: left; }
.pwform label { display: grid; gap: .2rem; font-size: .92rem; }
.pwform label.check { display: flex; align-items: center; gap: .4rem; }
.pwform input[type=password], .pwform input:not([type]) { font: inherit; padding: .45rem .6rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg); color: var(--text); }
.pwform input:disabled { opacity: .5; }
.pwform button { justify-self: start; }
form.inline { display: inline; }
button.danger { padding: .35rem .8rem; border: 1px solid #b3261e; border-radius: 8px; background: transparent; color: #b3261e; font-size: .9rem; }
@media (prefers-color-scheme: dark) { button.danger { border-color: #ff8a80; color: #ff8a80; } }
.newpw { margin: .6rem 0 0; }
.newpw code { font-size: 1.05rem; padding: .15rem .45rem; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); user-select: all; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.pwform textarea { font: inherit; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--text); resize: vertical; }
.request { max-width: 26rem; }
.notice p { margin: .2rem 0; }
button.small-btn { padding: .35rem .9rem; font-size: .9rem; }
.requests table.users { border-color: var(--accent); }
.cards-note { margin-top: 1.25rem; }
.tag.area-family { color: #8a4b00; background: #fbecd9; }
@media (prefers-color-scheme: dark) { .tag.area-family { color: #ffc27a; background: #3a2a14; } }
.pwform fieldset.areas { margin: 0 0 .2rem; padding: .6rem .8rem .7rem; border: 1px solid var(--border); border-radius: 8px; display: grid; gap: .45rem; }
.pwform fieldset.areas legend { padding: 0 .3rem; font-size: .92rem; font-weight: 600; }
.pwform fieldset.areas label.check { align-items: flex-start; }
.pwform fieldset.areas input { margin-top: .25rem; }
.also { display: block; margin-top: .15rem; }

/* admin tools list (admin page) */
.admin-area.tools { margin-top: 0; }
.tool-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.tool-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem;
  padding: .7rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tool-list a { font-weight: 600; }
.tag.area-admin { color: #3b4fa8; background: #e3e8fa; }
@media (prefers-color-scheme: dark) { .tag.area-admin { color: #a9b8ff; background: #1f2747; } }
.tag.dash-view { color: var(--muted); background: transparent; border: 1px solid var(--border); }
.tag.dash-full { color: #9a3412; background: #fdebd8; }
@media (prefers-color-scheme: dark) { .tag.dash-full { color: #ffb37a; background: #3a2414; } }
/* admin: one users table with permission checkboxes */
.table-scroll { overflow-x: auto; }
table.perms th.perm, table.perms td.perm { text-align: center; width: 1%; padding-left: .6rem; padding-right: .6rem; }
table.perms th.perm { min-width: 5.5rem; max-width: 7rem; line-height: 1.25; }
table.perms td.perm input { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
table.perms td.perm input:disabled { opacity: .55; }
/* wide layout (admin, comics): a wider column than the reading pages */
body.wide .wrap { max-width: 72rem; }
body.wide .lead { max-width: 46rem; }
footer.site .account a { color: inherit; }
code.reset-link { word-break: break-all; user-select: all; }
