/* ---------------------------------------------------------------
   Connemara GAA — base stylesheet
   Palette matches the live site: a fixed sepia/vintage-photo page
   background (bg.jpg) with white body text, and a translucent dark
   "card" for the actual content — same structure the old theme used
   (#inner-content over body's fixed background). Checked against the
   live site's rendered styles and its theme CSS on 2026-09-10.
   --------------------------------------------------------------- */

/* Special Elite (Google Fonts, OFL-licensed — no usage restrictions).
   Self-hosted rather than loaded from Google's CDN so the site has no
   third-party runtime dependency. Chosen to replace the live site's
   '28 Days Later' font, which is personal-use-only licensed. */
@font-face {
  font-family: 'Special Elite';
  src: url('/fonts/special-elite/SpecialElite.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Page background: fixed sepia photo, #77542c fallback while it loads. */
  --color-page-bg-fallback: #77542c;
  --color-text: #ffffff;
  --color-muted: #d8cdbf;
  --color-border: rgba(255, 255, 255, 0.15);
  /* Page title (h1) sits directly on the sepia background, outside the
     content card, so it needs a dark ink colour rather than white —
     sampled from the live site's rendered title text. */
  --color-page-title: #2b1810;
  --color-primary: #e2b96b;
  --color-primary-dark: #f0c880;
  --color-primary-contrast: #ffffff;
  /* The old theme's #inner-content: a translucent dark card floating
     over the fixed body background, with a translucent border — not
     an opaque surface, so some of the body texture still shows through. */
  --color-surface: rgba(0, 0, 0, 0.75);
  --color-surface-border: rgba(6, 6, 6, 0.5);
  /* The nav dropdown/mega-menu panels are deliberately a separate light
     surface (already tested for contrast) — they don't follow the page's
     dark theme, so they get their own variables rather than reusing the
     ones above. */
  --nav-surface: #ffffff;
  --nav-surface-text: #1f2a1f;
  --nav-surface-hover-bg: #fbfaf6;
  --nav-surface-border: #dfe3d8;
  --nav-accent: #1e5631;
  --color-nav-bg: #0a0806;
  --color-nav-bg-hover: #262626;
  --color-nav-border: #353535;
  --color-nav-text: #ffffff;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Special Elite', Georgia, "Times New Roman", serif;
  --nav-height: 4rem;
  --max-width: 72rem;
  --header-max-width: 100rem;
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  color: var(--color-text);
  background: var(--color-page-bg-fallback) url('/images/bg.jpg') repeat top center fixed;
  font-family: var(--font-body);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--color-primary);
}

/* The page <h1> sits directly on the sepia body background, outside
   the content card below, so it needs dark ink rather than the light
   gold used for headings inside the card. */
.page-title {
  overflow-wrap: break-word;
  margin-top: 0;
  color: var(--color-page-title);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Sits at the top of the content card, on its dark surface — so it uses
   the card's own text colours. (It used to sit above the title on the
   sepia photo, which needed a light pill for contrast and its own hover
   colour; neither is needed here.) */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border);
}
.breadcrumbs a {
  text-decoration: none;
}
.breadcrumbs a:hover,
.breadcrumbs a:focus {
  text-decoration: underline;
}
.breadcrumbs [aria-current="page"] {
  color: var(--color-text);
}
.breadcrumbs .crumb-sep {
  margin: 0 0.4em;
  opacity: 0.6;
}

a { color: var(--color-primary); }
a:hover, a:focus { color: var(--color-primary-dark); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-nav-bg);
  color: var(--color-nav-text);
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* ---------- Header / nav ---------- */

.site-header {
  background: var(--color-nav-bg);
  color: var(--color-nav-text);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: var(--header-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  min-height: var(--nav-height);
  position: relative;
}

.site-title {
  color: var(--color-nav-text);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: bold;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: auto;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-nav-text);
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: currentColor;
}
.hamburger { position: relative; }
.hamburger::before,
.hamburger::after {
  content: "";
  position: absolute;
  left: 0;
}
.hamburger::before { top: -6px; }
.hamburger::after { top: 6px; }

