/* ============================================
   NYC School Calendar — Design System
   Palette: Warm Forest (no blue/indigo/purple)
   Typography: Lexend + Source Sans 3
   Style: Flat Design + Swiss Modernism
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@400;500;600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

/* --- Design Tokens --- */
:root {
  --color-primary: #334155;
  --color-primary-dark: #1E293B;
  --color-primary-light: #64748B;
  --color-secondary: #475569;
  --color-accent: #D97706;
  --color-accent-hover: #B45309;
  --color-bg: #FFFBF5;
  --color-bg-alt: #FEF3E2;
  --color-surface: #FFFFFF;
  --color-text: #1C1917;
  --color-text-secondary: #57534E;
  --color-text-muted: #78716C;
  --color-border: #E7E5E4;
  --color-border-light: #F5F5F4;
  --color-holiday: #C05621;
  --color-holiday-bg: #FFF4EB;
  --color-halfday: #D97706;
  --color-halfday-bg: #FFFBEB;
  --color-hero-start: #1E293B;
  --color-hero-end: #334155;

  --font-heading: 'Lexend', sans-serif;
  --font-body: 'Source Sans 3', sans-serif;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.1);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --transition: 200ms ease;
  --max-width: 1100px;
  --nav-height: 64px;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text);
}

h1 {
  font-size: 2.2rem;
}

h2 {
  font-size: 1.6rem;
  margin-bottom: var(--space-lg);
}

h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-accent);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.section {
  padding: var(--space-xl) 0;
}

.section-alt {
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  display: flex;
  align-items: center;
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav-logo svg {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav-links a {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  text-decoration: none;
  position: relative;
  transition: color var(--transition);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  border-radius: 1px;
  transition: width 0.25s ease;
}

.nav-links a:hover {
  color: var(--color-primary);
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  color: var(--color-text);
}

.nav-toggle svg {
  width: 24px;
  height: 24px;
}

/* --- Hero --- */
.hero {
  margin-top: var(--nav-height);
  background: linear-gradient(135deg, var(--color-hero-start), var(--color-hero-end));
  color: #FFFFFF;
  padding: var(--space-3xl) 0;
  text-align: center;
}

.hero h1 {
  color: #FFFFFF;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.hero .subtitle {
  font-size: 1.15rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto var(--space-xl);
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* --- Year Switcher --- */
.year-switcher {
  display: flex;
  gap: 10px;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.year-tab {
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--color-bg-alt);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.year-tab:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.year-tab.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--color-accent);
  color: #FFFFFF;
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  color: #FFFFFF;
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #FFFFFF;
  color: #FFFFFF;
}

.hero-fake-search {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: #FFFFFF;
  border: 2px solid transparent;
  color: var(--color-text-muted);
  padding: 0 16px;
  height: 48px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: text;
  transition: all var(--transition);
  outline: none;
  min-width: 250px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.hero-fake-search:hover,
.hero-fake-search:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.hero-fake-search svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
}

.hero-fake-search span {
  flex: 1;
}

.hero-fake-search {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  background: #FFFFFF;
  border: 2px solid transparent;
  color: var(--color-text-muted);
  padding: 0 16px;
  height: 48px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: text;
  transition: all var(--transition);
  outline: none;
  min-width: 250px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

.hero-fake-search:hover,
.hero-fake-search:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.2);
}

.hero-fake-search svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
}

.hero-fake-search span {
  flex: 1;
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: #FFFFFF;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

/* --- Cards --- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-featured {
  border-left: 4px solid var(--color-primary);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--color-primary-dark);
}

.card-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  background: var(--color-primary);
  color: #FFFFFF;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Quick Look Grid --- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.quick-item {
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-light);
}

.quick-item-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
  font-family: var(--font-heading);
}

.quick-item-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
}

/* --- Action Bar --- */
.action-bar {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: 0;
}

/* --- Tables --- */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: var(--space-xl);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: fixed;
}

