/* ============================
   CALENDAR — PARS & PINTS
   ============================ */

/* ---- COMPACT NAV (calendar page only) ---- */
.cal-page #nav {
  padding: 0.5rem 0;
}

.cal-page #nav .nav-logo-mark {
  height: 40px;
  width: 40px;
}

/* ---- PAGE HERO ---- */
.cal-hero {
  background: linear-gradient(160deg, #0d2018 0%, #122a1e 60%, #1a3829 100%);
  border-bottom: 1px solid rgba(201,168,76,0.2);
  padding: 5rem 1.5rem 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* subtle decorative glow */
.cal-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(201,168,76,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.cal-hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.cal-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.15;
}

.cal-hero-divider {
  width: 48px;
  height: 2px;
  background: var(--gold);
  margin: 0 auto 1rem;
  opacity: 0.6;
}

.cal-hero p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ---- CALENDAR WRAPPER ---- */
.cal-wrap {
  max-width: 1060px;
  margin: 2.5rem auto 4rem;
  padding: 0 1.25rem;
}

/* ---- MONTH NAV ---- */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 1rem;
}

.cal-nav-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  flex: 1;
}

.cal-nav-btn {
  background: var(--green-dark);
  border: 1px solid rgba(201,168,76,0.25);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.cal-nav-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.06);
}

/* ---- GRID ---- */
.cal-grid {
  background: var(--green-dark);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 32px rgba(0,0,0,0.3);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: rgba(0,0,0,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.cal-weekday {
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.cal-day {
  min-height: 80px;
  padding: 0.5rem 0.55rem;
  border-right: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  user-select: none;
}

.cal-day > * { pointer-events: none; } /* clicks always hit the .cal-day, not children */

.cal-day:nth-child(7n) { border-right: none; }

.cal-day:hover:not(.cal-day--empty) {
  background: rgba(201,168,76,0.07);
  outline: 1px solid rgba(201,168,76,0.2);
  outline-offset: -1px;
}

.cal-day:active:not(.cal-day--empty) {
  background: rgba(201,168,76,0.12);
}

.cal-day--empty {
  background: rgba(0,0,0,0.12);
  cursor: default;
}

/* today highlight */
.cal-day--today {
  background: rgba(201,168,76,0.05);
}

.cal-day--today .cal-day-num {
  background: var(--gold);
  color: #0d2018;
  border-radius: 50%;
  font-weight: 700;
}

.cal-day--past { opacity: 0.45; }

.cal-day-num {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  flex-shrink: 0;
  border-radius: 50%;
}

.cal-day-events {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1;
}

.cal-event-pill {
  background: rgba(201,168,76,0.12);
  border-left: 2px solid var(--gold);
  border-radius: 2px;
  padding: 0.12rem 0.35rem;
  font-size: 0.65rem;
  color: var(--gold-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
  font-weight: 500;
}

.cal-event-more {
  font-size: 0.62rem;
  color: var(--text-dim);
  padding: 0 0.25rem;
}

/* ---- DAY MODAL ---- */
.cal-modal {
  display: none; /* must be none so hidden attribute works properly */
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.cal-modal:not([hidden]) {
  display: flex; /* only flex when visible — fixes click-blocking bug */
  pointer-events: none;
}

.cal-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.22s;
}

.cal-modal:not([hidden]) .cal-modal-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.cal-modal-box {
  position: relative;
  z-index: 1;
  background: #122a1e;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 14px;
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  overflow-y: auto;
  transform: scale(0.96) translateY(10px);
  opacity: 0;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.22s ease;
  pointer-events: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.cal-modal:not([hidden]) .cal-modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.cal-modal-header {
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  background: rgba(0,0,0,0.15);
}

.cal-modal-date {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.3rem;
  color: var(--text);
  line-height: 1.2;
}

.cal-modal-hours {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-modal-hours::before {
  content: '◷';
  color: var(--gold);
  font-size: 0.9rem;
}

.cal-modal-hours.closed { color: var(--text-dim); }
.cal-modal-hours.closed::before { content: '✕'; font-size: 0.7rem; color: var(--text-dim); }

.cal-modal-close {
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--text-dim);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

.cal-modal-close:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}

.cal-modal-body {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cal-modal-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-modal-empty {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-style: italic;
}

/* Tournament cards */
.modal-tournament {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.15);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
}

.modal-tournament:last-child { margin-bottom: 0; }

.modal-tournament-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
}

.modal-tournament-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.modal-tournament-meta span::before {
  content: '· ';
  color: var(--text-dim);
}

.modal-tournament-meta span:first-child::before { content: ''; }

.modal-tournament-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.55;
}

.modal-tournament-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
}

.modal-tournament-link:hover { color: var(--gold-light); }

.modal-tournament-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Specials */
.special-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.special-item {
  background: rgba(255,255,255,0.03);
  border-radius: 5px;
  padding: 0.5rem 0.75rem;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.special-name {
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 500;
}

.special-price {
  font-size: 0.78rem;
  color: var(--gold);
  font-weight: 600;
}

.special-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  width: 100%;
  margin-top: 0.1rem;
}

/* Announcements */
.cal-announcement {
  background: rgba(201,168,76,0.06);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}

.cal-announcement:last-child { margin-bottom: 0; }

.cal-announcement strong {
  display: block;
  color: var(--gold-light);
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
}

.cal-announcement p { color: var(--text-muted); line-height: 1.55; }

/* Book button */
.cal-modal-footer {
  padding: 0 1.5rem 1.5rem;
}

.btn-book {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  background: var(--gold);
  color: #0d2018;
  border: none;
  border-radius: 6px;
  padding: 0.8rem 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}

.btn-book:hover { background: var(--gold-light); color: #0d2018; }

/* Loading */
.cal-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  color: var(--text-dim);
  font-size: 0.85rem;
  grid-column: 1 / -1;
  gap: 0.5rem;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .cal-hero { padding: 5.5rem 1.25rem 2.5rem; }
  .cal-day { min-height: 56px; padding: 0.35rem 0.4rem; }
  .cal-day-num { width: 22px; height: 22px; font-size: 0.75rem; }
  .cal-event-pill { display: none; }
  .cal-day--has-event::after {
    content: '';
    display: block;
    width: 5px;
    height: 5px;
    background: var(--gold);
    border-radius: 50%;
    margin: 3px auto 0;
  }
  .cal-nav-title { font-size: 1.25rem; }
  .cal-modal-box { max-height: 92vh; border-radius: 10px; }
  .cal-wrap { margin-bottom: 2.5rem; }
}
