/* ========================================
   Light Directory — Minimal text-only styles
   ======================================== */

.light-page {
  background: var(--surface-page, #ffffff);
  min-height: 100vh;
}

/* ── Toolbar ─────────────────────────────── */
.light-toolbar {
  padding: 12px var(--page-gutter, 24px);
  background: var(--surface-page, #ffffff);
  border-bottom: 1px solid var(--border-soft, rgba(148, 163, 184, 0.35));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* The form wrapper exists only so the shared quick-links component can
   mount after it; flex `order` keeps the visual row: form, select, total,
   then the injected quick links on their own line. */
.light-toolbar .search-box {
  flex: 1 1 200px;
  min-width: 0;
  order: 1;
}

.light-toolbar .light-view-select { order: 2; }
.light-toolbar .light-total { order: 3; }

.light-toolbar .search-quick-links {
  order: 4;
  flex-basis: 100%;
  justify-content: flex-start;
  margin: 10px 0 0;
}

.light-filter-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.35));
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-soft, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast, 150ms);
}

.light-filter-input::placeholder {
  color: var(--text-muted, #64748b);
}

.light-filter-input:focus {
  border-color: var(--brand-primary, #f97316);
  box-shadow: 0 0 0 3px rgba(var(--brand-primary-rgb, 249 115 22) / 0.15);
}

.light-view-select {
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.35));
  border-radius: var(--radius-sm, 8px);
  background: var(--surface-soft, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
}

.light-total {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}

/* ── Main shell ──────────────────────────── */
.light-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--page-gutter, 24px) 48px;
}

/* ── Destination chips (the 8 brand cards from the main page) ── */
.light-destinations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--border-soft, rgba(148, 163, 184, 0.35));
  margin-bottom: 8px;
}

.light-jump-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-full, 9999px);
  border: 1px solid var(--border-soft, rgba(148, 163, 184, 0.35));
  background: var(--surface-soft, #f8fafc);
  color: var(--text-secondary, #334155);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast, 150ms);
  white-space: nowrap;
}

.light-jump-link:hover {
  border-color: var(--brand-primary, #f97316);
  color: var(--brand-primary-dark, #ea580c);
  background: var(--primary-50, #fff7ed);
}

.light-jump-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
  background: rgba(var(--brand-primary-rgb, 249 115 22) / 0.1);
  padding: 1px 6px;
  border-radius: var(--radius-full, 9999px);
}

/* ── Region / Group sections ─────────────── */
.light-section {
  margin-top: 20px;
}

.light-section summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-bottom: 2px solid var(--brand-primary, #f97316);
}

.light-section summary::-webkit-details-marker {
  display: none;
}

.light-section summary::before {
  content: '▶';
  font-size: 0.7rem;
  color: var(--brand-primary, #f97316);
  transition: transform var(--transition-fast, 150ms);
  flex-shrink: 0;
}

.light-section[open] summary::before {
  transform: rotate(90deg);
}

.light-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin: 0;
}

.light-section-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand-primary-dark, #ea580c);
  background: rgba(var(--brand-primary-rgb, 249 115 22) / 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full, 9999px);
}

/* ── Sub-group (chain within region) ─────── */
.light-subgroup {
  margin: 12px 0 0;
  padding: 0 0 0 6px;
  border-inline-start: 3px solid rgba(var(--brand-primary-rgb, 249 115 22) / 0.2);
}

.light-subgroup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
}

.light-subgroup-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-secondary, #334155);
  margin: 0;
}

.light-subgroup-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

/* ── Hotel table ─────────────────────────── */
.light-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.light-table th {
  text-align: start;
  padding: 6px 10px;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  border-bottom: 1px solid var(--border-soft, rgba(148, 163, 184, 0.35));
  white-space: nowrap;
}

.light-table td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  color: var(--text-primary, #0f172a);
  vertical-align: middle;
}

.light-table tbody tr:hover {
  background: rgba(var(--brand-primary-rgb, 249 115 22) / 0.04);
}

.light-table tbody tr.light-row-hidden {
  display: none;
}

.light-hotel-link {
  color: var(--text-primary, #0f172a);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast, 150ms);
}

.light-hotel-link:hover {
  color: var(--brand-primary, #f97316);
  text-decoration: underline;
}

.light-area-cell {
  color: var(--text-secondary, #334155);
  font-size: 0.84rem;
}

.light-arrow {
  color: var(--text-muted, #64748b);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color var(--transition-fast, 150ms);
}

.light-arrow:hover {
  color: var(--brand-primary, #f97316);
}

/* ── Page title ──────────────────────────── */
.light-page-title {
  margin: 14px 0 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary, #0f172a);
}

/* ── Back link ───────────────────────────── */
.light-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0 0;
  color: var(--text-muted, #64748b);
  font-size: 0.85rem;
  text-decoration: none;
  transition: color var(--transition-fast, 150ms);
}

.light-back:hover {
  color: var(--brand-primary, #f97316);
}

/* ── Empty / loading / error states ──────── */
.light-loading,
.light-empty,
.light-error {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted, #64748b);
  font-size: 1rem;
}

.light-retry {
  margin-top: 14px;
  padding: 9px 22px;
  border: none;
  border-radius: var(--radius-full, 9999px);
  background: var(--brand-primary, #f97316);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--transition-fast, 150ms);
}

.light-retry:hover {
  background: var(--brand-primary-dark, #ea580c);
}

/* ── Footer ──────────────────────────────── */
.light-footer {
  padding: 20px var(--page-gutter, 24px);
  border-top: 1px solid var(--border-soft, rgba(148, 163, 184, 0.35));
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 0.82rem;
}

/* ── No-match message in filtered view ───── */
.light-no-match {
  display: none;
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 0.95rem;
}

.light-no-match.is-visible {
  display: block;
}

/* ── Dark mode overrides ─────────────────── */
html[data-theme="dark"] .light-page {
  background: var(--surface-page);
}

html[data-theme="dark"] .light-toolbar {
  background: var(--surface-page);
  border-color: var(--border-soft);
}

html[data-theme="dark"] .light-toolbar .search-box input,
html[data-theme="dark"] .light-view-select {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .light-toolbar .search-box input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

html[data-theme="dark"] .light-jump-link {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.75);
}

html[data-theme="dark"] .light-jump-link:hover {
  background: rgba(var(--brand-primary-rgb, 249 115 22) / 0.12);
  color: var(--brand-primary, #f97316);
}

html[data-theme="dark"] .light-page-title,
html[data-theme="dark"] .light-section-title,
html[data-theme="dark"] .light-hotel-link,
html[data-theme="dark"] .light-table td {
  color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .light-table th {
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .light-table td {
  border-color: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .light-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .light-subgroup {
  border-color: rgba(var(--brand-primary-rgb, 249 115 22) / 0.15);
}

html[data-theme="dark"] .light-subgroup-title {
  color: rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] .light-footer {
  border-color: rgba(255, 255, 255, 0.08);
}

/* ── Print styles ────────────────────────── */
@media print {
  .light-toolbar,
  .light-destinations,
  .light-back,
  solana-navbar {
    display: none !important;
  }

  .light-section {
    break-inside: avoid;
  }

  .light-section[open] summary ~ * {
    break-inside: avoid;
  }
}

/* ── Responsive adjustments ──────────────── */
@media (max-width: 640px) {
  .light-toolbar {
    padding: 10px 16px;
  }

  .light-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .light-section-title {
    font-size: 1rem;
  }

  .light-table {
    font-size: 0.84rem;
  }
}
