/* ==========================================================================
   ERGC Rates Calendar
   Eagle Ridge Golf Club (golfglennie.com)

   Approved color system:
     Spring/Fall weekday  = #f5b087
     Spring/Fall weekend  = #ec691a
     Summer weekday       = #81c200
     Summer weekend/hol   = #4e7500
     Closed               = #ececec
     Selected             = inset ring on semantic color
     Holiday              = inherits peak + dot indicator
   ========================================================================== */

/* ---------- Container ---------- */

.ergc-rates-calendar {
  font-family: 'Lato', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: #191919;
  max-width: 1080px;
  margin: 0 auto;
}

.ergc-rates-calendar *,
.ergc-rates-calendar *::before,
.ergc-rates-calendar *::after {
  box-sizing: border-box;
}

/* ---------- Legend ---------- */

.ergc-rates-calendar__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 20px;
}

.ergc-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #353535;
}

.ergc-legend-chip::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ergc-legend-chip--sf-weekday::before   { background-color: #f5b087; }
.ergc-legend-chip--sf-peak::before      { background-color: #ec691a; }
.ergc-legend-chip--sum-weekday::before  { background-color: #81c200; }
.ergc-legend-chip--sum-peak::before     { background-color: #4e7500; }
.ergc-legend-chip--closed::before       { background-color: #ececec; }
.ergc-legend-chip--selected::before     {
  background-color: #81c200;
  box-shadow: inset 0 0 0 3px #1b2800;
}

/* ---------- Layout ---------- */

.ergc-rates-calendar__layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

/* ---------- Calendar Card ---------- */

.ergc-calendar-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  padding: 20px;
}

.ergc-calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ergc-calendar-month {
  font-family: 'Oswald', Helvetica, Arial, sans-serif;
  font-size: 20px;
  font-weight: 700;
  text-transform: uppercase;
  color: #353535;
  margin: 0;
}

.ergc-calendar-nav {
  background: none;
  border: 2px solid #e0e0e0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #353535;
  transition: border-color 0.2s, color 0.2s;
  padding: 0;
  line-height: 1;
}

.ergc-calendar-nav:hover,
.ergc-calendar-nav:focus-visible {
  border-color: #ec691a;
  color: #ec691a;
}

/* ---------- Weekday Headers ---------- */

.ergc-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-family: 'Oswald', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 4px;
}

/* ---------- Calendar Grid ---------- */

.ergc-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

/* Base day cell */
.ergc-calendar-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 8px 2px;
  border: 2px solid transparent;
  background: #f7f7f7;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: 'Lato', sans-serif;
}

.ergc-calendar-day:hover,
.ergc-calendar-day:focus-visible {
  border-color: #1b2800;
  outline: none;
}

/* Empty leading cells */
.ergc-calendar-day--empty {
  background: transparent;
  cursor: default;
  border: none;
  min-height: 0;
}

.ergc-calendar-day--empty:hover { border-color: transparent; }

/* ---------- Closed dates ---------- */

.ergc-calendar-day--closed {
  background-color: #ececec;
  cursor: pointer;
  border: 2px solid transparent;
}

.ergc-calendar-day--closed:hover,
.ergc-calendar-day--closed:focus-visible {
  border-color: #aaa;
}

.ergc-calendar-day--closed .ergc-calendar-day__num {
  color: #bbb;
}

/* Selected closed cell */
.ergc-calendar-day--closed.ergc-calendar-day--selected {
  box-shadow: inset 0 0 0 3px #888;
  border-color: #888;
}

.ergc-calendar-day--closed.ergc-calendar-day--selected .ergc-calendar-day__num {
  color: #888;
}

/* ---------- Season + Day-type colors (approved palette) ---------- */

/* Spring/Fall weekday */
.ergc-calendar-day--spring-fall-weekday {
  background-color: #f5b087;
}

/* Spring/Fall peak/weekend */
.ergc-calendar-day--spring-fall-peak {
  background-color: #ec691a;
}

.ergc-calendar-day--spring-fall-peak .ergc-calendar-day__num {
  color: #fff;
}

/* Summer weekday */
.ergc-calendar-day--summer-weekday {
  background-color: #81c200;
}

/* Summer peak/weekend/holiday */
.ergc-calendar-day--summer-peak {
  background-color: #4e7500;
}

.ergc-calendar-day--summer-peak .ergc-calendar-day__num {
  color: #fff;
}

/* ---------- Holiday refinement ---------- */

.ergc-calendar-day__holiday-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #fff;
  border: 2px solid #ec691a;
}

/* On dark peak cells, make dot more visible */
.ergc-calendar-day--summer-peak .ergc-calendar-day__holiday-dot {
  background-color: #ec691a;
  border-color: #fff;
}

/* ---------- Selected state (inset ring, preserves semantic color) ---------- */

.ergc-calendar-day--selected {
  box-shadow: inset 0 0 0 3px #1b2800;
  border-color: #1b2800;
}

/* On dark cells, make the ring lighter */
.ergc-calendar-day--summer-peak.ergc-calendar-day--selected,
.ergc-calendar-day--spring-fall-peak.ergc-calendar-day--selected {
  box-shadow: inset 0 0 0 3px #fff;
  border-color: #fff;
}

/* ---------- Day number ---------- */

.ergc-calendar-day__num {
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  color: #353535;
}

/* ---------- Detail Card ---------- */

.ergc-rate-detail-card {
  background: #fafafa;
  border: 1px solid #e0e0e0;
  padding: 24px;
  position: sticky;
  top: 80px;
}

.ergc-rate-detail-card__title {
  font-family: 'Oswald', Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-transform: uppercase;
  color: #353535;
  margin: 0 0 12px;
  line-height: 1.3;
}

.ergc-rate-detail-card__hint {
  color: #888;
  font-size: 14px;
  margin: 0;
}

.ergc-rate-detail-card__closed {
  color: #666;
  font-size: 14px;
  margin: 0 0 8px;
}

.ergc-rate-detail-card__closed-helper {
  color: #999;
  font-size: 13px;
  margin: 0;
}

.ergc-rate-detail-card__badge {
  display: inline-block;
  font-family: 'Oswald', Helvetica, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  margin: 0 6px 10px 0;
  color: #fff;
}

.ergc-rate-detail-card__badge--summer {
  background-color: #4e7500;
}

.ergc-rate-detail-card__badge--spring-fall {
  background-color: #ec691a;
}

.ergc-rate-detail-card__badge--holiday {
  background-color: #ec691a;
}

.ergc-rate-detail-card__badge--closed {
  background-color: #999;
}

.ergc-rate-detail-card__day-group {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  margin: 0 0 14px;
}

.ergc-rate-detail-card__empty {
  color: #999;
  font-style: italic;
  font-size: 14px;
}

/* Detail table */
.ergc-rate-detail-card__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 14px;
}

