/* Photo News — the one stylesheet. The full look arrives in piece 2. */

:root {
  --red: #F40009;
  --black: #000;
  --white: #fff;
  --bar-height: 46px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--black);
  color: var(--white);
  font-family: system-ui, sans-serif;
}

/* ── The red bar ─────────────────────────────── */

.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--bar-height);
  display: flex; align-items: center;
  padding: 0 12px;
  background: var(--red);
  box-shadow: 0 2px 0 0 var(--white); /* the white rule under the bar */
}

.topbar-name { font-weight: 800; font-size: 1.1rem; letter-spacing: .01em; }

/* The four grid views. A plain first version; the proper look comes in piece 2. */
.views { margin-left: auto; display: flex; gap: 4px; }

.views button {
  font: inherit;
  font-size: .78rem;
  font-weight: 700;
  color: var(--white);
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, .6);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
}
.views button:hover { border-color: var(--white); }
.views button[aria-pressed="true"] { background: var(--white); color: var(--red); border-color: var(--white); }

@media (max-width: 420px) {
  .topbar-name { font-size: 1rem; }
  .views { gap: 3px; }
  .views button { padding: 4px 5px; font-size: .72rem; }
}

/* ── The page under the bar ──────────────────── */

.page { padding-top: calc(var(--bar-height) + 2px); }

/* ── The photo grid ──────────────────────────────
   grid.js places each photo into the shortest column, edge to edge. */

.grid { position: relative; width: 100%; }

.grid-item {
  position: absolute;
  display: block;
  overflow: hidden;
  cursor: pointer;
  background: #111; /* shows while a photo is still loading */
}

.grid-item img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}

/* A thin coloured outline on hover; grid.js gives each photo its colour. */
.grid-item::after {
  content: "";
  position: absolute; inset: 0;
  border: 2px solid var(--hover-colour, var(--white));
  opacity: 0;
  transition: opacity .15s ease;
  pointer-events: none;
}
.grid-item:hover::after,
.grid-item:focus-visible::after { opacity: 1; }
.grid-item:focus-visible { outline: none; }

/* Single view: no hover outline. */
.grid--single .grid-item:hover::after { opacity: 0; }

.grid-empty {
  text-align: center;
  padding: 96px 16px;
  font-size: 1.25rem;
  color: rgba(255, 255, 255, .85);
}

#grid-more { height: 1px; }

/* ── The waiting list (index.html) ───────────────
   The whole front page until launch. The old gate's look: brand red,
   white wordmark, one field. No JavaScript — after signing up, the
   visitor lands on /#joined, and :target swaps the form for the message. */

@font-face {
  font-family: "PN Cool";
  src: url("https://photonews.b-cdn.net/ass/fonts/coolfontblack.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

body.waitlist {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(64px, 11vh, 96px) 22px clamp(28px, 6vh, 48px);
  background: var(--red);
}

.waitlist-shell {
  width: 100%;
  max-width: 400px;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}

.waitlist-logo { display: block; width: 100%; height: auto; margin-bottom: 18px; }

/* Held to one line at any width: shrinks with the screen instead of
   wrapping. 15.9 is the title's width per 1px of font size — re-measure
   if the words change. */
.waitlist-title {
  font-family: "PN Cool", system-ui, sans-serif;
  font-size: min(24px, calc((100vw - 50px) / 15.9));
  font-weight: 900; letter-spacing: .02em; line-height: 1.15;
  text-transform: uppercase; white-space: nowrap;
  margin: 0;
}

.waitlist-form {
  width: 100%;
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 22px;
  text-align: left;
}

.waitlist-form label { font-size: .78rem; font-weight: 700; letter-spacing: -.01em; }

.waitlist-form input {
  width: 100%; padding: 11px 13px;
  font: inherit; font-size: 1rem; color: var(--white);
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .4); border-radius: 8px;
  outline: none; transition: border-color .15s, background .15s;
}
.waitlist-form input::placeholder { color: rgba(255, 255, 255, .65); }
.waitlist-form input:focus { border-color: var(--white); background: rgba(255, 255, 255, .22); }

.waitlist-form button {
  margin-top: 8px;
  width: 100%; padding: 13px 16px;
  border: none; border-radius: 9px;
  background: var(--white); color: var(--red);
  font: inherit; font-size: .95rem; font-weight: 800; letter-spacing: -.01em;
  cursor: pointer; transition: opacity .12s;
}
.waitlist-form button:hover { opacity: .9; }
.waitlist-form button:focus-visible { outline: 2px solid var(--white); outline-offset: 3px; }

.waitlist-fine {
  margin: 8px 0 0;
  text-align: center;
  font-size: .8rem; line-height: 1.45;
  color: rgba(255, 255, 255, .85);
}

/* The two messages stay hidden until the address bar ends in their name. */
.waitlist-done,
.waitlist-trouble { display: none; margin: 18px 0 0; line-height: 1.5; }
.waitlist-done { font-weight: 600; }
.waitlist-trouble {
  padding: 9px 12px; font-size: .85rem; text-align: left;
  background: rgba(0, 0, 0, .22);
  border: 1px solid rgba(255, 255, 255, .3); border-radius: 8px;
}
.waitlist-done:target,
.waitlist-trouble:target { display: block; }

/* Signed up: the form goes. (On trouble it stays, so they can try again.) */
.waitlist-shell:has(.waitlist-done:target) .waitlist-form { display: none; }

/* "Sending it..." with a spinner while the sign-up saves. The few lines of
   JavaScript in index.html add .is-sending when the form is sent. */
.waitlist-form .when-sending { display: none; }
.waitlist-form.is-sending .when-ready { display: none; }
.waitlist-form.is-sending .when-sending {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
}
.waitlist-form.is-sending button { opacity: .85; cursor: progress; }
.waitlist-form.is-sending button:hover { opacity: .85; }

/* A ring with one red quarter, spinning. */
.spinner {
  width: 15px; height: 15px; flex: none;
  border: 2.5px solid rgba(244, 0, 9, .25);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* For people who've asked their device for less motion: a gentle pulse
   instead of spinning. */
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: pulse 1.4s ease-in-out infinite; border-top-color: rgba(244, 0, 9, .25); background: var(--red); transform: scale(.55); }
  @keyframes pulse { 50% { opacity: .35; } }
}