/* Fixed column widths for key-dates table */
thead th:nth-child(1) { width: 38%; }
thead th:nth-child(2) { width: 40%; }
thead th:nth-child(3) { width: 22%; }

thead {
  background: var(--color-primary-dark);
  color: #FFFFFF;
}

thead th {
  padding: 12px 16px;
  text-align: left;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border-light);
}

tbody tr:nth-child(even) {
  background: var(--color-bg); /* subtle zebra stripe */
}

tbody tr.holiday {
  background: var(--color-surface);
}

tbody tr.holiday:nth-child(even) {
  background: var(--color-bg); /* subtle zebra stripe */
}

.key-dates-table tbody td:first-child {
  font-weight: 600;
  color: var(--color-primary-dark);
}

tbody tr.halfday {
  background: var(--color-halfday-bg);
}

.date-col {
  white-space: nowrap;
  font-weight: 500;
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-heading);
  border: 1px solid transparent;
}

.tag-closed {
  background: var(--color-holiday-bg);
  color: #9C4221; /* Darkened terracotta for better contrast */
  border-color: rgba(192, 86, 33, 0.3);
}

.tag-halfday {
  background: var(--color-halfday-bg);
  color: #B45309; /* Darkened amber for better contrast */
  border-color: rgba(217, 119, 6, 0.3);
}

.tag-event {
  background: #F0FDFA;
  color: #0F766E;
  border-color: rgba(15, 118, 110, 0.3);
}

.error-report-link {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.2s;
}

.error-report-link:hover {
  color: var(--color-accent);
}

/* --- Monthly Calendar Sections --- */
.month-section {
  margin-bottom: var(--space-xl);
}

.month-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--color-primary);
  color: #FFFFFF;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.05rem;
}

.month-header:hover {
  background: var(--color-primary-dark);
}

.month-header svg {
  width: 20px;
  height: 20px;
  margin-left: auto;
  transition: transform var(--transition);
}

.month-header.active svg {
  transform: rotate(180deg);
}

.month-body {
  display: none;
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.month-body.open {
  display: block;
}
/* --- Map Explorer (Interactive District Map) --- */
.map-search-wrapper {
  position: relative;
  margin-bottom: var(--space-lg);
  max-width: 480px;
}

.map-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-muted);
  pointer-events: none;
}

.map-search {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  transition: all var(--transition);
}

.map-search:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.map-explorer {
  display: grid;
  grid-template-columns: 58% 1fr;
  gap: var(--space-xl);
}


.ny-map {
  width: 100%;
  height: auto;
}

.map-region {
  fill: var(--color-bg);
  stroke: var(--color-border);
  stroke-width: 1.5;
  cursor: pointer;
  transition: fill 200ms ease, stroke 200ms ease, opacity 200ms ease;
}

.map-region:hover {
  fill: #FDE68A;
  stroke: var(--color-accent);
  stroke-width: 2;
}

.map-region.active {
  fill: #FCD34D;
  stroke: var(--color-accent);
  stroke-width: 2.5;
}

.map-region.dimmed {
  opacity: 0.4;
}


.map-region-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  fill: var(--color-text-secondary);
  text-anchor: middle;
  pointer-events: none;
  user-select: none;
}

.map-label-sm {
  font-size: 10px;
  fill: var(--color-text-secondary);
}

.map-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-sm);
  padding: 0 var(--space-xs);
}

.map-legend-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.map-legend-hint svg {
  width: 14px;
  height: 14px;
  opacity: 0.7;
}

.map-show-all {
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-family: var(--font-body);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}

.map-show-all:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* --- District Cards --- */
.district-cards {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-self: start;
}

.district-cards-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
}

.district-cards-header h3 {
  font-size: 1.1rem;
  color: var(--color-primary-dark);
  margin: 0;
}

