/**
 * PROPERTISM V4 - CONTACT SECTION MODULE
 */

#contact-section.nri-contact-section {
    background-color: var(--bg-primary) !important;
    padding: var(--section-v-padding) 0 !important;
    border-top: 1px solid var(--border-subtle) !important;
    scroll-margin-top: var(--nav-height) !important;
}

#contact-section .section-inner {
    max-width: 1400px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 40px !important;
}

#contact-section .section-header {
    text-align: left !important;
    margin-bottom: 24px !important;
    max-width: 100% !important;
    width: 100% !important;
}

#contact-section .section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--brand-gold) !important;
    margin-bottom: 8px !important;
}

#contact-section .section-kicker-icon {
    width: 16px;
    height: 16px;
    color: var(--brand-gold);
}

#contact-section .section-title {
    font-family: var(--serif-main) !important;
    font-size: clamp(1.1rem, 1.8vw + 0.7rem, 1.9rem) !important;
    font-weight: 700 !important;
    line-height: 1.05 !important;
    letter-spacing: -0.02em !important;
    color: var(--text-main) !important;
    margin-bottom: 8px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

#contact-section .section-subtitle {
    font-size: 1rem !important;
    line-height: 1.4 !important;
    color: var(--text-muted) !important;
}

#contact-section .contact-split-container {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr; /* Form gets slightly more room */
    gap: 24px;
    align-items: stretch;
}

/* 1. LEFT CARD: NARRATIVE/INFO */
.hf-narrative-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border-subtle) !important;
    border-radius: 0 !important;
    padding: 20px !important;
    display: flex;
    flex-direction: column;
    margin: 0 !important;
    overflow: hidden !important;
}

.hf-card-title {
    font-family: var(--serif-main) !important;
    font-size: clamp(0.9rem, 1.3vw, 1.1rem) !important;
    font-weight: 700 !important;
    color: var(--text-main) !important;
    margin-bottom: 12px !important;
    letter-spacing: -0.02em;
    line-height: 1.05 !important;
    white-space: normal !important;
    overflow: visible !important;
}

.hf-office-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 6px;
    position: relative;
}

.hf-office-grid::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--brand-gold);
    opacity: 0.3;
    transform: translateX(-50%);
}

.hf-office-item {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 0 !important;
    overflow: hidden;
    align-content: start;
    padding-left: 20px !important;
    border-left: 3px solid var(--brand-gold) !important;
    background: rgba(196, 156, 82, 0.03) !important;
    padding: 12px !important;
    padding-left: 14px !important;
}

.hf-office-item > * {
    margin-bottom: 4px;
}

.hf-office-item > *:last-child {
    margin-bottom: 0;
}

.hf-office-phone {
    grid-row: 3;
    align-self: end;
}

.hf-office-phone-stack {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.hf-office-phone-stack .hf-office-phone + .hf-office-phone {
    padding-left: 0;
}

.hf-office-label {
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.15em;
    color: var(--brand-gold) !important;
    margin-bottom: 8px !important;
    display: block;
}

.hf-office-address {
    font-size: 1rem !important;
    line-height: 1.5 !important;
    color: var(--text-main) !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    font-family: var(--serif-main) !important;
    font-style: italic !important;
    font-weight: 400 !important;
}

.hf-office-phone {
    font-weight: 400 !important;
    color: var(--brand-gold) !important;
    font-size: 0.82rem !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: block;
    line-height: 1.45 !important;
    white-space: nowrap;
}

.hf-maps-cta {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    margin-top: 16px !important;
    margin-bottom: 16px !important;
    padding: 12px 24px !important;
    background: linear-gradient(135deg, rgba(196, 156, 82, 0.08) 0%, rgba(196, 156, 82, 0.03) 100%) !important;
    border: 2px solid var(--brand-gold) !important;
    color: var(--text-main) !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    text-transform: none !important;
    letter-spacing: 0.03em !important;
    text-decoration: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(196, 156, 82, 0.15) !important;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    cursor: pointer !important;
    width: 100% !important;
    justify-content: center !important;
}

.hf-maps-cta:hover {
    background: linear-gradient(135deg, rgba(196, 156, 82, 0.12) 0%, rgba(196, 156, 82, 0.06) 100%) !important;
    border-color: var(--brand-gold) !important;
    box-shadow: 0 4px 16px rgba(196, 156, 82, 0.25) !important;
    transform: translateY(-2px) !important;
    color: var(--text-main) !important;
}

.hf-maps-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

/* Contact Rail */
.hf-contact-rail {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    padding: 10px 2px 0 16px;
    border-top: 1px solid var(--border-subtle);
    border-left: 2px solid var(--brand-gold);
}

.hf-icon-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 30px;
    width: 100%;
    text-decoration: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    color: var(--text-main);
}

