/* =============================================================
   Northern Fishing Club: main stylesheet

   The look is a plain early-2000s home page: a fixed-width page
   in the middle of the screen, small Verdana text, square boxes
   and chunky raised buttons. The site always uses its dark colours.

   This file is "mobile first": the rules at the top are for
   phones, and the @media block near the bottom adjusts things
   for wider screens.
   ============================================================= */


/* ---------- 1. Colours, fonts and sizes ---------- */

:root {
  --bg: #0d1522;            /* page background (dark blue) */
  --surface: #142033;       /* boxes and the link bar */
  --text: #e7edf4;          /* main text */
  --muted: #a7b3c3;         /* secondary text */
  --line: #26344a;          /* borders */
  --accent: #5ee0b0;        /* links and buttons (aurora green) */
  --accent-text: #08131f;   /* text on accent-coloured buttons */
  --accent-soft: #173330;   /* dark green for headings bars and tags */
  --night: #08111f;         /* darkest blue: banner and contact box */
  --grid-navy: #08112a;     /* background grid squares (also set in images/bg-grid.svg) */
  --on-night: #e6eef7;      /* text on night blue */
  --aurora: #5ee0b0;        /* aurora green */

  --page-width: 1140px;     /* how wide the page column can get */

  /* System fonts only: nothing is downloaded from other websites. */
  --font-body: Verdana, Tahoma, Geneva, "DejaVu Sans", sans-serif;
  --font-display: "Trebuchet MS", Verdana, Tahoma, sans-serif;

  color-scheme: dark;
}


/* ---------- 2. Basics ---------- */

*, *::before, *::after { box-sizing: border-box; }

/* A small grid picture repeated across the screen behind the page. */
html {
  background: var(--grid-navy) url("../images/bg-grid.svg") repeat;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* The whole site sits in one fixed-width column in the middle,
   with the grid background showing around and between the boxes. */
body {
  width: 100%;
  max-width: var(--page-width);
  min-height: 100vh;
  margin: 0 auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.5;
}

img, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

a { color: var(--accent); }
a:visited { color: var(--accent); }
a:hover { color: var(--text); }

:focus-visible { outline: 2px dotted var(--accent); outline-offset: 2px; }

h1, h2, h3 {
  margin: 0 0 0.5em;
  font-family: var(--font-display);
  font-weight: bold;
  line-height: 1.2;
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { margin: 0 0 1em; }

.container { padding-inline: 12px; }

/* Hidden until a keyboard user tabs to it. */
.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 10;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.skip-link:focus { top: 1rem; }


/* ---------- 3. Header and menu ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--night);
}

.header-inner { padding-block: 12px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: bold;
  text-decoration: none;
}
.brand:visited { color: var(--text); }
.brand img { width: 36px; height: 36px; }

/* The menu box and the page box sit inside .layout.
   On phones the menu is a bar above the page box, like this:
   Home | Projects | Contact
   On wider screens it becomes a sidebar box (see section 11). */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);   /* lets wide tables scroll instead of stretching the page */
  grid-template-rows: auto 1fr;
  gap: 8px;
}

/* "sticky" keeps the menu in sight: it scrolls with the page until it
   reaches the top of the screen, then stays there. */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 4px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* The page box holds the title banner and the page itself. */
.page-box {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--bg);
}

main {
  flex: 1;
  padding-bottom: 20px;
}

/* The "Menu" title only shows in the sidebar. */
.nav-title { display: none; }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* A "|" between each link. */
.site-nav li + li::before {
  content: "|";
  padding-inline: 8px;
  color: var(--muted);
}

.site-nav a { font-weight: bold; }

.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}


/* ---------- 4. Buttons ---------- */

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* Square buttons with a raised edge that looks pressed in when clicked. */
.button,
.copy-button {
  display: inline-block;
  padding: 4px 12px;
  border: 2px outset var(--line);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}
.button:visited { color: var(--text); }
.button:hover { color: var(--text); background: var(--line); }
.button:active,
.copy-button:active { border-style: inset; }

.button-primary,
.button-primary:visited,
.button-primary:hover {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}


/* ---------- 5. Home page banner ---------- */

.hero {
  background: var(--night);
  color: var(--on-night);
}

.hero-art {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: 58% 100%;   /* keeps the boat in view */
  border-bottom: 1px solid var(--line);
}

.hero-inner { padding-block: 16px; }

.eyebrow {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: bold;
  text-transform: uppercase;
}

.hero .eyebrow { color: var(--aurora); }

.hero-lead { margin-bottom: 0; }


/* ---------- 6. Page sections ---------- */

.section { padding-top: 20px; }

/* Section headings sit in a coloured bar, with any link on the right. */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 12px;
  margin-bottom: 12px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
}
.section-head h2 { margin: 0; font-size: 1rem; }
.section-head a { font-size: 0.8rem; }

.page-header { padding-top: 20px; }
.page-header h1 {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.page-header + .section { padding-top: 4px; }

.lead { color: var(--muted); }


/* ---------- 7. Project boxes ---------- */

.cards {
  display: grid;
  gap: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--surface);
}

