/* Cumbernauld Model Flying Club
   Colours come from the club logo (orange) and the flying field (greens). */

:root {
  --orange: #fb751b;        /* logo orange: fills, rules, accents on dark */
  --orange-text: #b84f06;   /* darker orange that passes contrast on light backgrounds */
  --green-deep: #1f3f27;    /* header text, footer, headings */
  --green: #3c6b33;         /* links, buttons */
  --grass: #a9c77a;         /* soft accent on dark green */
  --paper: #eef2e6;         /* page background, a pale field green */
  --panel: #ffffff;
  --ink: #1d2520;
  --muted: #55615a;
  --line: #d3dcc6;

  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;

  --wrap: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green); text-underline-offset: 0.18em; }
a:hover { color: var(--green-deep); }

:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -100px;
  background: var(--green-deep);
  color: #fff;
  padding: 8px 14px;
  z-index: 100;
}
.skip-link:focus { top: 8px; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Header ---------- */

.site-header {
  background: #fff;
  border-bottom: 4px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
}

.brand img { width: 150px; }

.nav-toggle {
  display: none;
  font: 600 1.05rem/1 var(--font-head);
  letter-spacing: 0.02em;
  color: var(--green-deep);
  background: none;
  border: 2px solid var(--green-deep);
  border-radius: 4px;
  padding: 9px 14px;
  cursor: pointer;
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.site-nav a {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--green-deep);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover { border-bottom-color: var(--grass); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--orange); }

/* ---------- Home hero ---------- */

.hero {
  position: relative;
  min-height: clamp(380px, 62vh, 620px);
  display: flex;
  align-items: flex-end;
  color: #fff;
  overflow: hidden;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20, 42, 26, 0.92) 0%, rgba(20, 42, 26, 0.55) 40%, rgba(20, 42, 26, 0) 75%);
}

.hero .wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-bottom: clamp(28px, 5vw, 56px);
}

.hero h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  line-height: 0.92;
  margin: 0 0 16px;
  max-width: 12ch;
}

.hero p {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  max-width: 46ch;
  margin: 0;
}

/* ---------- Inner page title band ---------- */

.page-title {
  background: var(--green-deep);
  color: #fff;
  padding: clamp(28px, 5vw, 48px) 0;
}

.page-title h1 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  line-height: 1;
  margin: 0;
}

.page-title p {
  margin: 10px 0 0;
  color: #dfe8d3;
  max-width: 60ch;
}

/* ---------- Main layout: text with a photo rail ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(24px, 4vw, 48px);
  padding-top: clamp(28px, 5vw, 48px);
  padding-bottom: clamp(36px, 6vw, 64px);
}

/* Pages with no photos: the text panel keeps its reading width */
.layout.no-rail { grid-template-columns: minmax(0, 1fr); }

.content {
  background: var(--panel);
  border-radius: 6px;
  padding: clamp(20px, 4vw, 44px);
  min-width: 0;
}

.content > * { max-width: 68ch; }
.content > :first-child { margin-top: 0; }

.content h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.1;
  color: var(--green-deep);
  margin: 2em 0 0.4em;
}

.content h2::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  background: var(--orange);
  margin-top: 8px;
}

.content h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--green-deep);
  margin: 1.6em 0 0.3em;
}

.content p, .content ul, .content ol { margin: 0 0 1em; }
.content li { margin-bottom: 0.35em; }

.content figure {
  margin: 2em 0;
  max-width: none;
}

.content figcaption,
.rail figcaption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 8px;
}

/* Photo rail: prints with a white mat, like photos pinned up in the clubhouse */
.rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.rail figure {
  margin: 0;
  background: #fff;
  padding: 8px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.rail img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

/* ---------- Home: club at a glance ---------- */

.glance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 1.6em 0 2em;
  border-top: 3px solid var(--green-deep);
}

.glance div {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
}

.glance dt {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--green-deep);
}

.glance dd {
  margin: 2px 0 0;
  color: var(--muted);
}

/* ---------- Home: gallery strip ---------- */

.strip {
  background: var(--green-deep);
  color: #fff;
  padding: clamp(32px, 5vw, 56px) 0;
}

.strip h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2rem;
  margin: 0 0 20px;
}

.strip ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.strip img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
  width: 100%;
  border-radius: 3px;
}

.strip figcaption {
  font-size: 0.9rem;
  color: #d2ddc6;
  margin-top: 6px;
}

.strip figure { margin: 0; }

/* ---------- Tables ---------- */

.table-scroll { overflow-x: auto; margin: 1em 0 1.6em; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 1rem;
}

th, td {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

thead th {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--green-deep);
  border-bottom: 3px solid var(--green-deep);
}

td.amount { white-space: nowrap; font-weight: 700; }

/* ---------- File downloads ---------- */

.content ul.downloads {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.content ul.downloads li { margin: 0; }

.file-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
}

.file-link:hover { border-color: var(--green); background: var(--paper); color: var(--ink); }
.file-link svg { flex: none; }
.file-link strong { display: block; color: var(--green); }
.file-link .file-meta { display: block; font-size: 0.9rem; color: var(--muted); }

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  background: var(--orange);
  color: #1d1208;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.2rem;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 4px;
}

.button:hover { background: #ff8a3a; color: #1d1208; }

/* ---------- Placeholder text blocks (remove once real copy is in) ---------- */

.todo {
  border: 2px dashed var(--orange);
  border-radius: 4px;
  background: #fff6ee;
  padding: 14px 18px;
  margin: 0 0 1.2em;
  color: #6b3a12;
}

.todo strong { color: var(--orange-text); }

/* ---------- Footer ---------- */

.site-footer {
  background: #16301d;
  color: #d5dfcb;
  padding: 36px 0 28px;
  font-size: 0.95rem;
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
}

.site-footer h2 {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  margin: 0 0 8px;
}

.site-footer p { margin: 0 0 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 4px; }
.site-footer a { color: var(--grass); }
.site-footer a:hover { color: #fff; }

.site-footer .social {
  display: flex;
  gap: 14px;
  margin-top: 14px;
}

.site-footer .social a {
  display: block;
  color: var(--grass);
}

.site-footer .social a:hover { color: #fff; }
.site-footer .social svg { display: block; }

.site-footer .legal {
  grid-column: 1 / -1;
  border-top: 1px solid #2e4a35;
  padding-top: 16px;
  color: #9fb294;
}

/* ---------- Responsive ---------- */

@media (max-width: 960px) {
  .nav-toggle { display: inline-block; }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-bottom: 4px solid var(--orange);
    padding: 8px var(--gutter) 16px;
  }

  .site-nav.open { display: block; }

  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .site-nav a[aria-current="page"] { border-bottom: 1px solid var(--line); color: var(--orange-text); }

  .layout { grid-template-columns: minmax(0, 1fr); }

  .rail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .strip ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
  .site-footer .about { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .brand img { width: 120px; }
  .glance { grid-template-columns: minmax(0, 1fr); }
  .rail { grid-template-columns: minmax(0, 1fr); }
  .site-footer .wrap { grid-template-columns: minmax(0, 1fr); }
}