.hf-icon-badge {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hf-icon-badge svg {
    width: 20px;
    height: 20px;
}

.hf-icon-copy {
    display: block;
    min-width: 0;
}

.hf-icon-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-family: var(--sans-main);
    font-size: 0.9rem;
    line-height: 1.2;
    color: var(--text-main);
    white-space: normal;
}

.hf-icon-head {
    color: var(--brand-gold);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hf-icon-divider {
    width: 1px;
    height: 0.9em;
    background: rgba(184, 154, 74, 0.45);
    flex-shrink: 0;
}

.hf-icon-tail {
    color: inherit;
}

/* Brand-specific colors */
.hf-icon-link[title="Call Us"] {
    color: #34A853;
}

.hf-icon-link[title="WhatsApp"] {
    color: #25D366;
}

.hf-icon-link[title="Facebook"] {
    color: #1877F2;
}

.hf-icon-link[title="Instagram"] {
    color: #E4405F;
}

.hf-icon-link[title="LinkedIn"] {
    color: #0A66C2;
}

.hf-icon-link[title="Twitter/X"] {
    color: #000000;
}

.hf-icon-link[title="YouTube"] {
    color: #FF0000;
}

.hf-icon-link:hover {
    transform: translateX(4px);
    opacity: 0.82;
}

/* 2. STATS TILE GRID (UNIFIED) */
.hf-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0 !important;
    border: 2px solid var(--brand-gold);
    margin-top: auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(196, 156, 82, 0.15);
}

.hf-stat-tile {
    padding: 12px 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.hf-stat-tile:hover {
    transform: translateY(-2px);
}

.hf-stat-tile.is-gold {
    background: linear-gradient(135deg, var(--brand-gold) 0%, rgba(196, 156, 82, 0.9) 100%) !important;
}

.hf-stat-tile.is-offwhite {
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(255, 255, 255, 0.95) 100%) !important;
}

.hf-stat-number {
    font-family: var(--serif-main) !important;
    font-size: 1.6rem !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    display: block;
    margin-bottom: 4px;
}

.hf-stat-label {
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    color: #0F172A !important;
    line-height: 1.3 !important;
    letter-spacing: 0.05em;
}

/* 3. RIGHT CARD: THE FORM (DARK THEME) */
.hf-form-card {
    background: #0F172A !important;
    color: #FFFFFF !important;
    padding: 24px !important;
    border-radius: 0 !important;
    display: flex;
    flex-direction: column;
    margin: 0 !important;
}

.hf-form-card h1 {
    font-family: var(--serif-main) !important;
    font-size: clamp(1.4rem, 2.8vw, 1.7rem) !important;
    line-height: 1.1 !important;
    margin-bottom: 12px !important;
    letter-spacing: -0.02em;
    white-space: nowrap !important;
}

.hf-form-card h1 em {
    font-style: italic;
    color: var(--brand-gold);
}

#contact-section .hf-form-card .hf-sub {
    font-size: 0.85rem !important;
    color: #FFFFFF !important;
    margin-bottom: 16px !important;
    line-height: 1.3 !important;
}

/* FORM FIELDS HARDENING */
.hf-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px !important;
}

.hf-field-row-submit {
    display: grid;
    grid-template-columns: 85% 15%;
    gap: 12px;
    align-items: start;
    margin-bottom: 0 !important;
}

.hf-field-group {
    margin-bottom: 10px !important;
}

.hf-field-row .hf-field-group {
    margin-bottom: 0 !important;
}

