:root {
  /* =========================
     GLOBAL THEME COLORS
     Notes describe WHAT the color is used for (not what it looks like)
     ========================= */

  /* Page & base text */
  --color-page-bg: #121212;                 /* Main page background */
  --color-text-primary: #f3be39;            /* Default text color used across headings + content */

  /* “Inverse” text (text sitting on bright pill buttons) */
  --color-text-on-accent: #121212;          /* Text/icon color on light/filled buttons */

  /* Interactive filled surfaces (buttons / pills) */
  --color-accent-fill: #f3be39;             /* Default filled button/pill background */
  --color-accent-fill-hover: #d6a12b;       /* Hover background for filled buttons/pills */

  /* Card/section surfaces (subtle tinted panels) */
  --color-panel-bg: rgba(255, 183, 77, 0.2); /* Tinted background for cards/hero/hover panels */

  /* Borders & dividers (theme-aligned) */
  --color-border-strong: #f3be39;           /* Strong border (event card outline) */
  --color-border-panel: #f3be39;  /* Prominent panel border (next-show, event-hero) */
  --color-border-soft: #f3be39;   /* Softer borders (dropdown, map wrap) */
  --color-border-subtle: #f3be39; /* Very subtle border (toast outline) */

  /* Text hierarchy (muted/secondary text) */
  --color-text-muted: #B0BEC5;    /* Helper labels + hint text */
  --color-text-muted-strong: #B0BEC5; /* Secondary info text (meta lines) */
  --color-text-muted-bright: #B0BEC5; /* Slightly stronger secondary text (hero meta) */
  --color-text-on-dark-panel: #B0BEC5; /* Text/icons on darker surfaces (dropdown items, event time/location) */

  /* Dropdown / dark surface */
  --color-surface-dark: rgba(42, 42, 42, 0.98);     /* Dropdown menu background (dark panel) */

  /* Hover/focus states on tinted surfaces (dropdown item hover/focus) */
  --color-hover-tint: rgba(240, 212, 138, 0.14);    /* Hover background tint for dropdown items */
  --color-focus-tint: rgba(240, 212, 138, 0.18);    /* Focus-visible background tint for dropdown items */

  /* Toast */
  --color-toast-bg: #f3be39;            /* Toast background */
  --color-toast-text: #fff;                          /* Toast text color */

  /* Shadows (depth/elevation) */
  --shadow-soft: 0 4px 6px rgba(0, 0, 0, 0.2);       /* Buttons: subtle elevation */
  --shadow-card: 0 4px 10px rgba(0, 0, 0, 0.25);     /* Cards/hero: medium elevation */
  --shadow-dropdown: 0 8px 16px rgba(0, 0, 0, 0.45); /* Dropdown: strong elevation */
  --shadow-frame: 0 8px 16px rgba(0, 0, 0, 0.35);    /* Framed sections like map wrap */
}

/* =========================
   ORIGINAL CSS (refactored)
   ========================= */

body {
  font-family: Arial, sans-serif;
  background-color: var(--color-page-bg);
  color: var(--color-text-primary);
  margin: 0;
  padding: 20px;
  text-align: center;
}

h1 img {
  width: 75%;
  max-width: 350px;
  height: auto;
}

h2 {
  color: #B0BEC5;
  font-size: 32px;
  font-weight: 400;
  margin-top: 90px;
}

/* Slideshow styles */
.slideshow-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 10px auto;
  overflow: hidden;
}
.slideshow {
  position: relative;
  height: 0;
  padding-bottom: 75%;
  overflow: hidden;
}
.slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  position: absolute;
  top: 0;
  left: 0;
}
.slideshow img.active { opacity: 1; }

/* Social Buttons */
.button-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
}
.social-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background-color: var(--color-accent-fill);
  border-radius: 50%;
  text-decoration: none;
  color: var(--color-text-on-accent);
  font-size: 24px;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: var(--shadow-soft);
}
.social-button:hover {
  background-color: var(--color-accent-fill-hover);
  transform: scale(1.05);
}

/* Text pill buttons (DYNAMIC) */
.text-button-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  align-items: center;
}
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: auto;
  flex: 0 0 auto;
  padding: 1px 22px;

  min-height: 50px;
  background-color: var(--color-accent-fill);
  border-radius: 999px;
  text-decoration: none;
  color: var(--color-text-on-accent);
  font-size: 18px;
  font-weight: bold;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: var(--shadow-soft);
  border: none;
  cursor: pointer;

  white-space: nowrap;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.text-button:hover {
  background-color: var(--color-accent-fill-hover);
  transform: scale(1.05);
}

