/* ==========================================================================
   CONTACT PAGE — ubheritage.com
   File: assets/css/contact.css
   Scope: .ubh-contact
   Uses project constants: gold #d2ab67, 1820px container / 50px gutters,
   1200px mobile breakpoint. No border-radius on any image, ever.
========================================================================== */

.ubh-contact {
    overflow: hidden;
}

.ubh-contact .ubh-container {
    max-width: 1820px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* --------------------------------------------------------------------
   1. BANNER  — full-bleed image, 1920:600 ratio in Figma
-------------------------------------------------------------------- */
.ubh-contact-banner {
    position: relative;
    width: 100%;
    line-height: 0;
}

.ubh-contact-banner__img {
    display: block;
    width: 100%;
    aspect-ratio: 1920 / 600;
    height: auto;
    object-fit: cover;
    border-radius: 0 !important;
}

.ubh-contact-banner__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 50px;
    background: rgba(0, 0, 0, 0.18);
}

.ubh-contact-banner__text {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ubh-contact-banner__heading {
    font-family: 'IvyBodoni', serif;
    font-style: italic;
    font-weight: 400;
    color: #ffffff;
    font-size: clamp(28px, 3.2vw, 48px);
    line-height: 1.2;
    margin: 0;
}

.ubh-contact-banner__subheading {
    font-family: 'Avenir', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--ubh-gold, #d2ab67);
    font-size: clamp(13px, 1vw, 16px);
    margin: 0;
}

.ubh-contact-banner__para {
    font-family: 'Avenir', sans-serif;
    font-weight: 400;
    color: #f2f2f2;
    font-size: clamp(14px, 1.1vw, 17px);
    line-height: 1.7;
    margin: 6px 0 0;
}

/* --------------------------------------------------------------------
   2. CONTACT INFO — Address / Phone / Email
   Figma: icon circle 60px, icon graphic 40px, icon→divider gap 32px,
   divider→text gap 18px, text 18px/#070505, divider = full column width.
   Section: 140px padding-top (from banner), 58px padding-bottom (to map).
-------------------------------------------------------------------- */
.ubh-contact-info {
    padding: 140px 50px 58px;
}

.ubh-contact-info__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px 24px;
}

.ubh-contact-info__item {
    flex: 0 1 461px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.ubh-contact-info__icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f3f3f3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ubh-contact-info__icon svg {
    width: 40px;
    height: 40px;
    fill: none;
    stroke: #070505;
    stroke-width: 1.4;
}

.ubh-contact-info__icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 0 !important;
}

.ubh-contact-info__divider {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--ubh-gold, #d2ab67);
    margin: 32px 0 18px;
}

.ubh-contact-info__title {
    font-family: 'Avenir', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: #070505;
    margin-bottom: 6px;
    display: block;
}

.ubh-contact-info__value {
    font-family: 'Avenir', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.05vw, 18px);
    line-height: 1.5;
    color: #070505;
    text-decoration: none;
    width: 100%;
}

