/*
Theme Name: St Neots Splash Park
Theme URI: https://www.stneotsaq.org
Description: Custom theme for St Neots Aquatic and Leisure CIO splash park website. Based on the original Wix design — blue/white colour scheme, single-page layout with anchor navigation.
Author: St Neots Aquatic and Leisure CIO
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stneotsaq
Tags: one-page, custom-menu, featured-images, full-width-template
*/

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */

:root {
  --color-primary:       #2596be;   /* Logo blue — main brand colour */
  --color-primary-dark:  #1a7a9a;   /* Darker blue for hover states */
  --color-primary-light: #e6f4f9;   /* Very light blue tint for section backgrounds */
  --color-accent:        #00bcd8;   /* Bright cyan — water/splash accent */
  --color-accent-dark:   #009ab8;
  --color-white:         #ffffff;
  --color-offwhite:      #f8fafd;
  --color-text:          #222222;
  --color-text-muted:    #555555;
  --color-border:        #cce8f2;

  --font-heading: 'Montserrat', 'Segoe UI', Arial, sans-serif;
  --font-body:    'Open Sans', 'Segoe UI', Arial, sans-serif;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg: 16px;

  --shadow-sm: 0 2px 8px rgba(37,150,190,0.12);
  --shadow-md: 0 4px 20px rgba(37,150,190,0.18);

  --max-width: 1100px;
  --section-padding: 80px 20px;
}

/* ==========================================================================
   Base Reset & Typography
   ========================================================================== */

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-white);
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-primary);
  margin-top: 0;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color 0.2s;
}
a:hover { color: var(--color-accent-dark); }

p { margin: 0 0 1.2em; }

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

/* ==========================================================================
   Site Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--color-white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.10);
  border-bottom: 3px solid var(--color-primary);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 80px;
}

.site-logo img {
  height: 70px;
  width: auto;
}

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

/* Main Navigation */
.main-navigation ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 6px;
}

.main-navigation ul li a {
  display: block;
  padding: 8px 14px;
  color: var(--color-primary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: background 0.2s, color 0.2s;
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item a {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

/* Mobile hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(37,150,190,0.4);
  border-radius: var(--radius-sm);
  color: var(--color-primary);
  font-size: 1.3rem;
  padding: 6px 10px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }

  .main-navigation {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 16px;
    box-shadow: var(--shadow-md);
  }

  .main-navigation.is-open { display: block; }

  .main-navigation ul {
    flex-direction: column;
    gap: 4px;
  }

  .main-navigation ul li a { color: var(--color-primary); }
}

/* ==========================================================================
   Hero Banner
   ========================================================================== */

.hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
  color: var(--color-white);
  padding: var(--section-padding);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section a {
  color: var(--color-white);
  text-decoration: underline;
  font-weight: 600;
}

.hero-section::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--color-white);
  clip-path: ellipse(60% 100% at 50% 100%);
}

.hero-section h1,
.hero-section h2 {
  color: var(--color-white);
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hero-section p {
  color: rgba(255,255,255,0.92);
  font-size: 1.1rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero-section .wp-block-quote {
  background: rgba(255,255,255,0.12);
  border-left: 4px solid var(--color-white);
  border-radius: var(--radius-md);
  padding: 20px 28px;
  max-width: 680px;
  margin: 24px auto;
  text-align: left;
}

.hero-section .wp-block-quote p { color: var(--color-white); margin-bottom: 8px; font-style: italic; }
.hero-section .wp-block-quote cite { color: rgba(255,255,255,0.75); font-size: 0.9rem; font-style: normal; font-weight: 600; }

/* ==========================================================================
   Content Sections (About, Phases, Survey, Contact)
   ========================================================================== */

.about-section,
.phases-section,
.survey-section,
.contact-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-padding);
}

/* Alternating background tints */
.about-section  { background: var(--color-white); }
.phases-section { background: var(--color-offwhite); max-width: 100%; }
.phases-section > * { max-width: var(--max-width); margin-left: auto; margin-right: auto; }
.survey-section { background: var(--color-white); }
.contact-section {
  background: var(--color-primary);
  max-width: 100%;
  color: var(--color-white);
}
.contact-section > * { max-width: var(--max-width); margin-left: auto; margin-right: auto; }
.contact-section h2 {
  color: var(--color-white);
  position: relative;
  padding-bottom: 16px;
  margin-bottom: 32px;
}
.contact-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.45);
  border-radius: 2px;
}
.contact-section a  { color: rgba(255,255,255,0.9); }
.contact-section a:hover { color: var(--color-white); }

.contact-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 0 20px;
}

.contact-emails {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.contact-email-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,0.92) !important;
  text-decoration: none !important;
  font-size: 1.05rem;
  padding: 10px 24px;
  border-radius: 50px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  transition: background 0.2s, transform 0.2s;
}

.contact-email-link:hover {
  background: rgba(255,255,255,0.22) !important;
  color: var(--color-white) !important;
  transform: translateY(-2px);
}

.contact-social {
  display: flex;
  gap: 16px;
  align-items: center;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.35);
  color: var(--color-white) !important;
  text-decoration: none !important;
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.social-btn:hover {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.65);
  transform: translateY(-3px);
}

/* Section headings with decorative underline */
.about-section h2,
.phases-section h2,
.survey-section h2 {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 16px;
}

