/* Calendars — shared styles for every regional calendar page. */

/* App-bar icon: square, white-on-crimson, sized like the other calculators. */
body.page-cal .milan-app-bar__logo {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0;
  object-fit: contain;
}

.cal-body {
  padding: 1rem 1rem 1.25rem;
}

.cal-intro {
  margin: 0 0 1rem;
  color: var(--color-muted, #5a5a5a);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
}

/* Month navigation */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 auto 0.85rem;
}

.cal-nav__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  background: var(--crimson, #7a1834);
  color: #fff;
  text-decoration: none;
  font-size: 1.25rem;
  line-height: 1;
  flex: 0 0 auto;
  -webkit-tap-highlight-color: transparent;
}

.cal-nav__arrow:hover {
  background: var(--crimson-mid, #9b2244);
}

.cal-nav__arrow.is-disabled {
  background: #d9c9cf;
  pointer-events: none;
}

.cal-nav__selects {
  display: inline-flex;
  gap: 0.4rem;
}

.cal-select {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--crimson-mid, #9b2244);
  border-radius: 10px;
  background: #fff;
  color: var(--crimson, #7a1834);
  font-size: 0.95rem;
  font-weight: 600;
  min-height: 2.5rem;
}

/* Month header */
.cal-monthhead {
  text-align: center;
  margin-bottom: 0.9rem;
}

.cal-monthhead__greg {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: clamp(1.3rem, 5vw, 1.75rem);
  color: var(--crimson, #7a1834);
  margin: 0;
}

.cal-monthhead__era {
  margin: 0.2rem 0 0;
  font-weight: 700;
  color: var(--crimson-mid, #9b2244);
  font-size: 0.95rem;
}

.cal-monthhead__extra {
  margin: 0.15rem 0 0;
  font-weight: 600;
  color: #8a6a72;
  font-size: 0.82rem;
}

.cal-monthhead__month {
  margin: 0.1rem 0 0;
  color: var(--color-muted, #5a5a5a);
  font-size: 0.9rem;
}

/* Calendar grid */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-grid__wd {
  text-align: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--crimson, #7a1834);
  padding: 0.3rem 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cal-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  min-height: 5.2rem;
  padding: 0.3rem 0.32rem;
  border: 1px solid #ecdfe3;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--color-text, #1a1a1a);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.cal-cell:hover {
  border-color: var(--crimson-mid, #9b2244);
}

.cal-cell--blank {
  background: #faf6f7;
  border-color: #f0e8ea;
  cursor: default;
  pointer-events: none;
}

.cal-cell--shukla {
  border-left: 3px solid #e0b84a; /* waxing — gold */
}

.cal-cell--krishna {
  border-left: 3px solid #6a7bb5; /* waning — indigo */
}

.cal-cell--today {
  outline: 2px solid var(--crimson, #7a1834);
  outline-offset: -1px;
  background: #fdf3f6;
}

.cal-cell--fest .cal-cell__num::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 4px;
  border-radius: 50%;
  background: #d4761a;
  vertical-align: middle;
}

.cal-cell__num {
  font-weight: 700;
  font-size: 1rem;
  color: var(--crimson, #7a1834);
  line-height: 1.1;
}

.cal-cell__rmonth {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--crimson-mid, #9b2244);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Regional solar date ("Aani 1") on the solar panchang grids. */
.cal-cell__sday {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--crimson-mid, #9b2244);
  line-height: 1.1;
}

/* Tithi end time ("upto 8:24 AM") inside a day cell. */
.cal-cell__tend {
  font-size: 0.6rem;
  color: #9a8088;
  line-height: 1.1;
}

.cal-cell__tithi {
  font-size: 0.72rem;
  color: #333;
  line-height: 1.15;
}

.cal-cell__nak {
  font-size: 0.66rem;
  color: #8a6a72;
  line-height: 1.1;
}

.cal-cell__fests {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.cal-cell__fest {
  font-size: 0.6rem;
  font-weight: 600;
  color: #b3531a;
  background: #fbeede;
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cal-cell__fest--more {
  color: #fff;
  background: #d4761a;
}

/* Day detail */
.cal-detail {
  margin-top: 1rem;
  border: 1px solid var(--crimson-mid, #9b2244);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #fdf7f8;
}

/* Detail expanded inline inside the month grid, under the clicked date's row. */
.cal-detail--grid {
  grid-column: 1 / -1;
  margin: 2px 0;
}

.cal-cell.is-open {
  outline: 2px solid var(--crimson-mid, #9b2244);
  outline-offset: -2px;
}

.cal-detail__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.cal-detail__date {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--crimson, #7a1834);
  margin: 0;
}

.cal-detail__era {
  font-size: 0.85rem;
  color: var(--crimson-mid, #9b2244);
  font-weight: 600;
}

.cal-detail__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
}

.cal-detail__row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.85rem;
  border-bottom: 1px dashed #ecdfe3;
  padding: 0.25rem 0;
}

.cal-detail__row dt {
  color: #6a5a5e;
  font-weight: 600;
}

.cal-detail__row dd {
  margin: 0;
  color: var(--color-text, #1a1a1a);
  text-align: right;
}

.cal-detail__fests {
  grid-column: 1 / -1;
  margin: 0.4rem 0 0;
}

.cal-detail__fest {
  display: inline-block;
  margin: 0 0.35rem 0.35rem 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #fbeede;
  color: #b3531a;
  font-size: 0.8rem;
  font-weight: 600;
}

.cal-detail__close {
  margin-left: auto;
  border: none;
  background: transparent;
  color: var(--crimson, #7a1834);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
}

.cal-note {
  margin: 1rem 0 0;
  font-size: 0.8rem;
  color: var(--color-muted, #6a5a5e);
  line-height: 1.5;
}

.cal-loc-btn {
  border: none;
  background: transparent;
  color: var(--crimson, #7a1834);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.cal-empty {
  text-align: center;
  color: var(--color-muted, #6a5a5e);
  padding: 2rem 0;
}

/* Mobile: keep the 7-column grid but trim the per-cell text. */
@media (max-width: 560px) {
  .cal-body {
    padding: 0.75rem 0.5rem 1rem;
  }
  .cal-grid {
    gap: 3px;
  }
  .cal-cell {
    min-height: 4rem;
    padding: 0.2rem 0.22rem;
    border-radius: 6px;
  }
  .cal-cell__num {
    font-size: 0.82rem;
  }
  .cal-cell__tithi {
    font-size: 0.6rem;
  }
  .cal-cell__nak {
    display: none;
  }
  .cal-cell__tend {
    display: none;
  }
  .cal-cell__sday {
    font-size: 0.52rem;
  }
  .cal-cell__fest {
    font-size: 0;
    padding: 0;
    background: transparent;
  }
  .cal-cell__fest::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d4761a;
  }
  .cal-cell__fest--more {
    display: none;
  }
  .cal-detail__grid {
    grid-template-columns: 1fr;
  }
  .cal-grid__wd {
    font-size: 0.66rem;
  }
}

/* ===== Month festivals — alternating rows (Hindu / Indian calendars) ===== */
.cal-month-fests {
  margin: 1.1rem 0 0.5rem;
}

.cal-month-fests__title {
  margin: 0 0 0.7rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--crimson, #7a1834);
  text-align: center;
}

.cal-fest-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #ececec;
  border-radius: 12px;
  overflow: hidden;
}

.cal-fest-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  text-align: left;
  border: none;
  border-top: 1px solid #f0f0f0;
  cursor: pointer;
  padding: 0.6rem 0.85rem;
  background: #fff;
  color: #2a2a2a;
  font: inherit;
  transition: background 0.12s ease;
}

.cal-fest-rows li:first-child .cal-fest-row {
  border-top: none;
}

/* Alternating lightly coloured rows */
.cal-fest-rows li:nth-child(even) .cal-fest-row {
  background: #faf3f0;
}

.cal-fest-row:hover,
.cal-fest-row:focus-visible {
  background: #f6e7e2;
  outline: none;
}

.cal-fest-row__date {
  flex: 0 0 auto;
  width: 3rem;
  text-align: center;
  line-height: 1.1;
  color: var(--crimson, #7a1834);
}

.cal-fest-row__day {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
}

.cal-fest-row__mon {
  display: block;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

.cal-fest-row__body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cal-fest-row__name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.3;
}

.cal-fest-row__tithi {
  font-size: 0.78rem;
  font-weight: 600;
  color: #7a1834;
}

.cal-fest-row__badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.35rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.38rem;
  border-radius: 999px;
  background: #f0e3d2;
  color: #8a5a1a;
}

/* Inline (accordion) day detail that opens beneath a festival row. */
.cal-fest-rowdetail {
  list-style: none;
  padding: 0.4rem 0.6rem 0.7rem;
  background: #faf3f0;
}

.cal-fest-rowdetail .cal-detail--inline {
  margin-top: 0;
}

@media (max-width: 560px) {
  .cal-fest-row {
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
  }
  .cal-fest-row__date {
    width: 2.6rem;
  }
  .cal-fest-row__day {
    font-size: 1.05rem;
  }
  .cal-fest-row__name {
    font-size: 0.88rem;
  }
}

/* ===== Festival-only calendars (view = list) ===== */
.cal-list-heading {
  margin: 0 0 1rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--crimson, #7a1834);
  text-align: center;
}

.cal-fest-year {
  margin: 0 0 1.5rem;
}

.cal-fest-year__title {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--crimson, #7a1834);
  text-align: center;
  letter-spacing: 0.02em;
}

.cal-fest-year__toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0;
  padding: 0.55rem 0.75rem;
  background: rgba(122, 24, 52, 0.06);
  border: 1px solid rgba(122, 24, 52, 0.16);
  border-radius: 0.6rem;
  color: inherit;
  font: inherit;
  font-weight: 700;
  letter-spacing: inherit;
  cursor: pointer;
  min-height: 2.75rem;
}

.cal-fest-year__toggle:hover {
  background: rgba(122, 24, 52, 0.1);
}

.cal-fest-year__chev {
  width: 0.6rem;
  height: 0.6rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  margin-top: -0.18rem;
}

.cal-fest-year.is-collapsed .cal-fest-year__chev {
  transform: rotate(-45deg);
  margin-top: 0.12rem;
}

.cal-fest-year.is-collapsed .cal-fest-year__body {
  display: none;
}

.cal-fest-month {
  margin: 1rem 0 0.55rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #2a2a2a;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cal-fest-month__greg {
  flex: 0 0 auto;
}

.cal-fest-month__reg {
  flex: 0 0 auto;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--crimson-mid, #9b2244);
  letter-spacing: 0.01em;
}

.cal-fest-month::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(122, 24, 52, 0.16);
}

/* Regional era shown beside the Gregorian year on the year toggle. */
.cal-fest-year__era {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--crimson-mid, #9b2244);
  letter-spacing: 0.01em;
}

.cal-fest-year__era::before {
  content: "·";
  margin: 0 0.45rem 0 0;
  color: rgba(122, 24, 52, 0.5);
}

.cal-fest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.cal-fest-item {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 0.7rem 0.85rem;
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #fff;
}

.cal-fest-item.is-past {
  opacity: 0.55;
}

.cal-fest-item.is-today {
  border-color: var(--crimson, #7a1834);
  box-shadow: 0 0 0 1px var(--crimson, #7a1834) inset;
}

.cal-fest-date {
  flex: 0 0 auto;
  width: 3.4rem;
  text-align: center;
  background: var(--crimson, #7a1834);
  color: #fff;
  border-radius: 10px;
  padding: 0.4rem 0.2rem;
  line-height: 1.1;
}

.cal-fest-date__day {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
}

.cal-fest-date__mon {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cal-fest-date__wd {
  display: block;
  font-size: 0.66rem;
  opacity: 0.85;
  margin-top: 0.1rem;
}

.cal-fest-main {
  flex: 1 1 auto;
  min-width: 0;
}

.cal-fest-name {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  font-weight: 700;
  color: #2a2a2a;
  line-height: 1.3;
}

.cal-fest-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: #f0e3d2;
  color: #8a5a1a;
}

.cal-fest-badge--today {
  background: var(--crimson, #7a1834);
  color: #fff;
}

/* Category badges for the all-India (national) calendar. */
.cal-fest-badge--national { background: #fde2e4; color: #9d174d; }
.cal-fest-badge--international { background: #e0ecff; color: #1d4ed8; }
.cal-fest-badge--hindu { background: #fde7cf; color: #a16207; }
.cal-fest-badge--sikh { background: #fff3d6; color: #b45309; }
.cal-fest-badge--jain { background: #ffe9d6; color: #c2410c; }
.cal-fest-badge--buddhist { background: #fbe8cf; color: #92400e; }
.cal-fest-badge--christian { background: #e3eafe; color: #3730a3; }
.cal-fest-badge--islamic { background: #dcfce7; color: #15803d; }
.cal-fest-badge--astronomy { background: #ede9fe; color: #6d28d9; }

/* Eclipse / Grahan visibility badges. */
.cal-fest-badge--visible { background: #dcfce7; color: #15803d; }
.cal-fest-badge--novis { background: #ececec; color: #57534e; }

.cal-fest-meta {
  margin: 0 0 0.3rem;
  font-size: 0.82rem;
  color: var(--color-muted, #5a5a5a);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
}

.cal-fest-meta__tithi {
  font-weight: 600;
  color: #7a1834;
}

.cal-fest-time {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  color: var(--color-muted, #5a5a5a);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem;
}

.cal-fest-time__label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.66rem;
  color: #8a5a1a;
}

.cal-fest-time__sep {
  opacity: 0.7;
}

.cal-fest-time--paran .cal-fest-time__label {
  color: #7a1834;
}

.cal-fest-time__after {
  font-size: 0.72rem;
  opacity: 0.8;
}

.cal-fest-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #444;
}

@media (max-width: 560px) {
  .cal-fest-date {
    width: 3rem;
  }
  .cal-fest-date__day {
    font-size: 1.15rem;
  }
  .cal-fest-name {
    font-size: 0.95rem;
  }
  .cal-fest-desc {
    font-size: 0.84rem;
  }
}