a.ubh-contact-info__value:hover {
    color: var(--ubh-gold, #d2ab67);
}

/* --------------------------------------------------------------------
   3. MAP + GET DIRECTION BUTTON
   Figma: map box is the 1820px container itself, ratio 1820:810.
   Map→button gap 40px. Button: 43px tall, 28px/14px padding, 14px
   font, 0.7px tracking, border-radius 81px (full pill).
   Section padding-bottom (to next section) 130px.
-------------------------------------------------------------------- */
.ubh-contact-map {
    width: 100%;
    padding: 0 50px 130px;
}

.ubh-contact-map__frame {
    width: 100%;
    aspect-ratio: 1820 / 810;
    overflow: hidden;
}

.ubh-contact-map__frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.ubh-contact-map__btn-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.ubh-btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Avenir', sans-serif;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #000000;
    background: transparent;
    border: 1px solid #000000;
    border-radius: 999px;
    padding: 14px 28px;
    text-decoration: none;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.ubh-btn-outline:hover {
    background: #000000;
    color: #ffffff;
}

/* --------------------------------------------------------------------
   4. FORM CTA
   Figma: the whole section IS the 1820px container box (NOT edge to
   edge) — background-image sits directly on .ubh-contact-cta-inner,
   set inline from PHP. Figma ratio 1820:857.

   IMPORTANT: no fixed pixel height anywhere. The image box keeps its
   ratio via aspect-ratio and grows if the panel ever gets taller than
   it, so the media is never cropped or collapsed at any width.
-------------------------------------------------------------------- */
section.ubh-contact-cta.ubh-container {
    padding: 100px 50px 120px;
}

.ubh-contact-cta-inner {
    position: relative;
    margin: 0 auto;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 1820 / 857;
    height: auto;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
    justify-content: flex-end;
    align-items: center;
    box-sizing: border-box;
    padding: 40px 50px;
}

.ubh-contact-cta__panel {
    width: 48%;
    max-width: 882px;
    height: max-content;
    max-height: 100%;
    background: #000000;
    padding: 41px 60px 59px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    /* overflow must stay VISIBLE — the custom project dropdown panel is
       absolutely positioned and would get clipped by overflow:hidden. */
    overflow: visible;
}

.ubh-contact-cta__heading {
    font-family: 'IvyBodoni', serif;
    font-style: italic;
    font-weight: 400;
    color: var(--ubh-gold, #d2ab67);
    font-size: 48px;
    line-height: 1.1;
    text-align: center;
    margin: 0 0 32px;
}

/* --------------------------------------------------------------------
   CF7 form — two-col row (Name/Contact, 45px gap) → Email (full) →
   Our Projects (full) → Message (full) → centered Submit pill.
-------------------------------------------------------------------- */
.ubh-contact-cta__form {
    flex: 1;
}

.ubh-contact-cta__form .wpcf7-form {
    width: 100%;
}

.ubh-contact-cta__form .ubh-cf7-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0 45px;
}

.ubh-contact-cta__form .ubh-cf7-field {
    flex: 1 1 200px;
    min-width: 0;
    position: relative;
}

.ubh-contact-cta__form .ubh-cf7-field--full {
    flex: 1 1 100%;
}

.ubh-contact-cta__form .ubh-cf7-field--last {
    margin-bottom: 0;
}

.ubh-contact-cta__form label {
    display: block;
    font-family: 'Avenir', sans-serif;
    font-weight: 400;
    font-size: clamp(15px, 1.2vw, 18px);
    color: #ffffff;
    margin-bottom: 18px;
}

.ubh-contact-cta__form input[type="text"],
.ubh-contact-cta__form input[type="tel"],
.ubh-contact-cta__form input[type="email"],
.ubh-contact-cta__form select,
.ubh-contact-cta__form textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-family: 'Avenir', sans-serif;
    font-size: clamp(14px, 1vw, 15px);
    line-height: 1.4;
    padding: 0 0 12px;
    border-radius: 0;
    outline: none;
    transition: border-color 0.3s ease;
    display: block;
    box-sizing: border-box;
}

.ubh-contact-cta__form textarea {
    resize: none;
    height: 50px;
    overflow-y: auto;
}

.ubh-contact-cta__form input::placeholder,
.ubh-contact-cta__form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.ubh-contact-cta__form input:focus,
.ubh-contact-cta__form select:focus,
.ubh-contact-cta__form textarea:focus {
    border-bottom-color: var(--ubh-gold, #d2ab67);
}

/* Native <select> fallback styling — only visible if JS is disabled.
   When contact-select.js runs, the native control is hidden and the
   custom .ubh-select listbox below takes over. */
.ubh-contact-cta__form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: transparent;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23ffffff'%3e%3cpath d='M5.5 7.5l4.5 4.5 4.5-4.5' stroke='%23ffffff' stroke-width='1.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 18px;
    padding-right: 26px;
    cursor: pointer;
    color: #ffffff;
}

.ubh-contact-cta__form select option {
    background-color: #1c1b20;
    color: #ffffff;
}

