/* GOOGLE FONT — must be at top */
@import url('https://fonts.googleapis.com/css2?family=Montserrat+Alternates:wght@600;700&display=swap');

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, sans-serif;
  background: #0f1a14;
}

/* =====================
   MAP
===================== */
#map {
  height: 100vh;
  width: 100vw;
  position: relative;
}

/* =====================
   LOGO — Mist Fade In
===================== */
#intro {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 1000;
}

#intro img {
  width: 160px;
  opacity: 0;
  animation: mistFade 3s ease forwards;
}

@keyframes mistFade {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* =====================
   TRAIL SIGN (Hero UI)
===================== */
.trail-sign {
  position: absolute;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  z-index: 1000;

  /* Prevent sign from overflowing on small screens */
  width: max-content;
  max-width: calc(100vw - 32px);
  /* Allow dropdown to escape upward */
  overflow: visible;

  background-color: #1f3d2b;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.035) 0px,
      rgba(255,255,255,0.035) 1px,
      transparent 1px,
      transparent 4px
    ),
    linear-gradient(
      to bottom,
      #2b523a,
      #1f3d2b
    );

  color: #e8e1cf;

  padding: 18px 34px 16px;
  border-radius: 10px;

  font-family: 'Montserrat Alternates', sans-serif;
  text-align: center;

  border: 3px solid #13261b;

  box-shadow:
    0 4px 0 #13261b,
    inset 0 0 14px rgba(24,64,38,0.85);
}

/* Mossy edge glow */
.trail-sign::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 12px;
  background: radial-gradient(
    circle at top left,
    rgba(95,140,90,0.4),
    transparent 60%
  );
  pointer-events: none;
  z-index: -1;
}

/* =====================
   SIGN TEXT
===================== */
.sign-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.sign-subtitle {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: #d8d0b8;
  opacity: 0.9;
}

/* =====================
   EMBEDDED SOCIAL LINKS
===================== */
.sign-links {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.sign-link {
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;

  color: #e8e1cf;
  background: rgba(15, 26, 20, 0.6);

  padding: 6px 14px;
  border-radius: 14px;

  border: 1px solid rgba(232, 225, 207, 0.25);

  transition:
    background 0.2s ease,
    transform 0.2s ease;

  /* Prevent text wrapping inside buttons */
  white-space: nowrap;
}

.sign-link:hover {
  background: rgba(15, 26, 20, 0.85);
  transform: translateY(-1px);
}

/* Leaders button — warm wood tone to stand out */
.sign-link.leaders {
  background: rgba(90, 58, 18, 0.85);
  border-color: rgba(200, 150, 60, 0.4);
  color: #f0ddb0;
}

.sign-link.leaders:hover {
  background: rgba(110, 72, 22, 0.95);
}

.sign-link.races {
  background: rgba(20, 60, 30, 0.88);
  border-color: rgba(76, 220, 128, 0.35);
  color: #b6f2c2;
}

.sign-link.races:hover {
  background: rgba(25, 75, 38, 0.95);
}

/* =====================
   EXPLORE DROPDOWN
===================== */
.sign-dropdown-wrap {
  position: relative;
  display: inline-block;
  /* Ensure dropdown escapes any overflow:hidden on parents */
  z-index: 1001;
}

.sign-link-explore {
  cursor: pointer;
  font-family: 'Montserrat Alternates', sans-serif;
  border: none;
  background: rgba(15, 26, 20, 0.6);
  border: 1px solid rgba(232, 225, 207, 0.25);
}

.sign-link-explore:hover,
.sign-link-explore.active {
  background: rgba(15, 26, 20, 0.85);
}

.sign-dropdown {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background-color: #1a3524;
  background-image: linear-gradient(to bottom, #22422e, #1a3524);
  border: 1px solid rgba(182, 242, 194, 0.2);
  border-radius: 8px;
  box-shadow:
    0 -4px 20px rgba(0,0,0,0.4),
    inset 0 0 12px rgba(24,64,38,0.6);
  overflow: hidden;
  z-index: 2000;
  /* Arrow pointing down */
  margin-bottom: 2px;
}

.sign-dropdown::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #1a3524;
}

.sign-dropdown.open {
  display: block;
  animation: dropUp 0.18s cubic-bezier(.16,1,.3,1) both;
}

@keyframes dropUp {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.dropdown-item {
  display: block;
  padding: 10px 18px;
  font-family: 'Montserrat Alternates', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  color: #d8f0de;
  border-bottom: 1px solid rgba(182, 242, 194, 0.08);
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

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

.dropdown-item:hover {
  background: rgba(76, 220, 128, 0.12);
  color: #b6f2c2;
}

@media (max-width: 540px) {
  .sign-dropdown {
    min-width: 160px;
  }
  .dropdown-item {
    font-size: 10px;
    padding: 9px 14px;
  }
}

/* =====================
   MOBILE TUNING
===================== */
@media (max-width: 540px) {
  #intro img {
    width: 110px;
  }

  #intro {
    top: 16px;
    left: 16px;
  }

  .trail-sign {
    bottom: 24px;
    padding: 14px 18px 12px;
    width: calc(100vw - 32px);
    max-width: 100%;
    border-radius: 8px;
  }

  .sign-title {
    font-size: 14px;
    letter-spacing: 1.2px;
  }

  .sign-subtitle {
    font-size: 10px;
  }

  .sign-links {
    gap: 8px;
    margin-top: 10px;
  }

  .sign-link {
    font-size: 10px;
    padding: 6px 12px;
    border-radius: 12px;
    /* On mobile, let buttons fill row evenly in pairs */
    flex: 1 1 calc(50% - 8px);
    text-align: center;
    justify-content: center;
  }
}

/* =====================
   SOFT VIGNETTE
===================== */
#map::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 500;

  background: radial-gradient(
    ellipse at center,
    rgba(15, 26, 20, 0) 55%,
    rgba(15, 26, 20, 0.4) 100%
  );
}

/* =========================
   EVENTS BULLETIN BOARD
========================= */

.events-page {
  margin: 0;
  background: #2e3b2f;
  font-family: "Georgia", serif;
  display: flex;
  justify-content: center;
  padding: 40px 20px;
}

.board-wrapper {
  text-align: center;
  max-width: 900px;
  width: 100%;
}

.board-header h1 {
  color: #f3f0e6;
  margin-bottom: 5px;
}

.board-header p {
  color: #d9d4c8;
  margin-bottom: 25px;
}

/* Wood frame look */
.bulletin-board {
  position: relative;
  padding: 40px;
  background: #c89f65;
  border: 18px solid #6b4f2a;
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}

/* Cork texture effect */
.bulletin-board::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.3;
  pointer-events: none;
}

/* Calendar Image */
.calendar-image {
  max-width: 100%;
  width: 100%;
  height: auto;
  border: 6px solid white;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  transform: rotate(-1deg);
}

/* Push Pins */
.pin {
  width: 18px;
  height: 18px;
  background: #c0392b;
  border-radius: 50%;
  position: absolute;
  top: 20px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

.pin-left  { left: 40px; }
.pin-right { right: 40px; }

/* Back Link */
.back-link {
  display: inline-block;
  margin-top: 30px;
  text-decoration: none;
  color: #f3f0e6;
  font-weight: bold;
  transition: opacity 0.2s ease;
}

.back-link:hover { opacity: 0.7; }

.events-link {
  position: absolute;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  z-index: 1000;
  padding: 10px 18px;
  background: #6b4f2a;
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
}

/* Large screen polish */
@media (min-width: 1200px) {
  .board-wrapper {
    max-width: 850px;
  }
}
