/*
  ╔══════════════════════════════════════════════════════════════════╗
  ║  MANOR OF STRADBROKE WITH STUBCROFT                              ║
  ║  Stylesheet — style.css                                          ║
  ║                                                                  ║
  ║  HOW THIS FILE WORKS:                                            ║
  ║  CSS rules look like this:                                       ║
  ║    .class-name {                                                 ║
  ║      property: value;                                            ║
  ║    }                                                             ║
  ║  The .class-name selects an element from the HTML.             ║
  ║  The properties change how it looks.                            ║
  ║                                                                  ║
  ║  CSS Custom Properties (variables) are defined at the top        ║
  ║  under :root { } — change a colour there and it updates        ║
  ║  everywhere on the site instantly.                               ║
  ╚══════════════════════════════════════════════════════════════════╝
*/


/* ══════════════════════════════════════════════════════════════════
   CUSTOM PROPERTIES (Variables)
   Change these to re-theme the entire site.
   Usage: color: var(--navy);
══════════════════════════════════════════════════════════════════ */
:root {
  /* Colour palette */
  --navy:       #1F4E79;   /* Primary dark blue — headers, nav, buttons */
  --navy-mid:   #2E74B5;   /* Mid blue — links, accents */
  --navy-light: #EBF0F7;   /* Very light blue — hover states, backgrounds */
  --parch:      #F8F3EB;   /* Warm parchment white — section backgrounds */
  --oak:        #6B5E45;   /* Warm brown — secondary text, accents */
  --hedge:      #4A6741;   /* Muted green — featured card */
  --charcoal:   #2C2C2A;   /* Near-black — body text */
  --rule:       #C8BEA8;   /* Warm grey — borders, dividers */
  --muted:      #7A7468;   /* Muted grey — captions, labels */
  --warm-white: #FDFAF6;   /* Off-white — page background */

  /* Typography */
  --serif:   'EB Garamond', 'Palatino Linotype', Georgia, serif;
  --sans:    'Jost', 'Gill Sans', Calibri, sans-serif;

  /* Spacing scale — use multiples of 8px */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  48px;
  --space-2xl: 80px;
  --space-3xl: 120px;

  /* Max width — content never gets wider than this */
  --max-width: 1160px;

  /* Nav height */
  --nav-height: 64px;

  /* Transitions */
  --transition: 0.2s ease;
}


/* ══════════════════════════════════════════════════════════════════
   RESET AND BASE STYLES
   Remove browser default styles and set sensible foundations.
══════════════════════════════════════════════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;   /* Padding and border included in element width */
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;         /* 1rem = 16px everywhere */
  scroll-behavior: smooth; /* Smooth scroll when clicking anchor links */
}

body {
  font-family: var(--sans);
  color: var(--charcoal);
  background: var(--warm-white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased; /* Crisper text on Mac/iOS */
}

img {
  display: block;
  max-width: 100%;  /* Images never overflow their container */
  height: auto;
}

a {
  color: var(--navy-mid);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--navy);
}

ul {
  list-style: none;  /* Remove default bullet points */
}

/* ── UTILITY CLASSES ────────────────────────────────────────────── */

/* Centers content and limits its maximum width */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* A reusable horizontal rule */
.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: var(--space-xl) 0;
}


/* ══════════════════════════════════════════════════════════════════
   BUTTONS
   Two variants: primary (filled navy) and secondary (outline).
   A third variant btn-outline is used in the chain section.
══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  font-family: var(--sans);
  font-size: 0.875rem;   /* 14px */
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: white;
  color: var(--navy);
  border-color: white;
}

.btn-primary:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
  color: var(--navy);
}

.btn-secondary {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.5);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn-outline:hover {
  background: var(--navy);
  color: white;
}


/* ══════════════════════════════════════════════════════════════════
   NAVIGATION
══════════════════════════════════════════════════════════════════ */
.site-nav {
  position: fixed;          /* Sticks to the top of the screen as you scroll */
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;             /* Stays on top of everything else */
  height: var(--nav-height);
  background: var(--navy);
  transition: all 0.3s ease;
}

/* When the user scrolls down, add a shadow */
.site-nav.nav-scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
}

/* Site name / logo */
.nav-identity {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
  flex-shrink: 0;  /* Never shrinks to make room for other elements */
}

.nav-title {
  font-family: var(--serif);
  font-size: 1.125rem;  /* 18px */
  color: white;
  letter-spacing: 0.01em;
}

.nav-subtitle {
  font-size: 0.6875rem;  /* 11px */
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.12em;
  font-weight: 300;
}

/* Navigation links list */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-link {
  font-size: 0.8125rem;  /* 13px */
  color: rgba(255,255,255,0.7);
  padding: 6px 10px;
  border-radius: 2px;
  font-weight: 400;
  letter-spacing: 0.03em;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255,255,255,0.1);
}

/* Mobile toggle button — hidden on desktop */
.nav-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: white;
  transition: all 0.3s ease;
}


