/* ============ ACADEMICS PAGE CSS ============ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navbar: #5DADE2;
  --bg: #F8FBFF;
  --mint: #7ED6A5;
  --mint-hover: #66c491;
  --hover-blue: #4A90E2;
  --text: #2C3E50;
  --white: #FFFFFF;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(44, 62, 80, 0.08);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: 'Poppins', sans-serif;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== ACADEMICS HERO ===== */
.academics-hero {
  background: linear-gradient(135deg, #EAF4FF 0%, var(--bg) 100%);
  padding: 40px 40px 0;
  margin-bottom: 60px;
}

.academics-hero-container {
  max-width: 1300px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.ah-text h1 {
  font-size: 3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.ah-subtitle {
  color: var(--navbar);
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 18px;
}

.ah-desc {
  color: #5A6B7B;
  font-size: 1rem;
  line-height: 1.8;
  max-width: 460px;
}

.ah-image {
  width: 380px;
  height: 380px;
  margin: 0 auto;
  border-radius: 50%;
  position: relative;
  padding: 12px;
  perspective: 1000px;
}

.ah-image-inner {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 50%;
  transform-style: preserve-3d;
}

.ah-face-front,
.ah-face-back {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--white);
  backface-visibility: hidden;
}

.ah-face-back {
  transform: rotateY(180deg) scaleX(-1);
}

/* ===== PILL NAV ===== */
.ah-pillnav-wrapper {
  max-width: 1400px;
  margin: 0 auto 10%;
  padding: 0 40px;
  position: relative;
  top: 40px;
}

.ah-pillnav {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 30px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.ah-pillnav a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 6px;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.ah-pillnav a.pill-active {
  color: var(--navbar);
  border-bottom-color: var(--navbar);
}

.pill-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 0.8rem;
}

.icon-blue { background: var(--navbar); }
.icon-green { background: var(--mint-hover); }

/* ===== SHARED SECTIONS ===== */
.curriculum, .edu-programs, .learning-approach, .academic-year, .monthly-calendar, .exam-schedule,
.school-events, .ptm-section, .holidays-section, .library, .laboratories, .cocurricular {
  max-width: 1280px;
  margin: 50px auto;
  padding: 50px;
  text-align: center;
}

.curriculum .eyebrow, .edu-programs .eyebrow, .learning-approach .eyebrow,
.academic-calendar .eyebrow {
  color: var(--navbar);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 10px;
}

.eyebrow i {
  color: var(--mint);
  margin-right: 6px;
}

.curriculum h2, .edu-programs h2, .learning-approach h2, .monthly-calendar h2, .exam-schedule h2,
.school-events h2, .ptm-section h2, .holidays-section h2, .library h2, .laboratories h2, .cocurricular h2 {
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 10px;
}

.section-sub {
  color: #6B7C8C;
  margin-bottom: 40px;
}

/* ===== CURRICULUM TABS ===== */
.curriculum-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px;
  width: 60%;
  margin: 0 auto 40px;
  gap: 15px;
}

.tab-btn {
  background: var(--bg);
  border: 2px solid transparent;
  padding: 15px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.25s ease;
}

.tab-btn:hover {
  background: var(--navbar);
  color: var(--white);
  transform: translateY(-2px);
}

.tab-btn span {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  color: #6B7C8C;
}

.tab-btn.active {
  background: var(--navbar);
  color: var(--white);
  border-color: var(--navbar);
}

.tab-btn.active span {
  color: #EAF5FF;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.tab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: left;
}

.tab-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.tab-card-header i {
  font-size: 1.6rem;
  color: var(--navbar);
}

.tab-info-card h4 {
  font-size: 1.05rem;
  color: var(--text);
}

.tab-info-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.tab-info-card p {
  color: #6B7C8C;
  font-size: 1rem;
  line-height: 1.5;
}

/* ===== SUBJECTS ===== */
.subjects-block {
  margin-top: 50px;
}

.subjects-block h3 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 20px;
}

.subjects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

.subject-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 1px solid #E2EEFB;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.subject-pill i {
  color: var(--mint-hover);
}

/* ===== PROGRAMS ===== */
.programs-tilt-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.tilt-card-inner {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 34px 24px;
  text-align: left;
  height: 100%;
}