/* Next show banner */
.next-show {
  max-width: 700px;
  margin: 10px auto 0 auto;
  padding: 14px 16px;
  border: 1px solid var(--color-border-panel);
  border-radius: 10px;
  background: var(--color-panel-bg);
  text-align: left;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 0;
}
.next-show.has-open-dropdown { z-index: 100000; }

.next-show .label {
  color: var(--color-text-muted);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.next-show .title {
  color: var(--color-text-primary);
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 6px;
}
.next-show .meta {
  color: var(--color-text-muted-strong);
  font-size: 16px;
  margin-bottom: 10px;
}
.next-show .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Shared pill button style */
.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--color-accent-fill);
  color: var(--color-text-on-accent);
  text-decoration: none;
  font-family: inherit;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.3s ease;
}
.mini-btn:hover { background: var(--color-accent-fill-hover); transform: scale(1.03); }
.mini-btn i { font-size: 16px; }

.mini-btn .btn-text {
  font-family: inherit;
  font-weight: inherit;
  line-height: 1;
}

/* Event card */
.event {
  margin: 20px auto;
  padding: 15px;
  border: 1px solid var(--color-border-strong);
  border-radius: 8px;
  max-width: 650px;
  transition: background 0.3s ease, transform 0.2s ease;
  text-align: left;
  position: relative;
  z-index: 0;
}
.event.has-open-dropdown { z-index: 100000; }

.event:hover {
  background: var(--color-panel-bg);
  transform: scale(1.03);
}

.event-header {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  user-select: none;
}

.event-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--color-text-primary);
}
.event-day-date {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-primary);
  margin: 5px 0;
}
.event-time,
.event-location { color: var(--color-text-on-dark-panel); }

.event-chevron {
  float: right;
  color: var(--color-text-on-dark-panel);
  margin-top: 2px;
}

/* Action row under each event (hidden until expanded) */
.event-actions {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 10px 10px 10px;
  margin-top: 8px;
}
.event.expanded .event-actions { display: flex; }

/* Dropdown */
.dropdown {
  position: relative;
  display: inline-flex;
  isolation: isolate;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--color-surface-dark);
  border: 1px solid var(--color-border-soft);
  border-radius: 10px;
  box-shadow: var(--shadow-dropdown);
  z-index: 999999;
  overflow: hidden;
}
.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
  color: var(--color-text-primary);
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s ease;
}
.dropdown-item:hover { background: var(--color-hover-tint); }
.dropdown-item:focus-visible { background: var(--color-focus-tint); }

.dropdown-item i {
  color: var(--color-text-primary);
  width: 18px;
}

/* Helper text */
.hint {
  max-width: 650px;
  margin: 10px auto 0 auto;
  color: var(--color-text-muted);
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: var(--color-toast-bg);
  color: var(--color-toast-text);
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--color-border-subtle);
  display: none;
  z-index: 9999999;
  max-width: 92vw;
  font-size: 14px;
}

/* EVENT.PHP additions */
.event-page {
  max-width: 900px;
  margin: 0 auto;
  text-align: left;
}

.event-hero {
  margin: 10px auto 0 auto;
  padding: 16px;
  border: 1px solid var(--color-border-panel);
  border-radius: 12px;
  background: var(--color-panel-bg);
  box-shadow: var(--shadow-card);
}

.event-hero .label {
  color: var(--color-text-muted);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.event-hero .title {
  color: var(--color-text-primary);
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 8px;
  line-height: 1.15;
}

.event-hero .meta {
  color: var(--color-text-muted-bright);
  font-size: 18px;
  margin-bottom: 12px;
}

.event-hero .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Large map */
.map-wrap {
  margin-top: 16px;
  border: 1px solid var(--color-border-soft);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-frame);
}
.map-iframe {
  width: 100%;
  border: 0;
  display: block;
  height: 60vh;
  min-height: 420px;
}

/* Mobile optimization */
@media (max-width: 600px) {
  h2 {
    font-size: 28px;
    margin-top: 40px;
  }
  .social-button {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  .text-button-container { gap: 12px; }
  .text-button {
    font-size: 16px;
    padding: 1px 20px;
    min-height: 40px;
  }
  .dropdown-menu { mim-width: 220px; }

  .event-hero .title { font-size: 22px; }
  .event-hero .meta { font-size: 16px; }

  .map-iframe {
    height: 44vh;
    min-height: 260px;
  }
}
