/* Modern Schedule Page Styles
 * Focus: responsive layout, accessibility, clean visuals
 */
/* Theme variables moved to /scripts/theme.css for reuse across site */

html { scroll-behavior: smooth; }
body { margin:0; font-family: var(--font-base); background: var(--color-bg); color: var(--color-text); line-height:1.4; }

.skip-link { position:absolute; left:-999px; top:auto; width:1px; height:1px; overflow:hidden; }
.skip-link:focus { left:8px; top:8px; width:auto; height:auto; padding:.6rem 1rem; background:#000; color:#fff; z-index:1000; border-radius: var(--radius-sm); }

.page-header { background: linear-gradient(135deg,#043463,#0d5ab9); color:#fff; padding: 1.2rem 1rem 1rem; box-shadow: var(--shadow-md); }
.page-header a { color:#fff; text-decoration:none; }
.page-title { margin:0; font-size:clamp(1.5rem,3vw,2.1rem); font-weight:600; }
.header-inner { max-width:1200px; margin:0 auto; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1rem; }
.utility-bar { display:flex; align-items:center; gap:1rem; font-size:.85rem; }
.tag { background:rgba(255,255,255,.15); padding:.3rem .6rem; border-radius: var(--radius-sm); }

.content { max-width:1200px; margin:1rem auto 4rem; padding:0 1rem; }

.filters { background: var(--color-surface); border:1px solid var(--color-border); padding:.6rem .75rem; border-radius: var(--radius-md); box-shadow: var(--shadow-sm); display:flex; flex-wrap:nowrap; gap:.75rem; align-items:center; margin:0 0 .9rem; position:sticky; top:0; z-index:50; overflow-x:auto; }
.filters::-webkit-scrollbar { height:8px; }
.filters::-webkit-scrollbar-thumb { background: var(--color-border); border-radius:4px; }
.filter-form { display:flex; flex-wrap:nowrap; align-items:center; gap:.75rem; width:100%; }
.filter-item { display:flex; align-items:center; gap:.35rem; }
.filter-form label { font-size:.65rem; text-transform:uppercase; letter-spacing:.06em; font-weight:600; color:var(--color-muted); display:inline-flex; }
.field-inline { display:flex; align-items:center; gap:.45rem; }
.field-inline label { display:inline-flex; margin:0; }
.filter-form select, .filter-form input[type=text] { min-width:140px; padding:.5rem .6rem; border:1px solid var(--color-border); border-radius: var(--radius-sm); background:#fff; font-size:.9rem; }
.filter-form select:focus, .filter-form input[type=text]:focus { outline:2px solid var(--color-focus); outline-offset:1px; }

.btn { background: var(--color-accent); color:#fff; border:none; padding:.55rem .9rem; font-size:.8rem; font-weight:600; letter-spacing:.05em; border-radius: var(--radius-sm); cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; gap:.4rem; box-shadow: var(--shadow-sm); transition:.25s background; line-height:1; }
.btn:hover, .btn:focus { background: var(--color-accent-hover); }
.btn:focus { outline:2px solid var(--color-focus); outline-offset:2px; }
.btn[disabled] { opacity:.55; cursor:wait; }
.btn.outline { background:transparent; color: var(--color-accent); border:1px solid var(--color-accent); }
.btn.outline:hover { background: var(--color-accent); color:#fff; }
.btn.subtle { background:#fff; color: var(--color-accent); border:1px solid var(--color-border); }
.btn.subtle:hover { background:#eef5fd; }

/* Consistent Subscribe / Export button height (remove forced width) */
.actions #subscribe-link,
.actions #export-button {
  line-height:1; /* normalize cross-element line height */
  padding:.55rem .9rem; /* ensure identical vertical padding */
  justify-content:center;
}

.icon-btn { background:#fff; border:1px solid var(--color-border); padding:.35rem .55rem; font-size:1rem; line-height:1; border-radius: var(--radius-sm); cursor:pointer; box-shadow: var(--shadow-sm); }
.icon-btn:hover { background:#eef5fd; }
.icon-btn:focus { outline:2px solid var(--color-focus); outline-offset:2px; }

.search-container { position:relative; display:inline-flex; align-items:center; }
.search-container input { padding-right:.6rem; }
#clearSearch { display:none; position:static; transform:none; margin-left:.4rem; }
#printPage { position:static; transform:none; margin-left:.4rem; }
.assistive { position:absolute; left:-999px; width:1px; height:1px; overflow:hidden; }

.loading-indicator { position:fixed; top:10px; right:10px; background:#043463; color:#fff; padding:.5rem .75rem; font-size:.75rem; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); display:none; }

.table-wrapper { background: var(--color-surface); border:1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); overflow-x:auto; position:relative; }
.content { padding-top: var(--filters-height); }
.table-wrapper:focus { outline:2px solid var(--color-focus); outline-offset:2px; }

.data-table { width:100%; border-collapse:collapse; font-size:.85rem; }
.data-table thead { display:none !important; }
.data-table thead th { position:sticky; top: var(--sticky-offset); background:#043463; color:#fff; font-weight:600; padding:.65rem .6rem; text-align:left; font-size:.7rem; letter-spacing:.06em; z-index:40; }
.data-table tbody td { padding:.55rem .6rem; border-bottom:1px solid var(--color-border); vertical-align:top; }
.data-table tbody tr:nth-child(odd) { background:#f2f3f5; }
.data-table tbody tr:nth-child(even) { background:#e8eaee; }
.data-table tbody tr:hover { background:#f1f3f6; }

/* Spacer row to offset sticky thead so it doesn't overlap first data rows */
.data-table tbody tr.spacer-row { background:transparent !important; }
.data-table tbody tr.spacer-row td { padding:0; border:0; height:var(--thead-height, 0px); }
.data-table tbody tr.spacer-row:hover { background:transparent; }

/* Event type emphasis */
/* .capdevielle removed (star now appended to name without special styling) */
.sanctioned { font-weight:600; color: var(--color-sanctioned); }
.fontLarge { font-weight:500; }
.filters-right { display:flex; align-items:center; gap:.6rem; margin-left:auto; }
.star { color:#ffc400; font-weight:700; }

/* Utility */
.visually-hidden { position:absolute; width:1px; height:1px; margin:-1px; border:0; padding:0; clip:rect(0 0 0 0); overflow:hidden; }

.site-footer { max-width:1200px; margin:2rem auto 2rem; padding:0 1rem; font-size:.7rem; color:var(--color-muted); text-align:center; }

/* Dark theme rules moved to /scripts/theme.css */

@media (max-width: 760px) {
  .filters { padding:.5rem .6rem; }
  .filter-form { gap:.55rem; }
  .filter-form select, .filter-form input[type=text] { min-width:110px; }
  .filter-form label { font-size:.55rem; }
  .utility-bar { width:100%; justify-content:flex-start; }
  .content { padding-top: var(--filters-height); }
  .data-table thead { display:none; }
  .data-table .spacer-row { display:none; }
  .data-table tbody tr { display:grid; grid-template-columns:minmax(0,1fr); gap:.25rem; padding:.6rem .6rem .7rem; }
  .data-table tbody td { border:none; padding:0; }
  .data-table tbody td:first-child { font-weight:600; }
  .data-table tbody tr:hover { background:#fff9e6; }
  .data-table tbody td { display:block; }
  .data-table tbody td:nth-child(n+2)::before { content: attr(data-label); display:block; font-size:.65rem; text-transform:uppercase; letter-spacing:.05em; color:var(--color-muted); margin-top:.4rem; }
}

@media print {
  body { background:#fff; }
  .page-header { box-shadow:none; }
  .filters, .site-footer, .skip-link, .utility-bar, #returnToTop { display:none !important; }
  .data-table thead th { background:#000 !important; color:#fff !important; }
  .data-table tbody tr { page-break-inside: avoid; }
  .data-table .spacer-row { display:none !important; }
}

/* Calendar overlay (Schedule List -> Calendar View) */
body.calendar-overlay-open { overflow:hidden; }
.calendar-overlay { position:fixed; inset:0; z-index:200; display:flex; align-items:center; justify-content:center; padding:1rem; }
.calendar-overlay[hidden] { display:none !important; }
.calendar-overlay__backdrop { position:absolute; inset:0; background: rgba(0,0,0,.55); }
.calendar-overlay__panel { position:relative; width:min(1200px, 96vw); height:min(92vh, 900px); background: var(--color-surface); border:1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); overflow:hidden; display:flex; flex-direction:column; }
.calendar-overlay__toolbar { display:flex; justify-content:flex-end; gap:.5rem; padding:.6rem .75rem; border-bottom:1px solid var(--color-border); background: var(--color-surface); }
.calendar-overlay__frame { flex:1; width:100%; border:0; background: var(--color-bg); }

/* Ensure dark mode row colors override light greys (loaded after theme.css) */
body.theme-dark .data-table tbody tr:nth-child(odd),
body.theme-dark .data-table tbody tr:nth-child(odd) td { background:#123456 !important; }
body.theme-dark .data-table tbody tr:nth-child(even),
body.theme-dark .data-table tbody tr:nth-child(even) td { background:#0f2b4a !important; }
body.theme-dark .data-table tbody tr:hover,
body.theme-dark .data-table tbody tr:hover td { background:#1b3a6b !important; }
