/* ============================================================
   Carlingford Flames Netball Club — Shared Stylesheet
   Colours: Navy #0c213e | Orange #de6226 | White #ffffff
   ============================================================ */

/* ---------- Accessibility ---------- */

/* Skip to main content — visually hidden until focused by keyboard */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: 10000;
  background: var(--navy, #0c213e);
  color: #fff;
  padding: 10px 20px;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; outline: 3px solid var(--orange, #de6226); outline-offset: 2px; }

/* Visible focus ring for keyboard navigation on all interactive elements.
   Uses :focus-visible so mouse users are not affected. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--orange, #de6226);
  outline-offset: 3px;
  border-radius: 3px;
}

/* Remove the default outline only when :focus-visible is supported,
   so browsers without support still show a native ring */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible) { outline: none; }

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  color: #333;
  background: #fff;
  line-height: 1.7;
}

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

a { color: #de6226; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Colour Variables ---------- */
:root {
  --navy:   #0c213e;
  --orange: #de6226;
  --white:  #ffffff;
  --light:  #f5f7fa;
  --border: #dde1e7;
  --text:   #333333;
  --content-width: 1100px;
  --content-pad: 24px;
}

/* ---------- Layout Wrapper ---------- */
/* Every page uses: header > .page-heading > .page-content > footer */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-wrapper main {
  flex: 1;
}

/* Centred content column — same width on every page */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

/* ---------- Header & Navigation ---------- */
header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  /* Fix: ensure header always spans full viewport width */
  width: 100%;
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 var(--content-pad);
  height: 70px;
  /* 3-column grid: brand | nav (centred) | social+toggle */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.site-brand img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 4px;
}

.site-brand span {
  color: var(--orange);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  max-width: 220px;  /* "Carlingford Flames" on line 1, "Netball Club" on line 2 */
}

/* Main nav — grid col 2, truly centred */
nav {
  display: flex;
  justify-content: center;
  /* grid-column 2 is auto-sized to nav content, keeping it perfectly centred
     between the equal 1fr columns on either side */
}

nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  align-items: center;
}