.main-nav {
  font-family: var(--font-heading);
}

.main-nav .nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.nav-item { position: relative; }

.nav-item > a {
  display: block;
  padding: 1rem 0.55rem;
  color: var(--color-nav-text);
  text-decoration: none;
  white-space: nowrap;
}
.nav-item > a:hover,
.nav-item > a:focus,
.nav-item.open > a {
  background: var(--color-nav-bg-hover);
}

.caret { font-size: 0.7em; }

/* Standard dropdown */
.dropdown {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  min-width: 14rem;
  background: var(--nav-surface);
  color: var(--nav-surface-text);
  border: 1px solid var(--nav-surface-border);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  z-index: 60;
}
.dropdown li a {
  display: block;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--nav-surface-text);
}
.nav-item.has-children.open > .dropdown {
  display: block;
}

/* Mega menu (Regions) */
.mega-panel {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 100%;
  width: min(60rem, 90vw);
  background: var(--nav-surface);
  color: var(--nav-surface-text);
  border: 1px solid var(--nav-surface-border);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  z-index: 60;
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}
.nav-item.mega.open > .mega-panel {
  display: block;
}

.mega-cols {
  columns: 4 12rem;
  column-gap: 2rem;
}
.mega-group {
  break-inside: avoid;
  margin-bottom: 1rem;
}
.mega-group-heading {
  margin: 0 0 0.25rem;
  font-weight: bold;
  color: var(--nav-accent);
  border-bottom: 1px solid var(--nav-surface-border);
}
.mega-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mega-group-list a {
  display: block;
  padding: 0.15rem 0;
  text-decoration: none;
  color: var(--nav-surface-text);
}
/* ---------- Mobile nav ---------- */

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

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-nav-bg);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }
  .main-nav.open { display: block; }

  .main-nav .nav-list { flex-direction: column; }

  /* Matches the stacked-list divider from the live site's nav. */
  .main-nav .nav-item > a {
    border-bottom: 1px solid var(--color-nav-border);
  }

  .dropdown,
  .mega-panel {
    display: none;
    position: static;
    transform: none;
    width: auto;
    box-shadow: none;
    border: none;
    background: var(--color-nav-bg);
    color: var(--color-nav-text);
    max-height: none;
  }
  .nav-item.open > .dropdown,
  .nav-item.open > .mega-panel { display: block; }

  .dropdown li a,
  .mega-group-list a {
    color: var(--color-nav-text);
    padding-left: 2rem;
  }
  /* Visible tap/focus state against the dark panel background — the
     desktop hover colours (light background, dark-on-dark text) would
     be unreadable here, so this is deliberately a different treatment. */
  .dropdown li a:hover,
  .dropdown li a:focus,
  .mega-group-list a:hover,
  .mega-group-list a:focus {
    background: var(--color-nav-bg-hover);
  }
  .mega-cols { columns: 1; }
  .mega-group-heading { color: var(--color-nav-text); opacity: 0.8; }

  .funding-logos { justify-content: center; }
}

/* ---------- Desktop-only hover interactions ----------
   Dropdowns/mega-menu open on hover only above the breakpoint where
   the nav is a single row with a mouse pointer. Below it (see the
   mobile block above), the same markup is a tap-driven off-canvas
   menu — opening submenus on hover there fought the tap-to-expand
   behaviour and made them pop open unintentionally. */
@media (min-width: 60.0625rem) {
  .nav-item.has-children:hover > .dropdown,
  .nav-item.has-children:focus-within > .dropdown {
    display: block;
  }
  .nav-item.mega:hover > .mega-panel,
  .nav-item.mega:focus-within > .mega-panel {
    display: block;
  }
  .dropdown li a:hover,
  .dropdown li a:focus {
    background: var(--nav-surface-hover-bg);
  }
  .mega-group-list a:hover,
  .mega-group-list a:focus {
    color: var(--nav-accent);
  }
}

