/**
 * Mental Health Resource Directory - Premium Styles
 * BCCSA Branding: #003366 (navy), #f7941d (orange)
 * Design Philosophy: "Solid Ground" - Trust, Premium, Construction-Focused
 */

/* ============================================
   PAGE STRUCTURE
   ============================================ */

body {
    background: linear-gradient(135deg, #e8e8e8 0%, #f4f4f4 25%, #ffffff 50%, #f9f9f9 75%, #ebebeb 100%);
    background-size: 400% 400%;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    /* animation: gradient-shift 15s ease infinite; */
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* Subtle concrete/noise texture overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    opacity: 0.035;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

.mh-directory-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 48px 24px 32px 24px;
}

/* Crisis Support Button (Header) */
.crisis-support-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #dc2626;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.crisis-support-btn:hover {
    background: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
}

/* ============================================
   BREADCRUMBS
   ============================================ */

.breadcrumbs {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

.breadcrumbs a {
    color: #003366;
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs span {
    margin: 0 8px;
    color: #999;
}

/* ============================================
   PAGE TITLE SECTION - Premium Hero
   ============================================ */

.page-title-section {
    margin-top: 48px;
    margin-bottom: 32px;
    text-align: center;
}

/* Staggered fade-in animations for hero elements */
.page-eyebrow {
    font-family: 'proxima-nova-extra-condensed', 'Arial Narrow', sans-serif;
    color: #1e293b;
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 4px;
    opacity: 0;
    animation: hero-fade-in 0.6s ease-out forwards;
}

.page-title {
    font-family: 'proxima-nova-extra-condensed', 'Arial Narrow', sans-serif;
    font-size: 40px;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0;
    animation: hero-fade-in 0.6s ease-out 0.1s forwards;
}

.page-title-icon {
    color: #1e293b;
    font-size: 48px;
}

.page-title-accent {
    width: 100px;
    height: 3px;
    background: #1e293b;
    border-radius: 2px;
    margin: 0 auto 16px auto;
    transform-origin: center;
    /* Combined: signature underline + staggered delay */
    animation: signature-underline 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) 0.4s forwards;
    transform: scaleX(0);
    cursor: pointer;
    transition: width 0.3s ease, background 0.3s ease;
}

.page-title-accent:hover {
    width: 140px;
    background: linear-gradient(90deg, #1e293b 0%, #f7941d 100%);
}

@keyframes signature-underline {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: scaleX(1);
        opacity: 1;
    }
}

/* Hero fade-in animation */
@keyframes hero-fade-in {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-subtitle {
    font-size: 18px;
    color: #64748b;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    animation: hero-fade-in 0.6s ease-out 0.5s forwards;
}

/* Helper text above search */
.search-helper-text {
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 24px;
    letter-spacing: 0.3px;
    opacity: 0;
    animation: hero-fade-in 0.6s ease-out 0.7s forwards;
}

.trust-microcopy-container {
    max-width: 400px;
    margin: 0 auto;
    opacity: 0;
    animation: hero-fade-in 0.6s ease-out 0.7s forwards;
}

.trust-microcopy-container wa-alert::part(base) {
    border-radius: 50px;
    background-color: rgba(241, 245, 249, 0.8);
    backdrop-filter: blur(4px);
}

/* ============================================
   PLACEHOLDER ILLUSTRATION
   ============================================ */

.placeholder-illustration {
    text-align: center;
    padding: 0 24px 40px 24px;
    margin-top: -10px;
}

.placeholder-icon {
    font-size: 175px;
    color: #64748b;
    margin-bottom: 0;
    opacity: 0;
    animation: placeholder-fade-in 0.8s ease-out 0.3s forwards;
}

@keyframes placeholder-fade-in {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 0.5;
        transform: translateY(0);
    }
}

/* Results Reveal Animation */
.results-reveal-animation {
    animation: results-slide-up 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes results-slide-up {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Crisis Mode Alert Styling */
.crisis-mode-banner {
    margin-bottom: 32px;
}

.crisis-mode-banner:not(.hidden) {
    animation: results-slide-up 0.5s ease-out;
    padding: 0 40px;
    /* Match inner grid padding */
}

.emergency-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.emergency-card {
    background: #fff5f5;
    border: 2px solid #feb2b2;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s ease;
}

.emergency-card:hover {
    transform: scale(1.02);
}

.emergency-label {
    font-size: 13px;
    font-weight: 700;
    color: #c53030;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.emergency-phone {
    font-size: 34px;
    font-weight: 900;
    color: #9b2c2c;
    margin-bottom: 6px;
    line-height: 1.1;
}

.emergency-phone a {
    color: inherit;
    text-decoration: none;
}

.emergency-phone a:hover {
    text-decoration: underline;
}

.emergency-subtitle {
    font-size: 14px;
    color: #742a2a;
    font-weight: 600;
}

/* Results Header Layout */
.results-top-actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Exit Crisis Button Styling (Top Right) */
.exit-crisis-container {
    animation: results-slide-up 0.5s ease-out 0.2s backwards;
}

.btn-exit-crisis {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-exit-crisis:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
    transform: translateY(-2px);
}

.btn-exit-crisis wa-icon {
    font-size: 16px;
}

@media (max-width: 640px) {
    .emergency-actions {
        grid-template-columns: 1fr;
    }
}

.placeholder-text {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
    opacity: 0;
    animation: placeholder-fade-in 0.6s ease-out 0.5s forwards;
}

.placeholder-text {
    animation-fill-mode: forwards;
}

@keyframes placeholder-text-fade {
    to {
        opacity: 0.7;
    }
}

/* ============================================
   SEARCH INTERFACE - Premium Floating Card
   ============================================ */

.sentence-builder {
    background: transparent;
    border: none;
    padding: 16px;
    margin-bottom: 48px;
    overflow: visible;
}

.sentence-builder-content {
    max-width: 640px;
    margin: 0 auto;
    overflow: visible;
}

/* Scroll Indicator - appears after search */
.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 40px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.2s ease;
    cursor: pointer;
}



.scroll-indicator:hover {
    color: #f7941d;
}

.scroll-indicator i {
    font-size: 20px;
    animation: bounce-chevron 1.5s ease-in-out infinite;
}

@keyframes bounce-chevron {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(8px);
    }
}

/* Premium Floating Card */
.sentence-text {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 36px 40px;
    margin-bottom: 24px;
    position: relative;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.07),
        0 10px 20px -5px rgba(0, 0, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.05);
    display: block;
    /* Staggered fade-in */
    opacity: 0;
    animation: hero-fade-in 0.6s ease-out 0.9s forwards;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Micro-interaction: subtle pulse when card becomes active */
.sentence-text.active-pulse {
    animation: card-pulse 0.4s ease;
}

@keyframes card-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    }

    50% {
        transform: scale(1.01);
        box-shadow: 0 8px 25px rgba(247, 148, 29, 0.15), 0 4px 10px rgba(0, 0, 0, 0.08);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 10px 20px -5px rgba(0, 0, 0, 0.1);
    }
}