.tilt-card-inner i {
  font-size: 2rem;
  color: var(--navbar);
  margin-bottom: 16px;
}

.tilt-card-inner h4 {
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 14px;
}

.tilt-card-inner ul {
  list-style: none;
}

.tilt-card-inner li {
  color: #6B7C8C;
  font-size: 0.88rem;
  padding-left: 18px;
  position: relative;
  margin-bottom: 10px;
}

.tilt-card-inner li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--mint-hover);
  position: absolute;
  left: 0;
  font-size: 0.75rem;
  top: 2px;
}

/* ===== LEARNING APPROACH ===== */
.approach-intro {
  margin-bottom: 50px;
}

.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.approach-item {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 30px 20px;
  text-align: center;
}

.approach-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--navbar);
}

.approach-item p {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

/* ===== CALENDAR HERO ===== */
.calendar-hero {
  background: linear-gradient(135deg, #EAF4FF 0%, var(--bg) 100%);
  padding: 80px 40px;
  text-align: center;
}

.calendar-hero-container {
  max-width: 700px;
  margin: 0 auto;
}

.calendar-hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
}

.calendar-hero p {
  color: #5A6B7B;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ===== YEAR STRIP ===== */
.year-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}

.year-item {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px 18px;
  gap: 14px;
  min-width: 0;           /* allow grid child to shrink without overflow */
  overflow: hidden;
  box-shadow: var(--shadow);
}

.year-item i {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--navbar);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.year-item > div,
.year-item .year-text {
  min-width: 0;
  flex: 1;
}

.year-item span {
  display: block;
  color: #6B7C8C;
  font-size: 0.82rem;
  line-height: 1.3;
  word-break: normal;
  overflow-wrap: break-word;
}

.year-item strong {
  display: block;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.3;
  word-break: normal;
  overflow-wrap: break-word;
}

/* ===== MONTH CARDS (flip) =====
   Front + back are BOTH absolute inside the card.
   So activity list never spills into the grid or below.
*/
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  justify-items: center;
}

.month-card {
  width: 100%;
  max-width: 175px;
  height: 175px;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  perspective: 900px;
  cursor: pointer;
}

/* Optional wrapper used by some flip scripts */
.month-card-inner,
.month-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
}

.month-card:hover .month-inner,
.month-card.flipped .month-inner,
.month-card.is-flipped .month-inner,
.month-card.active .month-card-inner,
.month-inner {
  transform: rotateY(180deg);
}

/* Both faces fill the card */
.month-front,
.month-back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  padding: 14px 12px;
  box-sizing: border-box;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.month-front {
  background: var(--navbar);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  z-index: 2;
}

.month-front h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

/* Back face: white “board” with clean list */
.month-back {
  background: var(--white);
  box-shadow: inset 0 0 0 1px #E2EEFB, var(--shadow);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
  z-index: 1;
}

/* When there is no .month-inner, toggle faces with class on card */
.month-card:hover .month-front,
.month-card.flipped .month-front,
.month-card.is-flipped .month-front,
.month-card.active .month-front {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.month-card:hover .month-back,
.month-card.flipped .month-back,
.month-card.is-flipped .month-back,
.month-card.active .month-back {
  z-index: 3;
}

.month-back h4,
.month-back .month-back-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--navbar);
  margin: 0 0 8px;
  flex-shrink: 0;
  line-height: 1.25;
  text-align: center;
}

/* Clean list — like writing on a board, one activity per line */
.month-back ul {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.month-back li {
  display: block !important;
  width: 100%;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
  padding: 8px 6px !important;
  margin: 0 0 6px !important;   /* clear gap so each event is separate */
  border-bottom: 1px solid #E8EEF5;
  word-break: normal;
  overflow-wrap: break-word;
  white-space: normal !important;
}

.month-back li:last-child {
  border-bottom: none;
  margin-bottom: 0 !important;
}

.month-back li .batch-line,
.month-back .batch-line {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  color: var(--text);
  font-size: inherit;
  line-height: inherit;
  white-space: normal;
}

/*
  Hide the extra “detail panel” that JS sometimes injects under the grid.
  Activities should only show ON the flipped card.
*/
.month-detail-panel,
.calendar-month-detail,
.month-activities-panel,
#monthDetailPanel,
.calendar-detail {
  display: none !important;
}

/* Mobile detail panel under grid (if JS shows it) */
.month-detail-panel,
.calendar-month-detail {
  max-width: 480px;
  margin: 24px auto 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  text-align: left;
  position: relative;
}

.month-detail-panel h4,
.calendar-month-detail h4 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 12px;
  padding-right: 36px;
}