/* ---------- Content ---------- */

/* Matches the live site's #inner-content: a translucent dark card
   floating over the fixed body background, with a translucent border
   — everything actually being read sits inside this, while the page
   <h1> above it sits directly on the sepia background (see .page-title). */
/* ---------- Header slideshow ---------- */

/* Same dark translucent frame as .content-card, so the banner and the
   card read as one family. Slides are stacked and cross-faded (the old
   site used a 1s fade) while each one slowly zooms and drifts - the Ken
   Burns effect the old site had. Only the first slide shows without JS. */
.slideshow {
  --slide-interval: 6s;
  --slide-fade: 1s;
  position: relative;
  margin: 0 0 1.5rem;
  border: 10px solid var(--color-surface-border);
  border-radius: 10px;
  background: #000;
  overflow: hidden;
}
.slideshow-track {
  position: relative;
  /* The banners are ~1020x290; cover-crop on narrow screens rather than
     shrinking into a thin strip. */
  height: clamp(7rem, 26vw, 18rem);
  overflow: hidden;
}
.slideshow .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--slide-fade) ease;
  will-change: opacity, transform;
}
.slideshow .slide.is-active { opacity: 1; }

/* Ken Burns: four drift directions, picked at random per showing. The zoom
   lasts the slide's time on screen plus its fade-out, so it never stops
   short of the next slide. */
.slideshow .slide.is-active,
.slideshow .slide.is-leaving {
  animation: kenburns calc(var(--slide-interval) + var(--slide-fade)) linear both;
}
.slideshow .kb-0 { --kb-from: 1.18; --kb-to: 1;    transform-origin: 0 0; }
.slideshow .kb-1 { --kb-from: 1.18; --kb-to: 1;    transform-origin: 100% 100%; }
.slideshow .kb-2 { --kb-from: 1;    --kb-to: 1.18; transform-origin: 100% 0; }
.slideshow .kb-3 { --kb-from: 1;    --kb-to: 1.18; transform-origin: 0 100%; }
@keyframes kenburns {
  from { transform: scale(var(--kb-from)); }
  to   { transform: scale(var(--kb-to)); }
}
.slideshow.is-still .slide,
.slideshow.is-still .slideshow-progress { animation-play-state: paused; }

