@charset "utf-8";

/* =====================================================================
   Elevation Certificates — browse-by-year archive
   Rendered by Views/Partials/Flooding/_ElevationCertificates.cshtml.
   Every colour is a county token, so the component follows the section
   palette. All text pairings are >= 4.5:1 against their backgrounds.

   NOTE: controls/control.css sets `* { display: flex }` sitewide, so flex
   containers need no display declaration here — only elements that must
   NOT be flex (grid / block) declare one.
   ===================================================================== */

.ec-app {
  --ec-gap: 1.25rem;
  --ec-radius: 10px;
  --ec-line: 1px solid var(--gray-lt);
  flex-direction: column;
  margin-top: 2rem;
}

/* ---------- Lead copy ---------- */
.ec-lead {
  flex-direction: column;
  max-width: 62ch;
  margin-bottom: 2.5rem;
}

.ec-lead p {
  margin: 0 0 1rem;
  line-height: 1.6;
}

.ec-lead p:last-child {
  margin-bottom: 0;
}

/* ---------- Year accordion ---------- */
.ec-accordion {
  flex-direction: column;
  gap: 0.85rem;
}

/* each year is a native <details> so open/close needs no JS */
details.ec-yr {
  flex-direction: column;
  border: 1px solid var(--gray-lt);
  border-radius: var(--ec-radius);
  background: var(--lightest);
  overflow: hidden;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

details.ec-yr[open] {
  box-shadow: var(--float-close);
  border-color: var(--blue-3);
}

summary.ec-yr-head {
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.35rem;
  cursor: pointer;
  background: var(--blue-1);
  list-style: none;
  user-select: none;
  transition: background 0.12s ease;
}

summary.ec-yr-head::-webkit-details-marker { display: none; }
summary.ec-yr-head::marker { content: ""; }

summary.ec-yr-head:hover { background: var(--blue-2); }

/* Keyboard focus. details.ec-yr clips its overflow to keep the header corners
   rounded, which would cut off an outward ring, so this one is drawn inset.
   --color-6 on --blue-1 is 4.38:1 (3.66:1 while hovered) — both clear the 3:1
   minimum for a focus indicator. */
summary.ec-yr-head:focus-visible {
  outline: 3px solid var(--color-6);
  outline-offset: -3px;
}

details.ec-yr[open] summary.ec-yr-head {
  border-bottom: 1px solid var(--blue-2);
}

/* left block groups the year + subtitle vertically, and takes the row */
.ec-yr-label {
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.ec-yr-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--color-7);
  letter-spacing: -0.01em;
  line-height: 1.1;
}

/* header sits on --blue-1 (--blue-2 on hover), where --gray-med falls to
   4.19:1 / 3.50:1 — --gray-dark keeps it at 9.75:1 or better */
.ec-yr-sub {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-dark);
  margin-top: 0.15rem;
}

/* count pill on the right */
.ec-yr-count {
  flex: 0 0 auto;
  align-items: center;
  background: var(--color-6);
  color: var(--lightest);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--circle);
  padding: 0.25rem 0.8rem;
}

.ec-yr-chevron {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--color-6);
  transition: transform 0.18s ease;
}

details.ec-yr[open] .ec-yr-chevron { transform: rotate(180deg); }

.ec-yr-panel {
  flex-direction: column;
  padding: 1.35rem;
}

/* ---------- Certificate cards ---------- */
.ec-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(275px, 1fr));
  gap: var(--ec-gap);
}

.ec-app a.ec-card {
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  text-decoration: none;
  background: var(--lightest);
  border: var(--ec-line);
  border-radius: var(--ec-radius);
  padding: 0.9rem 1rem;
  color: var(--contrast);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.ec-app a.ec-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--float-close);
  border-color: var(--blue-3);
}

.ec-app a.ec-card:focus-visible {
  outline: 3px solid var(--color-6);
  outline-offset: 2px;
}

.ec-card-badge {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--lightest);
}

/* type badges — county blue family, all keeping AA contrast with white text */
.ec-badge-ECERT       { background: var(--color-6); }
.ec-badge-VENT        { background: var(--color-7); }
.ec-badge-VCERT       { background: var(--blue-8); }
.ec-badge-FLOODPROOF  { background: var(--blue-8); }
.ec-badge-NOIMPACT    { background: var(--gray-dark); }
.ec-badge-OTHER       { background: var(--gray-dark); }

.ec-card-body {
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 0.1rem;
}

.ec-card-permit {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--color-7);
}

.ec-card-type {
  display: block;            /* ellipsis needs a non-flex box */
  font-size: 0.82rem;
  color: var(--gray-med);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ec-card-meta {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  color: var(--gray-med);
}

/* fallback sizing if the icon lib doesn't copy classes onto the <svg> */
.ec-card-meta svg { width: 18px; height: 18px; }

.ec-card-meta .ec-dl {
  width: 18px;
  height: 18px;
  color: var(--color-6);
}

/* ---------- Help / request callout ---------- */
.ec-help {
  gap: 1.25rem;
  align-items: flex-start;
  margin-top: 3rem;
  padding: 1.75rem;
  border-radius: var(--ec-radius);
  background: linear-gradient(130deg, var(--color-7) 0%, var(--color-8) 100%);
  color: var(--lightest);
}

.ec-help-body {
  flex-direction: column;
}

.ec-help-icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: var(--circle);
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
}

.ec-help-icon svg {
  width: 26px;
  height: 26px;
  color: var(--lightest);
}

.ec-help h3 {
  margin: 0 0 0.4rem;
  color: var(--lightest);
  font-size: 1.3rem;
}

.ec-help p {
  margin: 0 0 1rem;
  line-height: 1.55;
  color: var(--blue-1);
  max-width: 62ch;
}

.ec-help-actions {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.ec-app a.ec-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--circle);
  transition: transform 0.12s ease, background 0.12s ease;
}

.ec-app a.ec-btn svg {
  width: 17px;
  height: 17px;
}

.ec-btn-solid {
  background: var(--lightest);
  color: var(--color-7);
}

.ec-btn-solid:hover {
  transform: translateY(-1px);
}

.ec-btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: var(--lightest);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}

/* 0.22 alpha lightened the panel enough to drop white label text to 4.50:1
   against the gradient's light end; 0.20 holds 4.71:1 with the same lift. */
.ec-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ---------- Responsive ---------- */
@media screen and (max-width: 520px) {
  .ec-yr-title { font-size: 1.2rem; }

  summary.ec-yr-head { padding: 0.85rem 1rem; }

  .ec-help {
    flex-direction: column;
    gap: 1rem;
  }
}