/* ══════════════════════════════════════════════════════════════════
   HERO SECTION
   Full-viewport-height opening section.
   The background image is set here — swap the URL when you have
   a real photo. For now it uses a placeholder colour.
══════════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;   /* Full height of the browser window */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  /* ── BACKGROUND IMAGE ──
     Replace this URL with your actual image path:
       background-image: url('images/stradbroke-aerial.jpg');
     The image should be landscape, at least 1920px wide.
     Keep "center center" and "cover" — they ensure the image
     fills the area regardless of screen size.
  ────────────────────────────────────────────────────────────── */
  background-image:
    linear-gradient(160deg, #1F4E79 0%, #0D2B45 60%, #1A3A2A 100%);
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;  /* Parallax effect on scroll */

  padding: calc(var(--nav-height) + var(--space-xl)) var(--space-xl) var(--space-xl);
}

/* Dark overlay on top of the background image.
   The rgba(0,0,0,0.45) means black at 45% opacity.
   Increase the last number (max 1) if text is hard to read. */
.hero-overlay {
  position: absolute;
  inset: 0;  /* Shorthand for top:0; right:0; bottom:0; left:0; */
  background: rgba(10,20,40,0.45);
}

/* hero-content sits above the overlay */
.hero-content {
  position: relative;   /* Allows z-index to work */
  z-index: 1;
  max-width: 760px;
}

.hero-eyebrow {
  font-size: 0.75rem;  /* 12px */
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-md);
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  /* clamp(min, preferred, max) — scales between screen sizes */
  font-weight: 400;
  color: white;
  line-height: 1.1;
  margin-bottom: var(--space-lg);
  letter-spacing: -0.01em;
}

.hero-date {
  font-family: var(--serif);
  font-size: 1rem;
  font-style: italic;
  color: rgba(255,255,255,0.65);
  margin-bottom: var(--space-lg);
}

.hero-statement {
  font-size: 1.125rem;
  color: rgba(255,255,255,0.85);
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto var(--space-xl);
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;  /* Stack on narrow screens */
}

/* Scroll hint at the bottom of the hero */
.hero-scroll-hint {
  position: absolute;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%);  /* Centers it precisely */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  color: rgba(255,255,255,0.4);
  font-size: 0.6875rem;  /* 11px */
  letter-spacing: 0.15em;
  text-transform: uppercase;

  /* Gentle pulse animation */
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 0.8; transform: translateX(-50%) translateY(4px); }
}


/* ══════════════════════════════════════════════════════════════════
   SECTION PREAMBLE
   Reused heading block above several sections.
══════════════════════════════════════════════════════════════════ */
.section-preamble {
  text-align: center;
  max-width: 640px;
  margin: 0 auto var(--space-xl);
}

.section-overline {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--navy-mid);
  margin-bottom: var(--space-sm);
}

.section-heading {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 400;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: var(--space-md);
}

.section-body {
  font-size: 1.0625rem;  /* 17px */
  color: var(--oak);
  line-height: 1.75;
}


/* ══════════════════════════════════════════════════════════════════
   INTRODUCTION CARDS SECTION
══════════════════════════════════════════════════════════════════ */
.intro-section {
  padding: var(--space-3xl) var(--space-xl);
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Three-column grid — automatically becomes one column on mobile */
.intro-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.intro-card {
  padding: var(--space-xl) var(--space-lg);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--navy);
  background: white;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: transform var(--transition), box-shadow var(--transition);
}

.intro-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(31,78,121,0.1);
}

/* The featured (middle) card has a different colour scheme */
.intro-card--featured {
  background: var(--navy);
  border-color: var(--navy);
}

.intro-card--featured .card-numeral { color: rgba(255,255,255,0.3); }
.intro-card--featured .card-heading { color: white; }
.intro-card--featured .card-body    { color: rgba(255,255,255,0.75); }
.intro-card--featured .card-facts li { color: rgba(255,255,255,0.65); }
.intro-card--featured .card-facts li::before { background: rgba(255,255,255,0.4); }
.intro-card--featured .card-link    { color: rgba(255,255,255,0.85); }
.intro-card--featured .card-link:hover { color: white; }

.card-numeral {
  font-family: var(--serif);
  font-size: 2.5rem;
  color: var(--rule);
  font-weight: 400;
  line-height: 1;
}

.card-heading {
  font-family: var(--serif);
  font-size: 1.375rem;  /* 22px */
  font-weight: 400;
  color: var(--navy);
  line-height: 1.2;
}

.card-body {
  font-size: 0.9375rem;  /* 15px */
  color: var(--charcoal);
  line-height: 1.7;
  flex: 1;  /* Pushes the link to the bottom of the card */
}

.card-facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card-facts li {
  font-size: 0.8125rem;  /* 13px */
  color: var(--muted);
  padding-left: 16px;
  position: relative;
}

/* The bullet dot — created with CSS rather than a list marker */
.card-facts li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--rule);
}

.card-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--navy-mid);
  letter-spacing: 0.02em;
  margin-top: auto;  /* Pushes to the bottom */
}

.card-link:hover {
  color: var(--navy);
}