.about-section h2::after,
.phases-section h2::after,
.survey-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

/* ==========================================================================
   Stat Columns (funding figures)
   ========================================================================== */

.about-section .wp-block-columns {
  margin: 32px 0;
  gap: 24px;
}

.about-section .wp-block-column {
  background: var(--color-primary-light);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}

.about-section .wp-block-column:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.about-section .wp-block-column h3 {
  font-size: 2.2rem;
  color: var(--color-primary);
  margin-bottom: 8px;
}

/* ==========================================================================
   Survey Results Columns
   ========================================================================== */

.survey-section .wp-block-column {
  background: var(--color-primary-light);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  border-top: 5px solid var(--color-accent);
}

.survey-section .wp-block-column h3 {
  font-size: 2.8rem;
  color: var(--color-primary);
  margin-bottom: 8px;
}

/* ==========================================================================
   Video Section
   ========================================================================== */

.video-section {
  background: var(--color-offwhite);
  padding: var(--section-padding);
  text-align: center;
}

.video-section h2 {
  color: var(--color-primary);
  margin-bottom: 32px;
  position: relative;
  padding-bottom: 16px;
}

.video-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--color-accent);
  border-radius: 2px;
}

.video-section .wp-block-video {
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.video-section .wp-block-video video {
  width: 100%;
  display: block;
}

/* ==========================================================================
   Phases Timeline
   ========================================================================== */

.phases-section h3 {
  color: var(--color-primary);
  border-left: 5px solid var(--color-accent);
  padding-left: 16px;
  margin-top: 40px;
  margin-bottom: 12px;
}

/* ==========================================================================
   WordPress Block Gallery (phases section)
   ========================================================================== */

.phases-section .wp-block-gallery.has-nested-images {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0 0 32px;
  padding: 0;
}

.phases-section .wp-block-gallery.has-nested-images figure.wp-block-image {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  width: 100% !important;
  height: 160px;
  flex-shrink: 0;
}

.phases-section .wp-block-gallery.has-nested-images figure.wp-block-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
  transition: transform 0.25s, opacity 0.25s;
}

.phases-section .wp-block-gallery.has-nested-images figure.wp-block-image:hover img {
  transform: scale(1.06);
  opacity: 0.5;
}

/* Captioned feature gallery — larger tiles */
.phases-section .wp-block-gallery.has-captioned-images.has-nested-images {
  grid-template-columns: repeat(3, 1fr);
}

.phases-section .wp-block-gallery.has-captioned-images.has-nested-images figure.wp-block-image {
  height: 240px;
}

/* Caption overlay */
.gallery-caption-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 100, 130, 0.88);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s;
  border-radius: var(--radius-sm);
  pointer-events: none;
}

.phases-section .wp-block-gallery.has-nested-images figure.wp-block-image:hover .gallery-caption-overlay {
  opacity: 1;
}

.gallery-caption-overlay strong {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}

.gallery-caption-overlay span {
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0.92;
  display: block;
}

@media (max-width: 768px) {
  .phases-section .wp-block-gallery.has-captioned-images.has-nested-images {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .phases-section .wp-block-gallery.has-captioned-images.has-nested-images {
    grid-template-columns: repeat(1, 1fr);
  }
  .phases-section .wp-block-gallery.has-captioned-images.has-nested-images figure.wp-block-image {
    height: 200px;
  }
}

/* Gutenberg wraps nested gallery images in an extra div — flatten it */
.phases-section .wp-block-gallery.has-nested-images figure.wp-block-image > div {
  height: 100%;
}

@media (max-width: 768px) {
  .phases-section .wp-block-gallery.has-nested-images {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 520px) {
  .phases-section .wp-block-gallery.has-nested-images {
    grid-template-columns: repeat(2, 1fr);
  }
  .phases-section .wp-block-gallery.has-nested-images figure.wp-block-image {
    height: 110px;
  }
}

/* ==========================================================================
   Separators
   ========================================================================== */

.wp-block-separator {
  border: none;
  border-top: 2px solid var(--color-border);
  margin: 0;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.wp-block-button .wp-block-button__link,
.btn {
  display: inline-block;
  padding: 14px 32px;
  background: var(--color-primary);
  color: var(--color-white) !important;
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 50px;
  letter-spacing: 0.03em;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  border: none;
  cursor: pointer;
}

.wp-block-button .wp-block-button__link:hover,
.btn:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--color-primary);
  color: var(--color-white) !important;
}

/* ==========================================================================
   Location Map
   ========================================================================== */

.site-map {
  width: 100%;
  line-height: 0;
  border-top: 3px solid var(--color-border);
}

.site-map iframe {
  height: 450px;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */

.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 28px 20px;
  font-size: 0.9rem;
}

.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: var(--color-white); }

.site-footer__social {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.site-footer__social a {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

/* ==========================================================================
   Utility
   ========================================================================== */

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 900px) {
  .about-section .wp-block-columns,
  .survey-section .wp-block-columns {
    flex-wrap: wrap;
  }
  .about-section .wp-block-column,
  .survey-section .wp-block-column {
    flex-basis: calc(50% - 12px);
    min-width: 200px;
  }
}

@media (max-width: 600px) {
  :root { --section-padding: 50px 16px; }

  .about-section .wp-block-column,
  .survey-section .wp-block-column {
    flex-basis: 100%;
  }

  .hero-section::before { display: none; }
}