.hf-field-row-submit .hf-field-group {
    margin-bottom: 0 !important;
}

.hf-field-row-submit .hf-submit-btn {
    margin-top: 23px !important;
}

.hf-field-label {
    font-size: 0.7rem !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #94A3B8 !important;
    margin-bottom: 4px !important;
    display: block;
}

.hf-field-input, .hf-field-textarea, .hf-field-select {
    width: 100% !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 10px !important;
    color: #FFFFFF !important;
    font-family: var(--sans-main) !important;
    border-radius: 0 !important;
    font-size: 0.9rem !important;
}

.hf-field-textarea {
    min-height: 70px;
    max-height: 70px;
    resize: none;
}

.hf-field-input:focus {
    border-color: var(--brand-gold) !important;
    background: rgba(255, 255, 255, 0.06) !important;
    outline: none !important;
}

.hf-submit-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--brand-gold) !important;
    color: #0F172A !important;
    width: 100% !important;
    height: 70px !important;
    padding: 8px 4px !important;
    font-size: 8px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    text-decoration: none !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    margin-top: 0 !important;
    line-height: 1.3 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    text-align: center !important;
}

.hf-submit-btn:hover {
    background: #0F172A !important;
    color: #FFFFFF !important;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Neutralize legacy elements */
.hf-corner, .hf-eyebrow, .hf-divider, .hf-field-underline { display: none !important; }

/* ============================================
   DARK MODE OVERRIDES
   Cards stay dark by design.
   The section shell must override legacy light gradients.
   ============================================ */
html[data-theme="dark"] #contact-section.nri-contact-section {
    background: #0B0F1A !important;
    background-image: none !important;
    border-top-color: rgba(196, 156, 82, 0.15) !important;
}

[data-theme="dark"] .hf-narrative-card {
    background-color: var(--bg-card) !important;
    border-color: var(--border-subtle) !important;
}

[data-theme="dark"] .hf-card-title,
[data-theme="dark"] .hf-office-address {
    color: var(--text-main) !important;
}

[data-theme="dark"] .hf-stats-grid {
    border-color: var(--border-subtle) !important;
}

/* ABSOLUTE AUTHORITY: Overriding hf-consultation.css Line 504 and propertism-styles.css */

/* Section background - Class removed for match reliability */
html[data-theme="dark"] body #contact-section {
    background: #0B0F1A !important;
    background-image: none !important;
    border-top-color: rgba(196, 156, 82, 0.15) !important;
}

/* Left narrative card */
html[data-theme="dark"] body #contact-section .hf-narrative-card {
    background-color: #1E2A3A !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

/* Left card headings — counter global h1/h2/h3 color: #1A1A1A */
html[data-theme="dark"] body #contact-section .hf-narrative-card .hf-card-title {
    color: #FFFFFF !important;
}

html[data-theme="dark"] body #contact-section .hf-narrative-card .hf-office-address {
    color: #E2E8F0 !important;
}

html[data-theme="dark"] body #contact-section .hf-narrative-card .hf-office-phone {
    color: var(--brand-gold) !important;
}

/* Google Maps CTA - Dark mode neutral */
html[data-theme="dark"] body #contact-section .hf-maps-cta {
    border-color: rgba(255, 255, 255, 0.15) !important;
    color: #E2E8F0 !important;
}

html[data-theme="dark"] body #contact-section .hf-maps-cta:hover {
    border-color: var(--brand-gold) !important;
    color: var(--brand-gold) !important;
}

/* Google Maps CTA - Premium styling (same in both modes) */
html[data-theme="dark"] body #contact-section .hf-maps-cta {
    background: linear-gradient(135deg, rgba(196, 156, 82, 0.12) 0%, rgba(196, 156, 82, 0.06) 100%) !important;
    border-color: var(--brand-gold) !important;
    color: #E2E8F0 !important;
}

html[data-theme="dark"] body #contact-section .hf-maps-cta:hover {
    background: linear-gradient(135deg, rgba(196, 156, 82, 0.18) 0%, rgba(196, 156, 82, 0.10) 100%) !important;
    color: #FFFFFF !important;
}

