/* SA Photography: bold sport style (condensed uppercase headlines, coral from
   the logo) on a clean white page so the photos stay the colour. */
:root {
  --bg: #ffffff;
  --surface: #f5f6f7;
  --text: #14181d;
  --muted: #5f6873;
  --line: #e4e7ea;
  --accent: #e2553a;
  --accent-text: #ffffff;
  --danger: #b42318;
  --ok: #2f7d4f;
  --radius: 8px;
  --shadow: 0 1px 2px rgb(20 24 29 / 0.06), 0 6px 20px rgb(20 24 29 / 0.08);
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Segoe UI', sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
}

img { max-width: 100%; display: block; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---- Layout ---- */

.site-header,
.site-footer,
main {
  max-width: 1280px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 40px);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  border-bottom: 1px solid var(--line);
}
.brand { display: block; }
.brand img { height: 56px; width: auto; }
.site-nav { display: flex; gap: 24px; }
.site-nav a {
  font: 600 0.85rem/1 var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.site-nav a:hover { color: var(--text); }

.site-footer {
  display: grid;
  gap: 6px;
  padding-block: 40px 32px;
  margin-top: 56px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer p { margin: 0; max-width: 70ch; }

.status { color: var(--muted); padding-block: 48px; }
.error { color: var(--danger); }
.meta { color: var(--muted); font-size: 0.875rem; margin: 0; }

/* Headlines: the condensed sport face, always uppercase */
.headline {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 0.95;
  text-wrap: balance;
  margin: 0;
}
.section-label {
  font: 700 0.8rem/1 var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

/* ---- Buttons and forms ---- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: 600 0.95rem/1 var(--font);
  text-decoration: none;
  cursor: pointer;
}
.button:hover { border-color: var(--muted); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button.primary:hover { filter: brightness(1.06); }
.button.danger { color: var(--danger); }
.button:disabled { opacity: 0.6; cursor: progress; }
.button.small { min-height: 32px; padding: 4px 12px; font-size: 0.85rem; }

input, select {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  width: 100%;
}
input:focus-visible, select:focus-visible, .button:focus-visible, .tile:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
label { display: grid; gap: 4px; font-size: 0.875rem; color: var(--muted); }

/* ---- Home: latest event banner ---- */

.feature {
  position: relative;
  display: grid;
  align-content: end;
  min-height: clamp(280px, 48vw, 520px);
  margin-top: 24px;
  padding: clamp(20px, 4vw, 44px);
  border-radius: var(--radius);
  overflow: hidden;
  color: #ffffff;
  background: #14181d;
  text-decoration: none;
}
.feature img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.feature:hover img { transform: scale(1.02); }
.feature::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, rgb(10 12 15 / 0.85), rgb(10 12 15 / 0.15) 60%, transparent);
}
.feature > div { position: relative; z-index: 2; display: grid; gap: 10px; justify-items: start; }
.feature .headline { font-size: clamp(2.4rem, 7vw, 5rem); }
.feature p { margin: 0; color: rgb(255 255 255 / 0.85); font-weight: 500; }
.pill {
  padding: 4px 10px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-text);
  font: 700 0.75rem/1.2 var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.feature .button { margin-top: 6px; }

/* ---- Home: all events ---- */

.events-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 48px;
}
.months { display: flex; gap: 8px; flex-wrap: wrap; }
.months a {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font: 600 0.8rem/1.2 var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.months a:hover { color: var(--text); border-color: var(--muted); }

.month { scroll-margin-top: 24px; padding-top: 28px; }
.month > h2 { font-family: var(--display); font-weight: 700; font-size: 1.6rem; text-transform: uppercase; margin: 0; }

.folders {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 28px 18px;
  margin-top: 14px;
}
.folder { display: grid; gap: 4px; text-decoration: none; min-width: 0; }
.folder-cover {
  display: block;
  aspect-ratio: 4 / 3;
  margin-bottom: 8px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.folder-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.folder:hover .folder-cover img { transform: scale(1.03); }
.folder-name { font-family: var(--display); font-weight: 700; font-size: 1.35rem; line-height: 1.05; text-transform: uppercase; }
.folder-meta { font-size: 0.875rem; color: var(--muted); }
.folder-meta b { color: var(--accent); font-weight: 600; }

/* ---- One event ---- */

.day-view { display: grid; gap: 6px; padding-top: 24px; }
.back {
  font: 600 0.8rem/1 var(--font);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}
.back:hover { color: var(--text); }
.day-view .headline { font-size: clamp(2.2rem, 6vw, 3.8rem); margin-top: 14px; }
.day-view .folder-meta { font-size: 1rem; }
.how-to-buy { margin: 6px 0 0; max-width: 70ch; color: var(--muted); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 45vw), 1fr));
  gap: 10px;
  margin-top: 18px;
}

