/* =========================================
   THE WHATELEY CLUB — Shared Stylesheet
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=Cinzel:wght@400;600&family=Lato:wght@300;400&display=swap');

/* --- Variables --- */
:root {
  --black: #0a0a0a;
  --white: #f5f2ed;
  --cream: #d9d2c5;
  --gold: #6b4f1e;
  --gold-light: #8a6830;
  --mid: #5a5550;
  --rule: rgba(184,150,90,0.35);
  --nav-h: 72px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--white);
  color: var(--black);
  font-family: 'Lato', sans-serif;
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: 'Cinzel', serif;
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.25;
}
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1rem, 2vw, 1.3rem); }
h4 { font-size: 0.8rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); }

p { font-family: 'Cormorant Garamond', serif; font-size: clamp(1rem, 1.5vw, 1.15rem); color: #2a2825; text-align: justify; hyphens: auto; -webkit-hyphens: auto; hyphenate-limit-chars: 10 4 4; hyphenate-limit-lines: 2; overflow-wrap: break-word; }

/* --- Navigation --- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: center;
  gap: 2.5rem;
  padding: 0 clamp(1.5rem, 5vw, 4rem);
  transition: box-shadow 0.3s ease;
}
.site-nav.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }

.nav-logo { flex-shrink: 0; margin-right: auto; }
.nav-logo img { height: 42px; width: auto; }

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  flex-shrink: 0;
}
.nav-links a {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--black);
  position: relative;
  padding-bottom: 3px;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s ease;
}
.nav-links a:hover { color: var(--gold); }
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--gold); }

/* Nav action button — always the rightmost nav element, fixed width */
.nav-action {
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mid);
  background: none;
  border: 1px solid var(--rule);
  cursor: pointer;
  padding: 0.35rem 0;
  width: 9rem;
  height: 2.1rem;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.nav-action:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* Hamburger */

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--black);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile menu */
.nav-mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  padding: 1.5rem clamp(1.5rem, 5vw, 4rem) 2rem;
  z-index: 99;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.nav-mobile.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}
.nav-mobile ul { list-style: none; display: flex; flex-direction: column; gap: 1.2rem; }
.nav-mobile a {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--black);
}
.nav-mobile a.active { color: var(--gold); }

/* --- Page Layout --- */
.page-wrap {
  padding-top: var(--nav-h);
}

/* Hero Banner with overlaid title */
.hero {
  width: 100%;
  height: clamp(220px, 32vw, 400px);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}
/* Dark gradient so title is always legible */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10,10,10,0.45);
  pointer-events: none;
}
.hero-title {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 2rem;
  color: var(--white);
}
.hero-title h2 {
  color: var(--white);
  text-shadow: 0 1px 8px rgba(0,0,0,0.4);
}
.hero-title .hero-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(245,242,237,0.75);
  margin-top: 0.4rem;
}

/* Content sections */
.content-section {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 5vw, 2.5rem);
}
.content-section + .content-section {
  border-top: 1px solid var(--rule);
}

/* Home intro: branch left, title + copy right */
.home-intro {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  gap: 2.5rem;
  align-items: center;
}
.home-intro .branch-img {
  width: 100%;
  max-width: 120px;
  opacity: 0.75;
  image-rendering: auto;
}
.home-intro .branch-img--flip {
  transform: rotate(180deg);
}
.home-intro-text h2 { margin-bottom: 1rem; }
.home-intro-text .gold-rule { margin: 1rem 0 1.25rem; }

/* Gold rule divider */
.gold-rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

/* CTA Button */
.btn {
  display: inline-block;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-light);
  border: 1px solid var(--gold-light);
  padding: 1rem 2.5rem;
  transition: background 0.25s ease, color 0.25s ease;
}
.btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--white);
}

/* Centered CTA block */
.cta-block {
  text-align: center;
  padding: 3rem 2rem;
  background: #2a2520;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.cta-block h4 {
  margin-bottom: 1.5rem;
  color: var(--gold-light);
  font-size: 1rem;
  letter-spacing: 0.15em;
}