/* ══════════════════════════════════════════════════════════════════
   DOMESDAY BAND
   Dark full-width section with quotation and statistics.
══════════════════════════════════════════════════════════════════ */
.domesday-band {
  background: var(--charcoal);
  padding: var(--space-3xl) var(--space-xl);
}

.band-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
}

.band-source {
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-md);
  font-weight: 400;
}

.band-text {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-style: italic;
  color: white;
  line-height: 1.6;
  margin-bottom: var(--space-md);
  /* Left border as a decorative element */
  border-left: 2px solid rgba(255,255,255,0.2);
  padding-left: var(--space-xl);
}

.band-note {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.4);
  padding-left: var(--space-xl);
  letter-spacing: 0.03em;
}

/* Statistics on the right side of the band */
.band-stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  padding-left: var(--space-xl);
  border-left: 1px solid rgba(255,255,255,0.1);
}

.stat-number {
  display: block;
  font-family: var(--serif);
  font-size: 3.5rem;
  color: white;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.05em;
  font-weight: 300;
}


/* ══════════════════════════════════════════════════════════════════
   TITLE CHAIN SECTION
══════════════════════════════════════════════════════════════════ */
.chain-section {
  padding: var(--space-3xl) var(--space-xl);
  background: var(--parch);
  max-width: 100%;
}

.chain-section .section-preamble {
  margin-bottom: var(--space-2xl);
}

/* The chain — a horizontal scrolling timeline */
.chain-timeline {
  display: flex;
  align-items: flex-start;
  gap: 0;
  max-width: var(--max-width);
  margin: 0 auto var(--space-xl);
  overflow-x: auto;   /* Scroll horizontally on small screens */
  padding-bottom: var(--space-md);

  /* Hide the scrollbar visually while keeping it functional */
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

/* Each node in the chain */
.chain-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  min-width: 140px;
  padding: 0 var(--space-sm);
  position: relative;
}

/* The dot at the top of each node */
.chain-node::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid var(--parch);
  outline: 1px solid var(--navy);
  margin-bottom: var(--space-md);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* The current lord's node has a special dot */
.chain-node--current::before {
  background: var(--hedge);
  outline-color: var(--hedge);
  width: 14px;
  height: 14px;
}

.chain-date {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--navy-mid);
  margin-bottom: 4px;
}

.chain-name {
  font-family: var(--serif);
  font-size: 0.9375rem;
  color: var(--navy);
  font-weight: 400;
  margin-bottom: 6px;
  line-height: 1.3;
}

.chain-note {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

/* The horizontal line connecting the nodes */
.chain-connector {
  flex-shrink: 0;
  width: 40px;
  height: 1px;
  background: var(--rule);
  margin-top: 4px;  /* Aligns with the centre of the dot */
  align-self: flex-start;
  margin-top: 26px; /* (dot-margin + half dot height) approx */
}

.chain-cta {
  text-align: center;
  margin-top: var(--space-xl);
}


/* ══════════════════════════════════════════════════════════════════
   FOOTER
══════════════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  padding: var(--space-2xl) var(--space-xl) var(--space-xl);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: var(--space-xl);
}

.footer-title {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: white;
  margin-bottom: 6px;
}

.footer-sub {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.05em;
  margin-bottom: var(--space-sm);
}

.footer-lord {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}

.footer-col-heading {
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: white;
}

.footer-base {
  max-width: var(--max-width);
  margin: 0 auto;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.35);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-archives {
  font-style: italic;
}


/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE DESIGN
   These rules apply only on screens narrower than the breakpoint.
   @media means "apply these styles when this condition is true".
══════════════════════════════════════════════════════════════════ */

/* ── TABLET: screens up to 960px wide ── */
@media (max-width: 960px) {

  .intro-grid {
    grid-template-columns: 1fr;   /* One column instead of three */
    max-width: 560px;
    margin: 0 auto;
  }

  .band-inner {
    grid-template-columns: 1fr;    /* One column instead of two */
    gap: var(--space-xl);
  }

  .band-stats {
    border-left: none;
    padding-left: 0;
    flex-direction: row;    /* Stats in a row instead of a column */
    flex-wrap: wrap;
    gap: var(--space-xl);
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-nav {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── MOBILE: screens up to 640px wide ── */
@media (max-width: 640px) {

  :root {
    --space-xl: 24px;    /* Reduce spacing on small screens */
    --space-2xl: 48px;
    --space-3xl: 72px;
  }

  /* Show the mobile toggle button */
  .nav-mobile-toggle { display: flex; }

  /* Hide the nav links by default on mobile */
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-md) var(--space-xl) var(--space-xl);
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  }

  /* When nav-open class is added by JavaScript, show the links */
  .nav-open .nav-links {
    display: flex;
  }

  .nav-link {
    padding: 10px 12px;
    font-size: 0.9375rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .chain-section .section-preamble {
    text-align: left;
  }

  .band-stats {
    flex-direction: column;
  }

  .footer-nav {
    grid-template-columns: 1fr;
  }

  .footer-base {
    text-align: center;
  }
}
