:root {
  --primary: #0f172a;
  --accent: #1e40af;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 3rem;
}

/* Header & Banner */
.header-banner {
  width: 100%;
  max-width: 800px;
  margin: 1rem auto 0 auto;
  padding: 0 1rem;
}

.header-banner img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: block;
}

.page-header {
  text-align: center;
  padding: 1rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.025em;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Search & Filter Controls */
.search-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#searchInput {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  background: #ffffff;
}

.filter-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-right: 0.25rem;
}

.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.season-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* Track Cards */
.track-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.track-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

.track-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.track-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
}

.tag-container {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  text-transform: uppercase;
}

.tag-soprano { background-color: #dbeafe; color: #1e40af; }
.tag-alto { background-color: #f3e8ff; color: #6b21a8; }
.tag-tenor { background-color: #dcfce7; color: #166534; }
.tag-bass { background-color: #ffedd5; color: #9a3412; }
.tag-full { background-color: #f1f5f9; color: #475569; }

audio {
  width: 100%;
  height: 40px;
  border-radius: 8px;
}

/* Navigation Bar */
.main-nav {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  text-decoration: none;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  margin: 0;
  padding: 0;
}

.nav-item {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius);
}

/* ==========================================================================
   Hymnal Key & Mass Schedule Styles
   ========================================================================== */

/* Page Header */
header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-size: 1.8rem;
  color: #1e3a8a;
  margin-bottom: 4px;
}

header p.subtitle {
  color: #64748b;
  font-size: 0.95rem;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #2563eb;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  margin-top: 10px;
}

/* Hymnal Key Legend */
.hymnal-key-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 1.25rem 0 1.75rem 0;
  padding: 0 1rem;
}

.hymnal-key-card {
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  background-color: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 12px);
  padding: 0.75rem 1.5rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.key-label {
  font-weight: 700;
  color: #1e3a8a;
  font-size: 0.9rem;
  white-space: nowrap;
}

.key-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.key-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 6px;
  background-color: #eef2ff;
  color: #1e40af;
}

.key-text {
  font-size: 0.85rem;
  color: #374151;
}

/* Schedule Cards & Grid Layout */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1rem;
}

.weekend-card {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 12px);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.card-header {
  border-bottom: 2px solid #2563eb;
  padding-bottom: 0.5rem;
  margin-bottom: 0.85rem;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e40af;
  margin: 0;
}

.liturgical-title {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  font-style: italic;
  margin-top: 0.15rem;
}

/* Song List Layout */
.song-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.song-item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 8px;
}

.song-item:last-child {
  border-bottom: none;
}

.part-name {
  font-weight: 700;
  color: #1e40af;
  font-size: 0.75rem;
  text-transform: uppercase;
  text-align: left;
}

.song-title {
  color: #0f172a;
  font-weight: 500;
  font-size: 0.9rem;
  text-align: left;
}

.hymnal-ref {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  text-align: right;
  white-space: nowrap;
}

/* Mobile Responsive Adjustments */
@media (max-width: 640px) {
  body {
    padding-bottom: 1.5rem;
  }

  .header-banner {
    padding: 0 0.5rem;
  }

  .container {
    padding: 0 0.75rem;
  }

  .filter-group {
    justify-content: flex-start;
  }

  .filter-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }

  .hymnal-key-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    width: 100%;
  }

  .grid-container {
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
  }
}

/* Important Dates Layout */
.important-dates-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 0 1.5rem 0;
  padding: 0 1rem;
}

.important-dates-card {
  width: 100%;
  max-width: 800px;
  background-color: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 12px);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}

.important-dates-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 0.75rem;
  border-bottom: 2px solid #2563eb;
  padding-bottom: 0.35rem;
}

.dates-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 4-Column Grid: Date | Time | Event | Dress Code */
.date-item {
  display: grid;
 grid-template-columns: max-content max-content auto auto;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
}

.date-item:last-child {
  border-bottom: none;
}

.date-col {
  font-weight: 700;
  color: #1e40af;
  font-size: 0.9rem;
  white-space: nowrap;
}

.time-col {
  font-weight: 600;
  color: #475569;
  font-size: 0.85rem;
  white-space: nowrap;
}

.event-col {
  color: #0f172a;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}

.dress-col {
color: #0f172a;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* Mobile responsive styling for narrow viewports */
@media (max-width: 640px) {
  .date-item {
    grid-template-columns: auto 1fr;
    row-gap: 4px;
    column-gap: 10px;
    padding: 10px 0;
  }

  .date-col {
    grid-column: 1;
  }

  .time-col {
    grid-column: 2;
  }

  .event-col {
    grid-column: 1;
  }

  .dress-col {
    grid-column: 2;
  }
}
.current-section-card {
  background-color: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 12px);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
}
.search-section-card {
  background-color: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius, 12px);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.05));
  margin-top: 40px;
  margin-bottom: 24px;
}
/* Choir Rehearsal Block Styles */
.choir-rehearsals-card {
  margin-bottom: 24px;
}

.rehearsal-title {
  font-weight: 700;
  color: #1e3a8a;
  margin-top: 0;
  margin-bottom: 16px;
  border-bottom: 2px solid #2563eb;
  padding-bottom: 8px;
}

.rehearsal-schedule {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.rehearsal-day {
  color: #1e3a8a;
}

.rehearsal-time {
  margin-left: 12px;
  color: #374151;
  font-weight: 600;
}

.rehearsal-location {
  color: #6b7280;
  font-size: 0.95rem;
}

.rehearsal-lineup-box {
  background-color: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  border: 1px solid #f3f4f6;
}

.rehearsal-lineup-header {
  font-weight: 700;
  color: #1e3a8a;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.rehearsal-list {
  margin: 0;
  padding-left: 20px;
  color: #1f2937;
  font-size: 0.95rem;
  line-height: 1.7;
}
#archive-tracks-section,
#archive-tracks-list {
  border: none;
  box-shadow: none;
  background: transparent;
}
/* Unified Generic Section Card */
.page-section {
  max-width: 900px;
  margin: 0 auto 24px auto;
  padding: 0 16px;
}

.section-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.section-card-title {
  margin-top: 0;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #2563eb;
  color: #1e3a8a;
  font-size: 1.25rem;
}
