/* Virginia Headwaters Council — Units datastore
 * Single unit, council-wide archive, and shortcode listings.
 */

/* ---- Listings ---------------------------------------------------------- */
.vahc-units-listing {
    margin: 2rem 0;
}

.vahc-units-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: end;
    padding: 1rem 1.25rem;
    background: #f6f7f8;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.vahc-units-filters label {
    display: flex;
    flex-direction: column;
    font-size: 0.875rem;
}

.vahc-filter-label {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #4a5159;
}

.vahc-units-filters select,
.vahc-units-filters input[type="search"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid #c9cdd2;
    border-radius: 6px;
    font: inherit;
    background: #fff;
}

.vahc-units-filters .vahc-filter-search {
    grid-column: span 2;
    min-width: 0;
}

.vahc-units-count {
    margin: 0;
    font-size: 0.875rem;
    color: #5a6168;
    align-self: center;
    white-space: nowrap;
}

.vahc-units-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.vahc-units-empty {
    grid-column: 1 / -1;
    padding: 2rem;
    text-align: center;
    color: #6c747c;
    background: #f6f7f8;
    border-radius: 8px;
}

/* ---- Card ------------------------------------------------------------- */
.vahc-unit-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 150ms ease, transform 150ms ease;
}

.vahc-unit-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.vahc-unit-card.is-hidden {
    display: none;
}

.vahc-unit-card-media {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e9edf1;
    display: block;
}

.vahc-unit-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Program-default art is offset downward in the source so it reads centered on
   the detail-page hero (under the nav). Cards show the full image height, so that
   offset reads low here — crop ~10% off the top to recenter. Real unit photos
   (no .is-default-art) are untouched. */
.vahc-unit-card-media img.is-default-art {
    transform: scale(1.11);
    transform-origin: center bottom;
}

.vahc-unit-card-media-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #4f6da3, #2d4373);
}

.vahc-unit-card-body {
    padding: 1rem 1.125rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.vahc-unit-card-header {
    margin: 0;
}

.vahc-unit-card-title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.2;
}

.vahc-unit-card-title a {
    color: #1a2233;
    text-decoration: none;
}

.vahc-unit-card-title a:hover {
    text-decoration: underline;
}

