/* Month page: tabs, header, 7-column grid, day boxes */
.cal-wrap { background: var(--cream); border: 3px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; }

.month-tabs { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin-bottom: 10px; }
.tab { text-align: center; padding: 6px 2px; line-height: 1.6; color: #fff; text-decoration: none; font-weight: 700; border-radius: 6px 6px 0 0; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-blue { background: var(--blue); }
.tab-maroon { background: var(--maroon); }
.tab:hover { color: #fff; filter: brightness(1.15); }
.tab.active { background: var(--orange); outline: 3px solid var(--gold); outline-offset: -3px; }

.month-head { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 12px; align-items: center; background: var(--cream2); border: 2px solid var(--gold); border-radius: 6px; padding: 10px 14px; margin-bottom: 8px; }
.mh-brand { display: flex; gap: 10px; align-items: center; }
.mh-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.mh-site { font-weight: 700; font-size: 1.2rem; color: var(--maroon); margin: 0; }
.mh-url { margin: 0; font-size: .85rem; color: var(--muted); }
.mh-ed { margin: 0; font-size: .8rem; color: var(--purple); font-weight: 600; }
.mh-month { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.mh-name { font-size: 64px; font-weight: 700; color: var(--red); margin: 0; line-height: 1.3; }
.mh-grange { margin: 0; font-weight: 600; color: var(--maroon); }
.mh-arrow { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 50%; background: var(--maroon); color: #fff; font-size: 1.1rem; flex: none; }
.mh-arrow:hover { background: var(--red); color: #fff; }
.mh-year { text-align: right; }
.mh-bnyear { font-size: 2.4rem; font-weight: 700; color: var(--blue); margin: 0; line-height: 1.25; }
.mh-bnyear small { font-size: 1rem; color: var(--maroon); }
.mh-gyear { margin: 0; color: var(--maroon); font-weight: 600; }
.mh-raja { margin: 4px 0; font-size: .9rem; color: var(--purple); }
.today-btn { margin-top: 4px; background: var(--green); border-color: var(--green); }

.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; background: var(--gold); border: 4px solid var(--gold); border-radius: 4px; }
.wd { background: var(--maroon); color: #fff; text-align: center; font-weight: 700; padding: 6px 2px; font-size: 1rem; }
.wd-sun { background: var(--red); }
.wd-short { display: none; }

.day, .span-cell, .empty-cell { background: var(--cream2); min-height: 118px; }
.empty-cell { background: #f7ebcc; }
.day { position: relative; display: flex; flex-direction: column; padding: 4px 6px; text-decoration: none; color: var(--text); overflow: hidden; }
.day:hover { background: #fff; color: var(--text); box-shadow: inset 0 0 0 2px var(--gold); }
.d-top { display: flex; justify-content: space-between; align-items: flex-start; }
.d-g { font-size: .85rem; font-weight: 700; color: var(--muted); font-family: 'Google Sans', sans-serif; }
.d-bn { font-size: 44px; font-weight: 700; color: var(--blue); line-height: 1.2; }
.day.sun .d-bn, .day.holiday .d-bn { color: var(--red); }
.day.sun .d-g { color: var(--red); }
.d-hijri { font-size: .72rem; color: var(--green); font-weight: 600; }
.d-fest { color: var(--red); font-weight: 700; font-size: .82rem; line-height: 1.4; padding-right: 50px; }
.d-more { color: var(--purple); font-size: .75rem; font-weight: 700; }
.d-note { color: var(--purple); font-size: .75rem; }
.d-tithi { margin-top: auto; font-size: .8rem; color: var(--maroon); padding-right: 50px; }
.d-tithi[class*="moon-"] { font-weight: 700; display: flex; align-items: center; gap: 4px; }
.d-tithi[class*="moon-"]::before { content: ''; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.moon-purnima { color: #9a6b00; }
.moon-purnima::before { background: #ffd54f; box-shadow: inset 0 0 0 1.5px #b8860b; }
.moon-amavasya { color: #222; }
.moon-amavasya::before { background: #222; }
.moon-ekadashi { color: var(--purple); }
.moon-ekadashi::before { background: linear-gradient(90deg, var(--purple) 50%, #fff 50%); box-shadow: inset 0 0 0 1.5px var(--purple); }
.d-thumb { position: absolute; right: 4px; bottom: 4px; width: 48px; height: 48px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: #fff; }
.day.holiday .d-tithi[class*="moon-"] { font-weight: 700; display: flex; align-items: center; gap: 4px; }
.d-tithi[class*="moon-"]::before { content: ''; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.moon-purnima { color: #9a6b00; }
.moon-purnima::before { background: #ffd54f; box-shadow: inset 0 0 0 1.5px #b8860b; }
.moon-amavasya { color: #222; }
.moon-amavasya::before { background: #222; }
.moon-ekadashi { color: var(--purple); }
.moon-ekadashi::before { background: linear-gradient(90deg, var(--purple) 50%, #fff 50%); box-shadow: inset 0 0 0 1.5px var(--purple); }
.d-thumb { border: 2px solid var(--red); }
.d-dot { display: none; }
.day.overflow { background: #fbf2dc; }
.day.overflow::after { content: ''; position: absolute; left: 0; top: 0; border-top: 14px solid var(--gold); border-right: 14px solid transparent; }
.day.today { box-shadow: inset 0 0 0 4px var(--green); background: #f1f8e9; }
.day.today::before { content: 'আজ'; position: absolute; left: 50%; top: 2px; transform: translateX(-50%); background: var(--green); color: #fff; font-size: .7rem; font-weight: 700; padding: 0 8px; border-radius: 999px; }

.span-cell { padding: 8px 10px; font-size: .85rem; overflow: auto; }
.span-1 { grid-column: span 1; } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; }
.span-title { font-weight: 700; color: var(--maroon); margin: 0 0 4px; border-bottom: 1px solid var(--gold); }
.span-cell ul { list-style: none; padding: 0; margin: 0; columns: 2 10em; column-gap: 12px; }
.span-cell li { break-inside: avoid; color: var(--red); line-height: 1.35; }
.span-cell li b { color: var(--blue); }

.month-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.mx-col { background: var(--cream2); border: 2px solid var(--gold); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.mx-col h2 { font-size: 1.1rem; }

@media (max-width: 1000px) {
  .mh-name { font-size: 48px; }
  .month-tabs { grid-template-columns: repeat(6, 1fr); }
}
@media (max-width: 700px) {
  .page { padding: 8px; }
  .cal-wrap { padding: 6px; border-width: 2px; }
  .month-tabs { display: flex; overflow-x: auto; gap: 4px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
  .tab { flex: none; padding: 6px 10px; }
  .month-head { grid-template-columns: 1fr; text-align: center; padding: 8px; }
  .mh-brand { display: none; }
  .mh-year { text-align: center; }
  .mh-name { font-size: 40px; }
  .mh-bnyear { font-size: 1.6rem; }
  .cal-grid { gap: 2px; border-width: 2px; }
  .wd { font-size: .8rem; padding: 4px 0; }
  .wd-full { display: none; }
  .wd-short { display: inline; }
  .day, .span-cell, .empty-cell { min-height: 86px; }
  .day { padding: 3px 2px; align-items: center; justify-content: flex-start; gap: 1px; }
  .d-top { flex-direction: column-reverse; align-items: center; }
  .d-bn { font-size: 24px; }
  .d-g { font-size: .65rem; }
  .d-more, .d-tithi, .d-hijri, .d-note, .d-dot { display: none; }
  .d-fest { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 9px; line-height: 1.4; text-align: center; padding: 2px 0 0; word-break: break-word; }
  .d-fest ~ .d-fest { display: none; }
  .d-tithi[class*="moon-"] { display: flex; font-size: 8.5px; gap: 2px; padding: 1px 0 0; margin: 1px 0 0; line-height: 1.4; }
  .d-tithi[class*="moon-"]::before { width: 7px; height: 7px; }
  .d-thumb { display: block; position: static; width: 20px; height: 20px; border-radius: 5px; margin-top: auto; }
  .day.holiday .d-thumb { border-width: 1px; }
  .day.today::before { font-size: .55rem; padding: 0 4px; top: 1px; left: auto; right: 1px; transform: none; }
  .span-cell { font-size: .7rem; padding: 4px; }
  .span-cell ul { columns: 1; }
  .month-extra { grid-template-columns: 1fr; }
}

/* Classic: "এই মাসের শুভ দিন" block under the month */
.shubh-classic { margin-top: 16px; background: var(--cream2); border: 2px solid var(--gold); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.shubh-classic h2 { font-size: 1.1rem; margin-top: 0; }
.shm-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.shm-k { margin: 0 0 6px; font-size: 1rem; color: var(--maroon); line-height: 1.5; }
.shm-dates { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.shm-chip { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 10px; border-radius: var(--radius); background: #fff; border: 1px solid var(--gold); color: var(--maroon); text-decoration: none; line-height: 1.4; }
.shm-chip:hover { background: var(--cream); }
.shm-chip.extra { border-style: dashed; }
.shm-chip b { font-weight: 700; font-size: .9rem; }
.shm-chip small { font-size: .7rem; color: var(--muted); }
.shm-empty { margin: 0; font-size: .9rem; color: var(--muted); }