/* --- Carousel ---
/* --- Carousel ---
   The .carousel wrapper clips overflow.
   The .carousel-track does NOT clip — this lets prev/next peek in from the sides.

   Active: width 76%, centred → left = 12%
   Gap between active and neighbours: 2%
   Prev:  left = 12% - 2% - 76% = -66%  (right edge lands at -66+76 = 10%, 2% gap before active)
   Next:  left = 12% + 76% + 2% = 90%
*/
.carousel {
  position: relative;
  overflow: hidden;        /* clips prev/next at the carousel boundary */
  background: var(--black);
  user-select: none;
  width: 100%;
}
.carousel-track {
  position: relative;
  width: 100%;
  height: clamp(280px, 42vw, 520px);
  overflow: visible;       /* do NOT clip here — let neighbours show */
  padding-top: 0.9rem;     /* match the dots padding below */
}
.carousel-track img {
  position: absolute;
  top: 0.9rem;             /* respect the top padding */
  width: 76%;
  height: calc(100% - 0.9rem);
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  left: 200%;              /* default: far off-screen */
  transition: left 0.5s cubic-bezier(0.4,0,0.2,1), opacity 0.5s ease;
}
.carousel-track img.is-active {
  left: 12%;
  opacity: 1;
  z-index: 2;
}
.carousel-track img.is-prev {
  left: -66%;
  opacity: 0.3;
  z-index: 1;
}
.carousel-track img.is-next {
  left: 90%;
  opacity: 0.3;
  z-index: 1;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10,10,10,0.55);
  border: 1px solid rgba(184,150,90,0.4);
  color: var(--gold-light);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s, border-color 0.2s;
  font-size: 1.1rem;
  line-height: 1;
}
.carousel-btn:hover {
  background: rgba(184,150,90,0.25);
  border-color: var(--gold);
}
.carousel-btn--prev { left: 1rem; }
.carousel-btn--next { right: 1rem; }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 0.9rem 0;
  background: var(--black);
}
.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(184,150,90,0.3);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}
.carousel-dot.active { background: var(--gold); }

/* --- Foundations: side-by-side image+text, equal height --- */
.split-section {
  display: grid;
  gap: 2.5rem;
  align-items: stretch;
  margin: 1.5rem 0;
}
.split-section.img-left  { grid-template-columns: 1fr 1fr; }
.split-section.img-right { grid-template-columns: 1fr 1fr; }
.split-section.img-right .split-img { order: 2; }
.split-section.img-right .split-text { order: 1; }
.split-img {
  min-height: 0; /* allow flex/grid shrink */
}
.split-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.split-text { display: flex; flex-direction: column; justify-content: center; }
.split-text p + p { margin-top: 1rem; }
.wae-logo { width: 90px; margin-top: 1.5rem; opacity: 0.85; display: block; margin-left: auto; margin-right: auto; }

/* Director lists */
.director-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}
.director-grid h4 { margin-bottom: 0.75rem; }
.director-grid ul { list-style: none; }
.director-grid ul li {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(184,150,90,0.15);
  color: #2a2825;
}

/* --- Accordion --- */
.accordion {
  border-top: 1px solid var(--rule);
  margin-top: 2rem;
}
.accordion-trigger {
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--rule);
  padding: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  gap: 1rem;
}
.accordion-trigger h4 {
  margin: 0;
  color: var(--gold);
  transition: color 0.2s;
}
.accordion-trigger:hover h4 { color: var(--gold-light); }
.accordion-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  position: relative;
  opacity: 0.6;
}
.accordion-icon::before,
.accordion-icon::after {
  content: '';
  position: absolute;
  background: var(--gold);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.accordion-icon::before { width: 100%; height: 1px; top: 50%; left: 0; transform: translateY(-50%); }
.accordion-icon::after  { width: 1px; height: 100%; left: 50%; top: 0; transform: translateX(-50%); }
.accordion-trigger[aria-expanded="true"] .accordion-icon::after { transform: translateX(-50%) rotate(90deg); opacity: 0; }
.accordion-body {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.4s ease;
}
.accordion-body-inner {
  padding: 1.5rem 0 2rem;
}

/* --- Art & Culture: intro image pair --- */
.gallery-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin-bottom: 2rem;
}
.gallery-intro img {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

/* --- Membership --- */
.membership-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  margin: 2.5rem 0;
}
.membership-intro img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

