/* =========================================================================
   The Village Community Club — main stylesheet
   All colours, fonts, spacing and corner radii are controlled by the CSS
   variables below. Change these to re-brand the site — the club's real
   colours and fonts can also be set from Admin > Settings in a future
   phase; for now, edit the values here.
   ========================================================================= */

:root {
    /* ---- Brand colours (warm, welcoming, traditional village palette) --- */
    --color-primary: #2f6d4f;        /* deep village green */
    --color-primary-dark: #234f39;
    --color-primary-light: #e7f2ec;
    --color-accent: #c9622b;         /* warm terracotta/autumn orange */
    --color-accent-dark: #a34e20;
    --color-gold: #d9a441;           /* bunting gold, used sparingly */

    --color-text: #2b2b26;
    --color-text-muted: #5b5a52;
    --color-surface: #ffffff;
    --color-surface-alt: #faf6ee;    /* warm off-white, like bunting paper */
    --color-border: #e4ddcd;
    --color-success-bg: #e6f4ea;
    --color-success-text: #1a7a3c;
    --color-error-bg: #fbeaea;
    --color-error-text: #a3261e;

    /* ---- Typography --- */
    --font-heading: Georgia, 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 1.125rem;      /* 18px — generous, readable for all ages */
    --line-height-base: 1.65;

    /* ---- Spacing scale --- */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.75rem;
    --space-lg: 3rem;
    --space-xl: 5rem;

    /* ---- Shape --- */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --shadow-card: 0 6px 20px rgba(43, 43, 38, 0.08);
    --shadow-hover: 0 10px 28px rgba(43, 43, 38, 0.14);

    --container-width: 1180px;
    --focus-ring: 3px solid #1857a8;
}

/* ---- Reset & base ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: var(--color-surface-alt);
}

h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--color-primary-dark); line-height: 1.2; margin: 0 0 var(--space-sm); }
h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 var(--space-sm); }
a { color: var(--color-accent-dark); }
a:hover { color: var(--color-accent); }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; top: -3rem; left: 1rem; background: var(--color-primary);
    color: #fff; padding: 0.75rem 1.25rem; border-radius: var(--radius-sm); z-index: 1000;
    transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; }

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 var(--space-sm); }

/* ---- Placeholder content flag -------------------------------------- */
.placeholder-flag {
    display: inline-block; background: var(--color-gold); color: #4a3410;
    font-size: 0.8rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px;
    margin-bottom: var(--space-xs); letter-spacing: 0.02em;
}

/* ---- Buttons --------------------------------------------------------- */
.btn {
    display: inline-block; padding: 0.85rem 1.6rem; border-radius: var(--radius-md);
    font-weight: 700; text-decoration: none; border: 2px solid transparent; cursor: pointer;
    font-size: 1rem; transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--color-accent); color: #fff; }
.btn--primary:hover { background: var(--color-accent-dark); color: #fff; }
.btn--secondary { background: transparent; color: var(--color-primary-dark); border-color: var(--color-primary); }
.btn--secondary:hover { background: var(--color-primary-light); color: var(--color-primary-dark); }
.btn--light { background: #fff; color: var(--color-primary-dark); }
.btn--block { display: block; width: 100%; text-align: center; }
.btn--danger { background: var(--color-error-text); color: #fff; }
.btn--small { padding: 0.5rem 1rem; font-size: 0.9rem; }

/* ---- Site header ------------------------------------------------------ */
.site-header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 100; }
.site-header__bar { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem var(--space-sm); gap: var(--space-sm); }
.site-header__brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }
.site-header__logo { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--color-primary-light); }
.site-header__titles { display: flex; flex-direction: column; line-height: 1.2; }
.site-header__name { font-family: var(--font-heading); font-weight: 700; font-size: 1.25rem; color: var(--color-primary-dark); }
.site-header__village { font-size: 0.85rem; color: var(--color-text-muted); }

.nav-toggle {
    display: none; align-items: center; gap: 0.5rem; background: var(--color-primary-light);
    border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; cursor: pointer;
}
.nav-toggle__icon { width: 22px; height: 2px; background: var(--color-primary-dark); position: relative; display: inline-block; }
.nav-toggle__icon::before, .nav-toggle__icon::after { content: ""; position: absolute; left: 0; width: 22px; height: 2px; background: var(--color-primary-dark); }
.nav-toggle__icon::before { top: -7px; }
.nav-toggle__icon::after { top: 7px; }