.ergc-rate-detail-card__table th {
  font-family: 'Oswald', Helvetica, Arial, sans-serif;
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 700;
  color: #888;
  text-align: left;
  padding: 6px 0;
  border-bottom: 2px solid #e0e0e0;
}

.ergc-rate-detail-card__table th:last-child {
  text-align: right;
}

.ergc-rate-detail-card__table td {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

.ergc-rate-detail-card__price {
  text-align: right;
  font-weight: 700;
  color: #1b2800;
  font-size: 16px;
}

.ergc-rate-detail-card__time {
  display: block;
  font-size: 12px;
  color: #888;
  font-weight: 400;
  margin-top: 2px;
}

/* Notes */
.ergc-rate-detail-card__notes {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  font-size: 13px;
  color: #666;
}

.ergc-rate-detail-card__notes li {
  padding: 3px 0 3px 16px;
  position: relative;
}

.ergc-rate-detail-card__notes li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  background-color: #ec691a;
  border-radius: 50%;
}

/* Discount anchor link */
.ergc-rate-detail-card__discount-link {
  display: block;
  width: 100%;
  text-align: center;
  font-family: 'Oswald', Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  text-decoration: none;
  color: #ec691a;
  background: none;
  border: 2px solid #ec691a;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  margin-top: 4px;
}

.ergc-rate-detail-card__discount-link:hover,
.ergc-rate-detail-card__discount-link:focus-visible {
  background-color: #ec691a;
  color: #fff;
}

/* ---------- Responsive: Tablet ---------- */

@media (max-width: 900px) {
  .ergc-rates-calendar__layout {
    grid-template-columns: 1fr;
  }

  .ergc-rate-detail-card {
    position: static;
  }
}

/* ---------- Responsive: Phone ---------- */

@media (max-width: 540px) {
  .ergc-calendar-card {
    padding: 12px;
  }

  .ergc-calendar-day {
    min-height: 44px;
    padding: 4px 1px;
  }

  .ergc-calendar-day__num {
    font-size: 13px;
  }

  .ergc-calendar-weekdays {
    font-size: 11px;
  }

  .ergc-rate-detail-card {
    padding: 16px;
  }
}
