/* ==========================================================
   CITY CONTACT DIRECTORY - PUBLIC v2.2.0
   Mockup-matched municipal presentation.
   ========================================================== */

.ccd-directory {
    --ccd-navy: #073b69;
    --ccd-dark: #062b4c;
    --ccd-accent: #0b5f9e;
    --ccd-pale: #eef6fc;
    --ccd-line: #c9ddec;
    --ccd-focus: #ffdd00;
    --ccd-card-bg: #ffffff;

    position: relative;

    width: min(1400px, calc(100vw - 32px));
    max-width: none;

    margin: 20px 0 52px;
    margin-left: 50%;
    transform: translateX(-50%);

    color: #17324c;
}

.ccd-directory *,
.ccd-directory *::before,
.ccd-directory *::after {
    box-sizing: border-box;
}

.ccd-theme-public-works {
    --ccd-navy: #6e520d;
    --ccd-dark: #453208;
    --ccd-accent: #8b6811;
    --ccd-pale: #fff7dc;
}

.ccd-theme-fire {
    --ccd-navy: #8b2020;
    --ccd-dark: #5b1212;
    --ccd-accent: #aa2c2c;
    --ccd-pale: #fff0ee;
}

.ccd-theme-police {
    --ccd-navy: #173a5b;
    --ccd-dark: #0d263d;
    --ccd-accent: #245c8f;
    --ccd-pale: #edf5fb;
}

.ccd-theme-rescue {
    --ccd-navy: #0f5a55;
    --ccd-dark: #0a3d39;
    --ccd-accent: #14736b;
    --ccd-pale: #edf9f7;
}


/* ==========================================================
   HERO
   ========================================================== */

.ccd-hero {
    position: relative;

    min-height: 390px;

    overflow: hidden;

    display: flex;
    align-items: center;

    border-radius: 22px 22px 0 0;

    background-image: var(--ccd-hero);
    background-size: cover;
    background-position: center;

    box-shadow: 0 14px 35px rgba(5, 42, 72, .14);
}

.ccd-hero-shade {
    position: absolute;
    inset: 0;

    background:
        linear-gradient(
            90deg,
            rgba(3, 39, 67, .93) 0%,
            rgba(3, 39, 67, .72) 40%,
            rgba(3, 39, 67, .27) 72%,
            rgba(3, 39, 67, .08) 100%
        );
}

.ccd-hero-copy {
    position: relative;
    z-index: 1;

    width: min(850px, 72%);

    padding: 48px 56px;

    color: #fff;
}

