/* ============================================================
   Cook Foundation UK — Global Stylesheet
   ============================================================ */

/* ---------- CSS Variables / Design Tokens ---------- */
:root {
  /* Colors */
  --clr-navy:        #1a2744;
  --clr-navy-light:  #243352;
  --clr-blue:        #1e73be;
  --clr-blue-light:  #3a8fd4;
  --clr-blue-pale:   #f4f8ff;
  --clr-white:       #ffffff;
  --clr-off-white:   #f7f9fc;
  --clr-text:        #2c3e50;
  --clr-text-light:  #5a6e82;
  --clr-border:      #e2e8f0;
  --clr-accent:      #e8b131;

  /* Typography */
  --ff-body:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semi:   600;
  --fw-bold:   700;

  /* Sizing */
  --container-max: 1160px;
  --header-height: 80px;

  /* Radius */
  --radius-sm:  8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(26,39,68,.06), 0 1px 2px rgba(26,39,68,.04);
  --shadow-md:  0 4px 14px rgba(26,39,68,.08), 0 2px 6px rgba(26,39,68,.04);
  --shadow-lg:  0 12px 40px rgba(26,39,68,.12), 0 4px 12px rgba(26,39,68,.06);
  --shadow-glow: 0 0 30px rgba(30,115,190,.15);

  /* Transitions */
  --ease-out: cubic-bezier(.22,1,.36,1);
  --dur-fast:  .2s;
  --dur-med:   .35s;
  --dur-slow:  .5s;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--ff-body);
  font-weight: var(--fw-normal);
  color: var(--clr-text);
  background: var(--clr-off-white);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

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

a {
  color: var(--clr-blue);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

a:hover {
  color: var(--clr-blue-light);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--clr-navy);
  line-height: 1.25;
  font-weight: var(--fw-bold);
}

ul { list-style: none; }

/* ---------- Utility ---------- */
.container {
  width: 90%;
  max-width: var(--container-max);
  margin: 0 auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ---------- HEADER ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--clr-border);
  transition: box-shadow var(--dur-med) var(--ease-out),
              background var(--dur-med) var(--ease-out);
}

.site-header.scrolled {
  box-shadow: var(--shadow-md);
  background: rgba(255,255,255,.97);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.logo img {
  height: 46px;
  width: auto;
}

/* Desktop Nav */
.main-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
}

.main-nav a {
  display: block;
  padding: 8px 16px;
  font-size: .9rem;
  font-weight: var(--fw-medium);
  color: var(--clr-text);
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--clr-blue);
  background: var(--clr-blue-pale);
}

/* Has dropdown */
.nav-item {
  position: relative;
}

.nav-item .dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity var(--dur-fast) var(--ease-out),
              visibility var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

/* Align dropdown to the right for the last few items to prevent screen overflow */
.main-nav ul li:nth-last-child(1) .dropdown,
.main-nav ul li:nth-last-child(2) .dropdown {
  left: auto;
  right: 0;
}

.nav-item .dropdown li { display: block; }

.nav-item .dropdown a {
  padding: 8px 14px;
  font-size: .85rem;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Mobile Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--clr-navy);
}

.nav-toggle svg {
  width: 26px;
  height: 26px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ---------- HERO / VIDEO SECTION ---------- */
.hero {
  margin-top: var(--header-height);
  position: relative;
  background: linear-gradient(145deg, var(--clr-navy) 0%, var(--clr-navy-light) 100%);
  padding: 60px 0 50px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(30,115,190,.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -15%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232,177,49,.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-caption {
  color: rgba(255,255,255,.85);
  font-size: .95rem;
  font-weight: var(--fw-medium);
  text-align: center;
  max-width: 780px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

.hero-caption strong {
  color: var(--clr-white);
}

.video-wrapper {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.video-wrapper::before {
  content: '';
  display: block;
  padding-bottom: 56.25%;       /* 16:9 aspect ratio */
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- WELCOME SECTION ---------- */
.welcome {
  padding: 80px 0 60px;
  text-align: center;
  background: var(--clr-white);
}

.welcome h1 {
  font-size: 2.2rem;
  margin-bottom: 18px;
  letter-spacing: -.02em;
}

.welcome p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--clr-text-light);
  font-size: 1.1rem;
  line-height: 1.8;
}

.welcome .divider {
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--clr-blue), var(--clr-accent));
  border-radius: 99px;
  margin: 30px auto 0;
}

/* ---------- FEATURE CARDS ---------- */
.features {
  padding: 70px 0 80px;
  background: var(--clr-off-white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  position: relative;
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 40px 32px 36px;
  text-align: center;
  transition: transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out);
}

.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 22px;
  background: var(--clr-blue-pale);
  color: var(--clr-blue);
  font-size: 1.6rem;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

.feature-card:hover .feature-icon {
  background: var(--clr-blue);
  color: var(--clr-white);
}

.feature-card h2 {
  font-size: 1.15rem;
  font-weight: var(--fw-semi);
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--clr-text-light);
  font-size: .93rem;
  line-height: 1.65;
  margin-bottom: 18px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .88rem;
  font-weight: var(--fw-semi);
  color: var(--clr-blue);
  transition: gap var(--dur-fast) var(--ease-out);
}

.card-link:hover {
  gap: 10px;
}

.card-link svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ---------- CTA CARDS ---------- */
.cta-section {
  padding: 0 0 80px;
  background: var(--clr-off-white);
}

.cta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}

