/*
 * Base styles: CSS custom properties (design tokens), reset, typography,
 * and layout primitives.
 *
 * Component styles live in:
 *   navigation.css  buttons.css  forms.css  components.css  features.css
 */

/* ══════════════════════════════════════════════════════════════════════
   DESIGN TOKENS
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* Brand palette */
  --color-dark:    #202026;   /* nav bg, primary buttons, strong text */
  --color-mid:     #50505a;   /* hover states, headings */
  --color-light:   #fdfdff;   /* card surfaces, header text, off-white bg */

  /* Text */
  --color-muted: #555;
  --color-faint: #888;

  /* Surfaces */
  --color-light-silver: #f6f6f9;  /* zebra rows, hover backgrounds, subtle panels */

  /* Borders */
  --color-border:       #ccc6c3;
  --color-border-mid:   #ddd;
  --color-border-light: #eee;

  /* Status: error */
  --color-error:        #BA160C;
  --color-error-bg:     #fff0f0;
  --color-error-border: #f5c6c6;

  /* Status: success */
  --color-success:        #046a38;
  --color-success-bg:     #f0fff4;
  --color-success-border: #b8e8c8;

  /* Typography */
  --font-sans:  "Open Sans", sans-serif;
  --font-music: "Bravura", "Noto Music", "FreeSerif", serif;

  /* Shape */
  --radius-sm: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;

  /* Motion */
  --duration: 0.15s;

  /* Stacking context */
  --z-header: 100;
  --z-nav:    200;
  --z-modal:  500;
}

/* ══════════════════════════════════════════════════════════════════════
   MOBILE OS TEXT SIZE
   Opt into iOS/iPadOS dynamic text-size preference. Setting
   font: -apple-system-body on html makes the root font-size track the
   OS Accessibility → Larger Text slider in Safari and Chrome on iOS.
   Firefox already honors OS text-size natively; no extra CSS needed.

   Desktop Safari also recognises -apple-system-body but maps it to the
   macOS UI body size (≈13 px). The @supports guard below resets the
   root font-size to 100% (browser default, 16 px) on Desktop Safari
   only: -webkit-touch-callout is iOS-only, so the NOT condition is true
   only on macOS Safari.
   ══════════════════════════════════════════════════════════════════════ */

html { font: -apple-system-body; }

@supports (font: -apple-system-body) and (not (-webkit-touch-callout: default)) {
  :root { font-size: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════
   BASE / RESET
   ══════════════════════════════════════════════════════════════════════ */

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans); /* override family set by font: -apple-system-body on html */
  font-size: 100%;
  line-height: 1.5;
  margin: 0;
  background-color: #fff;
  height: 100%;
}

@media (min-width: 1200px) {
  body { background-color: var(--color-light); }
}

/* Ensure [hidden] always wins over display rules */
[hidden] {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ══════════════════════════════════════════════════════════════════════ */

h1, h3, h4, h5, h6 {
  color: var(--color-mid);
  text-align: center;
  line-height: 1.25em;
  font-weight: 600;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-mid);
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  text-align: left;
  line-height: 1.25em;
}

.page-title {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-dark);
  text-align: left;
  line-height: 1.25em;
}

.page-subtitle {
  color: var(--color-muted);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

.section-heading {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  margin: 1.5rem 0 0.5rem;
}

.center {
  text-align: center;
}

.empty-state {
  color: #666;
  font-style: italic;
}

.greeting--hidden {
  opacity: 0;
}

p[data-controller="greeting"] {
  font-size: 1.5rem;
  transition: opacity var(--duration);
}

li + li {
  margin-top: 0.6em;
}

img.hero {
  display: block;
  margin: 20px auto;
  max-width: 100%;
}

img.logo {
  display: block;
  margin: 20px auto;
  width: 100%;
  max-width: 12em;
}

sup.ordinal {
  font-size: 60%;
  vertical-align: top;
  position: relative;
  top: -0.5em;
}

svg[aria-hidden="true"] {
  vertical-align: middle;
}

span.small {
  font-size: 75%;
}

div.page-content a,
div.page-content a:visited {
  color: #933;
}

div.page-content a:hover {
  color: #f33;
}

div.page-content a.btn,
div.page-content a.btn:visited {
  color: #fff;
}

.field-hint {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0 0 0.35rem;
}

/* ══════════════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════════════ */

div.container {
  padding: 0;
  margin: 0 auto;
  background-color: #fff;
  min-height: 100%;
}

div.page-content {
  padding: 80px 40px;
}

@media (max-width: 480px) {
  div.page-content {
    padding: 80px 16px 16px;
  }
}

/* Two-column dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 860px) {
  .dashboard-grid {
    grid-template-columns: 1fr 25rem;
    gap: 0 2rem;
    align-items: start;
  }
}

@media (min-width: 1281px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 758px) 1fr;
  }
}

@media (min-width: 1375px) {
  .dashboard-grid {
    grid-template-columns: 3fr 2fr;
  }
}

@media (min-width: 860px) {
  .dashboard-grid--equal {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1281px) {
  .dashboard-grid--equal {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1375px) {
  .dashboard-grid--equal {
    grid-template-columns: 1fr 1fr;
  }
}

.dashboard-col {
  min-width: 0;
}

.dashboard-col .detail-card {
  max-width: none;
  margin-left: 0;
  margin-right: 0;
}

.upcoming-events-table th.upcoming-events-table__count,
.upcoming-events-table td.upcoming-events-table__count {
  width: 3rem;
  text-align: center;
  white-space: nowrap;
}

[data-controller~="upcoming-events-poller"] {
  transition: background-color 500ms ease;
}

[data-controller~="upcoming-events-poller"].upcoming-events-flash {
  background-color: #eef3ff;
  transition: background-color 250ms ease;
}

/* Two-column events index grid */
.events-index-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .events-index-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
    align-items: start;
  }
}

.events-month-group {
  margin-bottom: 1.5rem;
}

/* Two-column musicians index grid */
.musicians-index-grid {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .musicians-index-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
    align-items: start;
  }
}

/* Profile / detail page layout */
.back-nav {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.detail-layout {
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