/* Thin timer line along the bottom edge, as on the old site. */
.slideshow-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.85);
  transform-origin: 0 50%;
  animation: slideshow-progress var(--slide-interval) linear infinite;
}
.slideshow-progress[hidden] { display: none; }
@keyframes slideshow-progress {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.slideshow-toggle {
  position: absolute;
  right: 0.75rem;
  bottom: 0.85rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.55);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 1rem 1rem;
  /* Pause bars while playing; a play triangle while paused. Inline SVG, so
     there is no icon font or extra request. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3E%3Crect x='3' y='2' width='3.5' height='12' rx='.5'/%3E%3Crect x='9.5' y='2' width='3.5' height='12' rx='.5'/%3E%3C/svg%3E");
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.15s ease, background-color 0.15s ease;
}
.slideshow-toggle.is-paused {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3E%3Cpath d='M4.5 2.2v11.6a.5.5 0 0 0 .76.43l9.3-5.8a.5.5 0 0 0 0-.86l-9.3-5.8a.5.5 0 0 0-.76.43z'/%3E%3C/svg%3E");
}
.slideshow-toggle[hidden] { display: none; }
.slideshow-toggle:hover,
.slideshow-toggle:focus-visible { opacity: 1; background-color: rgba(0, 0, 0, 0.8); }

/* Reduced motion: no drift, no timer line, no fade. */
@media (prefers-reduced-motion: reduce) {
  .slideshow .slide { transition: none; }
  .slideshow .slide.is-active,
  .slideshow .slide.is-leaving { animation: none; }
  .slideshow-progress { display: none; }
}

.content-card {
  background: var(--color-surface);
  border: 10px solid var(--color-surface-border);
  border-radius: 10px;
  padding: 1.5rem 2rem 2rem;
}

.child-page-list {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
}
.child-page-list li {
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1rem;
  /* A subtler overlay than .content-card's own background, so nested
     cards don't stack into an even darker block. */
  background: rgba(255, 255, 255, 0.06);
}
.child-page-list a {
  font-weight: bold;
  text-decoration: none;
  color: var(--color-primary);
}

/* WP [gallery] shortcode output — a grid of fixed-height crops rather
   than raw <img> tags at native size, which is what made these look
   scattered (wildly differing widths/heights and no clear grid). */
.wp-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.wp-gallery-item {
  margin: 0;
}
.wp-gallery-item a {
  display: block;
  position: relative;
  cursor: zoom-in;
}
/* A zoom-in cue on hover, since the thumbnail is cropped and clicking
   opens the full, uncropped image — that's not obvious from a static
   crop alone. */
.wp-gallery-item a::after {
  content: "⤢";
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: 50%;
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.wp-gallery-item a:hover::after,
.wp-gallery-item a:focus::after {
  opacity: 1;
}
.wp-gallery-item img {
  display: block;
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--color-border);
  transition: filter 0.15s ease;
}
.wp-gallery-item a:hover img,
.wp-gallery-item a:focus img {
  filter: brightness(0.85);
}
.wp-gallery-item figcaption {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: center;
}

.news-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.news-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--color-border);
}
.news-item:last-child { border-bottom: none; }
.news-item time {
  display: block;
  font-size: 0.85rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.news-item h2, .news-item h3 { margin: 0.25rem 0 0.5rem; }
.news-summary { color: var(--color-muted); }
.news-date {
  font-size: 0.9rem;
  color: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Footer / audio bar ---------- */

.site-footer {
  /* A translucent scrim, not just text colour, because the fixed
     background photo varies from light to dark across its tile —
     text-colour contrast alone isn't reliable at every scroll depth. */
  background: rgba(0, 0, 0, 0.55);
  border-top: 1px solid var(--color-border);
  margin-top: 3rem;
  padding: 1.5rem 1.25rem;
  color: var(--color-muted);
  font-size: 0.9rem;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-links {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.footer-links a {
  color: var(--color-muted);
  text-decoration: underline;
}
.footer-links a:hover,
.footer-links a:focus {
  color: var(--color-primary);
}

.funding-notice {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}

.funding-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.funding-logos img {
  /* These are official funding-body logos with their own fixed colour
     schemes designed for a white background — not part of the site's
     dark theme, and shouldn't be restyled to match it. */
  background: #ffffff;
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  height: 4.5rem;
  width: auto;
}

.funding-statement {
  margin: 0;
  font-size: 0.85rem;
  color: var(--color-muted);
}

.attribution {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Always pushed to the row's right edge — margin-left: auto still
   works this way even if it wraps onto its own line on narrow screens. */
.attribution .credits {
  margin-left: auto;
}

.credits {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem 0.3rem 0.5rem;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.5);
  color: var(--color-muted);
  text-decoration: none;
  font-family: Georgia, serif;
  opacity: 0.7;
}
.credits:hover,
.credits:focus {
  opacity: 1;
  color: var(--color-muted);
}
.credits img { display: block; }

.audio-bar {
  position: sticky;
  bottom: 0;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}

/* ---------- Image lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.9);
  padding: 3rem 1rem;
}
/* [hidden]'s default display:none loses to the class rule above at equal
   specificity (whichever comes later in the cascade wins) — without
   this, the "hidden" lightbox still renders full-screen and blocks
   clicks on everything underneath it. */
.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  max-width: 40rem;
  margin: 0;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.75rem;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 2rem;
}
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

@media (max-width: 40rem) {
  .lightbox-prev, .lightbox-next {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }
  .lightbox-prev { left: 0.25rem; }
  .lightbox-next { right: 0.25rem; }
}
