/*
 * calendar-festival.css
 * Indian Festival Calendar 2026-2030
 * Built by Webomatic, Ahmedabad
 * Tithi: સુદ (Shukla Paksha) | વદ (Krishna Paksha)
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
  --c-national:  #e63946;
  --c-hindu:     #f4a261;
  --c-muslim:    #2a9d8f;
  --c-christian: #457b9d;
  --c-sikh:      #6a4c93;
  --c-jain:      #e07d10;
  --c-special:   #6b9e3b;
  --c-bg:        #ffffff;
  --c-border:    #e8e8e8;
  --c-text:      #1a1a2e;
  --c-muted:     #888;
  --radius:      10px;
}

/* ============================================
   SECTION WRAPPER
   ============================================ */
.cal-section-wrap {
  padding: 20px 0 40px;
}

/* ============================================
   LEGEND
   ============================================ */
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: #f9f9f9;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--c-text);
  white-space: nowrap;
}
.cal-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-legend-dot.tithi-shukla  { background: #f4a261; border: 1px solid #e08040; }
.cal-legend-dot.tithi-krishna { background: #6a7fc1; border: 1px solid #4a5fa1; }
.cal-legend-dot.tithi-purnima { background: #f0c040; border: 1px solid #c09020; }
.cal-legend-dot.tithi-amavasya { background: #8888cc; border: 1px solid #6666aa; }

/* ============================================
   YEAR TABS
   ============================================ */
.cal-year-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  padding: 20px 0 0;
}
.cal-year-btn {
  font-family: "Abel", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 24px;
  border: 2px solid #0060AA;
  background: transparent;
  color: #1a1a2e;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all .2s;
  letter-spacing: .5px;
  border-bottom: none;
  position: relative;
  top: 2px;
}
.cal-year-btn.active,
.cal-year-btn:hover {
  background: #0060AA;
  color: #fff;
}

/* ============================================
   MONTH NAV BAR
   ============================================ */
.cal-month-nav {
  display: flex;
  flex-wrap: wrap;
  background: #0060AA;
  border-radius: 0 8px 8px 8px;
  overflow: hidden;
  padding: 6px 8px;
  margin-bottom: 24px;
  gap: 2px;
}
.cal-month-btn {
  font-size: 1rem;
  font-weight: 500;
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,1);
  cursor: pointer;
  border-radius: 6px;
  transition: all .18s;
  letter-spacing: .4px;
  white-space: nowrap;
}
.cal-month-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.cal-month-btn.active { background: #f4a261; color: #fff; font-weight: 700; }

/* ============================================
   MONTH HEADING
   ============================================ */
.cal-month-label {
  font-family: "Abel", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 2px;
}
.cal-month-sub {
  font-size: 1rem;
  color: var(--c-muted);
  margin-bottom: 12px;
  font-family: 'Noto Sans Gujarati', sans-serif;
}

/* ============================================
   CALENDAR CARD + GRID
   ============================================ */
.cal-card {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

/* Day-of-week header */
.cal-dow-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #1a1a2e;
}
.cal-dow-cell {
  padding: 8px 4px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,1);
  letter-spacing: .6px;
  text-transform: uppercase;
}
.cal-dow-cell.is-sun { color: #ff9f9f; }
.cal-dow-cell.is-sat { color: #9fd3ff; }

/* Date grid */
.cal-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-top: 1px solid var(--c-border);
}

/* Individual date cell */
.cal-date-cell {
  min-height: 82px;
  padding: 6px 6px 6px 7px;
  border-right: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  background: #fff;
  transition: background .15s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: default;
}
.cal-date-cell:nth-child(7n) { border-right: none; }
.cal-date-cell:hover:not(.is-empty) { background: #f5f5ff; }
.cal-date-cell.is-empty { background: #fafafa; cursor: default; }
.cal-date-cell.is-sun .cal-date-num { color: #c0392b; }
.cal-date-cell.is-sat .cal-date-num { color: #2980b9; }

/* Purnima + Amavasya cell glow */
.cal-date-cell.is-purnima  { background: linear-gradient(180deg,#fffef5,#fff8dc); }
.cal-date-cell.is-amavasya { background: linear-gradient(180deg,#f5f5ff,#e8e8f8); }
.cal-date-cell.is-purnima:hover  { background: #fff5c0; }
.cal-date-cell.is-amavasya:hover { background: #ddddf5; }

/* Date number */
.cal-date-num {
  font-size: .88rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1;
  margin-bottom: 3px;
  flex-shrink: 0;
}

/* ============================================
   FESTIVAL BADGES (inside cells)
   ============================================ */
.cal-fest-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}
.cal-badge {
  display: block;
  font-size: .6rem;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  color: #fff;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
}
.cal-badge.national  { background: var(--c-national); }
.cal-badge.hindu     { background: var(--c-hindu); color: #5a2e00; }
.cal-badge.muslim    { background: var(--c-muslim); }
.cal-badge.christian { background: var(--c-christian); }
.cal-badge.sikh      { background: var(--c-sikh); }
.cal-badge.jain      { background: var(--c-jain); color: #5a2e00; }
.cal-badge.special   { background: var(--c-special); }

/* ============================================
   TITHI LABEL (Gujarati — inside cell)
   ============================================ */
.cal-tithi {
  display: inline-flex;
  align-items: center;
  font-size: .6rem;
  font-weight: 500;
  margin-top: auto;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.3;
  font-family: 'Noto Sans Gujarati', 'Shruti', sans-serif;
  max-width: 100%;
}
.cal-tithi.shukla  { background: #fef3e2; color: #7c5200; border-left: 3px solid #f4a261; }
.cal-tithi.krishna { background: #eef0f8; color: #2c3a6e; border-left: 3px solid #6a7fc1; }
.cal-tithi.purnima { background: #fff8dc; color: #7a5c00; border-left: 3px solid #f0c040; font-weight: 700; }
.cal-tithi.amavasya{ background: #2a2a3e; color: #d0cfe8; border-left: 3px solid #8888cc; font-weight: 700; }
.cal-tithi.ekadashi{ background: #e8f5e9; color: #2e6b35; border-left: 3px solid #5aab62; font-weight: 600; }

.cal-paksha-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-right: 4px;
  flex-shrink: 0;
}
.cal-tithi.shukla   .cal-paksha-dot { background: #f4a261; }
.cal-tithi.krishna  .cal-paksha-dot { background: #6a7fc1; }
.cal-tithi.purnima  .cal-paksha-dot { background: #f0c040; }
.cal-tithi.amavasya .cal-paksha-dot { background: #8888cc; }
.cal-tithi.ekadashi .cal-paksha-dot { background: #5aab62; }

/* ============================================
   RIGHT PANEL — FESTIVAL LIST TABLE
   ============================================ */
.cal-festival-list-panel { width: 100%; }
.cal-list-heading {
  font-family: "Abel", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-text);
  margin-bottom: 2px;
}
.cal-list-sub {
  font-size: 1rem;
  color: var(--c-muted);
  margin-bottom: 10px;
}
.table-cal-list { font-size: 1rem; }
.table-cal-list th {
  background: #1a1a2e;
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .4px;
  border-color: #2d2d4e;
}
.table-cal-list td { vertical-align: middle; }
.table-cal-list small { font-family: 'Noto Sans Gujarati', sans-serif; font-size: 1rem; }

/* Festival type pill (in table) */
.cal-pill {
  display: inline-block;
  font-size: 1rem;
  font-weight: 0;
  padding: 2px 7px;
  border-radius: 20px;
  color: #fff;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.cal-pill.national  { background: var(--c-national); }
.cal-pill.hindu     { background: var(--c-hindu); color: #5a2e00; }
.cal-pill.muslim    { background: var(--c-muslim); }
.cal-pill.christian { background: var(--c-christian); }
.cal-pill.sikh      { background: var(--c-sikh); }
.cal-pill.jain      { background: var(--c-jain); color: #5a2e00; }
.cal-pill.special   { background: var(--c-special); }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 991px) {
  .cal-date-cell { min-height: 68px; }
}
@media (max-width: 767px) {
  .cal-date-cell { min-height: 54px; padding: 4px 3px; }
  .cal-badge     { font-size: .54rem; padding: 1px 3px; }
  .cal-tithi     { font-size: .52rem; padding: 1px 3px; }
  .cal-month-btn { font-size: .72rem; padding: 6px 9px; }
  .cal-year-btn  { font-size: .85rem; padding: 7px 14px; }
}
@media (max-width: 480px) {
  .cal-date-num  { font-size: .75rem; }
  .cal-tithi     { display: none; }
  .cal-date-cell { min-height: 44px; }
}

/* Current day highlight */
.cal-date-cell.is-today {
  outline: 2px solid #e63946;
  outline-offset: -2px;
  background: #fff5f5;
}
.cal-date-cell.is-today .cal-date-num {
  background: #e63946;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
}
.cal-date-cell.is-today.is-purnima  { background: #fff5f5; }
.cal-date-cell.is-today.is-amavasya { background: #fff5f5; }