/* SGSE TERM DATES 2026–2028 — SCOPED STYLES */
.sgse-term-dates {
  --td-navy: #003577;
  --td-blue: #b8d7ff;
  --td-light: #edf5ff;
  --td-ink: #182d49;
  --td-muted: #52647c;
  --td-line: #dbe5f1;
  color: var(--td-ink);
  /* Escape the narrow BeTheme column while remaining centred on the viewport. */
  width: min(1480px, calc(100vw - 48px));
  max-width: none;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin: 0 0 50px;
  font-size: 16px;
  line-height: 1.6;
}
.sgse-term-dates *,
.sgse-term-dates *::before,
.sgse-term-dates *::after { box-sizing: border-box; }
.sgse-term-dates h2,
.sgse-term-dates h3 { color: var(--td-navy); line-height: 1.25; margin: 0; }
.sgse-term-dates p { margin: 0; }
.sgse-term-dates [id] { scroll-margin-top: 110px; }

/* INTRODUCTION */
.sgse-term-dates .sgse-td-hero {
  position: relative;
  padding: 34px 38px;
  margin-bottom: 32px;
  color: #fff;
  background: var(--td-navy);
  border-radius: 18px;
  overflow: hidden;
}
.sgse-term-dates .sgse-td-hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -125px;
  width: 300px;
  height: 300px;
  border: 46px solid rgba(184,215,255,.12);
  border-radius: 50%;
  pointer-events: none;
}
.sgse-term-dates .sgse-td-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.sgse-term-dates .sgse-td-hero h2 {
  position: relative;
  z-index: 1;
  color: #fff;
  font-size: clamp(25px, 3.5vw, 37px);
  margin: 0 0 10px;
}
.sgse-term-dates .sgse-td-hero p {
  position: relative;
  z-index: 1;
  max-width: 670px;
  color: #f2f7ff;
}

/* TERM OVERVIEW */
.sgse-term-dates .sgse-td-overview { margin-bottom: 30px; }
.sgse-term-dates .sgse-td-section-title {
  font-size: 22px;
  margin: 0 0 16px;
}
.sgse-term-dates .sgse-td-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.sgse-term-dates a.sgse-td-card,
.sgse-term-dates a.sgse-td-card:link,
.sgse-term-dates a.sgse-td-card:visited {
  display: flex;
  flex-direction: column;
  min-height: 155px;
  padding: 20px 21px;
  border: 2px solid var(--td-line);
  border-radius: 14px;
  background: #f5f9ff;
  color: var(--td-ink);
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.sgse-term-dates a.sgse-td-card:hover,
.sgse-term-dates a.sgse-td-card:focus-visible {
  border-color: var(--td-navy);
  box-shadow: 0 6px 20px rgba(0,53,119,.12);
  transform: translateY(-2px);
}
.sgse-term-dates .sgse-td-card-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--td-navy);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 11px;
}
.sgse-term-dates .sgse-td-card-arrow { font-size: 21px; line-height: 1; }
.sgse-term-dates .sgse-td-card strong { font-size: 17px; line-height: 1.35; }
.sgse-term-dates .sgse-td-card-year { color: var(--td-muted); font-size: 14px; margin-top: 4px; }
.sgse-term-dates .sgse-td-current-label { display: none; }
.sgse-term-dates .sgse-td-card.is-current { border-color: var(--td-navy); background: var(--td-light); }
.sgse-term-dates .sgse-td-card.is-current .sgse-td-current-label {
  display: inline-block;
  align-self: flex-start;
  margin-top: 12px;
  padding: 3px 9px;
  border-radius: 20px;
  color: #fff;
  background: var(--td-navy);
  font-size: 12px;
  font-weight: 700;
}