.ubh-contact-cta__form select:invalid,
.ubh-contact-cta__form select option[value=""] {
    color: rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------------
   4b. CUSTOM PROJECT DROPDOWN  (built by assets/js/contact-select.js)
   Native <select> stays in the DOM for CF7 — it is just visually
   hidden. Everything the user sees/scrolls is this styled listbox,
   so the OS-blue popup and the fat grey native scrollbar are gone.
-------------------------------------------------------------------- */
.ubh-contact-cta__form .ubh-select {
    position: relative;
    display: block;
    width: 100%;
}

/* Hide the real select but keep it submittable + focusable by CF7. */
.ubh-contact-cta__form .ubh-select select,
.ubh-contact-cta__form select.ubh-select__native {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    padding: 0;
    margin: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
    background: none;
}

.ubh-contact-cta__form .ubh-select__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 0;
    padding: 0 0 12px;
    margin: 0;
    color: #ffffff;
    font-family: 'Avenir', sans-serif;
    font-size: clamp(14px, 1vw, 15px);
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.ubh-contact-cta__form .ubh-select__trigger:hover,
.ubh-contact-cta__form .ubh-select__trigger:focus,
.ubh-contact-cta__form .ubh-select.is-open .ubh-select__trigger {
    border-bottom-color: var(--ubh-gold, #d2ab67);
}

.ubh-contact-cta__form .ubh-select__value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
}

.ubh-contact-cta__form .ubh-select.has-value .ubh-select__value {
    color: #ffffff;
}

.ubh-contact-cta__form .ubh-select__arrow {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    display: block;
    color: rgba(255, 255, 255, 0.7);
    transition: transform 0.3s ease, color 0.3s ease;
}

.ubh-contact-cta__form .ubh-select__arrow svg {
    width: 16px;
    height: 16px;
    display: block;
}

.ubh-contact-cta__form .ubh-select.is-open .ubh-select__arrow {
    transform: rotate(180deg);
    color: var(--ubh-gold, #d2ab67);
}

/* The floating option list */
.ubh-contact-cta__form .ubh-select__panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    z-index: 30;
    background: #0d0d0d;
    border: 1px solid rgba(210, 171, 103, 0.35);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

.ubh-contact-cta__form .ubh-select.is-open .ubh-select__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.ubh-contact-cta__form .ubh-select__list {
    list-style: none;
    margin: 0;
    padding: 6px;
    max-height: 244px;
    overflow-y: auto;
    overscroll-behavior: contain;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: rgba(210, 171, 103, 0.6) transparent;
}

/* Chrome / Edge / Safari — thin gold rail instead of the native grey bar */
.ubh-contact-cta__form .ubh-select__list::-webkit-scrollbar {
    width: 4px;
}

.ubh-contact-cta__form .ubh-select__list::-webkit-scrollbar-track {
    background: transparent;
    margin: 6px 0;
}

.ubh-contact-cta__form .ubh-select__list::-webkit-scrollbar-thumb {
    background: rgba(210, 171, 103, 0.55);
    border-radius: 999px;
}

.ubh-contact-cta__form .ubh-select__list::-webkit-scrollbar-thumb:hover {
    background: var(--ubh-gold, #d2ab67);
}

.ubh-contact-cta__form .ubh-select__option {
    display: block;
    padding: 11px 14px;
    font-family: 'Avenir', sans-serif;
    font-weight: 400;
    font-size: 15px;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.78);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.ubh-contact-cta__form .ubh-select__option:hover,
.ubh-contact-cta__form .ubh-select__option.is-active {
    background: rgba(210, 171, 103, 0.12);
    color: #ffffff;
}

.ubh-contact-cta__form .ubh-select__option.is-selected {
    color: var(--ubh-gold, #d2ab67);
}

.ubh-contact-cta__form .ubh-select__empty {
    display: block;
    padding: 14px;
    font-family: 'Avenir', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.45);
}

/* Keep the "Our Projects" field on the same vertical rhythm as the
   text inputs above it. */
.ubh-contact-cta__form .ubh-cf7-field--project {
    margin-bottom: 30px;
}

.ubh-contact-cta__form .ubh-cf7-field--project label {
    margin-bottom: 18px;
}

.ubh-contact-cta__form .ubh-cf7-field--project .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
}

.ubh-contact-cta__form .ubh-cf7-submit-row {
    display: flex;
    justify-content: center;
    margin-top: 46px;
}

.ubh-contact-cta__form .ubh-cf7-submit-row p {
    margin: 0;
}

.ubh-contact-cta__form input[type="submit"] {
    width: auto;
    background: transparent;
    border: 1px solid var(--ubh-gold, #d2ab67);
    color: var(--ubh-gold, #d2ab67);
    font-family: 'Avenir', sans-serif;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    border-radius: 999px;
    padding: 15px 46px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease;
}

.ubh-contact-cta__form input[type="submit"]:hover {
    background: var(--ubh-gold, #d2ab67);
    color: #000000;
}

.ubh-contact-cta__form .wpcf7-spinner {
    display: none;
}

.ubh-contact-cta__form .wpcf7-not-valid-tip {
    color: #e2a34c;
    font-size: 12px;
    margin-top: 6px;
}

.ubh-contact-cta__form .wpcf7-response-output {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.35) !important;
    font-family: 'Avenir', sans-serif;
    font-size: 13px;
    margin-top: 20px;
    text-align: center;
}

/* ====================================================================
   RESPONSIVE
   Stepped scale — 1600 / 1400 / 1200 (stack) / 900 / 600
==================================================================== */

/* ---------- ≤1600px : panel gets a little wider, tighter padding --- */
@media (max-width: 1600px) {

    section.ubh-contact-cta.ubh-container {
        padding: 80px 40px 96px;
    }

    .ubh-contact-cta-inner {
        padding: 32px 40px;
    }

    .ubh-contact-cta__panel {
        width: 52%;
        padding: 36px 44px 46px;
    }

    .ubh-contact-cta__heading {
        font-size: 40px;
        margin-bottom: 28px;
    }

    .ubh-contact-cta__form .ubh-cf7-row {
        gap: 0 32px;
    }
}

/* ---------- ≤1400px : panel wider still, form spacing tightens ----- */
@media (max-width: 1400px) {

    .ubh-contact-cta-inner {
        padding: 26px 30px;
    }

    .ubh-contact-cta__panel {
        width: 58%;
        padding: 30px 34px 38px;
    }

    .ubh-contact-cta__heading {
        font-size: 34px;
        margin-bottom: 24px;
    }

    .ubh-contact-cta__form label {
        margin-bottom: 14px;
    }

    .ubh-contact-cta__form .ubh-cf7-field--project {
        margin-bottom: 24px;
    }

    .ubh-contact-cta__form .ubh-cf7-submit-row {
        margin-top: 34px;
    }
}

/* ---------- ≤1200px : STACK — image on top, panel below ------------ */
@media (max-width: 1200px) {

    .ubh-contact .ubh-container {
        padding: 0 24px;
    }

    .ubh-contact-info {
        padding: 64px 24px 40px;
    }

    .ubh-contact-info__grid {
        flex-direction: column;
        gap: 34px;
    }

    .ubh-contact-info__item {
        flex: 1 1 auto;
    }

    .ubh-contact-map {
        padding: 0 24px 56px;
    }

    .ubh-contact-map__frame {
        aspect-ratio: 4 / 3;
    }

    /* Form CTA — the inner is no longer a flex row. The background
       image gets its own ratio block via ::before, and the panel sits
       under it in normal flow at full width. No fixed heights, no
       negative margins, nothing overlaps. */
    section.ubh-contact-cta.ubh-container {
        padding: 64px 24px 72px;
    }

    .ubh-contact-cta-inner {
        display: block;
        aspect-ratio: auto;
        height: auto;
        padding: 0;
        background-position: center;
    }

    .ubh-contact-cta-inner::before {
        content: "";
        display: block;
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .ubh-contact-cta__panel {
        width: 100%;
        max-width: 100%;
        max-height: none;
        margin: 0;
        padding: 36px 32px 44px;
    }

    .ubh-contact-cta__heading {
        font-size: 32px;
        margin-bottom: 26px;
    }

    .ubh-contact-cta__form .ubh-cf7-row {
        flex-direction: column;
        gap: 0;
    }

    .ubh-contact-cta__form .ubh-select__list {
        max-height: 220px;
    }
}

/* ---------- ≤900px ------------------------------------------------- */
@media (max-width: 900px) {

    .ubh-contact-info {
        padding: 48px 24px 32px;
    }

    .ubh-contact-cta-inner::before {
        aspect-ratio: 4 / 3;
    }

    .ubh-contact-cta__panel {
        padding: 30px 24px 36px;
    }

    .ubh-contact-cta__heading {
        font-size: 28px;
    }
}

/* ---------- ≤600px ------------------------------------------------- */
@media (max-width: 600px) {

    section.ubh-contact-cta.ubh-container {
        padding: 48px 16px 56px;
    }

    .ubh-contact .ubh-container {
        padding: 0 16px;
    }

    .ubh-contact-info {
        padding: 40px 16px 28px;
    }

    .ubh-contact-map {
        padding: 0 16px 40px;
    }

    .ubh-contact-cta-inner::before {
        aspect-ratio: 3 / 2;
    }

    .ubh-contact-cta__panel {
        padding: 26px 20px 32px;
    }

    .ubh-contact-cta__heading {
        font-size: 24px;
        margin-bottom: 22px;
    }

    .ubh-contact-cta__form label {
        font-size: 15px;
        margin-bottom: 12px;
    }

    .ubh-contact-cta__form .ubh-cf7-submit-row {
        margin-top: 28px;
    }

    .ubh-contact-cta__form input[type="submit"] {
        font-size: 14px;
        letter-spacing: 1.2px;
        padding: 13px 36px;
    }

    .ubh-contact-cta__form .ubh-select__list {
        max-height: 190px;
    }
}