/* =========================================
   END THE UNION — Main Stylesheet
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:wght@400;600;700&display=swap');

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

:root {
  --navy: #0a1628;
  --dark-blue: #0d1f3c;
  --mid-blue: #1a3a6e;
  --accent-blue: #1e4d8c;
  --saltire-blue: #003078;
  --white: #ffffff;
  --off-white: #f5f5f0;
  --light-grey: #e8e8e2;
  --gold: #c8a94a;
  --warm-gold: #d4aa50;
  --text-dark: #1a1a1a;
  --text-mid: #444444;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  line-height: 1.7;
  color: var(--text-dark);
  background: var(--white);
}

/* ---- TOP BAR (reference documents) ---- */
.top-bar {
  background: var(--navy);
  padding: 0.5rem 2rem;
  border-bottom: 1px solid var(--mid-blue);
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.top-bar a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  transition: color 0.2s;
}

.top-bar a:hover { color: var(--gold); }

/* ---- HEADER ---- */
.site-header {
  background: var(--dark-blue);
  border-bottom: 3px solid var(--gold);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
}

.site-logo img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
}

.site-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--white);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-tagline {
  color: var(--gold);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  font-style: italic;
}

.edinburgh-cta {
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem 0;
}

.edinburgh-cta a {
  color: var(--gold);
  text-decoration: underline;
}

/* ---- NAV ---- */
.main-nav {
  background: var(--saltire-blue);
  border-bottom: 1px solid var(--mid-blue);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 1rem 0;
}

.nav-links {
  display: flex;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links li { position: relative; }

.nav-links a {
  display: block;
  color: var(--white);
  text-decoration: none;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s, color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--mid-blue);
  color: var(--gold);
}

.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--dark-blue);
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.25s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 100;
  border-top: 2px solid var(--gold);
}

.nav-links li:hover .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  padding: 0.6rem 1.25rem;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* ---- HERO ---- */
.hero {
  background: var(--dark-blue);
  color: var(--white);
  padding: 0;
  overflow: hidden;
}

.hero-slides {
  position: relative;
  min-height: 320px;
}

.hero-slide {
  padding: 4rem 2rem;
  text-align: center;
  display: none;
}

.hero-slide.active { display: block; }

.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}

.hero-slide h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.2;
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

.hero-slide p {
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
}

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 0 2rem;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  border: none;
  transition: background 0.2s;
}

.hero-dot.active { background: var(--gold); }

/* ---- SECTIONS ---- */
.section { padding: 4rem 2rem; }
.section--white { background: var(--white); }
.section--offwhite { background: var(--off-white); }
.section--dark { background: var(--dark-blue); color: var(--white); }
.section--navy { background: var(--navy); color: var(--white); }

.container { max-width: 1100px; margin: 0 auto; }
.container--narrow { max-width: 800px; margin: 0 auto; }

/* ---- SECTION HEADERS ---- */
.section-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

h2.section-title {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--dark-blue);
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.section--dark h2.section-title,
.section--navy h2.section-title { color: var(--white); }

/* ---- INTRO TEXT ---- */
.intro-text {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--text-mid);
  margin-bottom: 2rem;
}

.section--dark .intro-text,
.section--navy .intro-text { color: rgba(255,255,255,0.85); }

/* ---- SECTION CARDS (category index pages) ---- */
.section-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.section-card {
  background: var(--white);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  border-top: 4px solid var(--gold);
  transition: transform 0.2s, box-shadow 0.2s;
}

.section-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.section-card-inner { padding: 1.5rem; }

.section-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--dark-blue);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.section-card h3 a {
  color: inherit;
  text-decoration: none;
}

.section-card h3 a:hover { color: var(--saltire-blue); }

