/* Sportshots.ca shared styles */
:root { box-sizing: border-box; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

  /* Layout: a dark "night match" gallery. Home is three large sport tiles, each with its own colour;
     sport pages are masonry grids of framed photos that open in a lightbox. */
  :root {
    --bg: #0f1318;
    --surface: #171d24;
    --surface2: #1f2730;
    --fg: #e9eef3;
    --muted: #9aa7b4;
    --line: #2a343f;
    --afl: #5fb36a;
    --rugby: #d8584a;
    --bball: #e88a3c;
    --portrait: #8fa6c4;
    --font-display: 'Barlow Condensed', 'Arial Narrow', 'Helvetica Neue', sans-serif;
    --font-body: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
    color-scheme: dark;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
      --bg: #eef1f4; --surface: #ffffff; --surface2: #e3e8ed; --fg: #141a20; --muted: #55626f; --line: #cfd6dd;
      --afl: #2f8a43; --rugby: #b8382b; --bball: #c4631a; --portrait: #476585;
      color-scheme: light;
    }
  }
  :root[data-theme="light"] {
    --bg: #eef1f4; --surface: #ffffff; --surface2: #e3e8ed; --fg: #141a20; --muted: #55626f; --line: #cfd6dd;
    --afl: #2f8a43; --rugby: #b8382b; --bball: #c4631a; --portrait: #476585;
    color-scheme: light;
  }

  * { box-sizing: border-box; }
  body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.55;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-block: 24px 40px;
  }
  a { color: inherit; }
  :focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
  button { font: inherit; color: inherit; }

  .wrap { max-width: 1180px; margin-inline: auto; }

  /* Header */
  .site-head {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
    gap: 16px 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
  }
  .mark { display: flex; flex-direction: column; text-decoration: none; line-height: 1.1; }
  .mark-name { font-family: var(--font-display); font-weight: 700; font-size: 30px; letter-spacing: 0.01em; }
  .mark-sub { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 4px; }
  .nav { display: flex; gap: 6px 22px; flex-wrap: wrap; }
  .nav a {
    font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: 0.06em; text-transform: uppercase;
    text-decoration: none; color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent;
  }
  .nav a:hover { color: var(--fg); }
  .nav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--fg); }

  .view { padding-top: 40px; }
  .eyebrow { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 14px; }

  /* Home */
  .hero { max-width: 760px; margin-bottom: 22px; }
  .hero h1 {
    font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.01em;
    font-size: clamp(40px, 7vw, 68px); line-height: 0.92; margin: 0 0 12px; text-wrap: balance;
  }
  .lede { font-size: 18px; color: var(--muted); margin: 0; max-width: 52ch; }

  .sport-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .tile {
    display: flex; flex-direction: column; justify-content: space-between; gap: 28px; min-height: 320px; padding: 26px;
    background: color-mix(in srgb, var(--c) 10%, var(--surface));
    border: 1px solid var(--line); border-radius: 4px; text-decoration: none; transition: background 0.2s, border-color 0.2s;
  }
  .tile:hover { background: color-mix(in srgb, var(--c) 20%, var(--surface)); border-color: var(--c); }
  .tile svg { width: 132px; height: 132px; color: var(--c); transition: transform 0.3s; }
  .tile:hover svg { transform: rotate(-8deg) scale(1.04); }
  .tile h2 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 42px; line-height: 1; margin: 0 0 8px; }
  .tile .go { font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
  .tile:hover .go { color: var(--fg); }
  .tile.photo { position: relative; overflow: hidden; isolation: isolate; justify-content: flex-end; background: var(--surface); aspect-ratio: var(--ar, 1696 / 1800); min-height: 0; }
  .tile.photo:hover { background: var(--surface); }
  .tile.photo img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: contain; z-index: -2; transition: transform 0.4s; }
  .tile.photo::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(8, 11, 14, 0.8), rgba(8, 11, 14, 0) 45%); }
  .tile.photo:hover img { transform: scale(1.04); }
  .tile.photo h2 { color: #fff; }
  .tile.photo .go, .tile.photo:hover .go { color: #d5dde5; }
  /* Compact home so every sport tile fits on one screen */
  .view[data-view="home"] { padding-top: 28px; }
  .view[data-view="home"] .sport-grid .tile { min-height: 0; padding: 18px; }
  .view[data-view="home"] .tile h2 { font-size: 26px; }

  .tile.photo.notext::before { display: none; }
  .vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* Tiles share one height; widths follow each photo's proportions */
  .view[data-view="home"] .sport-grid { display: flex; }
  .view[data-view="home"] .sport-grid .tile { flex: var(--r, 1) 1 0; min-width: 0; }
  .view[data-view="home"] .row2 .wide { padding: 16px 22px; }

  .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
  .wide {
    display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 22px 26px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 4px; text-decoration: none; transition: border-color 0.2s;
  }
  .wide:hover { border-color: var(--c, var(--muted)); }
  .wide h2 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: 32px; line-height: 1; margin: 0; }
  .wide p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }
  .wide .arrow { font-family: var(--font-mono); font-size: 22px; color: var(--c, var(--muted)); }

  /* Gallery pages */
  .back { display: inline-block; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); text-decoration: none; margin-bottom: 20px; }
  .back:hover { color: var(--fg); }
  .page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 32px; }
  .page-head h2 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(44px, 8vw, 84px); line-height: 0.95; margin: 0 0 12px; text-wrap: balance; }
  .page-head p { margin: 0; color: var(--muted); max-width: 52ch; }
  .page-head svg { width: 88px; height: 88px; flex: none; color: var(--c); }

  .grid { columns: 3; column-gap: 14px; }
  .frame {
    position: relative; display: block; width: 100%; margin: 0 0 14px; padding: 0; overflow: hidden; cursor: zoom-in;
    break-inside: avoid; border: 1px solid var(--line); border-radius: 2px; text-align: left;
    background: linear-gradient(145deg, color-mix(in srgb, var(--c) 32%, var(--surface)), var(--surface) 70%);
  }
  .frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
  .frame::before, .frame::after { content: ""; position: absolute; width: 22px; height: 22px; border: 0 solid color-mix(in srgb, var(--fg) 55%, transparent); pointer-events: none; z-index: 1; }
  .frame::before { top: 12px; left: 12px; border-width: 2px 0 0 2px; }
  .frame::after { bottom: 12px; right: 12px; border-width: 0 2px 2px 0; }
  .frame:hover { border-color: var(--c); }
  .ph-label, .ph-meta { position: absolute; left: 16px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
  .ph-label { top: 16px; left: 44px; color: var(--fg); }
  .ph-meta { bottom: 16px; color: var(--muted); }

  /* Lightbox */
  .lb {
    position: fixed; inset: 0; z-index: 20; background: rgba(6, 9, 12, 0.94); color: #e9eef3;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
    padding-top: calc(24px + env(safe-area-inset-top, 0px)); padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .lb .frame { cursor: default; width: min(100%, 960px); max-height: 72vh; margin: 0; background: linear-gradient(145deg, color-mix(in srgb, var(--c) 32%, #171d24), #171d24 70%); border-color: #2a343f; }
  .lb .ph-label { color: #e9eef3; }
  .lb .ph-meta { color: #9aa7b4; }
  .lb .frame img { object-fit: contain; }
  .lb-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(100%, 960px); font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: #9aa7b4; }
  .lb-btns { display: flex; gap: 8px; }
  .lb-btn { background: #171d24; border: 1px solid #2a343f; border-radius: 3px; min-width: 44px; height: 44px; padding: 0 14px; cursor: pointer; color: #e9eef3; }
  .lb-btn:hover { border-color: #e9eef3; }

  /* About */
  .about { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
  .about h2 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(44px, 8vw, 84px); line-height: 0.95; margin: 0 0 20px; }
  .about p { max-width: 62ch; margin: 0 0 16px; }
  .about .frame { margin: 0; cursor: default; }
  .covers { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 32px; padding: 0; list-style: none; }
  .covers a { display: inline-block; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: 0.05em; text-transform: uppercase; }
  .covers a:hover { border-color: var(--c); color: var(--c); }
  .contact { border-top: 1px solid var(--line); padding-top: 20px; display: grid; gap: 6px; font-family: var(--font-mono); font-size: 14px; }
  .contact span { color: var(--muted); }
  .contact b { font-weight: 400; user-select: all; }

  footer { margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }

  @media (max-width: 900px) {
    .sport-grid { grid-template-columns: 1fr; }
    .view[data-view="home"] .sport-grid { flex-wrap: wrap; }
    .view[data-view="home"] .sport-grid .tile { flex: 0 1 calc((100% - 16px) * var(--w, 0.5)); }
    .tile { min-height: 0; flex-direction: row; align-items: center; }
    .tile.photo { align-items: flex-end; }
    .tile svg { width: 96px; height: 96px; order: 2; flex: none; }
    .grid { columns: 2; }
    .about { grid-template-columns: 1fr; gap: 32px; }
  }
  @media (max-width: 560px) {
    body { font-size: 16px; }
    .row2 { grid-template-columns: 1fr; }
    .page-head svg { display: none; }
    .tile { padding: 20px; }
    .tile h2 { font-size: 36px; }
    .view[data-view="home"] .tile h2 { font-size: 16px; }
    .view[data-view="home"] .sport-grid .tile { padding: 10px; }
    .view[data-view="home"] .tile .go { display: none; }
    .grid { column-gap: 10px; }
    .frame { margin-bottom: 10px; }
    .ph-label { font-size: 11px; }
    .ph-meta { display: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .tile, .tile svg, .tile.photo img, .wide { transition: none; }
    .tile.photo:hover img { transform: none; }
    .tile:hover svg { transform: none; }
  }