.cta-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  padding: 44px 40px;
  color: var(--clr-white);
  transition: transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out);
}

.cta-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.cta-card--objectives {
  background: linear-gradient(135deg, var(--clr-blue) 0%, #2b649d 100%);
}

.cta-card--contact {
  background: linear-gradient(135deg, var(--clr-navy) 0%, var(--clr-navy-light) 100%);
}

.cta-card::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  pointer-events: none;
}

.cta-card h3 {
  color: var(--clr-white);
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.cta-card p {
  opacity: .85;
  font-size: .95rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: var(--clr-white);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: var(--fw-semi);
  backdrop-filter: blur(4px);
  transition: background var(--dur-fast) var(--ease-out);
}

.cta-btn:hover {
  background: rgba(255,255,255,.25);
  color: var(--clr-white);
}

.cta-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* ---------- FOOTER ---------- */
.site-footer {
  background: var(--clr-navy);
  color: rgba(255,255,255,.7);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 50px;
}

.footer-brand p {
  font-size: .9rem;
  line-height: 1.7;
  margin-top: 16px;
}

.footer-brand img {
  height: 40px;
  filter: brightness(0) invert(1);
}

.footer-col h4 {
  color: var(--clr-white);
  font-size: .85rem;
  font-weight: var(--fw-semi);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col a {
  color: rgba(255,255,255,.65);
  font-size: .88rem;
  transition: color var(--dur-fast) var(--ease-out);
}

.footer-col a:hover {
  color: var(--clr-white);
}

.footer-contact li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
  font-size: .88rem;
}

.footer-contact svg {
  width: 16px;
  height: 16px;
  stroke: rgba(255,255,255,.5);
  stroke-width: 2;
  fill: none;
  flex-shrink: 0;
  margin-top: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .82rem;
}

.footer-bottom a {
  color: rgba(255,255,255,.5);
}

.footer-bottom a:hover {
  color: var(--clr-white);
}

.footer-legal {
  display: flex;
  gap: 20px;
}

/* ---------- ANIMATIONS (on-scroll reveal) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-med) var(--ease-out),
              transform var(--dur-med) var(--ease-out);
}

.reveal-stagger.visible > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible > *:nth-child(2) { transition-delay: .1s; }
.reveal-stagger.visible > *:nth-child(3) { transition-delay: .2s; }

.reveal-stagger.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .cta-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  /* Mobile nav breakpoint updated to 1024px to prevent tablet wrap */
  .nav-toggle {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    bottom: auto;
    height: calc(100vh - var(--header-height));
    background: var(--clr-white);
    padding: 30px 20px;
    transform: translateX(100%);
    transition: transform var(--dur-med) var(--ease-out);
    overflow-y: auto;
    z-index: 999;
  }

  .main-nav.open {
    transform: translateX(0);
  }

  .main-nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .main-nav a {
    font-size: 1.25rem;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
  }

  .nav-item .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 4px 16px 16px 24px;
    border-left: 2px solid var(--clr-border);
    min-width: 0;
  }

  .nav-item .dropdown a {
    font-size: 1.1rem;
    padding: 10px 16px;
    color: var(--clr-text-light);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }


  /* Hero */
  .hero {
    padding: 40px 0 36px;
  }

  .hero-caption {
    font-size: .88rem;
    margin-bottom: 22px;
    padding: 0 8px;
  }

  /* Welcome */
  .welcome {
    padding: 50px 0 40px;
  }

  .welcome h1 {
    font-size: 1.6rem;
  }

  .welcome p {
    font-size: 1rem;
  }

  /* Features */
  .features {
    padding: 50px 0 60px;
  }

  .feature-card {
    padding: 30px 24px 28px;
  }

  /* CTA */
  .cta-card {
    padding: 32px 28px;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- INNER PAGES ---------- */
.page-header {
  margin-top: var(--header-height);
  background: linear-gradient(145deg, var(--clr-navy) 0%, var(--clr-navy-light) 100%);
  padding: 80px 0 60px;
  text-align: center;
  color: var(--clr-white);
}

.page-header h1 {
  color: var(--clr-white);
  font-size: 2.4rem;
  margin-bottom: 15px;
}

.page-header p {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

.page-content {
  margin-top: var(--header-height);
  padding: 80px 0;
  background: var(--clr-white);
  min-height: 40vh;
}

.page-body p {
  margin-bottom: 26px;
  line-height: 1.8;
  color: var(--clr-text-light);
  font-size: 1.05rem;
}

.page-body ul, .page-body ol {
  margin-bottom: 26px;
  margin-left: 24px;
  line-height: 1.8;
  color: var(--clr-text-light);
  font-size: 1.05rem;
}

.page-body ul {
  list-style-type: disc;
}

.page-body ol {
  list-style-type: decimal;
}

.page-body ul ul {
  margin-top: 8px;
  margin-bottom: 8px;
}

.page-body li {
  margin-bottom: 10px;
}

.page-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

/* Content image alignment classes */
.page-body .alignright {
  float: right;
  max-width: 300px;
  margin: 0 0 20px 24px;
  display: block;
}

.page-body .alignleft {
  float: left;
  max-width: 300px;
  margin: 0 24px 20px 0;
  display: block;
}

.page-body .aligncenter {
  display: block;
  margin: 30px auto;
  max-width: 400px;
}

.page-body h2, .page-body h3, .page-body h4 {
  margin-top: 48px;
  margin-bottom: 20px;
  clear: both;
}

/* Image gallery (e.g. Birthplace Museum) */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin: 36px 0;
  clear: both;
}

.image-gallery img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin: 0;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.image-gallery img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

/* Charity thumbnails (CF UK Charities page) */
.charity-thumbnails {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin: 30px 0 40px;
  flex-wrap: wrap;
}

.charity-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out);
}