.vahc-unit-card-program {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #5a6168;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.vahc-unit-card-facts {
    margin: 0;
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

.vahc-unit-card-facts dt {
    color: #6c747c;
    font-weight: 600;
}

.vahc-unit-card-facts dd {
    margin: 0;
    color: #2a323d;
}

.vahc-unit-card-footer {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.vahc-unit-card-link {
    font-weight: 600;
    text-decoration: none;
}

.vahc-unit-card-ext {
    font-size: 0.875rem;
    color: #5a6168;
    text-decoration: none;
}

.vahc-unit-card-ext::before { content: '·'; margin-right: 0.5rem; color: #c0c5cc; }

/* ---- Single unit ------------------------------------------------------ */
.vahc-unit-single {
    margin-top: 0;
    margin-bottom: 3rem;
}

/* 2× the standard 250px hero. We share .hero_inner so typography (title,
   breadcrumb) inherits, but override the theme's `height: 250px !important`
   with higher specificity (element + two classes). */
section.hero_inner.vahc-unit-hero {
    height: 500px !important;
    min-height: 500px;
    position: relative;
    display: block;
    overflow: hidden;
}
section.hero_inner.vahc-unit-hero .hero_bg {
    height: 100% !important;
    z-index: 0;
}
section.hero_inner.vahc-unit-hero .container._lg {
    height: 100%;
    display: flex;
    align-items: flex-end;
    position: relative;
    z-index: 2;
}
section.hero_inner.vahc-unit-hero .hero_content {
    height: auto !important;
    width: 100%;
    padding: 0;
    color: #fff;
}
section.hero_inner.vahc-unit-hero .hero_title {
    color: #fff;
    margin: 0.25rem;
    padding-bottom: 0;
}

/* Subtitle line — same trade-gothic-compressed font as .breadcrumb. The
   theme's `.breadcrumb a::after` auto-appends » to anchors, so we wrap
   the subtitle in a <span> (no » suffix). */
section.hero_inner.vahc-unit-hero .vahc-unit-hero-sub {
    margin: 0;
    font-size: 20px;
    opacity: 0.95;
}

/* Background image fills the section. */
.vahc-unit-hero-bg {
    background: #1a2233; /* fallback color when no image */
}
.vahc-unit-hero-bg img {
    object-fit: cover;
    object-position: center;
}

/* Custom gradient: transparent → 60% black, 15° clockwise (darker lower-left).
   Sits ABOVE the image but BELOW the text via z-index. */
.vahc-unit-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(195deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Quick facts */
.vahc-unit-quick-facts {
    background: #f6f7f8;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.vahc-unit-quick-facts dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem 1.5rem;
    margin: 0;
}

.vahc-unit-quick-facts div { margin: 0; }
.vahc-unit-quick-facts dt {
    margin: 0 0 0.125rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c747c;
    font-weight: 600;
}
.vahc-unit-quick-facts dd { margin: 0; }

/* Leaders */
.vahc-unit-leaders { margin: 2rem 0; }
.vahc-unit-leaders h2 { margin: 0 0 1rem; }

.vahc-unit-leaders-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.vahc-unit-leader {
    background: #fff;
    border: 1px solid #e3e6ea;
    border-radius: 8px;
    padding: 1rem;
}

.vahc-unit-leader-name {
    margin: 0;
    font-weight: 700;
    font-size: 1.0625rem;
}

.vahc-unit-leader-position {
    margin: 0.25rem 0 0.5rem;
    font-size: 0.875rem;
    color: #5a6168;
}

.vahc-unit-leader-contact {
    margin: 0;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.vahc-unit-leader-contact a { word-break: break-all; }

/* Notes / language toggle */
.vahc-unit-notes { margin: 2rem 0; }
.vahc-unit-notes-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid #e3e6ea;
    margin-bottom: 1rem;
}
.vahc-unit-notes-tab {
    background: none;
    border: 0;
    padding: 0.5rem 0.75rem;
    font: inherit;
    font-weight: 600;
    color: #6c747c;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.vahc-unit-notes-tab.is-active {
    color: #1a2233;
    border-bottom-color: #2d4373;
}
.vahc-unit-notes-body.is-hidden { display: none; }

/* Photos */
.vahc-unit-photos { margin: 2rem 0; }
.vahc-unit-photos h2 { margin: 0 0 1rem; }
.vahc-unit-photos-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}
.vahc-unit-photos-grid figure { margin: 0; }
.vahc-unit-photos-grid img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}
.vahc-unit-photos-grid figcaption {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: #5a6168;
}
.vahc-photo-credit {
    display: block;
    color: #8a9099;
    font-style: italic;
}

/* Archive */
.vahc-units-archive-header { margin-bottom: 1.5rem; }
.vahc-units-archive-intro { color: #5a6168; max-width: 60ch; }

/* Table mode — matches the existing Monticello "unit-list" table styling. */
.vahc-units-table-wrap {
    overflow-x: auto;
}
.vahc-units-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.vahc-units-table thead {
    background: rgb(81, 83, 84);
}
.vahc-units-table thead th {
    text-align: center;
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    padding: 7px 14px;
    border: 0;
    font-family: "trade-gothic-next-compressed", "Avenir", "Helvetica Neue", Helvetica, "Arial Narrow", sans-serif;
    letter-spacing: 0;
}
.vahc-units-table tbody th,
.vahc-units-table tbody td {
    padding: 6.5px 13px;
    text-align: center;
    font-size: 13px;
    color: #222;
    border: 0;
    vertical-align: middle;
}
.vahc-units-table tbody tr:nth-child(even) th,
.vahc-units-table tbody tr:nth-child(even) td {
    background: rgb(233, 233, 228);
}
.vahc-unit-row.is-hidden { display: none; }
.vahc-unit-row-name { font-weight: 400; }
.vahc-unit-row-name a {
    color: #1a4179;
    text-decoration: underline;
}
.vahc-unit-row-name a:hover { text-decoration: none; }
.vahc-unit-row-details a { color: #1a4179; text-decoration: underline; }
.vahc-unit-row-details a:hover { text-decoration: none; }
.vahc-units-table .vahc-units-empty { padding: 2rem; text-align: center; }

/* CTAs (Apply / BeAScout) — Apply Now uses brand camp green ($venturing-green).
   Selectors are pinned with !important on color because theme link rules
   (red site-wide brand color) otherwise win the cascade. */
.vahc-unit-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 0 0 1.25rem; }
.vahc-unit-body aside .vahc-unit-cta { flex-direction: column; }
.vahc-unit-body aside .vahc-unit-cta > a { text-align: center; }
.vahc-unit-cta-primary,
.vahc-unit-cta-secondary {
    display: inline-block;
    padding: 0.7rem 1.25rem;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}
.vahc-unit-cta a.vahc-unit-cta-primary,
.vahc-unit-cta a.vahc-unit-cta-primary:link,
.vahc-unit-cta a.vahc-unit-cta-primary:visited {
    background: #006b3f;
    color: #fff !important;
}
.vahc-unit-cta a.vahc-unit-cta-primary:hover,
.vahc-unit-cta a.vahc-unit-cta-primary:focus {
    background: #00532f;
    color: #fff !important;
}
.vahc-unit-cta a.vahc-unit-cta-secondary,
.vahc-unit-cta a.vahc-unit-cta-secondary:link,
.vahc-unit-cta a.vahc-unit-cta-secondary:visited {
    background: #fff;
    color: #295135 !important;
    border: 2px solid #295135;
}
.vahc-unit-cta a.vahc-unit-cta-secondary:hover {
    background: #eef3ee;
    color: #295135 !important;
}

/* Body + sidebar layout for the single unit page. */
.vahc-unit-body {
    margin-top: 2rem;
}
@media (min-width: 920px) {
    .vahc-unit-body {
        flex-direction: row !important;
    }
    .vahc-unit-body article {
        width: 66% !important;
        padding-right: 2rem !important;
    }
    .vahc-unit-body aside {
        width: 34% !important;
        padding-left: 1rem !important;
    }
}
.vahc-unit-body aside .vahc-unit-map-section { margin: 0; }
.vahc-unit-body aside .vahc-unit-map { height: 320px; }

/* Map */
.vahc-unit-map-section { margin: 2rem 0; }
.vahc-unit-map-section h2 { margin: 0 0 1rem; }
.vahc-unit-map {
    width: 100%;
    height: 380px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e3e6ea;
}
.vahc-map-subtitle { color: #6c747c; font-size: 0.875rem; }

/* Find a unit */
.vahc-find-a-unit { margin: 2rem 0; }
.vahc-find-form {
    background: #f6f7f8;
    border: 1px solid #e3e6ea;
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
}
.vahc-find-fields {
    display: grid;
    grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(120px, 1fr)) auto;
    gap: 1rem;
    align-items: end;
}
@media (max-width: 720px) {
    .vahc-find-fields { grid-template-columns: 1fr 1fr; }
    .vahc-find-fields .vahc-find-address { grid-column: 1 / -1; }
}
.vahc-find-fields label { display: flex; flex-direction: column; font-size: 0.875rem; }
.vahc-find-fields select,
.vahc-find-fields input[type="text"] {
    padding: 0.55rem 0.75rem;
    border: 1px solid #c9cdd2;
    border-radius: 6px;
    font: inherit;
    background: #fff;
}
.vahc-find-submit {
    padding: 0.6rem 1.25rem;
    border: 0;
    border-radius: 6px;
    background: #2d4373;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}
.vahc-find-submit:hover { background: #1f3057; }
.vahc-find-error {
    background: #fff3f0;
    border-left: 4px solid #d93025;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    color: #5e1410;
}
.vahc-find-empty { color: #5a6168; }
.vahc-find-summary { color: #4a5159; margin: 1rem 0; }
.vahc-find-map { height: 380px; margin-bottom: 1.5rem; }
.vahc-find-result { position: relative; }
.vahc-find-distance {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #2d4373;
    color: #fff;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}