.month-detail-panel .close-detail,
.calendar-month-detail .close-detail {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.month-detail-panel ul,
.calendar-month-detail ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.month-detail-panel li,
.calendar-month-detail li {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #EEF3F8;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.4;
  word-break: normal;
  overflow-wrap: break-word;
}

.month-detail-panel li:last-child,
.calendar-month-detail li:last-child {
  border-bottom: none;
}

/* ===== EXAM TIMELINE ===== */
.timeline {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: 40px;
  flex-wrap: wrap;
  gap: 20px;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  height: 2px;
  background: #E2EEFB;
}

.timeline-item {
  flex: 1;
  min-width: 140px;
  text-align: center;
  position: relative;
}

.timeline-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--navbar);
  border: 4px solid var(--white);
  box-shadow: 0 0 0 2px var(--navbar);
  margin: 0 auto 16px;
  position: relative;
  z-index: 2;
}

.timeline-content h4 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 4px;
}

.timeline-content p {
  color: #6B7C8C;
  font-size: 0.85rem;
}

/* ===== EVENTS / HOLIDAYS — flex wrap, as many as fit per row ===== */
.events-grid,
.holidays-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 14px;
  margin-top: 30px;
}

.event-pill,
.holiday-pill {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border: 1px solid #E2EEFB;
  padding: 12px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  width: auto;           /* not stretched full row */
  max-width: 100%;
  flex: 0 1 auto;
  box-sizing: border-box;
}

.event-pill i,
.holiday-pill i {
  color: var(--navbar);
  min-width: 22px;
  flex-shrink: 0;
}

.event-pill .event-info,
.holiday-pill .holiday-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.event-pill .event-info strong,
.holiday-pill .holiday-info strong,
.event-pill .event-title,
.holiday-pill .holiday-title {
  font-weight: 600;
  line-height: 1.3;
  word-break: normal;
  overflow-wrap: break-word;
}

.event-pill .event-date,
.holiday-pill .holiday-date {
  font-size: 0.78rem;
  color: #5A6B7B;
  font-weight: 500;
}

/* ===== PTM — grid, 3 desktop / 2 mobile ===== */
.ptm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 30px;
}

.ptm-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 30px;
}

.ptm-card i {
  font-size: 1.8rem;
  color: var(--navbar);
  margin-bottom: 14px;
}

.ptm-card h4 {
  font-size: 1.2rem;
  color: var(--text);
  margin-bottom: 6px;
}

.ptm-card p {
  color: #6B7C8C;
  font-size: 0.9rem;
}

/* ===== NOTICE ===== */
.notice-box {
  max-width: 1000px;
  margin: 50px auto 90px;
  background: #FFF7E6;
  border-left: 4px solid #F5A623;
  border-radius: var(--radius);
  padding: 24px 30px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.notice-box i {
  color: #F5A623;
  font-size: 1.3rem;
  margin-top: 3px;
}

.notice-box p {
  color: #6B5B3A;
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ===== LIBRARY ===== */
.library-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 50px;
}

.lib-stat {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 30px 20px;
}

.lib-stat i {
  font-size: 1.8rem;
  color: var(--navbar);
  margin-bottom: 12px;
}

.lib-stat h3 {
  font-size: 1.6rem;
  color: var(--text);
  margin-bottom: 6px;
}

.lib-stat p {
  color: #6B7C8C;
  font-size: 0.85rem;
}

.library-features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.lib-feature-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 22px;
  text-align: left;
}

.lib-feature-card i {
  font-size: 1.7rem;
  color: var(--mint-hover);
  margin-bottom: 16px;
}

.lib-feature-card h4 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 10px;
}

.lib-feature-card p {
  color: #6B7C8C;
  font-size: 0.87rem;
  line-height: 1.6;
}

/* ===== LABS ===== */
.lab-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.lab-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 30px;
  text-align: left;
}

.lab-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
  margin-bottom: 20px;
}

.lab-card h4 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 16px;
}

.lab-card ul {
  list-style: none;
}

