/* Facility-specific styles — extends styles.css */

/* Breadcrumb */
.breadcrumb {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 10px 0;
}
.breadcrumb a { color: var(--teal); display: inline-block; padding: 8px 0; }
.breadcrumb span { color: var(--text-muted); }

/* Facility hero */
.facility-hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 30px 0;
}
.facility-hero .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
}
.facility-hero-left h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 10px; }
.facility-address, .facility-phone {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 4px 0;
}
.facility-address i, .facility-phone i { color: var(--teal); margin-right: 6px; }
.facility-phone a { color: var(--teal); }
.facility-meta { font-size: 0.9rem; color: var(--text-muted); margin-top: 10px; line-height: 1.6; }

/* Overall rating badge */
.overall-rating-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  padding: 10px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 4px solid var(--border);
  background: #fff;
  flex-shrink: 0;
  text-align: center;
}
.overall-rating-badge.badge-good { border-color: var(--teal); background: var(--cyan-light); }
.overall-rating-badge.badge-avg  { border-color: var(--lime); background: #f7faed; }
.overall-rating-badge.badge-poor { border-color: #e05252; background: #fdf4f4; }
.overall-num { font-size: 2.4rem; font-weight: 700; line-height: 1; color: var(--text); }
.overall-label { font-size: 0.7rem; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 4px 0 3px; }
.overall-stars { font-size: 0.8rem; color: #f4c430; letter-spacing: 1px; line-height: 1; }

/* Facility body — grid layout set in Feature 3 section below */

/* Alert blocks */
.alert-block {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  font-size: 0.95rem;
}
.alert-block i { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.alert-warn    { background: #fffbe8; border: 1px solid #f0c040; color: #7a5f00; }
.alert-warn i  { color: #e8a800; }
.alert-danger  { background: #fff4f4; border: 1px solid #f0a0a0; color: #8b1a1a; }
.alert-danger i{ color: #e05252; }

/* SLA badge */
.sla-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 14px;
  background: var(--cyan-light);
  border: 2px solid var(--teal);
}
.sla-badge i { font-size: 1.5rem; color: var(--teal); flex-shrink: 0; }
.sla-badge strong { display: block; color: var(--teal-darker); margin-bottom: 2px; }
.sla-badge span { font-size: 0.9rem; color: var(--text-muted); }
.sla-badge--unenrolled { background: var(--bg-alt); border-color: var(--border); }
.sla-badge--unenrolled i { color: var(--text-muted); }
.sla-badge--unenrolled strong { color: var(--text-muted); }

/* Sections */
.facility-section {
  margin: 30px 0;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}
.facility-section:first-child { border-top: 0; padding-top: 0; }
.facility-section h2 { font-size: 1.3rem; margin-bottom: 6px; }
.section-note { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }

/* Ratings grid */
.ratings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 620px) { .ratings-grid { grid-template-columns: repeat(2,1fr); } }
.rating-item {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 1px solid var(--border);
}
.rating-label { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 6px; }
.rating-stars { font-size: 1.3rem; letter-spacing: 2px; }
.rating-stars span { font-size: 0.85rem; color: var(--text-muted); margin-left: 4px; }
.stars-5 { color: #2a9d2a; }
.stars-4 { color: var(--teal); }
.stars-3 { color: var(--lime-dark); }
.stars-2 { color: #e07800; }
.stars-1 { color: #e05252; }
.no-data { color: var(--text-muted); font-size: 0.9rem; font-style: italic; }

/* Metrics grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.metric-card {
  background: var(--bg-alt);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  text-align: center;
}
.metric-value { font-size: 1.6rem; font-weight: 600; color: var(--teal-darker); line-height: 1.2; }
.metric-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; line-height: 1.35; }

/* Turnover */
.turnover-rows { display: flex; flex-direction: column; gap: 16px; }
.turnover-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  align-items: center;
  gap: 14px;
}
@media (max-width: 560px) { .turnover-row { grid-template-columns: 1fr; } }
.turnover-label { font-size: 0.95rem; font-weight: 500; }
.turnover-bar { position: relative; background: #e8eaea; border-radius: 20px; height: 20px; overflow: hidden; display: flex; align-items: center; }
.turnover-fill { height: 100%; border-radius: 20px; transition: width 0.4s ease; }
.bar-good { background: var(--teal); }
.bar-avg  { background: var(--lime-dark); }
.bar-poor { background: #e05252; }
.turnover-bar span { position: absolute; right: 10px; font-size: 0.8rem; font-weight: 600; color: var(--text); }
.turnover-count { font-size: 0.95rem; color: var(--text-muted); }

/* About grid */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px 24px;
}
.about-grid strong { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 4px; }
.about-grid p { margin: 0; font-size: 0.95rem; }

/* Facility form section */
.facility-form-section { background: var(--bg-alt); border-radius: var(--radius); padding: 30px; border: 1px solid var(--border); }
.facility-form-wrap h2 { margin-bottom: 8px; }
.facility-form-wrap p { color: var(--text-muted); margin-bottom: 20px; }

/* Nearby */
.nearby-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
@media (max-width: 700px) { .nearby-grid { grid-template-columns: 1fr; } }
.nearby-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s ease;
}
.nearby-card:hover { box-shadow: var(--shadow); }
.nearby-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 6px; }
.nearby-meta { font-size: 0.85rem; color: var(--text-muted); }
.stars-sm { color: #f4c430; }

/* State page */
.state-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 36px;
}
@media (max-width: 620px) { .state-stats { grid-template-columns: repeat(2,1fr); } }
.stat-card { background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 600; color: var(--teal-darker); }
.stat-label { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* minmax(0, ...) so a wide table scrolls inside its column instead of
   stretching the whole page past a phone's width. */
.state-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 30px; align-items: start; }
.state-body > * { min-width: 0; }
.state-body > div { overflow-x: auto; }
@media (max-width: 760px) { .state-body { grid-template-columns: minmax(0, 1fr); } }
.county-list h3 { font-size: 1rem; margin-bottom: 10px; }
.county-list ul { list-style: none; padding: 0; margin: 0; }
.county-list li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; display: flex; justify-content: space-between; align-items: center; }
.county-list a { color: var(--teal); }
.count-badge { background: var(--teal); color: #fff; border-radius: 20px; padding: 2px 8px; font-size: 0.75rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
.facility-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.facility-table th { background: var(--bg-alt); padding: 10px 14px; text-align: left; font-weight: 600; border-bottom: 2px solid var(--border); white-space: nowrap; }
.facility-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.facility-table tr:hover td { background: #fafbfb; }
.facility-table a { color: var(--teal); }
.stars-cell { font-size: 1rem; letter-spacing: 1px; }
.stars-cell.badge-good { color: #2a9d2a; }
.stars-cell.badge-avg  { color: #8fb32a; }
.stars-cell.badge-poor { color: #e05252; }

/* Badges */
.badge { display: inline-block; font-size: 0.75rem; padding: 2px 8px; border-radius: 20px; margin-left: 8px; }
.badge-red    { background: #fde8e8; color: #b91c1c; }
.badge-yellow { background: #fef3c7; color: #92400e; }

/* ── Feature 1: Top Rated badge ───────────────────────────── */
.top-rated-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #f4c430 0%, #ffdd57 100%);
  color: #5c4900;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 14px;
  border-radius: 20px;
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.top-rated-badge i { font-size: 0.9rem; }

/* ── Feature 2: Enhanced form ─────────────────────────────── */
.trust-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px 0;
}
.trust-signals span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--teal-darker);
  font-weight: 500;
}
.trust-signals i { color: var(--teal); font-size: 0.95rem; }
.form-trust-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-trust-note i { color: var(--teal); }
.facility-form-section {
  border-top: 3px solid var(--teal) !important;
}

/* ── Feature 3: Advisor CTA sidebar ──────────────────────── */
.facility-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 30px;
  padding: 30px 20px 60px;
  max-width: 1300px;
  align-items: start;
}
.facility-main { min-width: 0; }
.facility-sidebar {
  position: sticky;
  top: 20px;
}
.advisor-cta {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.advisor-cta-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--cyan-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.advisor-cta-icon i { font-size: 1.4rem; color: var(--teal); }
.advisor-cta h3 { font-size: 1.1rem; margin-bottom: 6px; }
.advisor-cta p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 14px; }
.advisor-phone {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--teal-darker);
  text-decoration: none;
  margin-bottom: 16px;
}
.advisor-phone:hover { text-decoration: underline; }
.advisor-phone i { margin-right: 4px; }
.advisor-mini-form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 8px;
  font-family: inherit;
}
.advisor-mini-form input:focus { outline: 2px solid var(--teal); outline-offset: 1px; }
.advisor-mini-form button {
  width: 100%;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 11px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.advisor-mini-form button:hover { background: var(--teal-dark); }
.advisor-trust-line {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* Mobile: sidebar collapses under content */
@media (max-width: 900px) {
  .facility-body { grid-template-columns: 1fr; }
  .facility-sidebar { position: static; }
}

/* Floating mobile CTA */
/* .advisor-float moved to styles.css: it appears on every Lilisity page. */


/* ── Feature 4: Chain section ─────────────────────────────── */
.chain-info {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.chain-stat {
  text-align: center;
  flex-shrink: 0;
  min-width: 90px;
}
.chain-stat-num { font-size: 2rem; font-weight: 700; color: var(--teal-darker); line-height: 1; }
.chain-stat-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-top: 4px; }
.chain-detail p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 8px; }
.chain-link { color: var(--teal); font-weight: 600; font-size: 0.92rem; }
@media (max-width: 500px) { .chain-info { flex-direction: column; text-align: center; } }

/* ── Feature 4: POI grid ──────────────────────────────────── */
.poi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.poi-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  text-align: center;
  transition: box-shadow 0.2s, transform 0.2s;
}
.poi-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.poi-card i { font-size: 1.4rem; color: var(--teal); }
.poi-card span { font-size: 0.88rem; font-weight: 500; }
.poi-card--map { background: var(--cyan-light); border-color: var(--teal); }

/* FAQ accordion (site.js toggles .open) */
.faq-list .faq-item { border-bottom: 1px solid var(--border); }
.faq-list .faq-q {
  width: 100%; background: none; border: 0; padding: 14px 0; text-align: left;
  font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--text); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq-list .faq-q i { color: var(--text-muted); transition: transform 0.25s; flex-shrink: 0; }
.faq-list .faq-item.open .faq-q i { transform: rotate(180deg); }
.faq-list .faq-a { display: none; padding: 0 0 14px; color: var(--text-muted); line-height: 1.6; }
.faq-list .faq-item.open .faq-a { display: block; }
