/* Poenamo Fishing Club — simple black & white brochure site */

:root {
  --black: #111111;
  --ink: #1a1a1a;
  --grey: #6b6b6b;
  --line: #e2e2e2;
  --paper: #ffffff;
  --paper-2: #f6f6f4;
  --max: 1080px;
  --pad: clamp(1.25rem, 5vw, 3rem);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--black); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); }
h3 { font-size: 1.15rem; letter-spacing: 0.04em; }
/* headings carry hash-link ids; keep the target clear of the sticky header */
h1, h2, h3 { scroll-margin-top: 5.5rem; }

p { margin: 0 0 1rem; }
a { color: var(--ink); }

img { max-width: 100%; display: block; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--pad); }

.eyebrow {
  font-family: "Oswald", "Arial Narrow", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: var(--grey);
  margin: 0 0 0.75rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 2px solid var(--black);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.6rem var(--pad);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; flex-shrink: 0; }
.brand img { height: 44px; width: auto; }
.brand .brand-text {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 1rem;
  color: var(--black);
  line-height: 1;
}
.brand .brand-text span { display: block; font-size: 0.62rem; letter-spacing: 0.24em; color: var(--grey); }

.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.nav-links a {
  text-decoration: none;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  color: var(--ink);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { border-bottom-color: var(--black); }
/* items flagged desktopHide sit in the footer + mobile menu only, not the desktop bar */
.nav-links li.nav-desktop-hide { display: none; }
/* GDMNZ app: wordmark beside the brand on desktop (margin pushes the links right),
   a row with the app icon at the top of the mobile menu */
.nav-app { display: flex; align-items: center; margin-right: auto; padding-left: 1rem; border-left: 1px solid var(--line); }
.nav-app img { height: 24px; width: auto; display: block; }
.nav-links li.nav-app-item { display: none; }
.nav-app .nav-app-icon { display: none; height: 32px; border-radius: 22%; }
/* narrow desktop: the app icon instead of the wordmark, so the links still fit */
@media (max-width: 1080px) {
  .nav-app .nav-app-wordmark { display: none; }
  .nav-app .nav-app-icon { display: block; }
}

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--black);
  width: 44px; height: 40px;
  border-radius: 4px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: "";
  display: block;
  width: 20px; height: 2px;
  background: var(--black);
  position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 980px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 2px solid var(--black);
    padding: 0;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { display: block; }
  .nav-links li.nav-desktop-hide { display: block; }
  .nav-app { display: none; }
  .nav-links li.nav-app-item { display: block; }
  .nav-links .nav-app-item a { display: flex; align-items: center; gap: 0.8rem; }
  .nav-app-item img { width: 36px; height: 36px; border-radius: 22%; }
  .nav-app-item small {
    display: block;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    text-transform: none;
    letter-spacing: 0;
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--grey);
  }
  /* full-width rows: dividers line up with the panel edges, roomy touch targets */
  .nav-links a {
    display: block;
    padding: 1.1rem var(--pad);
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
  }
  .nav-links li:last-child a { border-bottom: 0; }
  .nav-links a:hover,
  .nav-links a[aria-current="page"] {
    border-bottom-color: var(--line);
    background: var(--paper-2);
    font-weight: 700;
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.92rem;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border: 2px solid var(--black);
  background: var(--black);
  color: #fff;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: #fff; color: var(--black); }
.btn.ghost { background: transparent; color: var(--black); }
.btn.ghost:hover { background: var(--black); color: #fff; }
.btn.on-dark { border-color: #fff; }
.btn.on-dark.ghost { color: #fff; }
.btn.on-dark.ghost:hover { background: #fff; color: var(--black); }

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(rgba(12,12,12,0.66), rgba(12,12,12,0.8)),
    url("/assets/hero-2.jpg") center / cover no-repeat;
  background-color: var(--black);
  color: #fff;
  text-align: center;
  padding: clamp(3rem, 10vw, 6rem) var(--pad);
}
.hero h1, .hero .lead { text-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.hero img.hero-logo { height: clamp(120px, 26vw, 190px); width: auto; margin: 0 auto 1.5rem; }
.hero h1 { color: #fff; letter-spacing: 0.04em; }
.hero p.lead { color: #cfcfcf; max-width: 40ch; margin: 0 auto 1.75rem; }
.hero .actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Sections ---------- */
section.block { padding: clamp(2.5rem, 7vw, 4.5rem) 0; }
section.block.alt { background: var(--paper-2); }
.section-head { max-width: 60ch; margin-bottom: 2rem; }

.grid { display: grid; gap: 1.25rem; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 760px) { .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; } }

.card {
  border: 2px solid var(--black);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: #fff;
}
.card h3 { margin-bottom: 0.25rem; }
.card .card-link {
  margin-top: auto;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: 2px solid var(--black);
  align-self: flex-start;
  padding-top: 0.5rem;
}

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.gallery img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
/* justified rows (photos.js): boxes are positioned in px at each photo's own shape */
.gallery.is-justified { display: block; position: relative; }
.gallery.is-justified a.gallery-item { position: absolute; margin: 0; overflow: hidden; }
.gallery.is-justified img { aspect-ratio: auto; width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 760px) { .gallery { grid-template-columns: repeat(2, 1fr); } }

/* Partner/home logo floated beside the prose (e.g. Pat's Garage on About).
   .home-block contains the float so it can't spill into the next section. */
.home-block { display: flow-root; }
.home-logo { float: left; margin: 0.2rem 1.25rem 0.5rem 0; }
.home-logo img { height: 110px; width: auto; }
@media (max-width: 480px) {
  .home-logo { margin-right: 1rem; }
  .home-logo img { height: 84px; }
}

/* ---------- Sponsors ---------- */
.sponsors { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.sponsor {
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem; min-height: 120px;
  border: 1px solid var(--line); background: #fff; text-decoration: none;
  transition: box-shadow 0.15s, transform 0.15s;
}
a.sponsor:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }
.sponsor img { max-height: 72px; max-width: 100%; width: auto; object-fit: contain; }
/* square logos read small at the shared height — give Maddren more room */
.sponsor img[alt="Maddren Homes"] { max-height: 104px; }
@media (max-width: 900px) { .sponsors { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .sponsors { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Tables (calendar, pricing, leaderboards) ---------- */
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.5rem;
}
table.data caption {
  text-align: left;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 1.05rem;
  padding-bottom: 0.5rem;
}
table.data th, table.data td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data thead th {
  border-bottom: 2px solid var(--black);
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.85rem;
}
table.data tbody tr:hover { background: var(--paper-2); }
table.data tfoot td { border-top: 2px solid var(--black); border-bottom: 0; font-family: "Oswald", sans-serif; font-size: 1.05rem; }
table.data td.rank { font-family: "Oswald", sans-serif; font-size: 1.1rem; width: 3rem; }
.ladder-toggle { font-size: 0.8rem; padding: 0.4rem 0.9rem; margin: -0.75rem 0 1.5rem; }

/* Results index cards */
.year-filter { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 1.5rem; }
.yf-btn {
  font: inherit; line-height: 1; cursor: pointer;
  border: 2px solid var(--black); background: #fff; color: var(--black);
  padding: 0.4rem 0.85rem; border-radius: 999px;
}
.yf-btn:hover { background: var(--paper-2); }
.yf-btn.is-active { background: var(--black); color: #fff; }
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 300px));
  gap: 1.25rem;
}
.result-card {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--black);
  background: #fff;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.result-card:hover { transform: translateY(-3px); box-shadow: 0 6px 18px rgba(0,0,0,0.12); }
.result-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 2px solid var(--black); }
.result-card .rc-placeholder { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 4 / 3; background: var(--paper-2); border-bottom: 2px solid var(--black); }
.result-card .rc-placeholder svg { width: 34%; max-width: 90px; color: #c7c7c2; }
.result-card .rc-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1 1 auto; }
.result-card h3 { margin: 0; }
.result-card .rc-date { color: var(--grey); font-size: 0.9rem; }
.result-card .card-link { margin-top: auto; align-self: flex-start; }

/* Winning-catch photo on the results archive */
.result-photo { margin: 1.5rem 0; max-width: 420px; }
.result-photo img { width: 100%; height: auto; border: 1px solid var(--line); }
.result-photo figcaption { font-size: 0.85rem; color: var(--grey); margin-top: 0.5rem; }
.result-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.75rem; margin: 0 0 1.5rem; }
.result-photos img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--line); }

/* Key–value detail table (competition pages) */
table.data.kv th {
  width: 12rem;
  white-space: nowrap;
  font-family: "Oswald", sans-serif;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* Keep the date and competition-name columns on a single line each */
table.comps td:nth-child(1), table.comps th:nth-child(1),
table.comps td:nth-child(2), table.comps th:nth-child(2) { white-space: nowrap; }
/* Stop the details column being squeezed on mobile — table scrolls horizontally instead */
table.comps { min-width: 620px; }

/* Status pill (e.g. Postponed) */
.pill {
  display: inline-block;
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.66rem;
  line-height: 1;
  padding: 0.32em 0.62em;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 0.45rem;
  background: var(--black);
  color: #fff;
  white-space: nowrap;
}

/* ---------- Pricing ---------- */
.price { font-family: "Oswald", sans-serif; font-size: 1.6rem; }
.notice {
  border-left: 4px solid var(--black);
  background: var(--paper-2);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.notice strong { font-family: "Oswald", sans-serif; letter-spacing: 0.04em; }
/* Danger variant: the one red thing on the site, for "you must do this" warnings */
.notice.danger { border-left-color: #c62828; background: #fdecea; color: #5f1212; }
.notice.danger strong { color: #c62828; }

/* Downloadable forms list */
.forms { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; }
.forms li a {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border: 2px solid var(--black); padding: 1rem 1.25rem; text-decoration: none;
  font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.95rem;
}
.forms li a:hover { background: var(--black); color: #fff; }
.forms li a .tag { font-size: 0.75rem; letter-spacing: 0.1em; color: var(--grey); }
.forms li a:hover .tag { color: #cfcfcf; }

/* App Store / Google Play badges (GDMNZ app) */
.store-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 1.5rem 0; }
.store-badges img { height: 54px; width: auto; }

/* GDMNZ app icon + wordmark at the top of /gdmnz/, so people recognise it in the stores */
.app-brand { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem; margin-bottom: 1.5rem; }
.app-brand-icon { width: 96px; height: 96px; border-radius: 22%; }
.app-brand-wordmark { width: 300px; max-width: 100%; height: auto; }

/* Numbered how-to steps (GDMNZ page) */
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1.5rem; max-width: 65ch; }
.steps > li { counter-increment: step; display: grid; grid-template-columns: 2.5rem 1fr; gap: 1rem; }
.steps > li::before {
  content: counter(step);
  display: grid; place-items: center; width: 2.5rem; height: 2.5rem;
  background: var(--black); color: #fff;
  font-family: "Oswald", sans-serif; font-weight: 600; font-size: 1.3rem;
}
.steps h3 { margin: 0.55rem 0 0.4rem; }
.steps p:last-child { margin-bottom: 0; }

/* Embed slot */
.embed {
  border: 2px dashed var(--grey);
  padding: 2rem;
  text-align: center;
  color: var(--grey);
  background: var(--paper-2);
}
.embed iframe { width: 100%; border: 0; min-height: 700px; }

/* Live embedded form (e.g. Google Form) */
.form-embed { max-width: 700px; margin: 0 auto; }
.form-embed iframe { display: block; width: 100%; border: 0; }

.page-head {
  border-bottom: 2px solid var(--black);
  padding: clamp(2rem, 6vw, 3.5rem) 0 1.5rem;
}
.page-head .eyebrow { margin-bottom: 0.5rem; }

.prose { max-width: 65ch; }
.prose h2 { margin-top: 2rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--black);
  color: #cfcfcf;
  padding: 3rem 0 2rem;
  margin-top: 2rem;
}
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; } }
.site-footer img { height: 60px; margin-bottom: 1rem; }
.site-footer h4 {
  font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.1em;
  color: #fff; font-size: 0.85rem; margin: 0 0 0.75rem;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.footer-bottom {
  border-top: 1px solid #333; margin-top: 2rem; padding-top: 1.25rem;
  font-size: 0.82rem; color: var(--grey); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem;
}

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: #fff; color: #000; padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Committee gallery manager (/manage/) ---------- */
.upload-form { display: grid; gap: 0.75rem; max-width: 560px; margin-bottom: 2.5rem; }
.upload-form label { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; }
.file-drop { display: block; border: 2px dashed var(--black); padding: 1.5rem; text-align: center; cursor: pointer; background: var(--paper-2); }
.file-drop input { display: block; margin: 0 auto 0.5rem; max-width: 100%; }
.upload-form input[type="text"] { padding: 0.6rem 0.75rem; border: 2px solid var(--black); font: inherit; }
.upload-form .btn { justify-self: start; }
.status { min-height: 1.5em; color: var(--grey); }
.status.is-error, .is-error { color: #b00020; }

/* ---------- Public gallery (/gallery/ and the homepage grid) ---------- */
.gallery a.gallery-item { display: block; background: var(--paper-2); }
.gallery a.gallery-item img { transition: transform 0.2s, opacity 0.2s; }
.gallery a.gallery-item:hover img, .gallery a.gallery-item:focus-visible img { opacity: 0.88; }
.gallery a.gallery-item:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }
.gallery-group { margin-bottom: 2.75rem; }
.gallery-group h2 { margin-bottom: 0.15rem; }
.gallery-count { color: var(--grey); font-size: 0.9rem; margin: 0 0 0.9rem; }
.gallery-loading { color: var(--grey); }
/* PhotoSwipe caption (registered as a custom UI element in photos.js) */
.pswp__pfc-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2rem 1.25rem 1rem; text-align: center; color: #fff; font-size: 1rem; line-height: 1.4; background: linear-gradient(transparent, rgba(0,0,0,0.65)); pointer-events: none; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.pswp__pfc-caption[hidden] { display: none; }
.tile-check { display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; margin: 0.15rem 0 0.4rem; }
.tile-check input { margin: 0; width: 1rem; height: 1rem; accent-color: var(--black); }
.upload-form .upload-check { font-family: inherit; text-transform: none; letter-spacing: 0; font-size: 0.95rem; }

/* Featured (principal) sponsor: one big tile above the sponsor grid */
.sponsor-featured {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 1.75rem;
  padding: 1.5rem 2rem; margin-bottom: 1.25rem;
  border: 2px solid var(--black); background: #fff; text-decoration: none; color: var(--ink);
  transition: box-shadow 0.15s, transform 0.15s;
}
a.sponsor-featured:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.12); transform: translateY(-2px); }
.sponsor-featured img { height: 150px; width: auto; }
.sponsor-featured .eyebrow { display: block; margin-bottom: 0.35rem; }
.sponsor-featured strong { display: block; font-family: "Oswald", sans-serif; text-transform: uppercase; font-size: 1.6rem; letter-spacing: 0.03em; line-height: 1.1; margin-bottom: 0.35rem; }
.sponsor-featured .sf-blurb { display: block; color: var(--grey); }
@media (max-width: 560px) {
  .sponsor-featured { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 1.25rem; }
  .sponsor-featured img { height: 110px; }
}

/* manage: TV layout editor (collage pages per tv: label, drag photos between pages) */
.tv-editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin: 0 0 1rem; }
.tv-editor-bar label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; }
.tv-editor-bar select { font: inherit; font-size: 0.9rem; padding: 0.35rem 0.5rem; border: 1px solid var(--black); background: #fff; }
.tv-editor-bar .btn.small { font-size: 0.8rem; padding: 0.45rem 0.9rem; }
.tv-editor-bar .status { margin: 0; flex-basis: 100%; }
.tv-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1.25rem; }
.tv-page { border: 2px solid var(--black); background: #fff; }
.tv-page.is-over { outline: 3px solid var(--black); outline-offset: 3px; }
.tv-page-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--line); font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.8rem; }
.tv-page-head .muted { color: var(--grey); }
.tv-page-head .spacer { margin-left: auto; }
.tv-page-head .btn.small { margin: 0; font-size: 0.8rem; padding: 0.2rem 0.55rem; }
.tv-canvas { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; touch-action: none; }
.tv-canvas.is-empty::after { content: "Drop photos here"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #888; font-size: 0.9rem; }
.tv-tile { position: absolute; overflow: hidden; background: #222; cursor: grab; user-select: none; -webkit-user-select: none; }
.tv-tile:active { cursor: grabbing; }
.tv-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.tv-tile.is-dragging { opacity: 0.35; }
.tv-tile.is-before { box-shadow: inset 5px 0 0 #fff; }
.tv-tile.is-after { box-shadow: inset -5px 0 0 #fff; }
.tv-ghost { position: fixed; z-index: 50; width: 110px; aspect-ratio: 4 / 3; object-fit: cover; transform: translate(-50%, -50%); box-shadow: 0 6px 20px rgba(0,0,0,0.4); opacity: 0.9; pointer-events: none; border: 2px solid #fff; }

/* manage: album cards, album view, settings dialog */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.album-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; border: 2px solid var(--black); background: #fff; padding: 0; font: inherit; text-align: left; cursor: pointer; }
.album-card:hover .album-cover img { transform: scale(1.03); }
.album-cover { aspect-ratio: 3 / 2; background: #111; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; transition: transform 0.2s ease; }
.album-cover.is-empty { background: #f1f1f1; color: var(--grey); font-size: 0.85rem; }
.album-cover.is-new { background: #fff; border-bottom: 2px dashed var(--line); color: var(--grey); }
.album-cover.is-new .ico { width: 2.6rem; height: 2.6rem; margin: 0; stroke-width: 1.5; }
.album-card-new { border-style: dashed; }
.album-cover.is-icon { background: #e6e6e6; color: var(--grey); }
.album-cover.is-icon .ico { width: 2.6rem; height: 2.6rem; margin: 0; stroke-width: 1.5; }
.album-card-body { padding: 0.6rem 0.75rem 0.7rem; display: flex; flex-direction: column; gap: 0.15rem; }
.album-card-body strong { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; font-size: 1.05rem; }
.album-card-body span { font-size: 0.85rem; color: var(--grey); }
.album-badges { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.25rem; }
.album-badges i { font-style: normal; border: 1px solid var(--black); font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem; padding: 0.1rem 0.4rem; color: var(--black); }
.album-badges i.off { border-color: var(--line); color: var(--grey); }
.back-link { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; text-decoration: none; color: var(--black); }
.album-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.album-head h2 { margin: 0; }
.album-head .album-meta { color: var(--grey); font-size: 0.9rem; margin: 0; }
.album-head .btn.small { margin-left: auto; font-size: 0.8rem; padding: 0.45rem 0.9rem; }
.album-dialog { border: 2px solid var(--black); padding: 0; max-width: 32rem; width: calc(100% - 2rem); }
.album-dialog::backdrop { background: rgba(0,0,0,0.55); }
.album-dialog form { padding: 1.5rem; display: grid; gap: 0.9rem; }
.album-dialog h3 { margin: 0; }
.album-dialog label.field { display: grid; gap: 0.25rem; font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.album-dialog label.field input { padding: 0.6rem 0.75rem; border: 2px solid var(--black); font: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; text-transform: none; letter-spacing: 0; }
.album-dialog .tile-check { font-size: 0.95rem; margin: 0; }
.album-dialog fieldset { border: 1px solid var(--line); padding: 0.6rem 0.75rem 0.7rem; margin: 0; display: grid; gap: 0.4rem; }
.album-dialog legend { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; color: var(--grey); padding: 0 0.3rem; }
.album-dialog fieldset label { display: flex; gap: 0.45rem; align-items: flex-start; font-size: 0.9rem; }
.album-dialog fieldset input { margin-top: 0.2rem; accent-color: var(--black); }
.album-dialog fieldset small { display: block; color: var(--grey); }
.dialog-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.dialog-actions .spacer { flex: 1; }
.dialog-actions .btn.small { font-size: 0.8rem; padding: 0.45rem 0.9rem; }
.dialog-actions .btn.is-armed { background: #b00020; border-color: #b00020; color: #fff; }

/* manage: album view header, bare photo tiles with select + cog, bulk bar, dialogs */
[hidden] { display: none !important; } /* the hidden attribute wins over display rules (bulk bar, dialog fieldsets) */
.ico { width: 1.05em; height: 1.05em; vertical-align: -0.2em; margin-right: 0.35em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.album-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-left: auto; }
.album-actions .btn.small { font-size: 0.8rem; padding: 0.45rem 0.9rem; margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.6rem; }
.photo { position: relative; aspect-ratio: 1; background: #111; overflow: hidden; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: 3px solid transparent; outline-offset: -3px; }
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; pointer-events: none; }
.photo.is-dragging { opacity: 0.5; outline-color: var(--black); outline-style: dashed; }
.photo.is-selected { outline-color: var(--black); }
.photo.is-selected::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,0.25); pointer-events: none; }
.photo-select { position: absolute; top: 0.4rem; left: 0.4rem; z-index: 2; width: 1.6rem; height: 1.6rem; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.92); border: 1px solid var(--black); cursor: pointer; }
.photo-select input { margin: 0; width: 1rem; height: 1rem; accent-color: var(--black); cursor: pointer; }
.photo-cog { position: absolute; top: 0.4rem; right: 0.4rem; z-index: 2; width: 1.8rem; height: 1.8rem; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.92); border: 1px solid var(--black); color: var(--black); cursor: pointer; padding: 0; }
.photo-cog .ico { margin: 0; width: 1.05rem; height: 1.05rem; }
.photo-cog:hover { background: var(--black); color: #fff; }
.photo-foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.4rem 0.5rem 0.4rem; display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; background: linear-gradient(transparent, rgba(0,0,0,0.7)); pointer-events: none; }
.photo-foot:empty { display: none; }
.photo-pills { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.photo-pills:empty { display: none; }
.photo-pills i { font-style: normal; background: var(--black); color: #fff; font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.62rem; padding: 0.1rem 0.4rem; }
.photo-pills i.off { background: rgba(255,255,255,0.92); color: var(--black); }
.photo-caption { max-width: 100%; font-size: 0.72rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.select-bar { position: sticky; top: 0.5rem; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; padding: 0.6rem 0.9rem; margin: 1rem 0; background: var(--black); color: #fff; transition: opacity 0.15s; }
.select-bar.is-idle { opacity: 0.55; }
.select-bar.is-idle strong { font-weight: 500; }
.select-bar button:disabled, .select-bar select:disabled { cursor: default; }
.select-bar .btn.small:not(.ghost) { background: #fff; color: var(--black); border-color: #fff; }
.select-bar .btn.small:not(.ghost):hover { background: #ddd; border-color: #ddd; }
.select-bar .select-all { display: inline-flex; align-items: center; gap: 0.35rem; font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; cursor: pointer; padding-right: 0.5rem; border-right: 1px solid #555; }
.select-bar .select-all input { margin: 0; width: 1rem; height: 1rem; accent-color: #fff; cursor: pointer; }
.select-bar #selectCount { min-width: 6.5rem; font-variant-numeric: tabular-nums; }
.select-bar .bar-status { margin-left: auto; font-size: 0.85rem; color: #bbb; }
.select-bar .bar-status.is-error { color: #ff8a80; }
.album-head { margin-bottom: 0; }
.select-bar label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.select-bar select { font: inherit; font-size: 0.9rem; padding: 0.3rem 0.45rem; border: 1px solid #fff; background: #fff; color: var(--black); }
.select-bar .btn.small { font-size: 0.8rem; padding: 0.4rem 0.9rem; margin: 0; }
.select-bar .btn.ghost { color: #fff; border-color: #fff; }
.select-bar .btn.ghost:hover { background: #fff; color: var(--black); }
.select-bar .btn.is-armed { background: #b00020; border-color: #b00020; color: #fff; }
.album-dialog .file-drop { margin: 0; }
.album-dialog .prose.small { font-size: 0.85rem; color: var(--grey); margin: 0; }
.photo-dialog { max-width: 30rem; }
.photo-dialog #photoPreview { width: 100%; max-height: 40vh; object-fit: contain; background: #111; display: block; }
.photo-dialog label.field select { padding: 0.5rem 0.6rem; border: 2px solid var(--black); font: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; text-transform: none; letter-spacing: 0; background: #fff; }
.dialog-row { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.dialog-row .btn.small { font-size: 0.8rem; padding: 0.35rem 0.8rem; margin: 0; font-family: inherit; }
.dialog-row select { padding: 0.35rem 0.5rem; border: 1px solid var(--line); font: inherit; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; text-transform: none; letter-spacing: 0; background: #fff; }
.dialog-row small { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; text-transform: none; letter-spacing: 0; color: var(--grey); }
.photo-dialog .muted { color: var(--grey); font-size: 0.8rem; }
/* manage: (i) help buttons next to headings, and the plain-content dialog body */
.with-info { display: flex; align-items: center; gap: 0.6rem; }
.info-btn { flex: none; width: 1.5rem; height: 1.5rem; border: 0; border-radius: 50%; background: none; color: var(--grey); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.info-btn .ico { margin: 0; width: 1.35rem; height: 1.35rem; }
.info-btn:hover { color: var(--black); }
.album-dialog .dialog-body { padding: 1.5rem; display: grid; gap: 0.9rem; }
.album-dialog .dialog-body .prose p { margin: 0 0 0.75rem; }
.album-dialog .dialog-body .prose p:last-child { margin-bottom: 0; }