.ccd-eyebrow {
    margin: 0 0 12px;

    color: #fff;

    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ccd-hero-copy h1 {
    margin: 0;

    color: #fff;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.9rem, 5.7vw, 5.2rem);
    line-height: .98;
    letter-spacing: -.035em;
}

.ccd-hero-tagline {
    margin: 10px 0 8px;

    color: #fff;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.65rem, 3vw, 2.55rem);
    font-weight: 700;
    line-height: 1.1;
}

.ccd-hero-intro {
    max-width: 740px;

    margin: 0;

    color: #fff;

    font-size: 1.08rem;
    line-height: 1.55;
}


/* ==========================================================
   INFORMATION BAR
   ========================================================== */

.ccd-info-bar {
    position: relative;
    z-index: 2;

    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    margin: -4px 24px 0;

    overflow: hidden;

    border: 1px solid var(--ccd-line);
    border-radius: 0 0 16px 16px;

    background: rgba(255,255,255,.98);

    box-shadow: 0 10px 26px rgba(5, 42, 72, .07);
}

.ccd-info-block {
    display: grid;
    grid-template-columns: 56px 1fr;
    gap: 14px;
    align-items: center;

    min-height: 108px;

    padding: 18px 22px;

    border-right: 1px solid #d8e5ef;

    color: #113d66;
    text-decoration: none;
}

.ccd-info-block:last-child {
    border-right: 0;
}

.ccd-info-icon {
    display: grid;
    place-items: center;

    width: 52px;
    height: 52px;

    border-radius: 50%;

    background: linear-gradient(145deg, #0f67aa, #063e72);

    color: #fff;

    font-size: 1.55rem;
    font-weight: 700;
}

.ccd-info-block strong,
.ccd-info-block span,
.ccd-info-block small {
    display: block;
}

.ccd-info-block strong {
    margin-bottom: 3px;

    color: #0a3d6d;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
}

.ccd-info-block span {
    color: #17324c;
    line-height: 1.35;
}

.ccd-info-block small {
    margin-top: 3px;

    color: #5a6f82;
}


/* ==========================================================
   NOTICE
   ========================================================== */

.ccd-notice {
    display: grid;
    gap: 4px;

    margin: 18px 24px 0;
    padding: 15px 18px;

    border-left: 5px solid var(--ccd-navy);
    border-radius: 8px;

    background: var(--ccd-pale);
}


/* ==========================================================
   SEARCH + HELP
   ========================================================== */

.ccd-search-help-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 290px;
    gap: 16px;

    margin: 30px 24px 0;
}

.ccd-search-area {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr) 140px;
    align-items: center;

    min-height: 76px;

    overflow: hidden;

    border: 1px solid #d6e5f0;
    border-radius: 14px;

    background: linear-gradient(90deg, #edf7fd 0%, #fff 70%);

    box-shadow: 0 8px 20px rgba(5,42,72,.04);
}

.ccd-search-icon {
    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    margin-left: 10px;

    border-radius: 9px;

    background: linear-gradient(145deg, #176dad, #084577);

    color: #fff;

    font-size: 1.7rem;
}

.ccd-search-label {
    display: block;
}

.ccd-search {
    width: 100%;
    min-height: 54px;

    padding: 12px 15px;

    border: 0 !important;
    border-radius: 0 !important;

    background: transparent !important;

    color: #17324c;

    font-size: 1rem;
    box-shadow: none !important;
}

.ccd-search-button {
    min-height: 52px;

    margin-right: 8px;
    padding: 0 24px;

    border: 0;
    border-radius: 8px;

    background: linear-gradient(180deg, #0d5793, #063d70);

    color: #fff;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;
}

.ccd-quick-help {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 13px;
    align-items: center;

    padding: 14px 18px;

    border: 1px solid #d6e5f0;
    border-radius: 14px;

    background: #edf7fd;
}

.ccd-quick-help-icon {
    display: grid;
    place-items: center;

    width: 48px;
    height: 48px;

    border-radius: 50%;

    background: #d9edfb;

    color: #0b5791;

    font-size: 1.45rem;
}

.ccd-quick-help strong,
.ccd-quick-help span {
    display: block;
}

.ccd-quick-help strong {
    margin-bottom: 3px;

    color: #0a3d6d;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.05rem;
}

.ccd-quick-help span {
    color: #36546e;
    line-height: 1.35;
}

.ccd-results-status {
    min-height: 1.5em;

    margin: 8px 24px 0;

    color: #536b7f;
}


/* ==========================================================
   FEATURED CONTACTS
   ========================================================== */

.ccd-featured-section {
    margin: 18px 24px 36px;
}

.ccd-section-heading-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;

    margin-bottom: 16px;
}

.ccd-section-heading-row h2 {
    margin: 0;

    color: #0b3e6c;

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1;
}

.ccd-section-heading-row p {
    max-width: 780px;

    margin: 5px 0 0;

    color: #405b74;
}

.ccd-section-kicker {
    margin: 0 0 4px !important;

    color: #0d5793 !important;

    font-size: .78rem !important;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.ccd-view-departments {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    min-height: 44px;

    padding: 8px 15px;

    border: 1px solid #0f5892;
    border-radius: 7px;

    color: #0a3f70;
    text-decoration: none;

    font-family: Georgia, "Times New Roman", serif;
    font-weight: 700;

    white-space: nowrap;
}

.ccd-featured-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}


/* ==========================================================
   DEPARTMENT NAVIGATION
   ========================================================== */

.ccd-department-directory-anchor {
    scroll-margin-top: 120px;
}

.ccd-dept-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;

    margin: 8px 24px 28px;
    padding-top: 12px;

    border-top: 1px solid #e0eaf1;
}

.ccd-dept-nav a {
    display: inline-flex;
    align-items: center;

    min-height: 42px;

    padding: 8px 14px;

    border: 1px solid #cfe1ee;
    border-radius: 999px;

    background: #edf6fc;

    color: #0a3f70;
    text-decoration: none;

    font-weight: 700;
}


/* ==========================================================
   DEPARTMENT SECTIONS + CARDS
   ========================================================== */

.ccd-section {
    margin: 34px 24px;
}

.ccd-section > h2 {
    margin: 0 0 16px;

    color: var(--ccd-dark);

    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 3.4vw, 2.75rem);
}