.district-count {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.district-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: var(--space-xs);
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.district-cards-grid::-webkit-scrollbar {
  width: 5px;
}

.district-cards-grid::-webkit-scrollbar-track {
  background: transparent;
}

.district-cards-grid::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

.district-card {
  display: block;
  padding: var(--space-md);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: all var(--transition);
}

.district-card:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.district-card.hidden {
  display: none;
}

.district-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: 6px;
}

.district-card-top svg {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.district-card-name {
  font-weight: 600;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--color-primary-dark);
}

.district-card-status {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.district-card-status--current,
.district-card-status--official {
  background: #DCFCE7;
  color: #166534;
}

.district-card-status--projected {
  background: #FEF3C7;
  color: #92400E;
}

.district-card-dates {
  display: flex;
  gap: var(--space-lg);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
}

.district-card-dates strong {
  color: var(--color-text);
}

.district-cards-empty {
  padding: var(--space-xl);
  text-align: center;
  color: var(--color-text-muted);
}

/* --- Legacy district grid (keep for reference, hidden) --- */
.districts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.district-group {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
}

.district-group.span-full {
  grid-column: 1 / -1;
}

.district-group h3 {
  font-size: 1.05rem;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.district-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.district-list.cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xs) var(--space-lg);
}

.district-list li a {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  font-size: 0.93rem;
  transition: all var(--transition);
}

.district-list li a:hover {
  background: var(--color-bg-alt);
  color: var(--color-primary);
}

.district-list li a svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.coming-soon {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-left: auto;
}

/* --- FAQ --- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.faq-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-lg);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: left;
  transition: color var(--transition);
}

.faq-question:hover {
  color: var(--color-primary);
}

.faq-question svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform var(--transition);
}

.faq-question.active svg {
  transform: rotate(180deg);
}

.faq-question.active {
  color: var(--color-primary);
}

.faq-answer {
  display: none;
  padding: 0 var(--space-lg) var(--space-lg);
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.faq-answer.open {
  display: block;
}

/* --- Related Links --- */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-md);
}

.related-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: var(--color-text);
}

.related-link:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
  color: var(--color-primary);
}

.related-link svg {
  width: 20px;
  height: 20px;
  color: var(--color-accent);
  flex-shrink: 0;
}

/* --- Disclaimer --- */
.disclaimer {
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
}

.disclaimer strong {
  color: var(--color-text);
}

.last-updated {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: var(--space-md);
}

/* --- Read More (hidden on desktop) --- */
.read-more-btn {
  display: none;
}

/* --- Footer --- */
.footer {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--space-xl) 0 var(--space-md);
}

.footer-top {
  text-align: center;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: #FFFFFF;
  margin-bottom: var(--space-sm);
}

.footer-logo-icon {
  width: 1.3rem;
  height: 1.3rem;
  color: var(--color-accent);
}

.footer-desc {
  font-size: 0.88rem;
  opacity: 0.65;
  line-height: 1.5;
  max-width: 620px;
  margin: 0 auto;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
  text-align: center;
}

.footer h4 {
  color: #FFFFFF;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: var(--space-sm);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-bottom {
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.footer-legal-links {
  margin-bottom: var(--space-xs);
}

.footer-legal-links a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  transition: color var(--transition);
}

.footer-legal-links a:hover {
  color: #FFFFFF;
}

.footer-dot {
  color: rgba(255, 255, 255, 0.3);
  margin: 0 var(--space-xs);
}

.footer-bottom p {
  font-size: 0.75rem;
  opacity: 0.45;
  line-height: 1.5;
}

/* --- Projected Badge --- */
.projected-notice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-halfday-bg);
  border: 1px solid var(--color-halfday);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-accent-hover);
  margin-bottom: var(--space-lg);
}

.projected-notice svg {
  width: 16px;
  height: 16px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: var(--nav-height);
}