/* --- Inquiry Form --- */
.inquiry-section {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1.5rem, 5vw, 2.5rem);
}
.contact-info {
  text-align: center;
  margin-bottom: 3rem;
}
.contact-info a {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.contact-info p {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  color: var(--mid);
  margin-top: 0.5rem;
}

.form-group { margin-bottom: 1.5rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--rule);
  padding: 0.65rem 0.85rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  color: var(--black);
  outline: none;
  transition: border-color 0.2s;
  border-radius: 0;
  -webkit-appearance: none;
}
input:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 100px; }

.checkbox-group { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.4rem; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  color: var(--black);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  border: 1px solid var(--gold);
  background: transparent;
  accent-color: var(--gold);
  flex-shrink: 0;
  cursor: pointer;
}
.form-submit { margin-top: 2.5rem; text-align: center; }
.form-submit .btn { cursor: pointer; font-family: 'Cinzel', serif; }
.form-message {
  text-align: center;
  padding: 1rem;
  margin-top: 1rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  display: none;
}
.form-message.success { color: #4a7c59; }
.form-message.error { color: #8b2e2e; }

/* --- Monogram accent --- */
.monogram-accent {  display: block;
  width: 90px;
  margin: 3rem auto 4rem;
  opacity: 0.5;
}

/* --- Footer --- */
.site-footer {
  background: var(--black);
  color: var(--white);
  padding: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 5vw, 4rem);
}
.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 3rem;
  align-items: start;
}
.footer-logo img { height: 46px; width: auto; filter: invert(1); }
.footer-right { display: flex; flex-direction: column; gap: 1rem; }
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  list-style: none;
}
.footer-nav a {
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(245,242,237,0.65);
  transition: color 0.2s;
}
.footer-nav a:hover { color: var(--gold-light); }
.footer-address {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  color: rgba(245,242,237,0.5);
  line-height: 1.5;
}
.footer-copy {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.85rem;
  color: rgba(245,242,237,0.3);
  border-top: 1px solid rgba(184,150,90,0.2);
  max-width: 900px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-toggle { display: flex; }
  .nav-action { display: none; }
  .nav-mobile { display: block; }

  .home-intro { grid-template-columns: 1fr; }
  .home-intro .branch-img { display: none; }
  .home-intro-text { text-align: center; }

  .split-section.img-left,
  .split-section.img-right { grid-template-columns: 1fr; }
  .split-section.img-right .split-img { order: 0; }
  .split-section.img-right .split-text { order: 0; }

  .gallery-intro { grid-template-columns: 1fr; }
  .director-grid { grid-template-columns: 1fr; }
  .membership-intro { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

@media (max-width: 480px) {
  .gallery-intro img { height: 220px; }
}


/* --- Glitch effect (triggered by JS, rare) --- */
@keyframes heroGlitch {
  0%   { filter: none; opacity: 1; }
  8%   { filter: brightness(1.4) contrast(1.2) saturate(0); opacity: 0.92; transform: translateX(2px); }
  10%  { filter: none; opacity: 1; transform: none; }
  11%  { filter: brightness(0.7) hue-rotate(180deg); opacity: 0.85; transform: translateX(-1px); }
  13%  { filter: none; opacity: 1; transform: none; }
  100% { filter: none; opacity: 1; }
}
.hero.is-glitching img {
  animation: heroGlitch 0.35s steps(1) forwards;
}
