/* course-finder.css — Dreamcatcher Training Finder */

/* ── Custom properties ──────────────────────────────────────── */
:root {
  --page-bg:      #faf7f5;
  --surface:      #ffffff;
  --text:         #1a1a1a;
  --text-muted:   #5f5f63;
  --border:       #eadfdb;
  --accent:       #ff3131;
  --accent-hover: #e82727;
  --accent-soft:  rgba(255, 49, 49, 0.08);
  --focus:        #ff3131;
  --shadow:       0 14px 36px rgba(40, 8, 8, 0.08);
  --radius:       4px;
  --max-width:    780px;
  --gap:          0.875rem;
}

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

/* ── Base ───────────────────────────────────────────────────── */
html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--page-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Utility ────────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── Container ──────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-block: 1.125rem;
}

.site-header .container {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-title {
  min-width: 0;
}

.site-header h1 {
  font-size: 1.3125rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.site-tagline {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.header-dev-credit {
  flex-shrink: 0;
  align-self: center;
}

.header-dev-credit-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--text-muted);
  border-radius: var(--radius);
}

.header-dev-credit-link:hover {
  color: var(--text);
}

.header-dev-credit-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.header-dev-credit-logo {
  display: block;
  height: 28px;
  width: auto;
}

.header-dev-credit-link span {
  font-size: 0.6875rem;
  white-space: nowrap;
  line-height: 1.3;
}

/* ── Main ───────────────────────────────────────────────────── */
.site-main {
  flex: 1;
  padding-bottom: 2rem;
}

/* ── Search section ─────────────────────────────────────────── */
.search-section {
  padding-top: 1.25rem;
  padding-bottom: 0.25rem;
}

.search-form {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.search-row {
  display: flex;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 0.875rem;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  -webkit-appearance: none;
  appearance: none;
}

.search-input::placeholder {
  color: rgba(95, 95, 99, 0.6);
}

.search-input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(255, 49, 49, 0.15);
}

.filter-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.category-select {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 0.75rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s;
  -webkit-appearance: none;
  appearance: auto;
}

.category-select:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(255, 49, 49, 0.15);
}

.btn-clear {
  flex-shrink: 0;
  height: 48px;
  padding: 0 1rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.btn-clear:hover {
  background: var(--page-bg);
  border-color: #c4b2ae;
  color: var(--text);
}

.btn-clear:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--focus);
}

.result-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.875rem;
  min-height: 1.125rem;
  padding-bottom: 0.125rem;
}

/* ── State panels ───────────────────────────────────────────── */
.state {
  padding-block: 3rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.state p + p {
  margin-top: 0.5rem;
}

.state-error {
  color: var(--accent);
}

.state-no-results .btn {
  margin-top: 1rem;
}

/* ── Results area ───────────────────────────────────────────── */
.results-area {
  margin-top: 0.25rem;
}

.course-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-block: 0.75rem 0.5rem;
}

/* ── Course card ────────────────────────────────────────────── */
.course-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.125rem 1.125rem 1rem;
}

.course-card > header {
  margin-bottom: 0.875rem;
}

.course-title {
  font-size: 1.025rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.course-category {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ── Schedule section ───────────────────────────────────────── */
.schedule-section {
  margin-bottom: 1rem;
}

.schedule-heading {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.625rem;
}

.schedule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.schedule-entry {
  padding: 0.625rem 0.75rem;
  background: #fff8f5;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.schedule-date {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.schedule-venue {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-top: 0.125rem;
  margin-bottom: 0.5rem;
}

/* venue with no margin-bottom when followed immediately by button */
.schedule-entry .btn-enquire {
  margin-top: 0.5rem;
}

.no-dates {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

/* ── Card actions ───────────────────────────────────────────── */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.125rem;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.25rem 1.125rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
  border: 1.5px solid transparent;
  line-height: 1.3;
}

.btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Primary: filled */
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* Secondary: outlined */
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--accent-soft);
}

/* View course details: ghost/tertiary — overrides .btn-primary inside card actions */
.card-actions .btn-primary {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.card-actions .btn-primary:hover:not(:disabled) {
  background: var(--page-bg);
  border-color: var(--text-muted);
  color: var(--text);
}

/* Enquire button (inside schedule entry) — full width on mobile for tap comfort */
.btn-enquire {
  display: flex;
  width: 100%;
  font-size: 0.8125rem;
  padding: 0.25rem 0.875rem;
}

/* Show more */
.show-more-area {
  padding-block: 0.5rem 1rem;
  text-align: center;
}

.btn-show-more {
  height: 44px;
  padding: 0 2rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  color: var(--accent);
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.12s;
}

.btn-show-more:hover {
  background: var(--accent-soft);
}

.btn-show-more:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── Scroll sentinel ────────────────────────────────────────── */
#scroll-sentinel {
  height: 1px;
}

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding-block: 1.125rem;
  background: var(--surface);
  margin-top: auto;
}

.disclaimer {
  font-size: 0.78125rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.dev-credit {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.55;
}

.dev-credit a {
  color: var(--text-muted);
  text-decoration: underline;
  border-radius: var(--radius);
}

.dev-credit a:hover {
  color: var(--text);
}

.dev-credit a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── Calendar utility link ──────────────────────────────────── */
.cal-link {
  display: inline-block;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: var(--radius);
}

.cal-link:hover {
  color: var(--text);
}

.cal-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ── Wider screens ──────────────────────────────────────────── */
@media (min-width: 500px) {
  .card-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .card-actions .btn {
    flex: 1 1 auto;
    min-width: 0;
  }

  .btn-enquire {
    display: inline-flex;
    width: auto;
  }
}

@media (min-width: 580px) {
  .search-form {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .search-row {
    flex: 2 1 220px;
    min-width: 0;
  }

  .filter-row {
    flex: 1 1 180px;
    min-width: 0;
  }
}

@media (min-width: 640px) {
  .site-header h1 {
    font-size: 1.5rem;
  }

  .header-dev-credit-link span {
    font-size: 0.75rem;
  }

  .course-card {
    padding: 1.25rem 1.375rem 1.125rem;
  }

  .course-title {
    font-size: 1.0625rem;
  }
}

/* ── Calendar page ──────────────────────────────────────────── */
.calendar-panel {
  padding-top: 1.25rem;
}

.calendar-intro {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.calendar-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.25rem;
}

.calendar-embed {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.calendar-frame {
  display: block;
  width: 100%;
  min-height: 620px;
  height: 75vh;
  border: 0;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