.breadcrumb a {
  color: var(--color-text-muted);
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

.breadcrumb .sep {
  color: var(--color-border);
}

/* --- Visual Calendar Grid --- */
.projected-badge {
  font-size: 0.65em;
  font-weight: 400;
  font-style: italic;
  color: var(--color-text-muted);
}

.cal-year {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}

.cal-month {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cal-month-name {
  background: var(--color-primary);
  color: #FFFFFF;
  padding: 10px var(--space-lg);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--color-border-light);
}

.cal-dow {
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  padding: 6px 2px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cal-day {
  background: var(--color-surface);
  padding: 6px 4px;
  min-height: 40px;
  font-size: 0.9rem;
  text-align: center;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: default;
  position: relative;
}

.cal-day.empty {
  background: var(--color-bg);
}

.cal-day.weekend {
  background: #F5F5F4;
  color: var(--color-text-muted);
}

.cal-day.no-school {
  background: #F5F5F4;
  color: var(--color-text-muted);
  opacity: 0.5;
}

.cal-day.school {
  background: var(--color-surface);
  color: var(--color-text);
}

.cal-day.holiday {
  background: var(--color-holiday-bg);
  color: var(--color-holiday);
  font-weight: 700;
}

.cal-day.break {
  background: var(--color-halfday-bg);
  color: var(--color-accent-hover);
  font-weight: 600;
}

.cal-day.first-day,
.cal-day.last-day {
  background: var(--color-primary);
  color: #FFFFFF;
  font-weight: 700;
  border-radius: 0;
}

.cal-day.exam {
  background: #ECFDF5;
  color: #0F766E;
  font-weight: 500;
}

.cal-day .cal-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  margin-top: 2px;
}

.cal-day.holiday .cal-dot {
  background: var(--color-holiday);
}

.cal-day.break .cal-dot {
  background: var(--color-accent);
}

.cal-day.first-day .cal-dot,
.cal-day.last-day .cal-dot {
  background: #FFFFFF;
}

.cal-day.exam .cal-dot {
  background: #0F766E;
}

.cal-events {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-border-light);
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.8;
}

.cal-events ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-events li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cal-events .ev-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-events .ev-dot.dot-holiday {
  background: var(--color-holiday);
}

.cal-events .ev-dot.dot-break {
  background: var(--color-accent);
}

.cal-events .ev-dot.dot-event {
  background: #0F766E;
}

.cal-events .ev-dot.dot-exam {
  background: #0F766E;
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-xl);
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-xl);
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.cal-legend-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.cal-legend-swatch.sw-school {
  background: var(--color-surface);
}

.cal-legend-swatch.sw-weekend {
  background: #F5F5F4;
}

.cal-legend-swatch.sw-holiday {
  background: var(--color-holiday-bg);
  border-color: var(--color-holiday);
}

.cal-legend-swatch.sw-break {
  background: var(--color-halfday-bg);
  border-color: var(--color-accent);
}