.section-card p {
  font-size: 0.95rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.section-card .read-more {
  color: var(--saltire-blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.section-card .read-more:hover { color: var(--gold); }

/* ---- PAGE HEADER ---- */
.page-header {
  background: linear-gradient(135deg, var(--dark-blue), var(--saltire-blue));
  color: var(--white);
  padding: 3.5rem 2rem;
}

.page-header-inner {
  max-width: 900px;
  margin: 0 auto;
}

.page-header .eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.page-header .subtitle {
  font-size: 1.1rem;
  opacity: 0.85;
  line-height: 1.6;
}

/* ---- CONTENT BODY ---- */
.content-section { padding: 3.5rem 2rem; background: var(--white); }

.content-body {
  max-width: 860px;
  margin: 0 auto;
}

.content-body h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--dark-blue);
  margin: 2rem 0 1rem;
}

.content-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--dark-blue);
  margin: 2.5rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--light-grey);
}

.content-body h2:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.content-body p {
  font-size: 1.05rem;
  line-height: 1.85;
  margin-bottom: 1.5rem;
  color: var(--text-dark);
}

.content-body ul, .content-body ol {
  margin: 1rem 0 1.5rem 2rem;
  font-size: 1.05rem;
  line-height: 1.8;
}

.content-body li { margin-bottom: 0.5rem; }

.content-body strong { color: var(--dark-blue); }

.content-body em { font-style: italic; }

.content-body blockquote {
  border-left: 4px solid var(--gold);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--off-white);
  font-style: italic;
  color: var(--text-mid);
  font-size: 1.05rem;
  line-height: 1.8;
}

.content-body a {
  color: var(--saltire-blue);
  text-decoration: underline;
}

.content-body a:hover { color: var(--gold); }

/* ---- HASH TAG ---- */
.hashtag {
  display: inline-block;
  color: var(--gold);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  margin-top: 2rem;
}

/* ---- EDINBURGH PROCLAMATION CALLOUT ---- */
.proclamation-callout {
  background: var(--navy);
  color: var(--white);
  padding: 3rem 2rem;
  text-align: center;
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--gold);
}

.proclamation-callout h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.proclamation-callout p {
  font-size: 1.05rem;
  opacity: 0.9;
  margin-bottom: 1.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ---- FLASH CARDS ---- */
.flash-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.flash-card {
  background: var(--dark-blue);
  color: var(--white);
  padding: 2rem;
  border-radius: 8px;
  border-top: 4px solid var(--gold);
}

.flash-card h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.flash-card .instruction {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.flash-card p {
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.9;
  margin-bottom: 0.75rem;
}

.flash-card .hashtag {
  display: block;
  margin-top: 1rem;
  font-size: 0.8rem;
}

/* ---- BUTTONS ---- */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  font-family: var(--font-body);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--warm-gold); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--gold); border: 2px solid var(--gold); }
.btn-outline:hover { background: var(--gold); color: var(--navy); }

/* ---- REFERENCE DOCS ---- */
.ref-docs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.ref-doc-link {
  display: block;
  padding: 1rem 1.25rem;
  background: var(--dark-blue);
  color: var(--gold);
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--mid-blue);
  transition: all 0.2s;
}

.ref-doc-link:hover {
  background: var(--mid-blue);
  border-color: var(--gold);
}

/* ---- FOOTER ---- */
.site-footer {
  background: var(--navy);
  color: var(--white);
  padding: 3rem 2rem 1.5rem;
  border-top: 3px solid var(--gold);
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2.5rem;
  padding-bottom: 2rem;
}

.footer-col h4 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 1rem;
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.footer-col a:hover { color: var(--gold); }
.footer-col p { color: rgba(255,255,255,0.7); font-size: 0.9rem; line-height: 1.6; }

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .nav-toggle { display: block; width: 100%; text-align: left; }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: rgba(255,255,255,0.05);
  }
  .hero-slide h1 { font-size: 2rem; }
  .page-header h1 { font-size: 1.8rem; }
  .flash-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .site-title { font-size: 1.5rem; }
  .top-bar-inner { gap: 0.75rem; }
}