.primary-nav__list { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.primary-nav__link {
    display: inline-block; padding: 0.6rem 0.9rem; border-radius: var(--radius-sm);
    text-decoration: none; color: var(--color-text); font-weight: 600;
}
.primary-nav__link:hover, .primary-nav__link--active { background: var(--color-primary-light); color: var(--color-primary-dark); }

@media (max-width: 860px) {
    .nav-toggle { display: inline-flex; }
    .primary-nav { display: none; width: 100%; order: 3; }
    .primary-nav.is-open { display: block; }
    .primary-nav__list { flex-direction: column; }
    .site-header__bar { flex-wrap: wrap; }
}

/* ---- Cookie banner ------------------------------------------------- */
.cookie-banner { background: var(--color-primary-dark); color: #fff; padding: var(--space-sm) 0; }
.cookie-banner__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner__actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---- Alerts / flash messages ---------------------------------------- */
.alert { padding: 1rem 1.25rem; border-radius: var(--radius-md); margin: var(--space-sm) auto; max-width: var(--container-width); }
.alert--success { background: var(--color-success-bg); color: var(--color-success-text); }
.alert--error { background: var(--color-error-bg); color: var(--color-error-text); }

/* ---- Hero -------------------------------------------------------------- */
.hero {
    background: linear-gradient(180deg, rgba(47,109,79,0.88), rgba(35,79,57,0.92)), var(--hero-image, none) center/cover;
    color: #fff; padding: var(--space-xl) 0; text-align: center;
}
.hero h1 { color: #fff; margin-bottom: var(--space-xs); }
.hero__subtitle { font-size: 1.3rem; max-width: 42rem; margin: 0 auto var(--space-md); opacity: 0.95; }
.hero__actions { display: flex; gap: var(--space-sm); justify-content: center; flex-wrap: wrap; }

.page-hero { background: var(--color-primary-light); padding: var(--space-lg) 0; text-align: center; }
.page-hero p { color: var(--color-text-muted); max-width: 42rem; margin: 0 auto; }

/* ---- Section layout ------------------------------------------------- */
.section { padding: var(--space-lg) 0; }
.section--alt { background: var(--color-surface); }
.section__header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-md); flex-wrap: wrap; }
.section__header p.lede { color: var(--color-text-muted); }

/* ---- Card grid (news/events) ----------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
@media (max-width: 960px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .card-grid { grid-template-columns: 1fr; } }

.card {
    background: var(--color-surface); border-radius: var(--radius-lg); overflow: hidden;
    box-shadow: var(--shadow-card); display: flex; flex-direction: column; height: 100%;
    text-decoration: none; color: inherit; border: 1px solid var(--color-border);
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }
.card__image { aspect-ratio: 16/10; object-fit: cover; width: 100%; background: var(--color-primary-light); }
.card__body { padding: var(--space-sm) var(--space-md) var(--space-md); flex: 1; display: flex; flex-direction: column; }
.card__meta { font-size: 0.85rem; color: var(--color-text-muted); font-weight: 600; margin-bottom: 0.35rem; }
.card__title { font-size: 1.2rem; margin-bottom: 0.4rem; }
.card__excerpt { color: var(--color-text-muted); flex: 1; }
.card__badge { display: inline-block; background: var(--color-accent); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 999px; margin-bottom: 0.5rem; align-self: flex-start; }

/* ---- Intro / two-column content -------------------------------------- */
.two-col { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--space-lg); align-items: center; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.two-col img { border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }

.rich-content h2, .rich-content h3, .rich-content h4 { margin-top: var(--space-md); }
.rich-content ul, .rich-content ol { padding-left: 1.4rem; }
.rich-content blockquote {
    border-left: 4px solid var(--color-accent); margin: var(--space-sm) 0; padding: 0.5rem 0 0.5rem var(--space-sm);
    color: var(--color-text-muted); font-style: italic;
}
.rich-content img { border-radius: var(--radius-md); margin: var(--space-sm) 0; }

/* ---- Gallery preview / grid ------------------------------------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-xs); }
@media (max-width: 860px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
.gallery-grid__item {
    display: block; border-radius: var(--radius-md); overflow: hidden; aspect-ratio: 1/1;
    background: var(--color-primary-light); border: none; padding: 0; cursor: pointer;
}
.gallery-grid__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease; }
.gallery-grid__item:hover img { transform: scale(1.06); }

.album-card { text-decoration: none; color: inherit; }
.album-card__cover { aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.album-card__title { margin-top: 0.6rem; font-weight: 700; color: var(--color-primary-dark); }

/* ---- Lightbox ---------------------------------------------------------- */
.lightbox {
    position: fixed; inset: 0; background: rgba(20, 18, 12, 0.92); display: none;
    align-items: center; justify-content: center; z-index: 1000; padding: var(--space-sm);
}
.lightbox.is-open { display: flex; }
.lightbox__figure { max-width: 90vw; max-height: 85vh; text-align: center; }
.lightbox__figure img { max-width: 90vw; max-height: 78vh; margin: 0 auto; border-radius: var(--radius-md); }
.lightbox__caption { color: #fff; margin-top: 0.75rem; }
.lightbox__close, .lightbox__prev, .lightbox__next {
    position: absolute; background: rgba(255,255,255,0.15); color: #fff; border: none;
    border-radius: 50%; width: 3rem; height: 3rem; font-size: 1.5rem; cursor: pointer;
}
.lightbox__close { top: var(--space-sm); right: var(--space-sm); }
.lightbox__prev { left: var(--space-sm); top: 50%; transform: translateY(-50%); }
.lightbox__next { right: var(--space-sm); top: 50%; transform: translateY(-50%); }
.lightbox__close:hover, .lightbox__prev:hover, .lightbox__next:hover { background: rgba(255,255,255,0.3); }

/* ---- Video embed (privacy-friendly, consent-gated) ---------------------- */
.video-embed { position: relative; aspect-ratio: 16/9; border-radius: var(--radius-lg); overflow: hidden; background: var(--color-primary-dark); }
.video-embed iframe { width: 100%; height: 100%; border: 0; }
.video-consent { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: #fff; text-align: center; padding: var(--space-sm); gap: var(--space-xs); }

/* ---- Forms --------------------------------------------------------------- */
.form-grid { display: grid; gap: var(--space-sm); max-width: 640px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.form-field input, .form-field select, .form-field textarea {
    width: 100%; padding: 0.75rem 0.9rem; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
    font-family: inherit; font-size: 1rem; background: #fff;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--color-primary); }
.form-field small.hint { display: block; color: var(--color-text-muted); margin-top: 0.3rem; }
.form-checkbox { display: flex; align-items: flex-start; gap: 0.6rem; }
.form-checkbox input { width: auto; margin-top: 0.3rem; }
.form-honeypot { position: absolute; left: -9999px; top: -9999px; }
.form-errors { background: var(--color-error-bg); color: var(--color-error-text); border-radius: var(--radius-sm); padding: 1rem; margin-bottom: var(--space-sm); }
.form-errors ul { margin: 0; padding-left: 1.2rem; }

/* ---- Info blocks (opening hours / address / map) ------------------------- */
.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
@media (max-width: 860px) { .info-grid { grid-template-columns: 1fr; } }
.info-block { background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--space-md); box-shadow: var(--shadow-card); border: 1px solid var(--color-border); }
.info-block h3 { margin-top: 0; }
.map-embed { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16/9; }
.map-embed iframe { width: 100%; height: 100%; border: 0; }

/* ---- Committee ------------------------------------------------------------ */
.committee-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
@media (max-width: 860px) { .committee-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .committee-grid { grid-template-columns: 1fr; } }
.committee-card { background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--space-md); text-align: center; box-shadow: var(--shadow-card); border: 1px solid var(--color-border); }
.committee-card img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin: 0 auto var(--space-xs); }
.committee-card__role { color: var(--color-accent-dark); font-weight: 700; margin-bottom: 0.4rem; }

/* ---- Pricing / membership table -------------------------------------------- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-md); }
@media (max-width: 860px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card { background: var(--color-surface); border: 2px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-md); text-align: center; }
.pricing-card--featured { border-color: var(--color-accent); box-shadow: var(--shadow-hover); }
.pricing-card__price { font-size: 2.2rem; font-family: var(--font-heading); color: var(--color-primary-dark); margin: var(--space-xs) 0; }

/* ---- Pagination ---------------------------------------------------------- */
.pagination { display: flex; justify-content: center; align-items: center; gap: var(--space-sm); margin-top: var(--space-lg); }
.pagination__link { padding: 0.6rem 1.1rem; border-radius: var(--radius-sm); background: var(--color-primary-light); text-decoration: none; font-weight: 700; color: var(--color-primary-dark); }
.pagination__link:hover { background: var(--color-primary); color: #fff; }

/* ---- Newsletter list ------------------------------------------------------ */
.newsletter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.newsletter-item { display: flex; gap: var(--space-sm); align-items: center; background: var(--color-surface); border-radius: var(--radius-lg); padding: var(--space-sm) var(--space-md); box-shadow: var(--shadow-card); border: 1px solid var(--color-border); flex-wrap: wrap; }
.newsletter-item__cover { width: 70px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); background: var(--color-primary-light); }
.newsletter-item__meta { flex: 1; min-width: 200px; }
.newsletter-year-heading { margin-top: var(--space-lg); }

/* ---- Footer ---------------------------------------------------------------- */
.site-footer { background: var(--color-primary-dark); color: #f1efe6; padding-top: var(--space-lg); }
.site-footer a { color: #f1efe6; }
.site-footer__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-md); padding-bottom: var(--space-lg); }
@media (max-width: 860px) { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer__heading { color: #fff; font-size: 1.1rem; margin-bottom: 0.75rem; }
.footer-links, .social-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.site-footer address { font-style: normal; }
.site-footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-xs); border-top: 1px solid rgba(255,255,255,0.15); padding: var(--space-sm) 0; font-size: 0.9rem; }
.footer-legal { list-style: none; display: flex; gap: var(--space-sm); padding: 0; margin: 0; }

/* ---- Utility -------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.stack { display: grid; gap: var(--space-sm); }
.tag { display: inline-block; background: var(--color-primary-light); color: var(--color-primary-dark); font-weight: 700; font-size: 0.8rem; padding: 0.25rem 0.7rem; border-radius: 999px; }
.empty-state { text-align: center; padding: var(--space-lg) 0; color: var(--color-text-muted); }