.tile {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
}
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s ease; }
.tile:hover img { transform: scale(1.03); }
.tile .tag {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgb(20 24 29 / 0.7);
  color: #ffffff;
  font: 600 0.8rem/1.4 var(--font);
}

/* ---- Photo viewer ---- */

.viewer {
  width: min(1200px, 100vw);
  max-width: 100vw;
  max-height: 100dvh;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
}
.viewer::backdrop { background: rgb(10 12 15 / 0.88); }
.viewer figure { margin: 0; }
.viewer-stage { position: relative; background: #0d0f12; }
.viewer img { width: 100%; max-height: calc(100dvh - 160px); object-fit: contain; }
.viewer figcaption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 20px;
}
.viewer h2 { margin: 0; font-family: var(--display); font-size: 1.4rem; font-weight: 700; text-transform: uppercase; line-height: 1.1; }
.viewer p { margin: 0; color: var(--muted); }
.viewer .buy { display: flex; align-items: center; gap: 16px; }
.viewer .price { font-family: var(--display); font-size: 1.6rem; font-weight: 700; }
.viewer .error { flex-basis: 100%; }

.viewer-close,
.viewer-nav {
  position: absolute;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgb(0 0 0 / 0.5);
  color: #ffffff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.viewer-close { top: 12px; right: 12px; }
.viewer-nav { top: 50%; transform: translateY(-50%); }
.viewer-nav.prev { left: 12px; }
.viewer-nav.next { right: 12px; }

/* ---- Simple message pages ---- */

.notice { max-width: 40rem; padding-block: 56px; display: grid; gap: 14px; justify-items: start; }
.notice .headline { font-size: clamp(2.4rem, 6vw, 3.6rem); }
.notice p { color: var(--muted); margin: 0; }
.order-card {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  margin-block: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.order-card img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; }
.order-card h2 { margin: 0 0 10px; font-family: var(--display); font-size: 1.4rem; text-transform: uppercase; }

/* ---- Admin ---- */

.panel {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-block: 16px;
}
.login { max-width: 24rem; margin: 48px auto; display: grid; gap: 14px; }
.login .headline { font-size: 2.4rem; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.tabs .button[aria-selected='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 200px;
  padding: 24px;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  cursor: pointer;
}
.dropzone.over { border-color: var(--accent); color: var(--text); }
.dropzone strong { color: var(--text); font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; }

.upload-list { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.upload-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 0.875rem; }
.upload-list progress { grid-column: 1 / -1; width: 100%; height: 6px; accent-color: var(--accent); }
.upload-list .done { color: var(--ok); }
.upload-list .failed { color: var(--danger); }

.admin-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 16px;
}
.photo-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
}
.photo-card img { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; border-radius: 4px; }
.photo-card.hidden-photo img { opacity: 0.45; }
.photo-card .meta { font-size: 0.8rem; }
.photo-card .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.photo-card .actions { display: flex; gap: 8px; justify-content: space-between; align-items: center; }
.photo-card .saved { font-size: 0.8rem; color: var(--ok); }

.admin-group {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.admin-group summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
}
.admin-group summary::-webkit-details-marker { display: none; }
.admin-group summary::before { content: '▸'; color: var(--muted); transition: transform 0.15s ease; }
.admin-group[open] summary::before { transform: rotate(90deg); }
.admin-group-name { font-family: var(--display); font-weight: 700; font-size: 1.2rem; text-transform: uppercase; }
.admin-group-covers { display: flex; gap: 4px; margin-left: auto; }
.admin-group-covers img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; }
.admin-group[open] .admin-group-covers { display: none; }
.admin-group-body { display: grid; gap: 16px; padding: 0 16px 16px; }
.event-name { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; }
.event-name label { flex: 1 1 260px; }
.event-name .saved { font-size: 0.8rem; color: var(--ok); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; }
td img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
