/*
 * Contact page (v2 redesign) — Views/Home/Contact.cshtml
 * Team grid reuses the About-page card language (same 187/250 photo ratio and
 * 56.5rem shell) so the two pages read as one family.
 */

.ct-page {
    padding: clamp(3rem, 5vw, 5rem) 0 clamp(4rem, 6vw, 6rem);
    background: #fff;
}

.ct-shell {
    width: min(100%, 56.5rem);
    margin-inline: auto;
}

/* ── Page head ────────────────────────────────────────────────────────── */
.ct-head {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    text-align: start;
}

.ct-head-icon {
    color: var(--zino-green);
    font-size: 1.5rem;
    line-height: 1;
    padding-top: 0.125rem;
}

.ct-title {
    margin: 0 0 0.25rem;
    font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.75rem);
    font-weight: 700;
    color: var(--zino-text-heading);
    line-height: 1.4;
}

.ct-subtitle {
    font-size: 0.75rem;
    color: var(--zino-text-sub);
    line-height: 1.7;
}

/* ── Team grid ────────────────────────────────────────────────────────── */
.ct-team {
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* Three rows of three, matching the About-page team block: at xl the columns are
   quarter-width (and centred), which keeps the photos the same size there. The
   rows sit flush like About's — Bootstrap's row gutters already cancel out. */

.ct-card {
    /* shared by the name and by the icon row's height, so the icons always land
       on the name's line — the breakpoints below just re-set these two */
    --ct-name-size: clamp(0.6875rem, 0.4vw + 0.62rem, 0.875rem);
    --ct-name-lh: 1.4;
    position: relative;
    transition: transform 0.25s ease;
}

.ct-card:hover {
    transform: translateY(-4px);
}

.ct-card__photo-wrap {
    position: relative;
    aspect-ratio: 187 / 250;
    background: var(--zino-surface);
    overflow: hidden;
}

.ct-card__photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Contact panel that fades in over the bottom of the photo while either of the
   card's action icons is hovered/focused: green text on a white scrim, so it
   stays readable where the cut-out is dark. */
.ct-card__tip {
    position: absolute;
    left: 8%;
    right: auto;
    bottom: 6%;
    width: fit-content;
    max-width: 84%;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.92);
    color: var(--zino-green);
    direction: ltr;
    text-align: left;
    font-size: clamp(0.5625rem, 0.3vw + 0.52rem, 0.75rem);
    line-height: 1.75;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.25rem);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

.ct-card__tip-row {
    display: block;
    overflow-wrap: anywhere; /* long addresses wrap instead of being cut off */
}

.ct-card__tip-row b {
    font-weight: 700;
}

.ct-card:has(.ct-card__actions:hover) .ct-card__tip,
.ct-card:has(.ct-card__actions:focus-within) .ct-card__tip {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* Both icons light up together with the panel. */
.ct-card:has(.ct-card__actions:hover) .ct-card__action,
.ct-card:has(.ct-card__actions:focus-within) .ct-card__action {
    color: var(--zino-green);
}

/* Browsers without :has() fall back to a plain card hover. */
@supports not selector(:has(*)) {
    .ct-card:hover .ct-card__tip,
    .ct-card:focus-within .ct-card__tip {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .ct-card:hover .ct-card__action,
    .ct-card:focus-within .ct-card__action {
        color: var(--zino-green);
    }
}

.ct-card__row {
    display: flex;
    align-items: flex-start;
    /* name/role block + icons sit as one centred group, keeping the gap */
    justify-content: center;
    gap: 3.5rem;
    margin-top: var(--space-2);
}

.ct-card__text {
    min-width: 0; /* let a long name wrap instead of pushing the icons out */
}

.ct-card__actions {
    display: flex;
    /* DOM keeps email-then-phone; Figma shows the envelope on the outer left */
    flex-direction: row-reverse;
    /* match the name's line box so the icons sit on that line, not between the
       name and the role */
    height: calc(var(--ct-name-size) * var(--ct-name-lh));
    align-items: center;
    gap: 0.5rem;
}

.ct-card__action {
    display: inline-flex;
    color: var(--zino-text-sub);
    font-size: clamp(0.625rem, 0.35vw + 0.56rem, 0.8125rem);
    line-height: 1;
    transition: color 0.2s ease;
}

.ct-card__action:hover,
.ct-card__action:focus-visible {
    color: var(--zino-green);
}

.ct-card__name {
    margin: 0;
    color: var(--zino-text);
    font-size: var(--ct-name-size);
    font-weight: 600;
    line-height: var(--ct-name-lh);
}

.ct-card__role {
    margin: 0;
    color: var(--zino-text-sub);
    font-size: clamp(0.5625rem, 0.35vw + 0.5rem, 0.75rem);
    line-height: 1.4;
}

/* ── Divider ──────────────────────────────────────────────────────────── */
.ct-divider {
    margin: clamp(2rem, 4vw, 3rem) 0;
    border: 0;
    border-top: 1px solid var(--zino-border);
    opacity: 1;
}

/* ── Reach block (phones / socials / address + map) ───────────────────── */
.ct-reach {
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

.ct-reach__title {
    margin: 0 0 var(--space-3);
    font-size: clamp(0.875rem, 0.8rem + 0.3vw, 1.0625rem);
    font-weight: 700;
    color: var(--zino-text-heading);
    line-height: 1.4;
}

.ct-reach__cols {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3) var(--space-5);
}

.ct-reach__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ct-reach__list > li + li {
    margin-top: var(--space-2);
}

.ct-reach__item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--zino-text);
    font-size: 0.8125rem;
    line-height: 1.6;
    transition: color 0.2s ease;
}