nav ul li a {
  color: var(--white);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

nav ul li a:hover,
nav ul li a.active {
  background: var(--orange);
  color: var(--white);
}

/* Right-hand group: social icons + hamburger — grid col 3, right-aligned */
.header-right {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.header-social {
  display: flex;
  gap: 10px;
}

.header-social a {
  color: var(--white);
  font-size: 1.1rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  text-decoration: none;
}

.header-social a:hover { background: var(--orange); border-color: var(--orange); }

/* Hamburger toggle — hidden on desktop, shown via media query */
.nav-toggle {
  display: none;        /* overridden to flex at breakpoint */
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* ---------- Page Heading Band ---------- */
.page-heading {
  background: var(--navy);
  color: var(--white);
  padding: 28px var(--content-pad);
  text-align: center;
}

.page-heading h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

/* ---------- Main Content ---------- */
main {
  padding: 40px var(--content-pad);
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
}

/* Justified paragraphs as requested */
p { text-align: justify; margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

h1, h2, h3, h4 {
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

h2 { font-size: 1.5rem; margin-top: 2rem; }
h2:first-child { margin-top: 0; }
h3 { font-size: 1.2rem; margin-top: 1.5rem; }

section + section { margin-top: 2.5rem; }

/* ---------- Buttons ---------- */
/* Clearly styled so users know they're clickable */
.btn {
  display: inline-block;
  padding: 11px 28px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
  text-align: center;
  white-space: nowrap;
}

.btn-primary {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

.btn-primary:hover {
  background: #c4551e;
  border-color: #c4551e;
  color: var(--white);
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(222,98,38,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--navy);
}

.btn-outline:hover {
  background: var(--navy);
  color: var(--white);
  text-decoration: none;
}

.btn-sm { padding: 7px 18px; font-size: 0.85rem; }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.card h3 { margin-top: 0; }

/* ---------- Grid Helpers ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

/* ---------- Info Box ---------- */
.info-box {
  background: var(--light);
  border-left: 4px solid var(--orange);
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  margin: 1.5rem 0;
}

.info-box p { margin: 0; }

/* ---------- Section Divider ---------- */
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ---------- Homepage Hero ---------- */
.hero {
  position: relative;
  background-color: var(--navy);
  /* background-image set inline on the element for easy swap */
  background-size: cover;
  background-position: center 60%;
  color: var(--white);
  padding: 80px var(--content-pad);
  text-align: center;
}

/* Dark overlay so text stays readable over any photo */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(12, 33, 62, 0.70);
  pointer-events: none;
}

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

.hero h1 {
  color: var(--white);
  font-size: 2.6rem;
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.hero p {
  color: rgba(255,255,255,0.92);
  font-size: 1.1rem;
  max-width: 680px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

/* ---------- Homepage Photo Strip ---------- */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  height: 260px;
  overflow: hidden;
}

.photo-strip-item {
  overflow: hidden;
  position: relative;
}

.photo-strip-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
  display: block;
}

.photo-strip-item:hover img { transform: scale(1.05); }

@media (max-width: 600px) {
  .photo-strip { height: 160px; }
}

/* ---------- Homepage Widget Sections ---------- */
.home-section {
  padding: 40px 0;
  border-bottom: 1px solid var(--border);
}

/* Sections inside .home-cols don't need their own top/bottom padding —
   the grid gap and the wrapper's padding-bottom handle the spacing.
   Also cancel the global "section + section { margin-top }" rule so
   the second column starts at the same height as the first. */
.home-cols > .home-section {
  padding: 0;
  margin-top: 0;
}

.home-section:last-child { border-bottom: none; }

.home-section h2 {
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 1rem;
  padding-bottom: 8px;
  border-bottom: 3px solid var(--orange);
  display: inline-block;
}

/* ERNA widget embed placeholder */
.widget-frame {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
}

.erna-embed {
  width: 100%;
  border: none;
  border-radius: 8px;
  min-height: 300px;
}

/* ---------- Two-column layout for Home ---------- */
.home-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  /* Stretch both rows to equal height so widget frames line up */
  align-items: stretch;
}

/* Sections inside the two-column grid: flex column so the widget
   frame expands to fill the remaining height, keeping both sides
   visually aligned regardless of how much intro text each has */
.home-cols > .home-section {
  display: flex;
  flex-direction: column;
  border-bottom: none;  /* Single border goes on the wrapper, not each column */
}

.home-cols > .home-section .widget-frame {
  flex: 1;  /* Grow to fill remaining column height */
}

/* Replace the per-column borders with one tidy line below the grid */
.home-cols {
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

/* ---------- Sponsor Cards ---------- */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 1.5rem;
}

.sponsor-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Fixed-height logo area so all cards have the same space for the logo,
   keeping the button aligned at the same height across every card */
.sponsor-card .sponsor-logo-area {
  width: 100%;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sponsor-card img {
  max-height: 72px;
  max-width: 100%;
  width: auto;
  margin: 0 auto;
  object-fit: contain;
}

/* Push button to the bottom of the card regardless of logo/text height */
.sponsor-card .btn {
  margin-top: auto;
}

/* Placeholder shown when no logo image is available yet.
   Replace the whole <div class="sponsor-logo-placeholder">
   with an <img> tag once you have the sponsor's logo. */
.sponsor-logo-placeholder {
  width: 100%;
  height: 72px;
  background: var(--light);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.01em;
  padding: 0 12px;
}

/* ---------- Homepage Sponsors Logo Strip ---------- */
.sponsors-logo-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 24px 0 8px;
}

.sponsors-logo-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  min-width: 120px;
  transition: border-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
}

.sponsors-logo-item img {
  max-height: 52px;
  max-width: 140px;
  width: auto;
  object-fit: contain;
  display: block;
}

.sponsors-logo-item:hover {
  border-color: var(--orange);
  box-shadow: 0 2px 10px rgba(222,98,38,0.18);
  text-decoration: none;
}

@media (max-width: 600px) {
  .sponsors-logo-item { min-width: 100px; padding: 10px 14px; }
  .sponsors-logo-item img { max-height: 44px; max-width: 110px; }
}

.sponsor-card h3 {
  font-size: 1rem;
  margin: 0;
  color: var(--navy);
}

.sponsor-card p {
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  margin: 0;
}

/* ---------- Policy / Document List ---------- */
.doc-list { list-style: none; padding: 0; }

.doc-list li {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.doc-list li:last-child { border-bottom: none; }

.doc-icon {
  width: 40px;
  height: 40px;
  background: var(--orange);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.doc-info h3 { font-size: 1rem; color: var(--navy); margin: 0 0 4px; }
.doc-info p { font-size: 0.88rem; color: #555; margin: 0 0 8px; text-align: left; }

/* ---------- Contact Form ---------- */
.form-group {
  margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(222,98,38,0.12);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---------- Gallery Grid ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
  background: var(--light);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.gallery-item:hover img { transform: scale(1.05); }

.gallery-item .caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(12,33,62,0.8);
  color: var(--white);
  font-size: 0.82rem;
  padding: 6px 10px;
  transform: translateY(100%);
  transition: transform 0.3s;
}

.gallery-item:hover .caption { transform: translateY(0); }

/* ---------- News / Blog ---------- */
.news-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.filter-btn {
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}

.news-empty {
  background: var(--light);
  border-radius: 8px;
  padding: 40px;
  text-align: center;
  color: #666;
}

.news-empty p { text-align: center; margin: 0; }

/* ---------- Teams Page ---------- */
.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.faq-item:last-child { border-bottom: none; }

.faq-item h3 {
  font-size: 1.05rem;
  color: var(--navy);
  margin: 0 0 8px;
}

.faq-item p { margin: 0; }

.competition-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.competition-table th {
  background: var(--navy);
  color: var(--white);
  padding: 10px 14px;
  text-align: left;
}

.competition-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.competition-table tr:nth-child(even) td { background: var(--light); }

/* ---------- Footer ---------- */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.8);
  padding: 0 0 24px;  /* top padding handled by acknowledgement section */
}

/* Acknowledgement of Country — sits at the top of the footer */
.footer-acknowledgement {
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding: 28px var(--content-pad) 24px;
}

.footer-ack-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.footer-ack-flags {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 2px;
}

.footer-ack-flags img {
  height: 38px;
  width: auto;
  border-radius: 3px;
  display: block;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.footer-acknowledgement p {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.65;
  margin: 0;
  text-align: left;
}

.footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-top: 32px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 32px;
}

.footer-brand img {
  width: 56px;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.88rem;
  text-align: left;
  margin: 0;
  color: rgba(255,255,255,0.7);
}

/* h3 used (not h4) so heading hierarchy stays sequential after h2 in main content */
.footer-col h3 {
  color: var(--orange);
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a {
  color: rgba(255,255,255,0.75);
  font-size: 0.88rem;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col ul li a:hover { color: var(--orange); }

.footer-bottom {
  max-width: var(--content-width);
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.5);
  flex-wrap: wrap;
  gap: 8px;
}

.footer-social { display: flex; gap: 12px; }
.footer-social a {
  color: rgba(255,255,255,0.6);
  font-size: 1rem;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-social a:hover { color: var(--orange); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-orange { color: var(--orange); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* ---------- Responsive ---------- */

/* Hamburger breakpoint — 6 nav items fit comfortably above 900px */
@media (max-width: 900px) {
  :root { --content-pad: 16px; }

  /* Switch header-inner back to flex for the compact mobile layout.
     The 3-column grid is only needed when the full nav is visible. */
  .header-inner {
    display: flex;
    height: 64px;
  }

  .site-brand { flex: 1 1 auto; min-width: 0; }

  /* Show hamburger */
  .nav-toggle { display: flex; }

  /* Hide nav by default; shown when .open is toggled by JS */
  nav {
    display: none;
    position: absolute;
    /* JS sets exact top dynamically; this is a safe fallback */
    top: 64px;
    left: 0;
    right: 0;
    /* Full viewport width — fixes the "not full-width" bug */
    width: 100vw;
    background: var(--navy);
    padding: 12px 16px 20px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    z-index: 999;
  }

  nav.open { display: block; }

  nav ul {
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }

  nav ul li { width: 100%; }

  nav ul li a {
    display: block;
    padding: 13px 16px;   /* Larger touch targets on mobile */
    font-size: 1rem;
    border-radius: 6px;
    white-space: normal;  /* Allow word wrap on narrow screens */
  }

  .home-cols { grid-template-columns: 1fr; }
  .grid-2    { grid-template-columns: 1fr; }
  .grid-3    { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-inner > *:first-child { grid-column: 1 / -1; }

  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .hero h1 { font-size: 1.8rem; }
  .page-heading h1 { font-size: 1.5rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .sponsor-grid { grid-template-columns: repeat(2, 1fr); }
}