/* Contact Icons - Dark mode */
html[data-theme="dark"] .hf-contact-rail {
    border-top-color: rgba(255, 255, 255, 0.1);
    border-left-color: var(--brand-gold);
}

html[data-theme="dark"] .hf-icon-line {
    color: #E2E8F0;
}

html[data-theme="dark"] .hf-icon-head {
    color: var(--brand-gold);
}

/* Keep brand colors in dark mode */
html[data-theme="dark"] .hf-icon-link[title="Call Us"] {
    color: #34A853;
}

html[data-theme="dark"] .hf-icon-link[title="WhatsApp"] {
    color: #25D366;
}

html[data-theme="dark"] .hf-icon-link[title="Facebook"] {
    color: #1877F2;
}

html[data-theme="dark"] .hf-icon-link[title="Instagram"] {
    color: #E4405F;
}

html[data-theme="dark"] .hf-icon-link[title="LinkedIn"] {
    color: #0A66C2;
}

html[data-theme="dark"] .hf-icon-link[title="Twitter/X"] {
    color: #FFFFFF;
}

html[data-theme="dark"] .hf-icon-link[title="YouTube"] {
    color: #FF0000;
}

html[data-theme="dark"] .hf-icon-link:hover {
    opacity: 1;
}

/* Stats grid border */
html[data-theme="dark"] body #contact-section .hf-stats-grid {
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* Off-white tiles → Deep Obsidian Slate in dark */
html[data-theme="dark"] body #contact-section .hf-stat-tile.is-offwhite {
    background-color: #1E2A3A !important;
}

/* Text on off-white (now dark) tiles → white */
html[data-theme="dark"] body #contact-section .hf-stat-tile.is-offwhite .hf-stat-number,
html[data-theme="dark"] body #contact-section .hf-stat-tile.is-offwhite .hf-stat-label {
    color: #FFFFFF !important;
}

/* Text on gold tiles → stays dark navy */
html[data-theme="dark"] body #contact-section .hf-stat-tile.is-gold .hf-stat-number,
html[data-theme="dark"] body #contact-section .hf-stat-tile.is-gold .hf-stat-label {
    color: #0F172A !important;
}

/* Section header text — counter global p color: #4A4A4A (line 67) */
html[data-theme="dark"] body #contact-section .section-title {
    color: #FFFFFF !important;
}

html[data-theme="dark"] body #contact-section .section-subtitle {
    color: #94A3B8 !important;
}

@media (max-width: 768px) {
    #contact-section .section-inner {
        padding: 0 24px !important;
    }

    .hf-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .hf-stat-tile {
        min-width: 0;
        padding: 18px 10px;
    }

    .hf-stat-number {
        font-size: 1.35rem !important;
    }

    .hf-stat-label {
        font-size: 0.58rem !important;
        line-height: 1.35 !important;
    }

    .hf-form-card {
        padding: 36px 24px !important;
        margin: 0 !important; /* Neutralize legacy external margins */
    }

    .hf-form-card h1 {
        font-size: clamp(1.7rem, 8vw, 2.2rem) !important;
        line-height: 1.08 !important;
    }

    .hf-form-card h1 em {
        display: block;
        margin-top: 0.15rem;
    }

    .hf-form-card .hf-sub {
        font-size: 1rem !important;
        margin-bottom: 28px !important;
    }

    .contact-split-container {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    .hf-office-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .hf-office-grid::before {
        display: none !important;
    }

    .hf-office-phone-stack {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .hf-office-phone-stack .hf-office-phone + .hf-office-phone {
        padding-left: 0;
    }

    .hf-office-phone-stack .hf-office-phone + .hf-office-phone::before {
        display: none;
    }

    .hf-contact-rail {
        padding-left: 14px;
    }

    .hf-icon-link {
        align-items: flex-start;
    }

    .hf-icon-line {
        font-size: 0.84rem;
        gap: 8px;
    }

    .hf-field-row {
        grid-template-columns: 1fr !important;
    }

    .hf-field-row-submit {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    .hf-field-row-submit .hf-submit-btn {
        margin-top: 0 !important;
        height: 56px !important;
    }

    .hf-form-card h1 {
        white-space: normal !important;
    }
}