a.ct-reach__item:hover,
a.ct-reach__item:focus-visible {
    color: var(--zino-green);
}

.ct-reach__group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--zino-text);
    font-size: 0.8125rem;
    line-height: 1.6;
}

.ct-reach__group-icons {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Icons sit in the text colour, not brand colours — they only pick up green on
   hover, inherited from the link they live in. */
.ct-reach__icon {
    flex-shrink: 0;
    color: inherit;
    font-size: 0.9375rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.ct-reach__group-icons > a {
    display: inline-flex;
    color: inherit;
    transition: color 0.2s ease;
}

.ct-reach__group-icons > a:hover,
.ct-reach__group-icons > a:focus-visible {
    color: var(--zino-green);
}

.ct-reach__logo {
    width: 0.9375rem;
    height: 0.9375rem;
    object-fit: contain;
    filter: grayscale(1);
    transition: filter 0.2s ease;
}

.ct-reach__group-icons > a:hover .ct-reach__logo,
.ct-reach__group-icons > a:focus-visible .ct-reach__logo {
    filter: none;
}

.ct-reach__address {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.5rem;
    margin: var(--space-4) 0 0;
    color: var(--zino-text);
    font-size: 0.8125rem;
    line-height: 1.8;
}

.ct-reach__address .ct-reach__icon {
    padding-top: 0.1875rem;
}

/* ── Map ──────────────────────────────────────────────────────────────── */
.ct-map {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--zino-surface);
    overflow: hidden;
    z-index: 0; /* keep leaflet panes below the sticky header */
}

/* The Figma map reads as a muted, near-flat base map, so the green pin carries
   the only colour. */
.ct-map .leaflet-tile {
    filter: saturate(0.12) brightness(1.08);
}

.ct-map .leaflet-container {
    font-family: inherit;
    background: var(--zino-surface);
}

.ct-map .leaflet-control-attribution {
    font-size: 0.5625rem;
    color: var(--zino-text-sub);
    background: rgba(255, 255, 255, 0.7);
}

.ct-map__pin {
    line-height: 0;
}

@media (min-width: 992px) {
    .ct-map {
        aspect-ratio: 655 / 215;
        min-height: 13.75rem;
    }
}

/* ── Email form ───────────────────────────────────────────────────────── */
/* the page scrolls here after a submit, so keep the heading clear of the
   header (which is sticky below 992px) */
.ct-mail {
    scroll-margin-top: var(--space-4);
}

@media (max-width: 991.98px) {
    .ct-mail {
        scroll-margin-top: 7rem;
    }
}

.ct-mail__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 var(--space-3);
    font-size: clamp(0.875rem, 0.8rem + 0.3vw, 1.0625rem);
    font-weight: 700;
    color: var(--zino-text-heading);
    line-height: 1.4;
}