/* Remove speech bubble tail */
.sentence-text::after,
.sentence-text::before {
    display: none;
}

/* Prompt text styling */
.sentence-text span {
    font-size: 17px;
    color: #fca546;
    font-weight: 600;
    display: block;
    margin-bottom: 20px;
    letter-spacing: 0.3px;
}

/* Premium dropdown styling */
.sentence-text select {
    font-size: 16px;
    padding: 16px 44px 16px 18px;
    border: 2px solid #334155;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    line-height: 1.4;
    min-height: 56px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 18px;
    transition: all 0.2s ease;
    margin-bottom: 14px;
}

.sentence-text select option {
    background: #334155;
    color: #cbd5e1;
    font-size: 14px;
}

.sentence-text select:hover {
    border-color: #475569;
    background-color: rgba(255, 255, 255, 0.1);
}

.sentence-text select:focus {
    outline: none;
    border-color: #f7941d;
    box-shadow: 0 0 0 4px rgba(247, 148, 29, 0.2);
    background-color: #1e293b;
}

/* Selection confirmation feedback */
.selection-feedback {
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
    margin-top: -8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    animation: bubbleReveal 0.3s ease-out;
}

.selection-feedback.hidden {
    display: none;
}

/* Remove last select margin */
.sentence-text select:last-of-type {
    margin-bottom: 0;
}