.cal-legend-swatch.sw-first {
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.cal-legend-swatch.sw-exam {
  background: #ECFDF5;
  border-color: #0F766E;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.75rem;
  }

  h2 {
    font-size: 1.35rem;
    margin-bottom: var(--space-md);
  }

  /* --- Hero: compress height significantly --- */
  .hero {
    padding: var(--space-lg) 0;
  }

  .hero h1 {
    font-size: 1.6rem;
    margin-bottom: var(--space-sm);
  }

  .hero .subtitle {
    font-size: 0.95rem;
    margin-bottom: var(--space-md);
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
  }

  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
  }

  .nav-toggle {
    display: block;
  }

  /* --- Quick Look: keep 2 columns on mobile --- */
  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
  }

  .quick-item {
    padding: var(--space-sm) var(--space-md);
  }

  .quick-item-label {
    font-size: 0.7rem;
    margin-bottom: 2px;
  }

  .quick-item-value {
    font-size: 0.95rem;
  }

  /* --- Card: tighter padding --- */
  .card {
    padding: var(--space-md);
  }

  .card-header {
    margin-bottom: var(--space-md);
  }

  .card-title {
    font-size: 1.15rem;
  }

  .action-bar {
    flex-direction: column;
    padding: var(--space-md);
    gap: var(--space-sm);
  }

  /* --- Breadcrumb + title area --- */
  .breadcrumb {
    padding: var(--space-sm) 0;
  }

  .districts-grid {
    grid-template-columns: 1fr;
  }

  .district-list.cols-2 {
    grid-template-columns: 1fr;
  }

  .map-explorer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .map-container {
    flex: none;
    max-width: 100%;
    position: static;
    margin-bottom: var(--space-md);
  }

  .map-search-wrapper {
    max-width: 100%;
  }

  .district-cards {
    align-self: stretch;
  }

  .district-cards-grid {
    max-height: none;
    overflow-y: visible;
  }

  .district-card-dates {
    flex-direction: column;
    gap: 2px;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    padding: var(--space-lg) 0 var(--space-md);
  }

  .footer-top {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
  }

  .footer-brand {
    font-size: 1rem;
  }

  .footer-desc {
    font-size: 0.8rem;
    line-height: 1.4;
  }

  .footer-nav {
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  .footer h4 {
    font-size: 0.7rem;
    margin-bottom: var(--space-xs);
  }

  .footer-links a {
    font-size: 0.78rem;
  }

  .footer-bottom {
    padding-top: var(--space-sm);
  }

  .footer-bottom p {
    font-size: 0.68rem;
  }

  /* --- Overview: Read More collapse --- */
  #overview-text {
    max-height: 7.5em;
    overflow: hidden;
    position: relative;
    transition: max-height 0.3s ease;
  }

  #overview-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(transparent, var(--color-bg-alt, #faf8f5));
    pointer-events: none;
  }

  #overview-text.expanded {
    max-height: 500px;
  }

  #overview-text.expanded::after {
    display: none;
  }

  .read-more-btn {
    display: block;
    margin-left: auto;
    position: relative;
    z-index: 2;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: var(--space-sm) 0;
    transition: color 0.2s ease;
  }

  .read-more-btn:hover,
  .read-more-btn:active {
    color: var(--color-primary);
  }

  /* --- Map: wider on mobile --- */
  .ny-map {
    width: calc(100% + 2rem);
    margin-left: -1rem;
  }

  /* --- Calendar: tighter gaps --- */
  .cal-year {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .cal-day {
    min-height: 34px;
    font-size: 0.8rem;
    padding: 4px 2px;
  }

  .cal-dow {
    font-size: 0.65rem;
    padding: 4px 2px;
  }

  .cal-legend {
    gap: var(--space-sm) var(--space-md);
    font-size: 0.8rem;
    padding: var(--space-md);
    margin-bottom: var(--space-md);
  }

  /* --- FAQ: tighter spacing --- */
  .faq-list {
    gap: var(--space-sm);
  }

  .faq-question {
    padding: var(--space-md);
    font-size: 0.93rem;
  }

  .faq-answer {
    padding: 0 var(--space-md) var(--space-md);
  }

  /* --- Sections: reduce vertical padding --- */
  .section {
    padding: var(--space-md) 0;
  }

  .container {
    padding: 0 var(--space-md);
  }

  /* --- Table: compact --- */
  table {
    font-size: 0.85rem;
  }

  thead th,
  tbody td {
    padding: 10px 12px;
  }

  /* --- Projected notice: tighter --- */
  .projected-notice {
    margin-bottom: var(--space-md);
    font-size: 0.8rem;
  }

  /* --- Key dates table wrapper --- */
  .table-wrapper {
    margin-bottom: var(--space-md);
  }

  /* --- Month sections: reduce gap --- */
  .month-section {
    margin-bottom: var(--space-md);
  }

  /* --- Mobile Region Accordion --- */
  .district-cards-header {
    display: none;
  }

  .map-show-all {
    display: none;
  }

  .map-legend {
    margin: 0;
    padding: 0;
    min-height: 0;
  }

  .district-cards {
    margin-top: 0;
    padding-top: 0;
  }

  .district-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-right: 0;
    overflow-y: visible;
    max-height: none !important;
  }

  .region-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-xs);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition);
  }

  .region-group-header:active {
    background: var(--color-bg-alt);
  }

  .region-group-header.expanded {
    border-color: var(--color-accent);
    background: var(--color-bg-alt);
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    margin-bottom: 0;
  }

  .region-group-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-primary-dark);
  }

  .region-group-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
  }

  .region-group-count {
    font-size: 0.78rem;
    color: var(--color-text-muted);
  }

  .region-group-arrow {
    width: 18px;
    height: 18px;
    color: var(--color-text-muted);
    transition: transform var(--transition);
    flex-shrink: 0;
  }

  .region-group-header.expanded .region-group-arrow {
    transform: rotate(90deg);
    color: var(--color-accent);
  }

  .district-cards-grid .district-card {
    border-radius: 0;
    border-top: none;
    margin-bottom: 0;
  }

  .district-cards-grid .district-card:last-of-type,
  .district-cards-grid .district-card.region-last {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    margin-bottom: var(--space-xs);
  }

  /* Cards hidden by accordion (not by search/filter) */
  .district-card.region-collapsed {
    display: none;
  }
}