.ccd-leader-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 560px));
    gap: 18px;

    margin-bottom: 18px;
}

.ccd-staff-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.ccd-card {
    overflow: hidden;

    border: 1px solid #d3e3ee;
    border-radius: 13px;

    background: var(--ccd-card-bg);

    box-shadow: 0 7px 18px rgba(7, 49, 79, .06);
}

.ccd-card-photo {
    display: grid;
    place-items: center;

    width: 100%;
    aspect-ratio: 4 / 3;

    overflow: hidden;

    background: #edf4f8;
}

.ccd-contact-photo {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}

.ccd-placeholder {
    color: var(--ccd-navy);

    font-size: 3rem;
    font-weight: 800;
}

.ccd-card-body {
    padding: 16px 17px 18px;
}

.ccd-card h3 {
    margin: 0 0 4px;

    color: #0c3c68;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.28rem;
}

.ccd-title {
    margin: 0 0 10px;

    color: var(--ccd-accent);

    font-weight: 800;
}

.ccd-bio {
    color: #536a7e;
    line-height: 1.45;
}

.ccd-card-links {
    display: grid;
    gap: 8px;
}

.ccd-card-links a,
.ccd-card-links p {
    margin: 0;

    color: #0b4779;
    text-decoration: none;

    overflow-wrap: anywhere;
}


/* Main featured cards use circular headshots like approved mockup. */

.ccd-featured-grid .ccd-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);

    min-height: 190px;

    padding: 15px;
}

.ccd-featured-grid .ccd-card-photo {
    width: 78px;
    height: 78px;

    aspect-ratio: 1;

    border-radius: 50%;
}

.ccd-featured-grid .ccd-card-body {
    padding: 4px 0 0 10px;
}

.ccd-featured-grid .ccd-bio {
    display: none;
}


/* Department leader spotlight: important but not oversized. */

.ccd-card-featured {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);

    min-height: 230px;

    border: 2px solid var(--ccd-navy);
}

.ccd-card-featured .ccd-card-photo {
    min-height: 100%;
    aspect-ratio: auto;
}

.ccd-card-featured .ccd-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;

    padding: 24px;
}

.ccd-card-featured h3 {
    font-size: clamp(1.55rem, 2.3vw, 2rem);
}

.ccd-leader-label {
    margin: 0 0 5px;

    color: var(--ccd-accent);

    font-size: .77rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}


/* ==========================================================
   BOTTOM HELP BAR
   ========================================================== */

.ccd-bottom-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;

    margin: 40px 24px 0;
    padding: 18px 22px;

    border-radius: 15px;

    background: linear-gradient(90deg, #edf7fd 0%, #dceef9 100%);
}