.lab-card li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #5A6B7B;
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.lab-card li i {
  color: var(--mint-hover);
  font-size: 0.8rem;
}

/* ===== CO-CURRICULAR ===== */
.cc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.cc-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
}

.cc-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--white);
}

.cc-card h4 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 8px;
}

.cc-card p {
  color: #6B7C8C;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .year-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }


  .academics-hero-container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .ah-desc {
    margin-left: auto;
    margin-right: auto;
  }

  .ah-pillnav {
    justify-content: center;
  }

  .tab-grid,
  .programs-tilt-grid,
  .approach-grid,
  .library-features,
  .cc-grid,
  .lab-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .month-card {
    max-width: 100%;
  }

  .ptm-grid,
  .library-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .subjects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .academics-hero {
    padding: 32px 16px 0;
  }

  .ah-text h1 {
    font-size: 2.2rem;
  }

  .ah-image {
    width: 280px;
    height: 280px;
  }

  .ah-pillnav-wrapper {
    padding: 0 16px;
  }

  .ah-pillnav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
  }

  .ah-pillnav a {
    font-size: 0.78rem;
    white-space: normal;
  }

  .curriculum,
  .edu-programs,
  .learning-approach,
  .academic-year,
  .monthly-calendar,
  .exam-schedule,
  .school-events,
  .ptm-section,
  .holidays-section,
  .library,
  .laboratories,
  .cocurricular {
    padding: 32px 16px;
    margin-left: 12px;
    margin-right: 12px;
    max-width: calc(100% - 24px);
  }

  .curriculum-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .tab-btn {
    padding: 10px 6px;
    font-size: 0.8rem;
  }

  .tab-grid,
  .programs-tilt-grid,
  .approach-grid,
  .library-features,
  .cc-grid,
  .lab-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .calendar-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .month-back li {
    font-size: 0.85rem;
    padding: 6px 0;
  }

  /* Touch: only flip when .flipped / .is-flipped / .active is set by JS */
  @media (hover: none) {
    .month-card:hover .month-card-inner,
.month-inner {
      transform: none;
    }
    .month-card:hover .month-front {
      opacity: 1;
      visibility: visible;
      pointer-events: auto;
    }
    .month-card.flipped .month-inner,
    .month-card.is-flipped .month-inner,
    .month-card.active .month-card-inner,
.month-inner {
      transform: rotateY(180deg);
    }
  }

  .year-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .timeline {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-left: 4px;
  }

  .timeline::before {
    top: 12px;
    bottom: 12px;
    left: 17px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    text-align: left;
    min-width: 0;
    flex: none;
    padding-bottom: 28px;
  }

  .timeline-item:last-child {
    padding-bottom: 0;
  }

  .timeline-dot {
    margin: 0;
    flex-shrink: 0;
  }

  .ptm-grid,
  .library-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  /* Events & holidays: wrap ~2 per row */
  .events-grid,
  .holidays-grid {
    gap: 10px;
  }

  .event-pill,
  .holiday-pill {
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 6px);
    min-width: 140px;
  }

  /* Year strip: 1 col on phone so all 3 fully readable */
  .year-strip {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .year-item {
    padding: 14px 16px;
  }

  .year-item strong {
    font-size: 1rem;
  }

  .subjects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calendar-hero {
    padding: 48px 16px;
  }

  .calendar-hero h1 {
    font-size: 2rem;
  }

  .notice-box {
    margin-left: 12px;
    margin-right: 12px;
    max-width: calc(100% - 24px);
  }

  .footer-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 20px;
  }

  .footer-brand,
  .footer-newsletter {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .ah-text h1 {
    font-size: 1.85rem;
  }

  .ah-image {
    width: 220px;
    height: 220px;
  }

  .calendar-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .month-front h4 {
    font-size: 0.85rem;
  }

  .month-back li {
    font-size: 0.82rem;
  }

  .event-pill,
  .holiday-pill {
    flex: 1 1 calc(50% - 8px);
    max-width: calc(50% - 4px);
    padding: 10px 12px;
    font-size: 0.82rem;
  }

  .year-strip {
    grid-template-columns: 1fr;
  }

  .ptm-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tab-grid,
  .programs-tilt-grid,
  .approach-grid,
  .library-features,
  .cc-grid,
  .lab-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
}
