@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@700&family=Open+Sans:wght@400;600&display=swap');

/* Main grid layout for homepage */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 2.5rem;
  max-width: 1200px;
  margin: 0 auto 2.5rem auto;
  align-items: start;
}
.main-grid .hero {
  grid-column: 1 / 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  padding: 2rem 2rem 1.5rem 2rem;
}
.main-grid .hero-img {
  width: 100%;
  max-width: 480px;
  max-height: 380px;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  object-fit: cover;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  align-self: center;
}
.main-grid .hero-content {
  width: 100%;
}
.main-grid .features {
  grid-column: 2 / 3;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  padding: 2rem 2rem 1.5rem 2rem;
}
.main-grid .card {
  background: #E8F3FF;
  border: 1.5px solid #004E98;
  border-radius: 10px;
  padding: 1.5rem 1.5rem 1.2rem 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.main-grid .card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.main-grid .card a.btn, .main-grid .card a {
  margin-top: 0.7rem;
}
@media (max-width: 900px) {
  .main-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .main-grid .hero, .main-grid .features {
    grid-column: 1 / 2;
    padding: 1.2rem 0.7rem 1.2rem 0.7rem;
  }
  .main-grid .hero-img {
    max-width: 100%;
    max-height: 260px;
  }
}

/* Admin buttons: bold links and separators */
.admin-buttons a.btn {
  font-weight: 700;
  position: relative;
}
.admin-buttons a.btn + a.btn::before {
  content: " | ";
  position: absolute;
  left: -7px;
  color: #132e6e5f;
}

/* Recent contacts list */
.recent-contacts ul { list-style: none; padding: 0; margin: 0; }
.recent-contacts li { padding: 0.5rem 0; border-bottom: 1px solid #f0f2f4; }
.recent-contacts .contact-link { font-weight: 700; color: #004E98; text-decoration: none; }
.recent-contacts .contact-link:hover { text-decoration: underline; }

/* Responsive form tweaks: stack labels and inputs, full-width buttons on small screens */
/* Use .stack-on-mobile class on forms that should stack labels above inputs on mobile */
@media (max-width: 720px) {
  /* Explicit opt-in class for mobile stacking */
  .stack-on-mobile .form-group,
  .stack-on-mobile .form-item,
  .stack-on-mobile .form-row,
  .stack-on-mobile fieldset {
    display: block !important;
    width: 100% !important;
  }

  /* Labels on their own line */
  .stack-on-mobile label {
    display: block !important;
    width: 100% !important;
    margin-bottom: 0.35rem;
    text-align: left;
  }

  /* Full-width inputs beneath labels */
  .stack-on-mobile input,
  .stack-on-mobile select,
  .stack-on-mobile textarea {
    width: 100% !important;
    box-sizing: border-box;
    display: block !important;
    margin: 0 0 0.6rem 0;
  }

  /* Full-width buttons */
  .stack-on-mobile button,
  .stack-on-mobile .btn {
    width: 100% !important;
    display: block !important;
    margin-top: 0.4rem;
  }

  /* Make the payments table horizontally scrollable and readable */
  .payment-history, .payment-history table { width: 100%; overflow-x: auto; display: block; }
}

html {
  box-sizing: border-box;
  font-size: 16px;
}
*, *:before, *:after {
  box-sizing: inherit;
}
body {
  font-family: 'Open Sans', Arial, sans-serif;
  background: #E8F3FF;
  color: #222;
  margin: 0;
  min-height: 100vh;
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', Arial, sans-serif;
  color: #c0cad3;
  margin-top: 0;
}
a {
  color: #004E98;
  text-decoration: underline;
}
a:focus, button:focus, input:focus, select:focus, textarea:focus {
  outline: 3px solid #FF9F1C;
  outline-offset: 2px;
}

header {
  background: #004E98;
  color: #fff;
  padding: 0;
  position: relative;
  margin-bottom: 2.5rem;
}
.header-top {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
}
.logo {
  display: flex;
  align-items: center;
}
.logo img {
  height: 56px;
  width: auto;
  margin-right: 1rem;
}
.site-title {
  font-size: 1.7rem;
  font-family: 'Montserrat', Arial, sans-serif;
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
}

nav {
  position: relative;
}
.nav-list {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-list li a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: background 0.2s;
}
.nav-list li a:hover, .nav-list li a:focus {
  background: #FF9F1C;
  color: #222;
}

/* Members dropdown styles */
.has-dropdown {
  position: relative;
}
.has-dropdown > button {
  background: transparent;
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}
.has-dropdown > button:hover, .has-dropdown > button:focus {
  background: #FF9F1C;
  color: #222;
}
.dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  color: #222;
  min-width: 220px;
  box-shadow: 0 8px 24px rgba(2,6,23,0.12);
  border-radius: 8px;
  display: none;
  flex-direction: column;
  padding: 0.5rem 0;
  z-index: 60;
}
.dropdown.open { display: flex; }
.dropdown a {
  color: #004E98;
  padding: 0.6rem 1rem;
  text-decoration: none;
  display: block;
}
.dropdown a:hover, .dropdown a:focus { background: #f3f8ff; color: #00284d; }

@media (max-width: 800px) {
  .has-dropdown > button { width: 100%; text-align: left; }
  .dropdown { position: static; box-shadow: none; background: #004E98; color: #fff; }
  .dropdown a { color: #fff; }
}

/* Hamburger menu for mobile */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

@media (max-width: 800px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .nav-list {
    flex-direction: column;
    width: 100%;
    display: none;
    background: #004E98;
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 10;
  }
  .nav-list.open {
    display: flex;
  }
  .nav-toggle {
    display: block;
    margin-left: auto;
  }
}

main {
  max-width: 1200px;
  margin: 2rem auto 2rem auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  padding: 2rem;
}

/* Center and constrain sections inside main for consistent alignment */
main > section {
  max-width: 900px;
  margin: 0 auto 1.2rem auto;
  padding: 0 0.5rem;
}

/* Member quick-links (shown on members.php for logged-in users) */
.member-dashboard { margin-bottom: 1rem; }
.member-links { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.member-links .btn-link {
  display: inline-block;
  background: #004E98;
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(2,6,23,0.08);
  transition: background 0.12s ease, transform 0.12s ease;
}
.member-links .btn-link:hover,
.member-links .btn-link:focus {
  background: #FF9F1C;
  color: #222;
  transform: translateY(-2px);
  outline: 3px solid #FF9F1C;
  outline-offset: 3px;
}
.member-links .btn-link:focus { box-shadow: 0 0 0 4px rgba(255,159,28,0.12); }


/* Sticky Join Button */
.join-btn {
  position: fixed;
  right: 2vw;
  bottom: 2vw;
  z-index: 1000;
  background: #FF9F1C;
  color: #222;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  border: none;
  border-radius: 50px;
  padding: 0.9rem 2.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.13);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.join-btn:focus, .join-btn:hover {
  background: #004E98;
  color: #fff;
}

/* Slider arrow buttons - modern, accessible look */
.slider-container { position: relative; }
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0,78,152,0.95);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2,6,23,0.18);
  transition: transform 0.12s ease, background 0.12s ease, opacity 0.12s ease;
  opacity: 0.95;
}
.slider-btn svg { display: block; }
.slider-btn.prev { left: 12px; }
.slider-btn.next { right: 12px; }
.slider-btn:hover { transform: translateY(-50%) scale(1.05); background: #FF9F1C; color: #222; }
.slider-btn:focus { outline: 3px solid #FF9F1C; outline-offset: 4px; }

/* ensure controls sit above slides so they're clickable */
.slider-btn { z-index: 20; }
.slider-dots { z-index: 15; position: relative; }

@media (max-width: 720px) {
  .slider-btn { width: 40px; height: 40px; }
}

/* Slider visual improvements (clean refactor) */
.slider {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  width: 100%;
  min-height: 360px;
}
.slider .slide {
  position: absolute;
  inset: 0;
  display: none;
  opacity: 0;
  transition: opacity 500ms ease;
}
.slider .slide.active {
  display: block;
  opacity: 1;
  z-index: 2;
}
.slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Football fallback slider (uses simpler block/none) */
#football-slider .slide { position: static; }

/* Dots style (unified) */
.slider-dots { margin-top: 0.5rem; display: flex; justify-content: center; gap: 8px; }
.slider-dots .dot { width: 12px; height: 12px; padding: 0; border: none; background: #004E98; border-radius: 50%; cursor: pointer; opacity: 0.4; transition: opacity 0.2s ease, transform 0.2s ease; }
.slider-dots .dot.active { opacity: 1; transform: scale(1.1); }
.slider-dots .dot:focus { outline: 3px solid #FF9F1C; }

/* Memorial page hero/banner */
.memorial-hero {
  width: 100%;
  max-height: 480px; /* keeps image from getting excessively tall */
  height: auto;
  object-fit: contain; /* show the entire image without cropping */
  object-position: center;
  background: transparent; /* show site background instead of black */
  border-radius: 12px;
  margin-bottom: 1rem;
  display: block;
  box-shadow: 0 10px 30px rgba(2,6,23,0.18);
}
@media (max-width: 900px) {
  .memorial-hero { max-height: 380px; }
}

/* About page hero image */
.about-hero {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.12);
  object-fit: cover;
}

@media (max-width: 900px) {
  .about-hero { max-height: 320px; }
}
@media (max-width: 520px) {
  .memorial-hero { max-height: 220px; }
}
.memorial-list { list-style: none; padding: 0; margin: 0; }
.memorial-list li { padding: 0.8rem 0; border-bottom: 1px solid #eee; }
.memorial-note { margin-top: 0.4rem; color: #333; }
.memorial-meta { font-size: 0.85rem; color: #777; margin-top: 0.4rem; }

@media (max-width: 900px) {
  .slider-track { height: 320px; }
}
@media (max-width: 520px) {
  .slider-track { height: 220px; }
  .slider-btn { width: 38px; height: 38px; }
}

footer {
  background: #004E98;
  color: #fff;
  padding: 2rem 1rem 1rem 1rem;
  margin-top: 2rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.footer-logo img {
  height: 40px;
  width: auto;
}
.footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-links a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.2s;
}
.footer-links a:hover, .footer-links a:focus {
  color: #FF9F1C;
}
.footer-copy {
  width: 100%;
  text-align: center;
  margin-top: 1rem;
  font-size: 0.95rem;
  color: #E8F3FF;
}

/* Accessibility: High contrast for focus, visible skip link */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
  background: #FF9F1C;
  color: #222;
  padding: 0.5rem 1rem;
  border-radius: 4px;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  outline: 3px solid #004E98;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 800px;
  margin: 0 auto;
}
.form-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.form-item label {
  width: 250px;
  text-align: right;
  margin-right: 1.5rem;
  padding-top: 0.5rem;
  font-weight: 600;
  color: #333;
}

.form-item input,
.form-item textarea,
.form-item select {
  flex-grow: 1;
  border: 1px solid #ccc;
  padding: 0.8rem;
  border-radius: 6px;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 1rem;
  background: #fff;
  color: #333;
  transition: border 0.2s;
}

/* More polished form container for long forms like beneficiary */
.beneficiary-form {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.04);
  box-shadow: 0 6px 18px rgba(2,6,23,0.06);
}

.beneficiary-form .form-item {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: start;
}
.beneficiary-form .form-item label { text-align: right; padding-top: 0.5rem; }
.beneficiary-form .form-item.checkbox-item { grid-template-columns: 40px 1fr; align-items: center; }

/* Make the submit button a bit more prominent and aligned right */
.beneficiary-form button {
  align-self: end;
  margin-top: 0.5rem;
}

.form-item.checkbox-item {
  align-items: center;
}

.form-item.checkbox-item label {
  width: auto;
  text-align: left;
  margin-right: 0;
  padding-top: 0;
  margin-left: 0.5rem;
}

input:focus, textarea:focus, select:focus {
  border-color: #004E98;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 78, 152, 0.2);
}

button, input[type="submit"] {
  background: #004E98;
  color: #fff;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  padding: 0.9rem 2.2rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  align-self: flex-end;
  margin-top: 1rem;
}
button:hover, button:focus, input[type="submit"]:hover, input[type="submit"]:focus {
  background: #FF9F1C;
  color: #222;
}

/* Payment styles */
.payments-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.payment-summary {
    background: var(--secondary-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
}

.amount.due {
    color: #dc3545;
    font-weight: bold;
}

.amount.paid {
    color: #28a745;
    font-weight: bold;
}

.payment-history table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background: white;
}

.payment-history th,
.payment-history td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.payment-history th {
    background: var(--primary-color);
    color: white;
}

.admin-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.payment-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .payment-history {
        overflow-x: auto;
    }
    
    .payment-history table {
        min-width: 600px;
    }
}

/* Responsive tweaks */
@media (max-width: 600px) {
  main {
    padding: 1rem;
  }
  .footer-inner {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
}

/* Form grid */
.form-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.form-row label {
  text-align: right;
  padding-right: 1rem;
  font-weight: 600;
  color: #333;
}
.form-row input,
.form-row textarea,
.form-row select {
  border: 1px solid #ccc;
  padding: 0.8rem;
  border-radius: 6px;
  font-family: 'Open Sans', Arial, sans-serif;
  font-size: 1rem;
  background: #fff;
  color: #333;
  transition: border 0.2s;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; }
  .form-row label { text-align: left; padding-right: 0; }
}
/* Override: force-center nav for legacy or cached header markup
   This high-specificity block ensures the navigation appears centered
   even if the live site is still serving the older header structure.
*/
header > nav, header nav, .header-top nav {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}
header nav .nav-list, .header-top .nav-list {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 auto !important;
}
@media (max-width: 800px) {
  /* keep mobile behavior intact */
  header nav .nav-list { display: none !important; }
  header .nav-toggle { display: block !important; }
  header nav .nav-list.open { display: flex !important; flex-direction: column !important; width: 100% !important; }
}

/* Align header/nav to the same layout container as .main-grid
   Ensures the nav edges line up with the main content grid (max-width:1200px).
   Applies to both the new `main-nav-wrapper`/`nav-inner` structure and
   legacy header markup that may still be live on the demo server.
*/
header > nav, header nav, .header-top nav {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem; /* match header/top horizontal padding */
  box-sizing: border-box;
}
header nav .nav-list, .header-top .nav-list {
  justify-content: center; /* keep links centered inside the constrained container */
}

/* Simple Slider Redesign & Resize */
.simple-slider {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  width: 100%;
  height: 500px; /* Fixed height for consistent layout */
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  margin-bottom: 1rem;
}

.simple-slider .slide {
  position: absolute;
  inset: 0;
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  background: #000;
}

.simple-slider .slide.active {
  display: flex;
  opacity: 1;
  z-index: 2;
  align-items: center;
  justify-content: center;
}

.simple-slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensure entire image is visible */
  display: block;
}

.simple-slider .slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  color: #fff;
  padding: 2rem 1.5rem 1rem;
  text-align: left;
}

/* Events Grid Layout */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 1.5rem;
}

.event-card {
  background: #fff;
  border: 1px solid #e1e8ed;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.event-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f0f0f0;
}

.event-details {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.event-desc {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.5;
}

