:root {
  color-scheme: light dark;
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body,
html {
  font-family: Optima, Calibri, Verdana, Tahoma, sans-serif;
  background-color: #dddddd;
  color: #333333;
}

/* Explicit dark mode */
.theme-dark body,
.theme-dark html,
.theme-dark textarea,
.theme-dark select,
.theme-dark input {
  background-color: #222222;
  color: #cccccc;
}
.theme-dark a {
  color: #ffffff;
}
.theme-dark header,
.theme-dark footer {
  background-color: #000000;
  color: #cccccc;
}
.theme-dark nav.navbar ul li a {
  color: #cccccc;
}
.theme-dark .dark-section {
  background-color: #26335b;
}
.theme-dark .light-section {
  background-color: #41528c;
}
.theme-dark .accordion {
  background: #333333;
  color: #cccccc;
}
/* Explicit light mode */
.theme-light body,
.theme-light html,
.theme-light textarea,
.theme-light select,
.theme-light input {
  background-color: #dddddd;
  color: #333333;
}
.theme-light a {
  color: #000000;
}
.theme-light nav.navbar ul li a {
  color: #ffffff;
}
.theme-light .dark-section {
  background-color: #7893e2;
}
.theme-light .light-section {
  background-color: #abbdf4;
}
/* High Contrast Theme */
.theme-hc body,
.theme-hc html,
.theme-hc textarea,
.theme-hc select,
.theme-hc input {
  background-color: #000000;
  color: #ffffff;
}
.theme-hc a {
  color: #0ff;
}
.theme-hc header,
.theme-hc footer {
  background-color: #111111;
  color: #ffffff;
}
.theme-hc nav.navbar ul li a {
  color: #ffffff;
}
.theme-hc .dark-section {
  background-color: #222222;
}
.theme-hc .light-section {
  background-color: #333333;
}
/* Pastel Theme */
.theme-pastel body,
.theme-pastel html {
  background-color: #fef6f6;
  color: #333333;
}
.theme-pastel a {
  color: #30172d;
}
.theme-pastel header,
.theme-pastel footer {
  background-color: #b99191;
  color: #444444;
}
.theme-pastel .dark-section {
  background-color: #dec7e5;
}
.theme-pastel .light-section {
  background-color: #fae4fa;
}
.theme-pastel textarea,
.theme-pastel select,
.theme-pastel input {
  background-color: #fdccee;
  color: #333333;
}

/* Fixed Header & Navigation */
header {
  position: fixed;
  top: 0;
  width: 100%;
  background: #000000;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo {
  width: 5rem;
  margin-right: 1rem;
}

.logo-fs-container {
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-fs {
  width: 66%;
  height: auto;
}

header h1 {
  font-size: 1.5rem;
}

nav.navbar ul {
  list-style: none;
  display: flex;
  gap: 1rem;
}

nav.navbar ul li a {
  color: #ffffff;
  text-decoration: none;
  font-weight: bold;
}
.navbar-join {
  color: #9757ef;
  background-color: #ffffff;
  padding: 4px;
  border-radius: 0.5rem;
}

.hamburger {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  display: none;
}

/* Responsive Navigation for Mobile */
@media (max-width: 768px) {
  nav.navbar {
    position: fixed;
    right: -200px;
    top: 0;
    height: 100%;
    width: 200px;
    background: #333;
    display: flex;
    flex-direction: column;
    padding-top: 60px;
    transition: right 0.3s ease;
  }
  nav.navbar.open {
    right: 0;
  }
  nav.navbar ul {
    flex-direction: column;
    gap: 1rem;
    padding-left: 1rem;
  }
  .hamburger {
    display: block;
  }
}

/* Hero Section */
.hero {
  background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.8)),
    url("images/pb-group.jpg") center center/cover no-repeat;
  color: #ffffff;
  text-align: center;
  padding: 12rem;
  border-radius: 1rem;
  margin-top: 2rem;
}
.hero h1 {
  all: unset; /* Resets all inherited and applied styles */
  font-size: 3rem;
  margin-bottom: 2rem;
}
.hero h1:after {
  content: none; /* Removes the global `h1:after` pseudo-element */
}
.hero p {
  font-size: 1.5em;
  margin-top: 1.5rem;
}

/* Main content container */
main {
  max-width: 1024px;
  margin: 80px auto; /* account for the fixed header */
  padding: 1rem;
}

/* Section styling */
.dark-section,
.light-section {
  scroll-margin-top: 80px;
  padding: 2rem;
  border-bottom: 1px solid #ccc;
}
.dark-section h2,
.light-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  text-align: center;
}
.dark-section h3,
.light-section h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  text-align: center;
}
.dark-section p,
.light-section p {
  margin-top: 1rem;
}
.dark-section li,
.light-section li {
  margin-left: 2.5rem;
}
.dark-section {
  background-color: #7893e2;
}
.light-section {
  background-color: #abbdf4;
}