.charity-thumb:hover {
  transform: translateY(-4px);
}

.charity-thumb img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  max-height: 160px;
  width: auto;
  margin: 0;
}

.charity-thumb span {
  font-size: .9rem;
  font-weight: var(--fw-semi);
  color: var(--clr-navy);
}

.coming-soon-box {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  padding: 60px 40px;
  background: var(--clr-off-white);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--clr-border);
}

.coming-soon-box svg {
  width: 64px;
  height: 64px;
  stroke: var(--clr-blue);
  margin-bottom: 20px;
}

/* ---------- CONTACT FORM ---------- */
.contact-wrapper {
  max-width: 800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
}

.contact-card {
  background: var(--clr-white);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-md);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-size: 0.95rem;
  font-weight: var(--fw-semi);
  margin-bottom: 8px;
  color: var(--clr-navy);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  font-family: var(--ff-body);
  font-size: 1rem;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}

.form-control:focus {
  outline: none;
  border-color: var(--clr-blue);
  box-shadow: 0 0 0 3px rgba(30,115,190,0.1);
}

textarea.form-control {
  min-height: 150px;
  resize: vertical;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--clr-blue);
  color: var(--clr-white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: var(--fw-semi);
  cursor: pointer;
  transition: background var(--dur-fast), transform var(--dur-fast);
}

.btn-primary:hover {
  background: var(--clr-navy);
  color: var(--clr-white);
  transform: translateY(-2px);
}

/* Responsive inner pages */
@media (max-width: 768px) {
  .page-header {
    padding: 60px 0 40px;
  }
  .page-header h1 {
    font-size: 2rem;
  }
  .contact-card {
    padding: 24px;
  }
}