/* NEXT THREE DATES */
.sgse-term-dates .sgse-td-upcoming {
  display: grid;
  grid-template-columns: minmax(210px, .8fr) minmax(0, 1.7fr);
  gap: 26px;
  padding: 25px;
  margin-bottom: 42px;
  border: 1px solid var(--td-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 18px rgba(0,53,119,.055);
}
.sgse-term-dates .sgse-td-upcoming-heading .sgse-td-eyebrow {
  color: var(--td-navy);
  margin-bottom: 8px;
}
.sgse-term-dates .sgse-td-upcoming-heading h2 { font-size: 23px; margin-bottom: 8px; }
.sgse-term-dates .sgse-td-upcoming-heading p,
.sgse-term-dates .sgse-td-fallback { color: var(--td-muted); font-size: 14px; }
.sgse-term-dates .sgse-td-upcoming-list { display: grid; gap: 9px; }
.sgse-term-dates .sgse-td-next-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 10px;
  background: var(--td-light);
}
.sgse-term-dates .sgse-td-next-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 0 0 58px;
  min-height: 62px;
  border-radius: 9px;
  background: var(--td-navy);
  color: #fff;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sgse-term-dates .sgse-td-next-date .sgse-td-month {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.sgse-term-dates .sgse-td-next-date .sgse-td-day { font-size: 25px; font-weight: 800; line-height: 1.15; }
.sgse-term-dates .sgse-td-next-info { min-width: 0; }
.sgse-term-dates .sgse-td-next-info strong { display: block; color: var(--td-navy); line-height: 1.35; }
.sgse-term-dates .sgse-td-next-info span { display: block; font-size: 13px; color: var(--td-muted); }

/* TERM TABLE SECTIONS */
.sgse-term-dates .sgse-td-term { margin-bottom: 36px; }
.sgse-term-dates .sgse-td-term-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 13px;
  padding-left: 14px;
  border-left: 5px solid var(--td-navy);
}
.sgse-term-dates .sgse-td-term-kicker {
  display: block;
  color: var(--td-muted);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.2px;
}
.sgse-term-dates .sgse-td-term-heading h2 { font-size: 27px; }
.sgse-term-dates .sgse-td-term-season { color: #8ba4c3; font-size: 14px; font-weight: 700; }
.sgse-term-dates .sgse-td-table-wrap {
  border: 1px solid var(--td-line);
  border-radius: 12px;
  overflow: hidden;
}
.sgse-term-dates table.sgse-td-table {
  width: 100%;
  table-layout: fixed;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
  color: var(--td-ink);
  background: #fff;
}
.sgse-term-dates .sgse-td-table th,
.sgse-term-dates .sgse-td-table td {
  padding: 15px 20px;
  vertical-align: middle;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--td-line);
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: break-word;
}
.sgse-term-dates .sgse-td-table thead th {
  color: #fff;
  background: var(--td-navy);
  font-size: 14px;
  font-weight: 700;
}
.sgse-term-dates .sgse-td-table th:first-child { width: 40%; }
.sgse-term-dates .sgse-td-table tbody th { color: var(--td-ink); font-weight: 650; }
.sgse-term-dates .sgse-td-table tbody tr:nth-child(even) th,
.sgse-term-dates .sgse-td-table tbody tr:nth-child(even) td { background: #f4f8fe; }
.sgse-term-dates .sgse-td-table tbody tr:last-child th,
.sgse-term-dates .sgse-td-table tbody tr:last-child td { border-bottom: 0; }
.sgse-term-dates .sgse-td-table time { font-weight: 600; }
.sgse-term-dates .sgse-td-subline { display: block; color: var(--td-muted); font-size: 13px; margin-top: 3px; }
.sgse-term-dates .sgse-td-badge {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  margin: 4px 0 0 7px;
  padding: 2px 8px;
  border: 1px solid #b4cbe8;
  border-radius: 99px;
  background: #e4f0ff;
  color: var(--td-navy);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  vertical-align: middle;
}
.sgse-term-dates .sgse-td-badge--finish { background: #fff1d7; border-color: #edce8b; color: #704600; }

/* FOOTER NOTE + PRINT */
.sgse-term-dates .sgse-td-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 23px 26px;
  border-radius: 13px;
  background: var(--td-light);
  border-left: 5px solid var(--td-navy);
}
.sgse-term-dates .sgse-td-footer h2 { font-size: 20px; margin-bottom: 7px; }
.sgse-term-dates .sgse-td-footer p { margin: 0 0 7px; font-size: 14px; }
.sgse-term-dates .sgse-td-footer p:last-child { margin-bottom: 0; }
.sgse-term-dates .sgse-td-footer a,
.sgse-term-dates .sgse-td-footer a:link,
.sgse-term-dates .sgse-td-footer a:visited { color: var(--td-navy); font-weight: 700; text-decoration: underline; }
.sgse-term-dates button.sgse-td-print {
  flex: 0 0 auto;
  padding: 12px 17px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--td-navy);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}