.ccd-bottom-help-copy {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ccd-bottom-help-icon {
    display: grid;
    place-items: center;

    width: 54px;
    height: 54px;

    flex: 0 0 54px;

    border-radius: 50%;

    background: #d2eafb;

    color: #0b5791;
}

.ccd-bottom-help h2 {
    margin: 0 0 3px;

    color: #0a3e6d;

    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
}

.ccd-bottom-help p {
    margin: 0;

    color: #3b5871;
}

.ccd-call-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;

    min-height: 50px;

    padding: 10px 22px;

    border-radius: 8px;

    background: linear-gradient(180deg, #0d5793, #063d70);

    color: #fff;
    text-decoration: none;

    white-space: nowrap;
}

.ccd-call-button strong {
    color: #fff;
}


/* ==========================================================
   FOCUS / ACCESSIBILITY
   ========================================================== */

.ccd-directory a:focus-visible,
.ccd-directory button:focus-visible,
.ccd-directory input:focus-visible {
    outline: 3px solid var(--ccd-focus) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 2px #173b59 !important;
}

.ccd-error {
    max-width: 900px;

    margin: 30px auto;
    padding: 18px;

    border: 2px solid #a61b1b;
    border-radius: 10px;

    background: #fff4f2;
}


/* ==========================================================
   RESPONSIVE REFLOW
   ========================================================== */

@media (max-width: 1180px) {
    .ccd-featured-grid,
    .ccd-staff-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ccd-info-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .ccd-directory {
        width: min(100% - 20px, 1400px);
    }

    .ccd-hero-copy {
        width: min(820px, 88%);
        padding: 38px 32px;
    }

    .ccd-search-help-row {
        grid-template-columns: 1fr;
    }

    .ccd-featured-grid,
    .ccd-staff-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ccd-section-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .ccd-directory {
        width: min(100% - 12px, 1400px);
        margin-top: 8px;
    }

    .ccd-hero {
        min-height: 360px;
        border-radius: 15px 15px 0 0;
    }

    .ccd-hero-shade {
        background: linear-gradient(
            90deg,
            rgba(3,39,67,.94),
            rgba(3,39,67,.72)
        );
    }

    .ccd-hero-copy {
        width: 100%;
        padding: 28px 20px;
    }

    .ccd-info-bar {
        grid-template-columns: 1fr;

        margin-inline: 8px;
    }

    .ccd-info-block {
        border-right: 0;
        border-bottom: 1px solid #d8e5ef;
    }

    .ccd-search-help-row,
    .ccd-featured-section,
    .ccd-dept-nav,
    .ccd-section,
    .ccd-bottom-help,
    .ccd-results-status,
    .ccd-notice {
        margin-inline: 8px;
    }

    .ccd-search-area {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    .ccd-search-button {
        grid-column: 1 / -1;

        width: calc(100% - 16px);

        margin: 0 8px 8px;
    }

    .ccd-featured-grid,
    .ccd-staff-grid,
    .ccd-leader-grid {
        grid-template-columns: 1fr;
    }

    .ccd-featured-grid .ccd-card {
        grid-template-columns: 82px minmax(0, 1fr);
    }

    .ccd-card-featured {
        grid-template-columns: 1fr;
    }

    .ccd-card-featured .ccd-card-photo {
        min-height: 260px;
        aspect-ratio: 16 / 10;
    }

    .ccd-bottom-help {
        align-items: stretch;
        flex-direction: column;
    }

    .ccd-call-button {
        justify-content: center;
        white-space: normal;
    }
}


/* ==========================================================
   REDUCED MOTION / FORCED COLORS
   ========================================================== */

@media (prefers-reduced-motion: reduce) {
    .ccd-directory *,
    .ccd-directory *::before,
    .ccd-directory *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

@media (forced-colors: active) {
    .ccd-directory a:focus-visible,
    .ccd-directory button:focus-visible,
    .ccd-directory input:focus-visible {
        outline-color: Highlight !important;
        box-shadow: none !important;
    }
}


/* ==========================================================
   V2.2.1 CORRECTIONS
   ========================================================== */

/* Hide the theme-generated duplicate title only on directory pages. */
body.ccd-directory-page .entry-title,
body.ccd-directory-page .page-title,
body.ccd-directory-page .gp-page-title,
body.ccd-directory-page .gp-entry-title,
body.ccd-directory-page .post-title {
    display: none !important;
}

/* Remove excess gap left behind by some themes after hiding page title. */
body.ccd-directory-page .entry-content,
body.ccd-directory-page .page-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* SVG icon normalization. */
.ccd-info-icon svg,
.ccd-search-icon svg,
.ccd-quick-help-icon svg,
.ccd-bottom-help-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Make the default clean mountain hero feel more photographic/polished. */
.ccd-hero {
    background-color: #1d4c57;
    background-position: center 52%;
}

/* Improve featured section balance when there are only 1-2 people. */
.ccd-featured-grid {
    grid-template-columns: repeat(auto-fit, minmax(270px, 320px));
    justify-content: start;
}

.ccd-featured-grid .ccd-card {
    min-height: 205px;
}

.ccd-featured-grid .ccd-card-photo {
    width: 86px;
    height: 86px;
}

.ccd-featured-grid .ccd-card-body {
    padding-top: 2px;
}

/* Keep section/button from drifting too far apart. */
.ccd-section-heading-row {
    align-items: center;
}

.ccd-view-departments {
    margin-left: auto;
}

/* Compact excess vertical whitespace. */
.ccd-featured-section {
    margin-top: 28px;
}

.ccd-results-status:empty {
    display: none;
}

/* If only three info blocks exist, let them fill the row evenly. */
.ccd-info-bar > :first-child:nth-last-child(3),
.ccd-info-bar > :first-child:nth-last-child(3) ~ * {
    width: auto;
}

/* Main directory looks better with 3 columns when there are exactly 3 items. */
.ccd-info-bar {
    grid-auto-flow: row;
}

@media (min-width: 1181px) {
    .ccd-info-bar:has(> :nth-child(3):last-child) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.ccd-directory-page .entry-content,
    body.ccd-directory-page .page-content {
        margin-top: 0 !important;
    }
}

/* ==========================================================
   V2.2.3 - REAL APPALACHIAN HERO PHOTO
   ========================================================== */
.ccd-hero {
    min-height: 365px;
    background-size: cover !important;
    background-position: center 52% !important;
    background-repeat: no-repeat !important;
}

.ccd-hero-shade {
    background: linear-gradient(
        90deg,
        rgba(3, 38, 66, .90) 0%,
        rgba(3, 38, 66, .72) 37%,
        rgba(3, 38, 66, .34) 63%,
        rgba(3, 38, 66, .07) 100%
    ) !important;
}

.ccd-hero-copy {
    max-width: 850px;
}

@media (max-width: 640px) {
    .ccd-hero {
        background-position: 58% center !important;
    }
}


/* ==========================================================
   V2.2.4 - CITY HALL LOCATION / MAP / HOURS
   ========================================================== */

.ccd-info-multiline {
    white-space: normal;
    line-height: 1.4;
}

.ccd-map-button {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;

    width: fit-content;

    margin-top: 8px;
    padding: 6px 10px;

    border: 1px solid var(--ccd-navy);
    border-radius: 6px;

    background: #ffffff;

    color: var(--ccd-navy) !important;
    text-decoration: none !important;

    font-size: .82rem;
    font-weight: 800;
    line-height: 1.2;
}

.ccd-map-button:hover {
    background: var(--ccd-pale);
}

.ccd-map-button:focus-visible {
    outline: 3px solid var(--ccd-focus) !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 0 2px #173b59 !important;
}

@media (max-width: 640px) {
    .ccd-map-button {
        min-height: 42px;
        padding: 8px 12px;
    }
}


/* ==========================================================
   V2.2.5 - CITY HALL DIRECTIONS + PHOTO
   ========================================================== */

.ccd-city-hall-photo-card {
    position: relative;

    min-height: 108px;
    margin: 0;

    overflow: hidden;

    border-right: 0;

    background: #e8f1f6;
}

.ccd-city-hall-photo {
    display: block;

    width: 100%;
    height: 108px;

    object-fit: cover;
}

.ccd-city-hall-photo-card figcaption {
    position: absolute;
    right: 8px;
    bottom: 7px;

    padding: 4px 8px;

    border-radius: 999px;

    background: rgba(5, 43, 76, .88);

    color: #fff;

    font-size: .72rem;
    font-weight: 800;
}

@media (min-width: 1181px) {
    .ccd-info-bar:has(.ccd-city-hall-photo-card) {
        grid-template-columns:
            minmax(0, 1.05fr)
            minmax(0, 1.15fr)
            minmax(0, 1fr)
            minmax(230px, .95fr);
    }
}

@media (max-width: 1180px) {
    .ccd-city-hall-photo {
        height: 150px;
    }

    .ccd-city-hall-photo-card {
        min-height: 150px;
    }
}

/* ==========================================================
   V2.2.6 - CLEAN MAIN DIRECTORY HIERARCHY
   Featured leaders appear only once on the main directory.
   ========================================================== */

.ccd-department-heading-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.ccd-department-heading-row h2 {
    margin: 0;
    color: var(--ccd-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 3.4vw, 2.75rem);
}

.ccd-department-page-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--ccd-navy);
    border-radius: 7px;
    color: var(--ccd-navy);
    background: #fff;
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}

.ccd-department-page-link:hover {
    background: var(--ccd-pale);
}

@media (max-width: 700px) {
    .ccd-department-heading-row {
        align-items: flex-start;
        flex-direction: column;
    }
}