.card img {
  width: 100%;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  border-bottom: 1px solid var(--line);
  background: var(--accent-soft);
}

.card-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px 10px;
}
.card-body h3 { margin: 0; }
.card-body p { margin: 0; color: var(--muted); }

.card-meta {
  font-size: 0.75rem;
  font-weight: bold;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tags li {
  padding: 0 6px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  font-size: 0.75rem;
}

.card-link {
  margin-top: auto;
  padding-top: 4px;
  font-weight: bold;
}


/* ---------- 8. Project write-ups ---------- */
/* Used by project pages full of figures, such as
   carlsnickers-channel-breakdown.html. */

.breadcrumb {
  margin-bottom: 8px;
  font-size: 0.8rem;
  font-weight: bold;
}

.section-intro {
  max-width: 70ch;
  color: var(--muted);
}

/* Tables sit in a box that scrolls sideways on small screens. */
.table-box {
  margin-bottom: 1em;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

/* Very long tables get their own scroll bar so the page stays short. */
.table-box-tall {
  max-height: 600px;
  overflow-y: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}
.data-table th,
.data-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.data-table tbody tr:last-child td { border-bottom: 0; }

/* Column headings stay in view while the table scrolls. */
.data-table th {
  position: sticky;
  top: 0;
  background: var(--accent-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Every other row is slightly darker, to help the eye along. */
.data-table tbody tr:nth-child(even) td { background: var(--bg); }

.data-table .num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.data-table .rank { width: 3em; color: var(--muted); }
.data-table .date { white-space: nowrap; }

/* The green bar under each game name shows its share of the hours.
   Its length is set on each row with --w. */
.bar {
  display: block;
  width: var(--w);
  height: 4px;
  margin-top: 3px;
  background: var(--accent);
}

/* Rows that are counted separately, like "Multi-game / Other". */
.row-muted td { color: var(--muted); font-style: italic; }
.row-standalone td:first-child { color: var(--muted); }

.split,
.note {
  color: var(--muted);
  font-size: 0.75rem;
}

.summary-table td:first-child { width: 60%; }
.summary-table .big {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: bold;
  vertical-align: middle;
}

/* Boxes with one big figure each. */
.stat-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.stat-boxes li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.stat-boxes .fig {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: bold;
}
.stat-boxes span { color: var(--muted); }

/* The filter box above a table. js/main.js makes it work. */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.filter-row input {
  flex: 1 1 200px;
  max-width: 320px;
  padding: 3px 6px;
  border: 2px inset var(--line);
  background: var(--night);
  color: var(--text);
  font: inherit;
}
.filter-count { color: var(--muted); font-size: 0.75rem; }

/* A list of notes, one box each, with a bold title line. */
.notes-list {
  display: grid;
  gap: 8px;
  max-width: 80ch;
  margin: 0;
  padding: 0;
  list-style: none;
}
.notes-list li {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.notes-list b { display: block; }
.notes-list li > span { color: var(--muted); }

.flag-tag {
  margin-left: 6px;
  padding: 0 6px;
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.7rem;
  text-transform: uppercase;
}


/* ---------- 9. Contact box ---------- */

.contact-box {
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--night);
  color: var(--on-night);
}
.contact-box h2 { margin-bottom: 4px; }
.contact-box p { margin: 0 0 8px; }

.contact-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.email-link {
  color: var(--aurora);
  font-weight: bold;
  overflow-wrap: anywhere;
}

/* The "Copy" button is added by js/main.js. Its look is in section 4. */


/* ---------- 10. 404 "page not found" ---------- */

.not-found {
  padding-top: 32px;
  text-align: center;
}
.not-found svg {
  width: 80px;
  margin: 0 auto 12px;
  color: var(--muted);
}
.not-found .button-row { justify-content: center; }


/* ---------- 11. Wider screens ---------- */

/* Tablets and up: the menu becomes a separate box on the left. */
@media (min-width: 761px) {
  body { padding: 12px; }

  .layout {
    grid-template-columns: 170px minmax(0, 1fr);
    grid-template-rows: none;
    gap: 12px;
  }

  /* align-self: start keeps the menu box only as tall as its links. */
  .site-nav {
    align-self: start;
    top: 12px;
    padding: 0;
  }

  .nav-title {
    display: block;
    margin: 0;
    padding: 4px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--accent-soft);
    font-family: var(--font-display);
    font-weight: bold;
  }

  /* One link per line, each in its own row. */
  .site-nav ul { display: block; }
  .site-nav li + li::before { content: none; }
  .site-nav a {
    display: block;
    padding: 4px 10px;
    border-bottom: 1px solid var(--line);
  }
  .site-nav li:last-child a { border-bottom: 0; }
  .site-nav a[aria-current="page"] { background: var(--bg); }
}

/* Laptops and up: put boxes side by side. */
@media (min-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}

/* Big screens: a taller banner. */
@media (min-width: 1141px) {
  .hero-art { height: 220px; }
}
