/* The photo site.
   Dark, because it is a page full of photographs and a white surround makes
   every one of them look wrong. Sized for a phone held at an event first; the
   desktop layout is what happens when there is room. */
:root {
    --bg: #11151d;
    --panel: #19202b;
    --panel-2: #1f2836;
    --line: #2b3546;
    --ink: #eef2f8;
    --muted: #9aa6b8;
    --brand: #f0b23c;
    --brand-ink: #1a1206;
    --ok: #4ade80;
    --bad: #f87171;
    --warn: #fbbf24;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
a { color: var(--brand); }
h1 { font-size: clamp(24px, 5vw, 34px); margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: clamp(18px, 3.4vw, 22px); margin: 28px 0 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 18px; color: var(--muted); max-width: 46ch; margin: 0 auto 22px; }

/* ------------------------------------------------------------- chrome --- */
.top {
    display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
    padding: calc(12px + var(--safe-top)) 18px 12px;
    background: var(--panel); border-bottom: 1px solid var(--line);
}
.top .brand { font-weight: 700; color: var(--ink); text-decoration: none; margin-right: auto; }
.top nav { display: flex; gap: 14px; flex-wrap: wrap; }
.top nav a { text-decoration: none; font-size: 14px; }
.wrap { flex: 1 1 auto; width: 100%; max-width: 1040px; margin: 0 auto; padding: 22px 16px 40px; }
.narrow { max-width: 460px; margin: 0 auto; }
.foot {
    display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap;
    padding: 16px 18px calc(16px + var(--safe-bottom));
    border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}

/* -------------------------------------------------------------- bits --- */
.card {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 14px; padding: 18px; margin: 0 0 16px;
}
.card.empty { text-align: center; padding: 36px 18px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
/* `search` was missing, which is why the two search boxes on the admin pages
   were the only white things on a dark site. */
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=search], input[type=tel], input[type=url],
select, textarea {
    width: 100%; padding: 12px 13px; font: inherit;
    background: var(--panel-2); color: var(--ink);
    border: 1px solid var(--line); border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
/* A tick box or a radio with its words beside it, rather than under it. The
   whole row is the label, so the words are part of the target — on a phone,
   a 14px circle on its own is not something to aim at. */
/* `.field label` is display:block and more specific than a bare class, so this
   has to out-specify it or the tick box lands on its own line above the words. */
.check-row, .field label.check-row {
    display: flex; gap: 10px; align-items: flex-start;
    cursor: pointer; margin-bottom: 4px; font-size: 14px; color: var(--ink);
}
.check-row input { width: auto; flex: none; margin-top: 3px; }
.check-row > span { display: block; font-size: 14px; color: var(--ink); }
.check-row .muted { display: block; margin-top: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.row > .field { flex: 1 1 180px; }

.btn {
    display: inline-block; border: 0; border-radius: 10px; cursor: pointer;
    background: var(--brand); color: var(--brand-ink);
    font: inherit; font-weight: 600; padding: 11px 18px; text-decoration: none;
    /* A tap target somebody can actually hit on a phone, one-handed. */
    min-height: 44px; line-height: 22px;
}
.btn.big { width: 100%; text-align: center; font-size: 17px; padding: 14px 18px; }
/* A button that fills its card, and a line of text under it that lines up with
   it — the sign-in and sign-up pages are one column of one thing each. */
.btn.block { display: block; width: 100%; }
.centre { text-align: center; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: 14px; }
.btn:active { transform: scale(0.98); }
.row .btn.big { flex: 1 1 180px; width: auto; }

.flash { border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; border: 1px solid var(--line); }
.flash-ok { background: #13291f; border-color: #1f5c40; color: #bbf7d0; }
.flash-error { background: #2a1519; border-color: #6b2b34; color: #fecaca; }
.flash-warning { background: #2a2314; border-color: #6b5320; color: #fde68a; }

.page-head { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------ landing --- */
.hero { text-align: center; padding: 22px 0 10px; }
.code-card { max-width: 420px; margin: 0 auto 18px; text-align: left; }
.code-card input {
    font: 700 24px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 2px; text-align: center; margin-bottom: 12px;
}
.pin-input {
    font: 700 22px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    letter-spacing: 6px; text-align: center;
}

/* ------------------------------------------------------------ galleries --- */
.shoot-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.shoot-card {
    background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
    overflow: hidden; text-decoration: none; color: var(--ink); display: block;
}
.shoot-card .shot {
    aspect-ratio: 4 / 3; background: #0c1017;
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.shoot-card .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shoot-card .shot .none { color: var(--muted); font-size: 13px; }
.shoot-card .meta { padding: 12px 14px; }
.shoot-card .when { font-weight: 600; }
.shoot-card .sub, .shoot-card .left { font-size: 13px; color: var(--muted); }
.shoot-card .left.bad { color: var(--bad); }
.shoot-card.gone { opacity: 0.55; }

.keep-note {
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; margin-bottom: 20px; font-size: 14px; color: var(--muted);
}

.feature figure { margin: 0; }
.feature img {
    max-width: 100%; height: auto; display: block; border-radius: 12px;
    border: 1px solid var(--line); background: #0c1017;
}
.feature .boomerang { max-width: 540px; }
.feature figcaption {
    display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 10px;
}

.photo-grid {
    display: grid; gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.photo { margin: 0; }
.photo img {
    width: 100%; height: auto; display: block; border-radius: 10px;
    border: 1px solid var(--line); background: #0c1017;
}
.photo figcaption { margin-top: 8px; }
/* A list that is a list of things, not a list of bullets. */
.plain { list-style: none; margin: 0 0 10px; padding: 0; }
.plain li { padding: 4px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
/* The thumbnail in the visits table: big enough to recognise a face in, small
   enough that forty rows still fit on a screen. */
.row-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; display: block; }
.row-thumbs { display: flex; gap: 4px; }

/* ------------------------------------------------------------ the admin ---
   A bar rather than nine cards down one scroll. */
.admin-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    border-bottom: 1px solid var(--line); margin: 0 0 18px; padding-bottom: 2px;
}
.admin-tabs a {
    padding: 9px 14px; border-radius: 10px 10px 0 0; text-decoration: none;
    color: var(--muted); font-size: 15px; font-weight: 600;
    border: 1px solid transparent; border-bottom: none;
}
.admin-tabs a:hover { color: var(--ink); background: var(--panel-2); }
.admin-tabs a.on {
    color: var(--ink); background: var(--panel);
    border-color: var(--line); margin-bottom: -3px; padding-bottom: 12px;
}

/* The wall: every photograph as a tile, square so the grid reads as a grid
   whatever shape the pictures are. */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.wall-tile { display: block; text-decoration: none; color: inherit; }
.wall-tile img {
    width: 100%; aspect-ratio: 1; object-fit: cover;
    border-radius: 10px; background: var(--panel-2); display: block;
}
.wall-tile:hover img { outline: 2px solid var(--brand); outline-offset: 2px; }
/* The corner of a page where things get deleted. Marked, so nobody lands on it
   by scrolling. */
.danger-card { border-color: rgba(107,43,52,.9); }
.wall-none {
    display: flex; align-items: center; justify-content: center;
    aspect-ratio: 1; border-radius: 10px; background: var(--panel-2);
    border: 1px dashed var(--line); color: var(--muted); font-size: 12px;
}
.wall-cap { display: block; font-size: 11.5px; line-height: 1.35; margin-top: 5px; }
.wall-cap .muted { display: block; }
.wall-event {
    display: block; color: var(--ink); font-weight: 600;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ------------------------------------------------------------- tables --- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.tag {
    display: inline-block; padding: 2px 8px; border-radius: 999px;
    font-size: 11.5px; border: 1px solid var(--line); color: var(--muted);
}
.tag.ok { color: var(--ok); border-color: #1f5c40; }
.tag.bad { color: var(--bad); border-color: #6b2b34; }
.tag.warn { color: var(--warn); border-color: #6b5320; }

.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 700; }
.grid { display: grid; gap: 12px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* A page of photographs on a phone is the whole point, so nothing above may
   drag the layout sideways. */
main, .wrap, .table-wrap { min-width: 0; }
img { max-width: 100%; }

/* ---------------------------------------------------------------- brand ---
   The school's logo, taken from the shop so there is one of them. It sits in
   the bar at a size that leaves the name readable beside it, and larger on the
   landing page, which is the one screen with room. */
.top .brand { display: flex; align-items: center; gap: 10px; }
.top .brand img { height: 30px; width: auto; display: block; }
.hero-logo { height: 74px; width: auto; margin: 0 auto 14px; display: block; }
.foot .staff { margin-left: auto; font-size: 12px; color: var(--muted); text-decoration: none; }
.foot .staff:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 420px) {
    .top .brand img { height: 26px; }
    .hero-logo { height: 58px; }
}

/* A logo drawn for a letterhead is a dark mark on transparency, and on these
   pages it vanishes. When the stored logo measures dark, it gets a light plate
   to sit on — which is the one change that works for every logo without asking
   anybody to supply a second version of theirs. */
.logo.plate, .hero-logo.plate {
    background: #fff; border-radius: 10px; padding: 5px 8px;
    box-shadow: 0 1px 0 rgba(255,255,255,.12);
}
.hero-logo.plate { padding: 10px 14px; border-radius: 14px; }