/* Cards: 2 columns on wider phones (480px+) */
@media (min-width: 480px) and (max-width: 768px) {
  .district-cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .district-card {
    padding: 10px;
  }

  .district-card-name {
    font-size: 0.88rem;
  }

  .district-card-dates {
    font-size: 0.78rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.5rem;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

/* --- Print Summary: hidden on screen --- */
.cal-print-summary {
  display: none;
}

/* --- Print labels: hidden on screen --- */
.cal-label {
  display: none;
}

/* --- Shape symbols in legend: hidden on screen, shown on print --- */
.cal-legend-shape {
  display: none;
}

/* --- Print --- Year-at-a-Glance on ONE landscape page ---
   5 cols × 2 rows + consolidated Key Dates footer.
   Flexbox distributes vertical space for balanced proportions.
   ============================================ */
@media print {

  @page {
    size: letter landscape;
    margin: 0.3in 0.22in 0.15in;
  }

  body {
    background: #fff !important;
    margin: 0;
    padding: 0;
  }

  /* ---------- Hide ALL non-calendar content ---------- */
  .nav,
  .footer,
  .breadcrumb,
  .action-bar,
  .projected-notice,
  .hero,
  .hero-actions,
  .nav-toggle,
  #key-dates,
  #faq,
  .faq-list,
  .related-grid,
  .related-link,
  .disclaimer,
  .last-updated,
  .table-wrapper,
  .back-to-top,
  .year-switcher,
  .section:not(#full-calendar) {
    display: none !important;
  }

  body>.container {
    display: none !important;
  }

  body>nav {
    display: none !important;
  }

  body>footer {
    display: none !important;
  }

  /* ---------- Full-calendar fills the page ---------- */
  #full-calendar {
    display: flex !important;
    flex-direction: column;
    padding: 0 !important;
    position: relative;
    height: auto;
    box-sizing: border-box;
  }

  #full-calendar .container {
    padding: 0 !important;
    max-width: 100% !important;
    flex: 1;
    display: flex !important;
    flex-direction: column;
  }

  /* ---------- Title ---------- */
  #full-calendar h2 {
    font-size: 14pt;
    font-weight: 700;
    margin: 0 0 6pt 0;
    text-align: center;
    flex-shrink: 0;
    letter-spacing: 0.3pt;
  }

  /* Website URL — top-right corner */
  #full-calendar .container::before {
    content: "NYschoolcalendar.com";
    position: absolute;
    top: 2pt;
    right: 0;
    font-size: 9pt;
    color: #94A3B8;
    font-family: var(--font-heading), sans-serif;
    letter-spacing: 0.3px;
  }

  /* Hide the subtitle paragraph */
  #full-calendar>.container>p {
    display: none !important;
  }

  /* ---------- Legend ---------- */
  .cal-legend {
    border: 1px solid #D1D5DB;
    padding: 4pt 10pt;
    margin-bottom: 0;
    font-size: 8pt;
    gap: 3pt 12pt;
    page-break-after: avoid;
    flex-shrink: 0;
    border-radius: 3pt;
    justify-content: center;
  }

  .cal-legend-swatch {
    width: 11px;
    height: 11px;
    border-radius: 2px;
  }

  /* ---------- Hide inline event lists (shown as consolidated footer) --- */
  .cal-events {
    display: none !important;
  }

  /* ---------- Calendar grid: 5 cols × 2 rows ---------- */
  .cal-year {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6pt !important;
    flex: 1;
    margin-top: 6pt;
    align-content: center;
    align-items: start;
    page-break-inside: avoid;
  }

  .cal-month {
    page-break-inside: avoid;
    border: 1px solid #D1D5DB;
    border-radius: 3pt;
    box-shadow: none;
    overflow: hidden;
  }

  .cal-month-name {
    background: #1E293B !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #fff !important;
    padding: 3pt 6pt;
    font-size: 10pt;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.3pt;
  }

  .cal-dow {
    background: #475569 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color: #fff !important;
    font-size: 7pt;
    padding: 2pt 1pt;
    font-weight: 600;
  }

  .cal-day {
    min-height: 28px;
    font-size: 9pt;
    padding: 2pt 2pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cal-day .cal-dot {
    display: none;
  }

  /* --- Print symbol labels (visible only on print) --- */
  .cal-label {
    display: block !important;
    font-size: 7pt;
    position: absolute;
    bottom: 0pt;
    left: 0;
    right: 0;
    text-align: center;
    line-height: 1;
    opacity: 0.85;
  }


  /* --- Day colors: use same as screen, just force print to render them --- */
  .cal-day.holiday,
  .cal-day.break,
  .cal-day.exam,
  .cal-day.first-day,
  .cal-day.last-day,
  .cal-day.weekend,
  .cal-day.no-school {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cal-day.weekend {
    background: #E8E8E8 !important;
    color: #57534E !important;
  }

  .cal-day.no-school {
    background: #F0F0F0 !important;
    opacity: 0.6;
  }

  /* --- Legend: hide color swatches, show only shapes in print --- */
  .cal-legend-swatch {
    display: none !important;
  }

  /* Hide School Day & Weekend items (no shapes, self-explanatory) */
  .cal-legend-item:has(.sw-school),
  .cal-legend-item:has(.sw-weekend) {
    display: none !important;
  }

  .cal-legend-shape {
    display: inline !important;
    font-size: 7pt;
    margin-right: 2pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ---------- Consolidated Key Dates Footer ---------- */
  .cal-print-summary {
    display: block !important;
    flex-shrink: 0;
    margin-top: 8pt;
    padding-top: 6pt;
    border-top: 1.5pt solid #CBD5E1;
  }

  .cal-print-summary-title {
    font-size: 10pt;
    font-weight: 700;
    text-align: center;
    margin-bottom: 5pt;
    color: #1E293B;
    letter-spacing: 0.5pt;
    text-transform: uppercase;
  }

  .cal-print-summary-list {
    column-count: 5;
    column-gap: 14pt;
    font-size: 8pt;
    line-height: 1.7;
    color: #334155;
  }

  .cal-print-summary-item {
    display: flex;
    align-items: center;
    gap: 4pt;
    padding: 0.5pt 0;
    break-inside: avoid;
  }

  .cal-print-summary-shape {
    font-size: 8pt;
    flex-shrink: 0;
    width: 9pt;
    text-align: center;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .cal-print-legend-shape {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}


/* --- Back to Top Button --- */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
  z-index: 99;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-accent-hover);
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }

  .back-to-top svg {
    width: 20px;
    height: 20px;
  }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}