/* ==========================================================================
   The hospitals page
   Its own address for the medical provider directory, so the menu can link to
   a page instead of an anchor half-way down the front page. Everything below
   the page heading is the same directory the front page shows.
   ========================================================================== */

.hospitals-page-head {
  padding: 2.1rem 0 0.2rem;
  text-align: center;
}

.hospitals-page-head h1 {
  margin: 0 0 0.6rem;
  color: var(--primary-navy, #013947);
  font-size: clamp(1.6rem, 3.6vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.hospitals-page-head p {
  max-width: 720px;
  margin: 0 auto;
  color: #55665c;
  font-size: clamp(0.9rem, 1.5vw, 1.03rem);
  line-height: 1.6;
}

.hospitals-page .provider-directory-section {
  padding-top: 0.6rem;
}

body[data-mobile="true"] .hospitals-page-head {
  padding: 1.2rem 0 0;
}

body[data-mobile="true"] .hospitals-page-head h1 {
  font-size: 1.45rem;
}

body[data-mobile="true"] .hospitals-page-head p {
  font-size: 0.85rem;
}

/* ==========================================================================
   Two ways into the directory
   The panel starts with a switch: find a hospital and then the insurers and
   plans that list it, or walk County -> Insurer -> Medical Plan the way the
   front page always has. Both views live in the same panel and only one is
   shown at a time; js/providers.js flips the switch and the blocks below.
   ========================================================================== */

/* The blocks below are shown and hidden with the [hidden] attribute, and the
   directory's own rules set display on them (.directory-grid is a grid,
   .directory-status is a flex row), which would otherwise beat the browser's
   plain [hidden] style and leave both views on screen at once. */

#providers .directory-grid[hidden],
#providers .directory-results[hidden],
#providers .directory-status[hidden],
#providers .directory-hospital-detail[hidden] {
  display: none !important;
}

.directory-mode-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.1rem;
}

.directory-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.05rem;
  border: 1px solid #d7dfe7;
  border-radius: 999px;
  background: #fff;
  color: #2f4f52;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.directory-mode-btn i {
  font-size: 0.85em;
}

.directory-mode-btn:hover,
.directory-mode-btn:focus-visible {
  border-color: #2b676a;
  color: #173a3c;
  outline: none;
  box-shadow: 0 6px 16px rgba(1, 57, 71, 0.08);
}

.directory-mode-btn.is-active {
  background: #01545f;
  border-color: #01545f;
  color: #fff;
  box-shadow: 0 8px 20px rgba(1, 57, 71, 0.18);
}

/* The hospital fields sit in the same three-column grid as the plan fields,
   but the third one keeps its own column instead of spanning the row. */

.directory-hospital-grid > div:last-child {
  grid-column: auto;
}

.directory-hospital-grid .directory-hospital-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.directory-hospital-grid .directory-hospital-field > label {
  margin-bottom: 0;
}

.directory-hospital-grid .directory-hospital-field > select,
.directory-hospital-grid .directory-hospital-field > input {
  width: 100%;
  min-width: 0;
}

/* --- one result, one facility -------------------------------------------- */

.directory-facility-card {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.directory-facility-card:focus-visible {
  outline: 3px solid #2f8a8f;
  outline-offset: 2px;
}

.directory-facility-kind {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: #e8f5f4;
  color: #136a68;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.directory-facility-card .directory-facility-kind {
  margin-bottom: 0.5rem;
}

.directory-facility-open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  color: #1f5c5f;
  font-size: 0.8rem;
  font-weight: 800;
}

.directory-facility-cover strong {
  color: #013947;
}

/* --- the insurers and plans behind the facility --------------------------- */

.directory-hospital-detail {
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px solid #e2e9e9;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(1, 57, 71, 0.07);
}

.directory-facility-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid #d7dfe7;
  border-radius: 999px;
  background: #fff;
  color: #2f4f52;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s;
}

.directory-facility-back:hover,
.directory-facility-back:focus-visible {
  border-color: #2b676a;
  color: #173a3c;
  outline: none;
  box-shadow: 0 6px 16px rgba(1, 57, 71, 0.08);
}

.directory-facility-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.directory-facility-head h3 {
  margin: 0;
  color: #173a3c;
  font-size: 1.15rem;
}

.directory-hospital-detail .meta {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0 0 0.35rem;
  color: #3c5b52;
  font-size: 0.88rem;
}

.directory-hospital-detail .meta > i {
  flex: 0 0 1rem;
  width: 1rem;
  margin-top: 0.18rem;
  text-align: center;
  color: #2b676a;
}

.directory-hospital-detail .meta > a {
  color: #1f5c5f;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.directory-facility-summary {
  margin: 0.85rem 0 0;
  color: #3c5b52;
  font-size: 0.88rem;
  line-height: 1.5;
}

.directory-facility-summary strong {
  color: #013947;
}

.directory-insurer-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.directory-insurer-block {
  padding: 0.85rem 0.95rem;
  border: 1px solid #e3ecec;
  border-radius: 14px;
  background: #f8fbfb;
}

.directory-insurer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.directory-insurer-name {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: #013947;
  font-size: 0.95rem;
  font-weight: 800;
}

.directory-insurer-count {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #e6f4f4;
  color: #557065;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.directory-plan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.directory-plan-chip,
.directory-plan-more {
  max-width: 100%;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: 0.16s;
}

.directory-plan-chip {
  border: 1px solid #cfe3e3;
  background: #fff;
  color: #1f5c5f;
}

.directory-plan-chip:hover,
.directory-plan-chip:focus-visible {
  border-color: #2b676a;
  background: #eaf7f6;
  color: #013947;
  outline: none;
}

.directory-plan-more {
  border: 1px dashed #b9d2d2;
  background: transparent;
  color: #2f6f70;
  font-weight: 700;
}

.directory-plan-more:hover,
.directory-plan-more:focus-visible {
  border-style: solid;
  border-color: #2b676a;
  color: #013947;
  outline: none;
}

.directory-facility-note {
  margin: 0.9rem 0 0;
  color: #718078;
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .directory-insurer-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .directory-mode-switch {
    width: 100%;
  }

  .directory-mode-btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}