/* Button container - right-aligned for subtle secondary action */
.button-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
    padding-right: 8px;
}

/* Search button - Bubble Style CTA (currently unused) */
.btn-search {
    background: #f7941d;
    color: white;
    border: none;
    padding: 16px 48px;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(247, 148, 29, 0.3);
}

.btn-search:hover {
    background: #e67e0d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(247, 148, 29, 0.4);
}

/* Clear/Start Over button - Subtle text link style */
.btn-clear {
    background: transparent;
    color: #94a3b8;
    border: none;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    text-transform: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-clear:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.btn-go-resources {
    background: #f7941d;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-go-resources:hover {
    background: #e68a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(247, 148, 29, 0.4);
}

/* ============================================
   RESULTS COUNTER
   ============================================ */

/* ============================================
   RESULTS WRAPPER - Premium Container
   ============================================ */

.results-section-wrapper {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 24px;
    padding: 60px 80px 100px 80px;
    /* Generous padding for premium feel */
    margin-bottom: 48px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    scroll-margin-top: 100px;
}

@keyframes results-reveal {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-section-title {
    font-family: 'proxima-nova-extra-condensed', 'Arial Narrow', sans-serif;
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
    padding-bottom: 0;
    text-align: left;
}

.results-headline {
    margin-bottom: 0;
    animation: results-reveal 0.5s ease-out forwards;
    text-align: left;
}

.results-headline h4 {
    font-family: 'proxima-nova', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #f7941d;
    margin: 0;
    letter-spacing: 0.2px;
    text-align: left;
}

/* ============================================
   RESULTS HEADER LAYOUT (Three-Column)
   ============================================ */

.results-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding: 0 0 20px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    width: 100%;
    gap: 24px;
}

.results-header-left {
    flex: 1 1 0;
}

.results-header-center {
    flex: 0 1 auto;
    display: flex;
    justify-content: center;
}

.results-header-right {
    flex: 1 1 0;
    text-align: right;
    white-space: nowrap;
}

/* ============================================
   RESULTS COUNTER
   ============================================ */

/* results-header-group replaced by results-header-top */

.results-counter {
    font-size: 15px;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Premium Location Filter Pill */
.location-filter {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 !important;
    padding-left: 0 !important;
    /* Reset padding since it's now under title */
}

/* Force ghost style on container */
.ghost-filter {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.location-filter label {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Ghost/Glass Dropdown for Dark Background */
.location-filter select {
    appearance: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    padding: 8px 36px 8px 16px;
    font-size: 14px;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    transition: all 0.2s ease;
}

/* Fix for dark options in light dropdown */
.location-filter select option {
    background: #1e293b !important;
    color: #ffffff !important;
    padding: 10px;
}

.location-filter select:focus {
    outline: none;
    border-color: #f7941d;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 3px rgba(247, 148, 29, 0.2);
}

/* Fix for dark options in light dropdown */
.location-filter select option {
    background: #1e293b;
    color: #ffffff;
}

/* Helper text under location filter */
.location-filter-helper {
    width: 100%;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 400;
    font-style: italic;
    margin-top: 0;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

/* ============================================
   RESULTS GRID
   ============================================ */

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

/* Tablet - 2 columns */
@media (max-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile - 1 column */
@media (max-width: 768px) {
    .results-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .results-section-wrapper {
        padding: 40px 24px 60px 24px;
    }

    .results-header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .results-header-center {
        width: 100%;
        justify-content: flex-start;
    }

    .results-header-right {
        width: 100%;
        text-align: left;
    }

    .results-counter {
        align-self: flex-start;
    }
}

/* ============================================
   RESOURCE TILE COMPONENT - Premium "Job Ticket" Style
   ============================================ */

.resource-tile {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 12px;
    padding: 0 28px 24px 28px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    /* Allow tooltips to escape the tile boundary */
    overflow: visible;
}

.resource-tile.crisis-style {
    border-top: none;
    background: #ffffff;
}

.tile-separator {
    border: none !important;
    border-top: 1px solid #e2e8f0 !important;
    background: transparent !important;
    height: 0 !important;
    margin: 12px 0 16px 0 !important;
    width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
}

.resource-tile:hover {
    box-shadow:
        0 12px 28px rgba(0, 51, 102, 0.15),
        0 4px 10px rgba(0, 0, 0, 0.06);
    transform: translateY(-6px);
    border-color: #cbd5e1;
    z-index: 50;
    /* Ensure hovered card (and its tooltips) are above neighbors */
}

/* Unified Dark Header Block */
.tile-header-block {
    background: #304060;
    margin: 0 -28px 24px -28px;
    padding: 20px 28px 24px 28px;
    border-bottom: 3px solid #f7941d;
    border-radius: 12px 12px 0 0;
    overflow: visible;
}

.crisis-style .tile-header-block {
    background: #7f1d1d;
    border-bottom: 3px solid #e53e3e;
}

.tile-badges-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 28px;
}

.tile-header-block .tile-title {
    color: #ffffff;
    margin: 0 0 6px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.tile-header-block .tile-provider {
    color: #fbbf24;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* Icon Badges (Construction & Recommended) — dark-bg variant */
.icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: help;
    transition: all 0.2s ease;
}

.icon-badge:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.icon-badge.construction-icon i {
    color: #cbd5e1;
    font-size: 13px;
}

.icon-badge.recommended-icon i {
    color: #fbbf24;
    font-size: 13px;
}

/* Reasoning Section (Expandable Bottom) */
.reasoning-container {
    margin: 16px 0 24px 0;
    border-top: 1px solid #e2e8f0;
    width: 100%;
    display: block;
    box-sizing: border-box;
}

.reasoning-trigger {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 14px 4px;
    margin-bottom: 0;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.reasoning-trigger:hover,
.reasoning-trigger.active {
    color: #003366;
}

.reasoning-trigger i {
    transition: transform 0.3s ease;
    font-size: 14px;
}

.reasoning-trigger.active i {
    transform: rotate(180deg);
}

.reasoning-content {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease-in-out;
}

.reasoning-content.expanded {
    grid-template-rows: 1fr;
}

.reasoning-content-inner {
    overflow: hidden;
    min-height: 0;
}

.reasoning-list {
    list-style: none;
    padding: 12px;
    margin: 8px 0 0 0;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
    border: 1px dashed #e2e8f0;
}

.reasoning-list li {
    font-size: 13px;
    color: #334155;
    font-weight: 500;
    padding-left: 18px;
    position: relative;
    line-height: 1.5;
    margin-bottom: 6px;
}

.reasoning-list li:last-child {
    margin-bottom: 0;
}

.reasoning-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #16a34a;
    font-weight: bold;
}

/* Zone B: Title - Strong & Professional */
.tile-title {
    font-family: 'proxima-nova', 'Segoe UI', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 14px 0;
    padding-top: 0;
    line-height: 1.35;
}

/* Zone C: Separator - Subtle Accent */
.tile-separator {
    border: none;
    width: 48px;
    height: 3px;
    background: #f7941d;
    border-radius: 2px;
    margin: 0 0 20px 0;
}

/* Zone D: Description - Readable */
.tile-description {
    font-size: 15px;
    line-height: 1.65;
    color: #64748b;
    margin: 0 0 20px 0;
    flex-grow: 1;
    /* Ensure full visibility as requested */
    display: block;
    overflow: visible;
}

/* Zone D2: Tile Bullets - explicit circle bullets */
.tile-bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.tile-bullets li {
    font-size: 14px;
    line-height: 1.5;
    color: #475569;
    margin-bottom: 8px;
    position: relative;
    padding-left: 18px;
    list-style: none !important;
    background: none !important;
}

.tile-bullets li::before {
    content: '•' !important;
    font-family: Arial, Helvetica, sans-serif !important;
    color: #003366;
    font-size: 18px;
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 1px;
    background: none !important;
}

/* Zone E: Phone Number */
.tile-phone {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 20px;
}

/* Zone F: CTA Button - Solid & Confident */
/* Zone F: CTA Button - Tactile & Premium */
.tile-cta {
    display: block;
    width: 100%;
    background: #003366;
    color: #ffffff;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.8px;
    padding: 14px 20px;
    border-radius: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: auto;
    position: relative;
    top: 0;
    box-shadow: 0 4px 6px -1px rgba(0, 51, 102, 0.1);
}

.tile-cta:hover {
    background: #003f7d;
    top: -2px;
    box-shadow: 0 10px 15px -3px rgba(0, 51, 102, 0.25);
}

/* ============================================
   RESULTS FOOTER BAR - 3 Column Layout
   ============================================ */

/* Bottom Results Counter */
.bottom-results-counter-container {
    text-align: right;
    margin-top: 32px;
    margin-bottom: 24px;
    padding-right: 8px;
}

.results-footer-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: 48px;
    margin-bottom: 20px;
    padding: 32px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 24px;
}

.footer-col {
    display: flex;
    align-items: flex-end;
}

.footer-col-left {
    justify-content: flex-start;
    flex: 1;
}

.footer-col-center {
    justify-content: center;
    flex: 1;
}

.footer-col-right {
    justify-content: flex-end;
    flex: 1;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

/* Share section */
.share-prompt {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    margin: 0;
    text-align: right;
}

.share-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
}

.btn-copy-link,
.btn-footer-search {
    background: #304060;
    color: #ffffff;
}

.btn-copy-link:hover,
.btn-footer-search:hover {
    background: #3d5175;
}

.btn-copy-link.copied {
    background: #16a34a;
}

.btn-email-share {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: #ffffff;
    padding: 10px 14px;
}

.btn-email-share:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}

/* Responsive Medium: Tablet layout (Load more on top row, search/share below) */
@media (max-width: 1024px) {
    .results-footer-bar {
        flex-wrap: wrap;
    }

    .footer-col-center {
        order: -1;
        width: 100%;
        flex: 0 0 100%;
        margin-bottom: 24px;
        justify-content: center;
    }

    .footer-col-left {
        flex: 1;
        justify-content: flex-start;
    }

    .footer-col-right {
        flex: 1;
        justify-content: flex-end;
    }
}

/* Responsive Small: Stack entirely on mobile */
@media (max-width: 768px) {
    .results-footer-bar {
        flex-direction: column;
        align-items: center;
        gap: 28px;
    }

    .footer-col-left,
    .footer-col-center,
    .footer-col-right {
        justify-content: center;
        align-items: center;
        flex: none;
        width: 100%;
        margin-bottom: 0;
    }

    .footer-col-center {
        order: -1;
        /* Keep Load More first on mobile */
    }

    .share-prompt {
        text-align: center;
    }
}

.btn-load-more {
    background: transparent;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px 40px 14px 40px;
    /* Optical centering: slightly less bottom padding if needed, or equal with line-height fix */
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    /* Use inline-flex for button centering */
    align-items: center;
    justify-content: center;
    /* Center text inside button */
    min-width: 240px;
    height: 54px;
    /* Fixed height for consistent centering */
    line-height: 1;
    /* Reset line height to prevent baseline shift */
    box-sizing: border-box;
    /* Ensure padding doesn't break height */
}

.btn-load-more:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #1e293b;
}

.btn-load-more[style*="display: none"] {
    display: none !important;
}

/* Removed .btn-bottom-search completely */

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    .mh-directory-container {
        padding: 20px 16px;
    }

    .page-title-section {
        margin-top: 32px;
        margin-bottom: 28px;
    }

    .page-title {
        font-size: 28px;
    }

    .page-subtitle {
        font-size: 16px;
    }

    .sentence-builder {
        padding: 8px;
    }

    /* Search Card Mobile */
    .sentence-text {
        padding: 24px 20px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .sentence-text span {
        font-size: 15px;
        margin-bottom: 16px;
    }

    .sentence-text select {
        font-size: 15px;
        padding: 14px 40px 14px 14px;
        min-height: 50px;
    }

    .button-container {
        flex-direction: column;
        gap: 12px;
    }

    .btn-search,
    .btn-clear {
        width: 100%;
        padding: 14px 32px;
        font-size: 14px;
    }

    /* Resource Cards Mobile */
    .resource-tile {
        padding: 22px 20px 20px 20px;
        border-radius: 10px;
    }

    .tile-title {
        font-size: 18px;
    }

    .tile-description {
        font-size: 14px;
    }

    .tile-cta {
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 64px 24px;
    color: #999;
}

.empty-state h3 {
    font-size: 24px;
    color: #666;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
}

/* ============================================
   PROGRESSIVE REVEAL - HIDDEN/REVEALED STATES
   ============================================ */

.hidden {
    display: none;
    opacity: 0;
}

.revealed {
    display: block;
    opacity: 1;
}

/* Bubble reveal animation - Fade in + Slide up */
@keyframes bubbleReveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Apply animation when elements are revealed */
.sentence-text span:not(.hidden),
.sentence-text select:not(.hidden) {
    animation: bubbleReveal 0.4s ease-out;
}

/* Button reveal animation */
.btn-search:not(.hidden),
.btn-clear:not(.hidden) {
    animation: bubbleReveal 0.3s ease-out;
}

/* ============================================
   LOCATION FILTER (POST-SEARCH)
   ============================================ */

/* .location-filter removed */

/* .location-filter label removed */

/* orphaned part 1 removed */
/* removed */
/* removed */
/* removed */
/* removed */
/* removed */
/* removed */
/* removed */
/* removed */
/* removed */
/* removed */
/* removed */
/* removed */
/* removed */

/* Select hover removed */

/* Select focus removed */

/* ============================================
   NEW TILE ELEMENTS
   ============================================ */

/* Provider name */
.tile-provider {
    font-size: 14px;
    color: #888;
    margin: -8px 0 12px 0;
    font-weight: 500;
}

/* Summary bullets */
.tile-bullets {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.tile-bullets li {
    font-size: 14px;
    color: #555;
    padding: 4px 0 4px 20px;
    position: relative;
    line-height: 1.4;
}

.tile-bullets li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #1e293b;
    font-weight: bold;
}

/* Crisis phone - prominent display */
.tile-crisis-phone {
    background: #FFEBEE;
    border: 1px solid #FFCDD2;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tile-crisis-phone i {
    color: #D32F2F;
    font-size: 20px;
}

.tile-crisis-phone a {
    color: #D32F2F;
    font-weight: 800;
    font-size: 24px;
    text-decoration: none;
}

.tile-crisis-phone a:hover {
    text-decoration: underline;
}

.tile-crisis-phone .text-support {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Address display */
.tile-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tile-address i {
    color: #f7941d;
}

/* Online badge */
.tile-online-badge {
    display: inline-block;
    font-size: 12px;
    color: #1976D2;
    font-weight: 600;
    margin-bottom: 16px;
}

.tile-online-badge i {
    margin-right: 4px;
}

/* Responsive adjustments for location filter */
@media (max-width: 768px) {
    .location-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .location-filter label {
        margin-bottom: 4px;
    }
}

/* ============================================
   FOOTER STYLES
   ============================================ */

.mh-footer {
    background: #202426;
    border-top: 1px solid #334155;
    padding: 60px 0 40px 0;
    margin-top: 80px;
}

.mh-footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 40px;
}

.mh-footer-col-logo {
    flex: 1;
    min-width: 280px;
}

.mh-footer-col {
    flex: 1;
    min-width: 180px;
}

.mh-footer-col-social {
    flex: 1;
    min-width: 220px;
    text-align: right;
}

.mh-footer-logo-link {
    display: block;
    margin-bottom: 20px;
}

.mh-footer-logo {
    height: 55px;
    filter: brightness(0) invert(1);
}

.mh-footer-desc {
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.6;
    max-width: 320px;
}

.mh-footer-heading {
    font-family: 'proxima-nova-extra-condensed', sans-serif;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    color: #e2e8f0;
    margin-bottom: 20px;
}

.mh-footer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Unified footer nav buttons - Resources and Support columns */
.mh-footer-nav wa-button {
    padding: 0;
    justify-content: flex-start;
    color: #cbd5e1;
    --wa-button-font-size-small: 0.9rem;
    --wa-button-color-text: #cbd5e1;
    --wa-button-color-text-hover: #ffffff;
    width: 100%;
    text-align: left;
}

.mh-footer-nav wa-button::part(base) {
    padding: 8px 16px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.mh-footer-nav wa-button::part(base):hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.mh-footer-social-grid {
    display: grid;
    grid-template-columns: repeat(3, min-content);
    gap: 12px;
    justify-content: end;
    margin-bottom: 25px;
    margin-left: auto;
    width: max-content;
}

.mh-footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid #475569;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mh-footer-social-link:hover {
    border-color: #f7941d;
    color: #f7941d;
}

/* Helper class for review image link */
.mh-footer-review-img {
    height: 40px;
    opacity: 0.8;
    transition: opacity 0.2s;
    filter: brightness(0) invert(1);
}

.mh-footer-review-img:hover {
    opacity: 1;
}

.mh-footer-copyright {
    margin-top: 50px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #94a3b8;
}

.mh-footer-copyright p {
    margin: 0;
}

.mh-footer-tagline {
    font-weight: 600;
}

/* ============================================
   TRANSITION ANIMATIONS - Polish & Slickness
   ============================================ */

/* Results wrapper exit — crisp, decisive slide out */
.results-exit {
    animation: resultsSlideOut 0.28s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes resultsSlideOut {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    70% {
        opacity: 0.3;
    }

    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Sentence builder return — snappy, intentional entrance */
.search-return {
    animation: searchSlideIn 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes searchSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-16px);
    }

    60% {
        opacity: 1;
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card refresh animation on location change */
.cards-refresh .resource-tile {
    animation: cardRefresh 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardRefresh {
    0% {
        opacity: 0;
        transform: translateY(12px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered delay for each card */
.cards-refresh .resource-tile:nth-child(1) {
    animation-delay: 0.03s;
}

.cards-refresh .resource-tile:nth-child(2) {
    animation-delay: 0.06s;
}

.cards-refresh .resource-tile:nth-child(3) {
    animation-delay: 0.09s;
}

.cards-refresh .resource-tile:nth-child(4) {
    animation-delay: 0.12s;
}

.cards-refresh .resource-tile:nth-child(5) {
    animation-delay: 0.15s;
}

.cards-refresh .resource-tile:nth-child(6) {
    animation-delay: 0.18s;
}

.cards-refresh .resource-tile:nth-child(7) {
    animation-delay: 0.21s;
}

.cards-refresh .resource-tile:nth-child(8) {
    animation-delay: 0.24s;
}

.cards-refresh .resource-tile:nth-child(9) {
    animation-delay: 0.27s;
}

/* ============================================
   KITCHEN SINK CARD STYLING (LOGOS, META, TAGS)
   ============================================ */

.tile-header-block.has-logo {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 16px;
    min-height: 140px;
    /* provides space to bottom-left align title block */
}

.tile-header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    width: 100%;
}

.tile-badges-container {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 0;
    margin-bottom: 0;
}

/* Icon overrides for new design layout */
.icon-badge.construction-icon {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.icon-badge.construction-icon i {
    color: #64748b;
    font-size: 14px;
}

.icon-badge.crisis-icon {
    background: #fee2e2;
    border-color: #fca5a5;
}

.icon-badge.crisis-icon i {
    color: #ef4444;
    font-size: 14px;
}

.tile-logo-container {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    background: #ffffff;
    border-radius: 12px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tile-logo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.tile-logo-fallback {
    color: #cbd5e1;
    font-size: 34px;
}

.tile-header-content {
    flex-grow: 1;
}

.tile-body-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Metadata Row */
.tile-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px 18px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.meta-item {
    font-size: 13px;
    line-height: 1.4;
    color: #475569;
    font-weight: 600;
    display: flex;
    align-items: flex-start;
    gap: 6px;
}

.meta-item i {
    color: #94a3b8;
    font-size: 14px;
    margin-top: 2px;
}

a.meta-link {
    color: #003366;
    text-decoration: none;
    transition: all 0.2s ease;
}

a.meta-link:hover {
    color: #0077cc;
    text-decoration: underline;
}

a.meta-link:hover i {
    color: #0077cc;
}

/* Sleeker Crisis Phone Area */
.tile-crisis-phone-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin: 16px 0 24px 0;
}

.tile-crisis-phone {
    font-size: 24px;
    font-weight: 800;
    color: #c53030;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0 !important;
}

.tile-crisis-phone i {
    font-size: 18px;
    color: #f56565;
}

.tile-crisis-phone a {
    color: inherit;
    text-decoration: none;
}

.tile-crisis-phone a:hover {
    text-decoration: underline;
}

/* Sleek Badge replaces old text-support */
.sleek-text-badge {
    background: #fed7d7;
    color: #9b2c2c;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 28px;
    border: 1px solid rgba(197, 48, 48, 0.2);
}

/* Match Tooltip Icon */
.icon-badge.match-icon {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.icon-badge.match-icon i {
    color: #64748b;
    font-size: 14px;
}

/* Crisis Phone inline icons */
.crisis-icons-group {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f56565;
    margin-right: 6px;
}

.crisis-icons-group i {
    font-size: 18px;
}

.icon-separator {
    font-size: 12px;
    font-weight: normal;
    color: #f56565;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Address Block */
.meta-item.address-block {
    align-items: flex-start;
}

.address-lines {
    line-height: 1.5;
    /* explicit layout fixes for inline elements to display naturally */
    display: block;
}

/* Custom CSS Tooltip (mimicking Web Awesome style for dynamically injected elements) */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    /* -6px offset to sit on top of 6px arrow */
    background: #1e293b;
    color: #ffffff;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

[data-tooltip]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    /* sitting at bottom 100% (top of icon) */
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 9999;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

a.map-link {
    font-weight: 700;
    margin-top: 2px;
    font-size: 12px;
}

.bottom-results-counter-container {
    display: none;
    /* Controlled by JS */
    justify-content: space-between;
    align-items: center;
    padding: 0 4px 16px 4px;
    margin-top: 10px;
}

.results-counter {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

/* Suggest a Fix link (Footer) */
.suggest-fix-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.suggest-fix-link:hover {
    color: #fca546;
}