strong {
  color: #000000;
}
.schedule {
  display: grid;
  gap: 1.5rem;
  margin-top: 1rem;
}
.schedule-item {
  text-align: center;
  padding: 1rem;
  border: 1px solid #ddd;
  border-radius: 8px;
  background-color: #7893e2;
}

.map-container {
  margin-top: 1rem;
}

.carousel-container {
  overflow-x: auto;
  white-space: nowrap;
  padding: 1rem;
}

.carousel {
  display: inline-flex;
  gap: 1rem;
}

.carousel img {
  width: 16rem;
  height: 16rem; /* Fixed height for cropping */
  object-fit: cover; /* Crop to fill the box */
  cursor: pointer;
  transition: transform 0.3s ease;
}

.carousel img:hover {
  transform: scale(1.05);
}

.button-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}
.button-group button {
  padding: 0.75rem;
  background-color: #9757ef;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: bolder;
  border: none;
  border-radius: 0.5rem;
  cursor: pointer;
  min-width: 6rem;
}
.button-group button {
  background-color: rgb(255, 255, 255, 0.25);
  color: #ffffff;
}
.button-group button:hover {
  background-color: #ffffff;
  color: #9757ef;
}
.button-group .icon-button {
  min-width: 2rem;
  width: 4rem;
  height: 4rem;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
}
.button-group .nextdoor {
  background-image: url("images/nextdoor.png");
  background-color: rgb(255, 255, 255, 0);
}
.button-group .facebook {
  background-image: url("images/facebook.png");
  background-color: rgb(255, 255, 255, 0);
}
.button-group .icon-button:hover {
  filter: brightness(1.25);
}
.join-link {
  display: inline-block;
  padding: 0.75rem 1.25rem;
  background-color: #9757ef;
  color: #ffffff;
  font-size: 1.1rem;
  font-weight: bolder;
  text-decoration: none;
  border-radius: 0.5rem;
  text-align: center;
}
.join-link:hover {
  background-color: #dddddd;
  color: #9757ef;
}

.centred {
  text-align: center;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  position: relative;
  text-align: center;
}
.modal-content img {
  max-width: 95vw;
  max-height: 95vh;
}
.modal-close {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  font-size: 2rem;
  color: #ffffff;
  cursor: pointer;
}

footer {
  background: #000000;
  color: #ffffff;
  text-align: center;
  padding: 1rem;
  position: relative;
}

.footer-links {
  margin-top: 0.5rem;
  font-size: 0.8rem;
}

.footer-links a {
  color: #ffffff;
  text-decoration: underline;
  margin: 0 0.5rem;
}

/* Footer Accordion Styling */
.accordion {
  display: none; /* Hidden by default */
  background: #333333;
  color: #dddddd;
  padding: 1rem;
  position: relative;
  animation: slideDown 0.5s ease;
  max-width: 1024px;
  margin: 0 auto;
}

.accordion.open {
  display: block;
}

@keyframes slideDown {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.accordion-header {
  text-align: center;
  margin-bottom: 1rem;
}

.accordion-toggle {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 1.5rem;
  cursor: pointer;
}

.accordion-content {
  text-align: justify;
  font-size: 0.75rem;
  line-height: 1.4;
  margin-left: 2rem;
  margin-right: 2rem;
}

.accordion-content li {
  margin-left: 1.5rem;
}

.policy-content {
  display: none;
}

/* Media queries for text scaling */
@media screen and (min-width: 1600px), screen and (min-height: 1024px) {
  html {
    font-size: 1.2rem;
  }
  .schedule {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media screen and (max-width: 1024px), screen and (max-height: 768px) {
  html {
    font-size: 1rem;
  }
  .schedule {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 768px), screen and (max-height: 576px) {
  html {
    font-size: 0.8rem;
  }
}

@media screen and (max-width: 480px), screen and (max-height: 480px) {
  html {
    font-size: 0.6rem;
  }
  .schedule {
    grid-template-columns: 1fr;
  }
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
  body,
  html {
    background-color: #222222;
    color: #cccccc;
  }
  a {
    color: #ffffff;
  }
  header,
  footer {
    background-color: #000000;
    color: #cccccc;
  }
  nav.navbar ul li a {
    color: #cccccc;
  }
  .dark-section {
    background-color: #26335b;
  }
  .light-section {
    background-color: #41528c;
  }
  .accordion {
    background: #333333;
    color: #cccccc;
  }
  strong {
    color: #ffffff;
  }
}