.sgse-term-dates button.sgse-td-print:hover { background: #0050a9; }
.sgse-term-dates a:focus-visible,
.sgse-term-dates button:focus-visible { outline: 3px solid #e7a800; outline-offset: 3px; }

/* Do not display the print button if JavaScript is unavailable. */
.sgse-term-dates .sgse-td-print[hidden] { display: none !important; }

/* RESPONSIVENESS */
@media (max-width: 850px) {
  .sgse-term-dates .sgse-td-card-grid { grid-template-columns: 1fr; }
  .sgse-term-dates a.sgse-td-card { min-height: 0; }
  .sgse-term-dates .sgse-td-upcoming { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 600px) {
  .sgse-term-dates { font-size: 15px; }
  .sgse-term-dates .sgse-td-hero { padding: 25px 20px; }
  .sgse-term-dates .sgse-td-upcoming { padding: 18px; }
  .sgse-term-dates .sgse-td-term-heading h2 { font-size: 24px; }
  .sgse-term-dates .sgse-td-table th,
  .sgse-term-dates .sgse-td-table td { padding: 12px 10px; font-size: 13px; }
  .sgse-term-dates .sgse-td-table th:first-child { width: 41%; }
  .sgse-term-dates .sgse-td-badge { margin-left: 0; display: table; }
  .sgse-term-dates .sgse-td-footer { flex-direction: column; align-items: stretch; padding: 19px; }
  .sgse-term-dates .sgse-td-print { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .sgse-term-dates .sgse-td-card { transition: none; }
}
@media print {
  .sgse-term-dates { max-width: none; margin: 0; font-size: 11pt; }
  .sgse-term-dates .sgse-td-hero { background: #fff; color: #000; padding: 0 0 15px; border-radius: 0; }
  .sgse-term-dates .sgse-td-hero::after { display: none; }
  .sgse-term-dates .sgse-td-hero h2,
  .sgse-term-dates .sgse-td-hero p,
  .sgse-term-dates .sgse-td-hero .sgse-td-eyebrow { color: #000; }
  .sgse-term-dates .sgse-td-overview,
  .sgse-term-dates .sgse-td-upcoming,
  .sgse-term-dates .sgse-td-print { display: none !important; }
  .sgse-term-dates .sgse-td-term { break-inside: avoid; margin-bottom: 15px; }
  .sgse-term-dates .sgse-td-term-heading h2 { font-size: 17pt; }
  .sgse-term-dates .sgse-td-table thead th { background: #e8e8e8 !important; color: #000 !important; }
  .sgse-term-dates .sgse-td-table th,
  .sgse-term-dates .sgse-td-table td { padding: 7px 10px; font-size: 10pt; border: 1px solid #aaa; }
  .sgse-term-dates .sgse-td-footer { background: #fff; border: 1px solid #aaa; padding: 10px; }
}


/* ACADEMIC YEAR SWITCHER — buttons appear only when JS is running */
.sgse-term-dates .sgse-td-year-nav[hidden],
.sgse-term-dates .sgse-td-year-panel[hidden] { display: none !important; }
.sgse-term-dates .sgse-td-year-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin: 4px 0 20px;
}
.sgse-term-dates .sgse-td-year-title {
  color: var(--td-ink);
  font-size: 15px;
  font-weight: 700;
}
.sgse-term-dates .sgse-td-year-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--td-line);
  border-radius: 13px;
  background: #eef5ff;
}
.sgse-term-dates button.sgse-td-year-button {
  display: inline-block;
  height: auto;
  min-height: 42px;
  padding: 9px 22px;
  margin: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: var(--td-navy);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.sgse-term-dates button.sgse-td-year-button[aria-pressed="true"] {
  color: #fff;
  background: var(--td-navy);
  box-shadow: 0 2px 6px rgba(0,53,119,.16);
}
.sgse-term-dates button.sgse-td-year-button[aria-pressed="false"]:hover {
  background: #d8e9ff;
}
.sgse-term-dates .sgse-td-card-note,
.sgse-term-dates .sgse-td-note,
.sgse-term-dates .sgse-td-term-range {
  color: var(--td-muted);
  font-size: 13px;
  line-height: 1.5;
}
.sgse-term-dates .sgse-td-card-note { margin-top: 7px; }
.sgse-term-dates .sgse-td-note { margin-top: 13px; }
.sgse-term-dates .sgse-td-term-range { margin-top: 5px; }
/* Theme-proof all table cells; BeTheme must not override the navy header. */
.sgse-term-dates .sgse-td-table thead th { background: var(--td-navy); color: #fff; }
@media (max-width: 600px) {
  .sgse-term-dates { width: calc(100vw - 24px); }
  .sgse-term-dates .sgse-td-year-nav { gap: 7px; }
  .sgse-term-dates .sgse-td-year-buttons { width: 100%; }
  .sgse-term-dates button.sgse-td-year-button { flex: 1; min-width: 0; padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .sgse-term-dates button.sgse-td-year-button { transition: none; }
}
@media print {
  .sgse-term-dates { position: static; left: auto; transform: none; width: 100%; max-width: 100%; margin: 0; }
  .sgse-term-dates .sgse-td-year-nav { display: none !important; }
}


/* ==========================================================
   PRINT-ONLY DOCUMENT
   The screen layout is untouched. The printable sheet is a
   direct child of <body> and only the selected year is shown.
   ========================================================== */
@media screen {
  body > .sgse-td-print-sheet { display: none !important; }
}

@media print {
  @page { size: A4 portrait; margin: 12mm 14mm; }

  html, body {
    width: 100% !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: #111 !important;
  }

  /* Remove the entire website, including BeTheme and the WordPress admin bar. */
  body > :not(.sgse-td-print-sheet) { display: none !important; }

  body > .sgse-td-print-sheet {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #111 !important;
    font-family: Arial, Helvetica, sans-serif !important;
    font-size: 9pt !important;
    line-height: 1.3 !important;
  }

  body > .sgse-td-print-sheet * {
    color: #111 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body > .sgse-td-print-sheet h1 {
    padding: 0 0 7mm !important;
    margin: 0 0 5mm !important;
    border-bottom: 2px solid #222 !important;
    font-size: 18pt !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: left !important;
  }

  body > .sgse-td-print-sheet .sgse-td-print-term {
    margin: 0 0 6mm !important;
    padding: 0 !important;
    break-inside: avoid-page;
    page-break-inside: avoid;
  }

  body > .sgse-td-print-sheet h2 {
    margin: 0 0 2mm !important;
    padding: 0 !important;
    font-size: 12pt !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    text-align: left !important;
  }

  body > .sgse-td-print-sheet .sgse-td-print-range {
    margin: 0 0 2mm !important;
    font-size: 8.5pt !important;
  }

  body > .sgse-td-print-sheet table {
    width: 100% !important;
    table-layout: auto !important;
    margin: 0 !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    border: 1px solid #bbb !important;
    font-size: 9pt !important;
  }

  body > .sgse-td-print-sheet th,
  body > .sgse-td-print-sheet td {
    padding: 3.5px 7px !important;
    border: 1px solid #bbb !important;
    font-size: 9pt !important;
    font-weight: 400;
    line-height: 1.3 !important;
    text-align: left !important;
    vertical-align: top !important;
  }

  body > .sgse-td-print-sheet thead th {
    background: #eee !important;
    font-weight: 700 !important;
  }
  body > .sgse-td-print-sheet tbody th {
    width: 40% !important;
    font-weight: 700 !important;
  }
  body > .sgse-td-print-sheet tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  body > .sgse-td-print-sheet .sgse-td-badge {
    display: inline !important;
    margin: 0 0 0 4px !important;
    padding: 0 !important;
    border: 0 !important;
    font-size: 8pt !important;
    font-weight: 400 !important;
    white-space: normal !important;
  }
  body > .sgse-td-print-sheet .sgse-td-badge::before { content: '('; }
  body > .sgse-td-print-sheet .sgse-td-badge::after { content: ')'; }
  body > .sgse-td-print-sheet .sgse-td-subline {
    display: block !important;
    font-size: 8pt !important;
  }
  body > .sgse-td-print-sheet .sgse-td-print-note {
    margin: 3mm 0 0 !important;
    padding-top: 3mm !important;
    border-top: 1px solid #bbb !important;
    font-size: 8pt !important;
    line-height: 1.35 !important;
  }
}
