/* Thames Rifle Association — site styles */

:root {
  --green-dark: #14411f;
  --green: #1f6b34;
  --green-bright: #2d8a49;
  --ink: #1b1f1c;
  --paper: #faf8f3;
  --paper-2: #f0ece1;
  --line: #ded6c3;
  --muted: #5b6259;
  --gold: #b08d3e;
  --radius: 10px;
  --shadow: 0 6px 20px rgba(20, 65, 31, 0.12);
  --maxw: 1100px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: "Merriweather", Georgia, "Times New Roman", serif;
  color: var(--green-dark);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; border-radius: var(--radius); }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--green-dark);
  color: #eaf3ea;
  font-size: 0.9rem;
}
.topbar .wrap {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}
.topbar a { color: #eaf3ea; }

/* ---------- Header / nav ---------- */
header.site {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand img { width: 52px; height: 52px; border-radius: 0; }
.brand-text .name {
  font-family: "Merriweather", Georgia, serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--green-dark);
  display: block;
}
.brand-text .tag {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  display: block;
}

nav.primary {
  display: flex;
  gap: 1.15rem;
  align-items: center;
}
nav.primary a {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
nav.primary a:hover,
nav.primary a.active {
  color: var(--green);
  border-bottom-color: var(--gold);
  text-decoration: none;
}
nav.primary a.cta {
  background: var(--green);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border-bottom: none;
}
nav.primary a.cta:hover { background: var(--green-dark); }

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  color: var(--green-dark);
}

@media (max-width: 800px) {
  .menu-toggle { display: block; }
  nav.primary {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1.25rem 1rem;
    gap: 0.25rem;
    box-shadow: var(--shadow);
  }
  nav.primary.open { display: flex; }
  nav.primary a { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
  nav.primary a.cta { text-align: center; margin-top: 0.4rem; border-bottom: none; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--green-dark), var(--green) 70%);
  color: #fff;
  padding: 3.2rem 0 3.6rem;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}
.hero h1 { color: #fff; }
.hero p.lead {
  font-size: 1.1rem;
  color: #e4efe4;
  max-width: 46ch;
}
.hero .btns { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
}
.btn.primary { background: var(--gold); color: #2a2109; }
.btn.primary:hover { background: #c39c47; text-decoration: none; }
.btn.ghost { background: rgba(255,255,255,0.08); color: #fff; border: 1px solid rgba(255,255,255,0.5); }
.btn.ghost:hover { background: rgba(255,255,255,0.18); text-decoration: none; }
.btn.ghost-dark {
  background: transparent;
  color: var(--green-dark);
  border: 1px solid var(--green-dark);
  cursor: pointer;
  font-family: inherit;
}
.btn.ghost-dark:hover { background: var(--paper-2); text-decoration: none; }
.hero img { border-radius: var(--radius); box-shadow: 0 20px 40px rgba(0,0,0,0.35); }

@media (max-width: 800px) {
  .hero .wrap { grid-template-columns: 1fr; }
}

/* ---------- Page header (non-home pages) ---------- */
.page-head {
  background: var(--green-dark);
  color: #fff;
  padding: 2.4rem 0;
}
.page-head h1 { color: #fff; margin: 0; }
.page-head p { color: #dcebdd; margin: 0.3rem 0 0; }

/* ---------- Sections ---------- */
main { padding: 3rem 0; }
section + section { margin-top: 3rem; }

.grid {
  display: grid;
  gap: 1.5rem;
}
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid > img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 800px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
}

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-top: 0; }

.discipline-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; margin-bottom: 1rem; }

.callout {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.fact-strip {
  display: flex;
  gap: 2.5rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.fact-strip div strong {
  display: block;
  font-family: "Merriweather", Georgia, serif;
  font-size: 1.5rem;
  color: var(--green-dark);
}
.fact-strip div span { color: var(--muted); font-size: 0.9rem; }

table.fees {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
table.fees th, table.fees td {
  text-align: left;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--line);
}
table.fees th {
  background: var(--paper-2);
  font-family: "Merriweather", Georgia, serif;
  color: var(--green-dark);
}
table.fees tr:last-child td { border-bottom: none; }

ol.steps { padding-left: 1.2rem; }
ol.steps li { margin-bottom: 0.9rem; }

.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.doc-list li {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
}
.doc-list a { font-weight: 600; }
.doc-list .kind { color: var(--muted); font-size: 0.85rem; margin-left: 0.4rem; }

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.photo-grid img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }

.album-link {
  position: relative;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.album-link img { width: 100%; aspect-ratio: 16/10; object-fit: cover; margin: 0; }
.album-link .label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.72));
  color: #fff;
  padding: 1.6rem 1rem 0.8rem;
  font-family: "Merriweather", Georgia, serif;
  font-size: 1.15rem;
}
.album-link:hover .label { text-decoration: none; }

/* ---------- Footer ---------- */
footer.site {
  background: var(--green-dark);
  color: #d9e6da;
  padding: 2.2rem 0 1.4rem;
  margin-top: 3rem;
  font-size: 0.92rem;
}
footer.site .wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem;
}
footer.site h4 {
  color: #fff;
  font-family: "Merriweather", Georgia, serif;
  font-size: 1rem;
  margin: 0 0 0.6rem;
}
footer.site a { color: #d9e6da; }
footer.site .bottom {
  max-width: var(--maxw);
  margin: 1.6rem auto 0;
  padding: 1rem 1.25rem 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  color: #a9bfab;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
@media (max-width: 800px) {
  footer.site .wrap { grid-template-columns: 1fr; }
}

/* ---------- Calculator form ---------- */
.field {
  display: block;
  margin-bottom: 1.3rem;
}
.field > span, fieldset.field legend {
  display: block;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}
fieldset.field {
  border: none;
  padding: 0;
  margin: 0 0 1.3rem;
}
.field-row {
  display: flex;
  gap: 0.6rem;
}
.field input[type="number"] {
  flex: 1;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
}
.field select {
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--paper);
  color: var(--ink);
}
label.radio {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}
label.radio input { accent-color: var(--green); width: 16px; height: 16px; }

.result-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.result-figure {
  font-family: "Merriweather", Georgia, serif;
  font-weight: 900;
  font-size: 4rem;
  color: var(--green-dark);
  line-height: 1;
}
.result-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}
.result-sub {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- Print ---------- */
@media print {
  .topbar, header.site, footer.site, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 1rem 0; }
  .page-head { background: #fff !important; color: var(--ink) !important; padding: 0 0 1rem; }
  .page-head h1, .page-head p { color: var(--ink) !important; }
  .card, .callout { box-shadow: none; border: 1px solid #999; }
  .grid.cols-2 { grid-template-columns: 1fr 1fr; }
}
