/* WeatherOnFilm shared styles.
   Every page links this one file. Colours and sizes come from the style guide. */

/* ---------- Colours ---------- */
:root {
  --bg: #F3F5F8;
  --panel: #FFFFFF;
  --line: #DCE2EA;
  --border-soft: #C9D2DD;
  --border: #748293;
  --field: #FFFFFF;
  --selected: #E4EAF2;
  --text: #121A24;
  --muted: #4B5868;
  --accent: #0A5CC7;
  --on-accent: #FFFFFF;
  --chip-on-bg: #121A24;
  --chip-on-text: #FFFFFF;
  --label: #0A5CC7;
  --error: #C62828;
  --stamp: #FFD166;
  color-scheme: light;
}

/* Dark colours. Used when the visitor's device asks for dark,
   unless they picked light with the header button. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1522;
    --panel: #152033;
    --line: #1E2B42;
    --border-soft: #2A3A55;
    --border: #687CA0;
    --field: #09101A;
    --selected: #1B2942;
    --text: #EEF3FA;
    --muted: #A9B8CE;
    --accent: #4DA8FF;
    --on-accent: #0D1522;
    --chip-on-bg: #EEF3FA;
    --chip-on-text: #0D1522;
    --label: #FFD166;
    --error: #FF9B8F;
    color-scheme: dark;
  }
}
/* Dark colours when the visitor picked dark with the header button. */
:root[data-theme="dark"] {
  --bg: #0D1522;
  --panel: #152033;
  --line: #1E2B42;
  --border-soft: #2A3A55;
  --border: #687CA0;
  --field: #09101A;
  --selected: #1B2942;
  --text: #EEF3FA;
  --muted: #A9B8CE;
  --accent: #4DA8FF;
  --on-accent: #0D1522;
  --chip-on-bg: #EEF3FA;
  --chip-on-text: #0D1522;
  --label: #FFD166;
  --error: #FF9B8F;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
}
a { color: var(--text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }

/* A clear outline for people using the keyboard. */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.skip-link {
  position: absolute; left: -999px; top: 8px;
  padding: 10px 16px; background: var(--accent); color: var(--on-accent);
  font-weight: 600; border-radius: 8px; z-index: 10;
}
.skip-link:focus { left: 8px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px 24px; padding: 10px 24px; border-bottom: 1px solid var(--line);
}
.logo {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-weight: 600; font-size: 24px; letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo svg { flex: none; }
.logo .logo-brackets { stroke: var(--text); }
.logo .logo-sun { fill: var(--accent); }
.logo .logo-rays { stroke: var(--accent); }
.logo-light { font-weight: 400; }

.search { flex: 1 1 320px; max-width: 620px; display: flex; }
.search input {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 18px;
  font-weight: 400; font-size: 16px; font-family: inherit; color: var(--text);
  background: var(--field); border: 1px solid var(--border); border-right: 0;
  border-radius: 22px 0 0 22px;
}
.search button {
  width: 64px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--line); color: var(--text); border: 1px solid var(--border);
  border-radius: 0 22px 22px 0; cursor: pointer;
}
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; font-weight: 600; font-size: 15px; font-family: inherit;
  border-radius: 22px; cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn-icon { width: 44px; padding: 0; }

/* ---------- Page layout ---------- */
.layout { display: flex; flex-wrap: wrap; align-items: flex-start; }
.side-nav {
  flex: 1 1 200px; max-width: 240px; display: flex; flex-direction: column; gap: 2px; padding: 12px;
}
.side-nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px;
  font-weight: 500; border-radius: 10px;
}
.side-nav a[aria-current="page"] { font-weight: 600; background: var(--line); }
.side-nav .nav-heading {
  padding: 16px 14px 6px; font-weight: 600; font-size: 13px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted);
}
.main { flex: 999 1 600px; min-width: 0; padding: 16px 24px 44px; display: flex; flex-direction: column; gap: 22px; }

/* ---------- Filter chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  min-height: 44px; padding: 0 16px; font-weight: 500; font-size: 15px; font-family: inherit;
  background: var(--line); color: var(--text); border: 0; border-radius: 10px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--chip-on-bg); color: var(--chip-on-text); }

/* ---------- Small label ---------- */
.label {
  font-weight: 600; font-size: 13px; line-height: 1.2; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--label);
}

/* ---------- Camcorder date stamp (the only place this font is used) ---------- */
.stamp {
  position: absolute; left: 8px; top: 8px; padding: 2px 7px;
  font-family: VT323, "Courier New", monospace; font-size: 16px; line-height: 1.15;
  background: rgba(15, 14, 13, 0.8); color: var(--stamp);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}
.stamp-large { left: 14px; top: 14px; padding: 2px 9px; font-size: 24px; }
.badge {
  position: absolute; right: 8px; bottom: 8px; padding: 2px 7px;
  font-weight: 600; font-size: 12px; background: rgba(15, 14, 13, 0.8); color: #FFFFFF; border-radius: 4px;
}