.ct-mail__head i {
    color: var(--zino-green);
    font-size: 1.25rem;
    line-height: 1;
}

.ct-mail__box {
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid var(--zino-border-strong);
    background: #fff;
}

/* Honeypot: clipped rather than display:none, which the better bots know to
   skip. Clipping (not a -9999px offset) avoids overflowing an RTL page into a
   horizontal scrollbar. Real visitors never see or tab into it. */
.ct-form__trap {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    border: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.ct-form__label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--zino-text);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
}

.ct-form__req {
    color: var(--zino-green);
}

.ct-form__input,
.ct-form__textarea {
    width: 100%;
    background: #fff;
    color: var(--zino-text);
    font-family: inherit;
    font-size: 0.8125rem;
    outline: none;
}

.ct-form__input {
    border: 0;
    border-bottom: 1px solid var(--zino-border-strong);
    padding: 0.5rem 0;
    transition: border-color 0.2s ease;
}

.ct-form__input:focus {
    border-bottom-color: var(--zino-green);
}

.ct-form__textarea {
    min-height: 7.5rem;
    padding: 0.75rem;
    border: 1px solid var(--zino-border-strong);
    line-height: 1.9;
    resize: vertical;
    transition: border-color 0.2s ease;
}

.ct-form__textarea:focus {
    border-color: var(--zino-green);
}

.ct-form__input::placeholder,
.ct-form__textarea::placeholder {
    color: var(--zino-text-placeholder);
}

.ct-form__error {
    display: block;
    margin-top: var(--space-1);
    color: var(--zino-warn);
    font-size: 0.6875rem;
    line-height: 1.6;
}

.ct-form__actions {
    display: flex;
    justify-content: flex-end; /* RTL → bottom-left, per Figma */
    margin-top: var(--space-5);
}

/* Same slanted shape as the «افزودن به سبد خرید» CTA (.fav-cta / .loc-save-btn):
   the fill lives on ::before so the clip-path never cuts the label. */
.ct-form__submit {
    position: relative;
    isolation: isolate;
    z-index: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 8px 28px 8px 34px; /* wider on the notched side */
    border: none;
    background: none;
    color: #fff;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    line-height: 1.6;
    white-space: nowrap;
    cursor: pointer;
}

.ct-form__submit::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--zino-green);
    clip-path: polygon(14px 0, 100% 0, 100% 100%, 0 100%);
    transition: background 0.2s ease;
}

.ct-form__submit:hover::before,
.ct-form__submit:focus-visible::before {
    background: var(--zino-green-hover);
}

.ct-form__submit:disabled {
    cursor: default;
}

.ct-form__submit:disabled::before {
    background: var(--zino-disabled);
}

/* ── Small screens ────────────────────────────────────────────────────── */

/* Below xl the About page narrows its team photos and type; mirror it exactly
   so the two grids stay the same size at every breakpoint. */
@media (max-width: 1199.98px) {
    .ct-card {
        --ct-name-size: 0.5625rem;
        --ct-name-lh: 1.3;
    }

    .ct-card__photo-wrap {
        aspect-ratio: 122 / 163;
    }

    .ct-card__role {
        font-size: 0.5rem;
        line-height: 1.3;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .ct-card {
        --ct-name-size: 0.75rem;
    }

    .ct-card__role {
        font-size: 0.625rem;
    }
}

/* No hover on touch, so the panel would never open — the icons act directly. */
@media (hover: none) {
    .ct-card__tip {
        display: none;
    }
}

/* Three columns on a phone leave ~100px per card — not enough for a full name
   plus both icons on one line, so the icons drop under the name. */
@media (max-width: 767.98px) {
    /* keep name/icons on one row like desktop, just tighten the gap so both
       fit next to each other in a ~100px-wide card; RTL already puts the
       icons on the name's left. */
    .ct-card__row {
        justify-content: flex-start;
        gap: 0.375rem;
    }

    .ct-card__actions {
        gap: 0.25rem;
    }
}

@media (max-width: 575.98px) {
    .ct-reach__cols {
        flex-direction: column;
    }
}