/* ---------- Featured film ---------- */
.featured {
  position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px;
  padding: 36px 32px; background: var(--panel); border: 1px solid var(--border-soft);
  border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
}
/* Viewfinder corners. Only the featured film has these. */
.featured::before, .featured::after, .featured > .corner-bl, .featured > .corner-br {
  content: ""; position: absolute; width: 18px; height: 18px; border: 0 solid var(--accent);
}
.featured::before { left: 10px; top: 10px; border-left-width: 2px; border-top-width: 2px; }
.featured::after { right: 10px; top: 10px; border-right-width: 2px; border-top-width: 2px; }
.featured > .corner-bl { left: 10px; bottom: 10px; border-left-width: 2px; border-bottom-width: 2px; }
.featured > .corner-br { right: 10px; bottom: 10px; border-right-width: 2px; border-bottom-width: 2px; }
.featured-media { position: relative; flex: 1 1 420px; min-width: 0; border-radius: 6px; overflow: hidden; }
.featured-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.featured-text { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.featured-text h2 { font-weight: 600; font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -0.01em; line-height: 1.08; }
.featured-meta { font-size: 17px; color: var(--muted); }
.featured-meta a { font-weight: 600; color: var(--muted); text-decoration: underline; }

/* ---------- Film grid ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font-weight: 600; font-size: 21px; }
.section-head span { font-size: 14px; color: var(--muted); }
.film-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 24px 18px;
}
.film-card { display: flex; flex-direction: column; gap: 8px; }
.film-thumb { position: relative; display: block; border-radius: 12px; overflow: hidden; }
.film-thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.film-info { display: flex; gap: 10px; }
.avatar {
  flex: none; width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; background: var(--selected); color: var(--text); border-radius: 50%;
}
.film-title { display: block; font-weight: 600; font-size: 16px; line-height: 1.3; }
.film-meta { display: block; font-size: 14px; color: var(--muted); }
.film-meta a { color: var(--muted); }
.empty { padding: 22px 18px; background: var(--panel); border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px;
  padding: 18px 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--muted); }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  .site-header { padding: 8px 12px; }
  .logo { font-size: 19px; }
  .logo svg { width: 30px; height: 30px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .side-nav { flex-direction: row; max-width: none; flex-basis: 100%; overflow-x: auto; padding: 8px 12px; }
  .side-nav a { flex: none; white-space: nowrap; }
  .side-nav .nav-heading { display: none; }
  .main { padding: 14px 14px 28px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
  .chip { flex: none; }
  .featured { padding: 0; overflow: hidden; }
  .featured::before, .featured::after, .featured > .corner-bl, .featured > .corner-br { display: none; }
  .featured-media { border-radius: 0; flex-basis: 100%; }
  .featured-text { padding: 0 14px 16px; }
  .film-grid { grid-template-columns: 1fr; }
}

/* People who ask their device for less motion get none. */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Names the converted pages use ----------
   The inner pages were converted from the design prototype, which used
   shorter names for the same colours. These lines point the old names
   at the real ones, so there is still one set of colours. */
:root {
  --b1: var(--border-soft);
  --b2: var(--border);
  --deep: var(--field);
  --sel: var(--selected);
  --on: var(--on-accent);
  --chipbg: var(--chip-on-bg);
  --chipfg: var(--chip-on-text);
  --err: var(--error);
}

/* ---------- Top navigation (every page except the homepage) ---------- */
.top-nav { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.top-nav a {
  flex: none; display: inline-flex; align-items: center; min-height: 48px; padding: 0 14px;
  font-weight: 500; white-space: nowrap; color: var(--muted); border-bottom: 3px solid transparent;
}
.top-nav a:hover { text-decoration: none; color: var(--text); }
.top-nav a[aria-current="page"] { font-weight: 600; color: var(--text); border-bottom-color: var(--accent); }

.page { display: block; min-height: 50vh; }
.page img { max-width: 100%; }

/* ---------- Signed-in header ---------- */
.bell { position: relative; }
.bell-dot { position: absolute; right: 9px; top: 9px; width: 10px; height: 10px; background: var(--error); border: 2px solid var(--bg); border-radius: 50%; }
.avatar-button { background: var(--selected); font-weight: 600; border-radius: 50%; }

/* ---------- Plain text pages ---------- */
.text-page { max-width: 760px; margin: 0 auto; padding: 30px 24px 48px; display: flex; flex-direction: column; gap: 16px; }
.text-page h1 { font-weight: 600; font-size: 34px; letter-spacing: -0.01em; line-height: 1.1; }
.text-page p { font-size: 17px; line-height: 1.6; }
.text-page a { color: var(--accent); font-weight: 600; }
.preview-note { opacity: 0.8; }

/* ---------- Short message at the bottom of the screen ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20;
  max-width: calc(100% - 32px); padding: 12px 18px; font-weight: 600;
  background: var(--chip-on-bg); color: var(--chip-on-text); border-left: 5px solid var(--accent);
  border-radius: 8px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

/* ---------- Bottom bar on phones ---------- */
.tab-bar { display: none; }
@media (max-width: 760px) {
  .top-nav { display: none; }
  body { padding-bottom: 64px; }
  .tab-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
    background: var(--panel); border-top: 1px solid var(--line);
  }
  .tab-bar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 56px; font-size: 11px; font-weight: 500; color: var(--muted);
  }
  .tab-bar a:hover { text-decoration: none; }
  .tab-bar a[aria-current="page"] { font-weight: 600; color: var(--text); }
  .tab-bar .tab-upload { font-weight: 600; color: var(--accent); }
  .tab-bar .tab-upload svg { width: 48px; height: 34px; padding: 6px 13px; background: var(--accent); color: var(--on-accent); border-radius: 17px; }
  .toast { bottom: 76px; }
  .site-footer { padding-bottom: 24px; }
}
