/* ==========================================================================
   Appointment page (appuntamento.php): "talk to me" card, trust panel, steps.
   Loaded after css/site.css and css/booking.css (the form card); classes prefixed .ap-.
   ========================================================================== */

/* How far the form card rises into the hero (shared by hero and form section). */
.page-main {
    --ap-overlap: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
}

/* Hero: short credentials under the lead */
.ap-hero .lead {
    margin-bottom: var(--space-5);
}

ul.ap-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2) 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ap-badges li {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 36px;
    padding: 0.375rem 0.75rem 0.375rem 0.5rem;
    border: 1px solid var(--c-line);
    border-radius: var(--radius-pill);
    background: rgb(251 252 251 / 0.65);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--c-ink);
}

.ap-badges .icon {
    width: 17px;
    height: 17px;
    color: var(--c-teal);
}

/* Call link under the lead, shown on phones only (see Responsive). */
.ap-hero__call {
    display: none;
}

/* Booking area: form card (css/booking.css) overlapping the hero + side column */
.ap-book {
    position: relative;
    z-index: 2;
    margin-top: calc(-1 * var(--ap-overlap) - var(--inset));
    padding-bottom: var(--section-y);
}

/* Hero leaves room for the overlapping form card. */
.page-hero:has(+ .ap-book) {
    padding-bottom: calc(var(--ap-overlap) + clamp(2.25rem, 1.75rem + 2vw, 3.5rem));
}

.ap-book__grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-6) clamp(1.5rem, 0.5rem + 3vw, 3.5rem);
    align-items: start;
}

/* Side column: starts below the hero on desktop */
.ap-side {
    display: grid;
    gap: var(--space-5);
    margin-top: calc(var(--ap-overlap) + var(--inset));
}

/* "Preferisci parlare a voce?": teal card with portrait, large call button, hours */
.ap-voice {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
    background:
        radial-gradient(70% 60% at 100% 0%, rgb(201 123 99 / 0.28), transparent 70%),
        radial-gradient(60% 60% at 0% 100%, rgb(11 45 51 / 0.35), transparent 70%),
        var(--c-teal);
    color: var(--c-on-dark);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 60px -28px rgb(11 45 51 / 0.6);
}

/* Brand emblem as a quiet watermark, as in the contact panel. */
.ap-voice::before {
    content: "";
    position: absolute;
    right: -70px;
    top: -40px;
    width: 280px;
    aspect-ratio: 480 / 327;
    background: url("../../images/logo/emblema-480.webp") no-repeat center / contain;
    opacity: 0.12;
    z-index: -1;
}

.ap-voice :focus-visible {
    outline-color: var(--c-on-dark);
}

.ap-voice__person {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
    font-size: var(--fs-sm);
    line-height: 1.35;
    color: var(--c-on-teal-soft);
}

.ap-voice__person img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    object-position: 50% 22%;
    box-shadow: 0 0 0 3px var(--c-teal), 0 0 0 4px rgb(243 246 244 / 0.45);
    flex: none;
}

.ap-voice__person strong {
    display: block;
    font-weight: 600;
    color: var(--c-on-dark);
}

.ap-voice__title {
    margin-bottom: var(--space-2);
    font-family: var(--font-serif);
    font-size: clamp(1.625rem, 1.4rem + 0.7vw, 2rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--c-on-dark);
    text-wrap: balance;
}

.ap-voice__title em {
    font-style: italic;
    font-weight: 400;
    color: #e8b6a5;
}

.ap-voice__text {
    color: var(--c-on-teal-soft);
}

/* Large call button */
.ap-call {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    min-height: 80px;
    margin-top: var(--space-5);
    padding: var(--space-3) var(--space-5) var(--space-3) var(--space-3);
    background: var(--c-surface);
    border-radius: var(--radius-pill);
    color: var(--c-ink);
    text-decoration: none;
    box-shadow: 0 14px 30px -16px rgb(11 45 51 / 0.7);
    transition:
        transform var(--dur) var(--ease-out),
        box-shadow var(--dur) var(--ease-out);
}

.ap-call:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 36px -16px rgb(11 45 51 / 0.75);
}

.ap-voice .ap-call:focus-visible {
    border-radius: var(--radius-pill);
}

.ap-call__icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--c-teal);
    color: var(--c-on-dark);
    flex: none;
}

.ap-call__icon .icon {
    width: 24px;
    height: 24px;
}

.ap-call__body {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.ap-call__label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-teal-strong);
}

.ap-call__number {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 1.3rem + 0.7vw, 1.875rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
    font-variant-numeric: lining-nums;
    white-space: nowrap;
}

.ap-call__go {
    width: 20px;
    height: 20px;
    margin-left: auto;
    color: var(--c-teal);
    transition: transform var(--dur) var(--ease-out);
}

.ap-call:hover .ap-call__go {
    transform: translateX(3px);
}

/* Hours: days and times as a small two-cell table */
.ap-hours {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: var(--space-5) 0 0;
    border: 1px solid rgb(243 246 244 / 0.22);
    border-radius: var(--radius);
    background: rgb(11 45 51 / 0.12);
}

.ap-hours div {
    padding: var(--space-3) var(--space-4);
}

.ap-hours div + div {
    border-left: 1px solid rgb(243 246 244 / 0.22);
}

.ap-hours dt {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-on-teal-soft);
}

.ap-hours dd {
    margin: 2px 0 0;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--c-on-dark);
    font-variant-numeric: lining-nums;
    white-space: nowrap;
}

.ap-voice__mail {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    margin-top: var(--space-3);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--c-on-dark);
    text-decoration-color: rgb(243 246 244 / 0.45);
    overflow-wrap: anywhere;
}

.ap-voice__mail .icon {
    width: 18px;
    height: 18px;
    color: var(--c-on-teal-soft);
}

.ap-voice__mail:hover {
    text-decoration-color: currentColor;
}

/* "Dove ricevo": studio photo + offices */
.ap-where {
    overflow: hidden;
    background: var(--c-surface);
    border: 1px solid var(--c-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.ap-where__photo {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: 50% 60%;
}

.ap-where__body {
    padding: clamp(1.25rem, 1rem + 1vw, 1.75rem) clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem) clamp(1.25rem, 1rem + 1vw, 1.75rem);
}

.ap-where__title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.015em;
}

/* Offices: reuses .offices/.office from site.css, without its top rule. */
.ap-offices {
    margin-top: var(--space-4);
    padding-top: 0;
    border-top: 0;
}

.ap-online {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--c-line);
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--c-ink-soft);
}

.ap-online .icon {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--c-tertiary-strong);
}

.ap-online a {
    display: inline-block;
    padding-block: 0.5rem;
    font-weight: 600;
    color: var(--c-teal-strong);
    text-decoration-color: currentColor;
}

.ap-online a:hover {
    color: var(--c-ink);
}

/* Trust panel: credentials on the left, reviews card on the right */
.ap-trust__grid {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--space-7) clamp(2rem, 1rem + 4vw, 5rem);
    align-items: center;
}

.ap-trust .h2 {
    margin-bottom: var(--space-4);
}

.ap-trust__intro {
    max-width: 40rem;
    font-size: var(--fs-lead);
    line-height: 1.6;
    color: var(--c-ink-soft);
    text-wrap: pretty;
}

ul.ap-creds {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-5) var(--space-6);
    margin: var(--space-6) 0 0;
    padding: 0;
    list-style: none;
}

.ap-creds li {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
}

.ap-creds .icon-chip {
    width: 48px;
    height: 48px;
}

.ap-creds .icon-chip .icon {
    width: 26px;
    height: 26px;
}

.ap-creds .tone-sage {
    --chip-bg: var(--c-surface);
}

.ap-creds p {
    font-size: var(--fs-sm);
    line-height: 1.45;
    color: var(--c-ink-soft);
}

.ap-creds strong {
    display: block;
    margin-bottom: 2px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--c-ink);
}

/* Scientific societies: text + official logos on white plates */
.ap-societies {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4) var(--space-5);
    margin-top: var(--space-6);
    padding: var(--space-4) var(--space-5);
    background: rgb(251 252 251 / 0.6);
    border: 1px solid var(--c-line);
    border-radius: var(--radius);
}

.ap-societies p {
    flex: 1 1 16rem;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--c-ink-soft);
}

.ap-societies strong {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--c-ink);
}

ul.ap-societies__logos {
    display: flex;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.ap-societies__logo {
    display: flex;
    align-items: center;
    height: 56px;
    padding: 0 var(--space-3);
    border-radius: var(--radius-sm);
    background: #ffffff;
    box-shadow: inset 0 0 0 1px var(--c-line);
}

.ap-societies__logo img {
    width: auto;
    height: 40px;
    max-width: none;
}

/* Optical balance between the compact SITCC mark and the wide MITHS logo */
.ap-societies__logo--miths img {
    height: 32px;
}

.ap-trust .link-arrow {
    margin-top: var(--space-4);
}

/* Reviews card: one quote at a time (carousel from js/site.js) */
.ap-reviews {
    position: relative;
    padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
    background: var(--c-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.ap-reviews__mark {
    position: absolute;
    top: clamp(1.25rem, 0.9rem + 1vw, 1.75rem);
    right: clamp(1.5rem, 1rem + 2vw, 2.5rem);
    width: 52px;
    height: 52px;
    color: var(--c-secondary);
    --icon-duo: var(--c-secondary);
    --icon-duo-opacity: 0.35;
}

.ap-reviews__head {
    margin-bottom: var(--space-5);
    padding-right: 64px;
}

.ap-reviews__title {
    margin-bottom: var(--space-2);
    font-family: var(--font-serif);
    font-size: 1.375rem;
    font-weight: 500;
    line-height: 1.25;
}

.ap-reviews__track {
    grid-auto-columns: 100%;
    gap: var(--space-6);
    padding: 0;
}

/* The shared .review styles are for the dark home stage: switch them to ink on this light card. */
.ap-reviews .review blockquote {
    font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
    color: var(--c-ink);
}

.ap-reviews .review__by {
    color: var(--c-ink-soft);
}

.ap-reviews .review__by strong {
    color: var(--c-ink);
}

.ap-reviews .review__by .monogram {
    background: var(--c-secondary-soft);
    color: var(--c-secondary-strong);
}

.ap-reviews__controls {
    justify-content: flex-end;
    margin-top: calc(-1 * 46px);
    pointer-events: none;
}

.ap-reviews__controls .carousel__btn {
    width: 46px;
    height: 46px;
    pointer-events: auto;
}

.ap-reviews__more {
    display: flex;
    width: 100%;
    margin-top: var(--space-4);
    padding-top: var(--space-3);
    border-top: 1px solid var(--c-line);
}

/* How it works: three steps in a row, joined by a hairline */
.ap-steps {
    padding-block: clamp(3rem, 2rem + 3vw, 5rem);
}

.ap-steps__title {
    margin-bottom: var(--space-6);
}

ol.ap-steps__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--space-6) clamp(1.5rem, 1rem + 2vw, 3rem);
    margin: 0;
    padding: 0;
    list-style: none;
}

.ap-step {
    position: relative;
}

.ap-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 28px;
    left: calc(56px + var(--space-4));
    right: calc(-1 * clamp(1.5rem, 1rem + 2vw, 3rem) + var(--space-4));
    height: 1px;
    background: var(--c-line-strong);
}

.ap-step__marker {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-bottom: var(--space-4);
    border-radius: 50%;
    background: var(--c-surface);
    color: var(--c-teal-strong);
    box-shadow: var(--shadow-sm);
    --icon-duo: var(--c-secondary);
    --icon-duo-opacity: 0.45;
}

.ap-step__marker .icon {
    width: 28px;
    height: 28px;
}

.ap-step .h3 {
    margin-bottom: var(--space-2);
}

.ap-step p {
    max-width: 34ch;
    color: var(--c-ink-soft);
    text-wrap: pretty;
}

/* Responsive */
@media (max-width: 1023px) {
    .ap-book__grid,
    .ap-trust__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ap-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        margin-top: 0;
    }

    /* The call card now sits below the whole form: a direct call link in the hero. */
    .ap-hero__call {
        display: inline-flex;
        margin: calc(-1 * var(--space-2)) 0 var(--space-3);
    }

    .ap-hero__call .icon {
        width: 20px;
        height: 20px;
    }

    /* Narrower call button in the half-width card: the arrow keeps clear of the number. */
    .ap-call {
        gap: var(--space-3);
        padding-right: var(--space-4);
    }

    .ap-call__number {
        font-size: 1.5rem;
    }
}

@media (max-width: 767px) {
    .ap-side,
    ul.ap-creds,
    ol.ap-steps__list {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Steps stack vertically: marker on the left, line running down. */
    .ap-step {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr);
        column-gap: var(--space-4);
    }

    .ap-step__marker {
        grid-row: span 2;
        margin-bottom: 0;
    }

    .ap-step .h3 {
        align-self: end;
        margin-top: var(--space-3);
    }

    .ap-step:not(:last-child)::after {
        top: calc(56px + var(--space-2));
        bottom: calc(-1 * var(--space-6) + var(--space-2));
        left: 28px;
        right: auto;
        width: 1px;
        height: auto;
    }
}

@media (max-width: 599px) {
    .ap-hero .lead {
        margin-bottom: var(--space-4);
        font-size: var(--fs-base);
        line-height: 1.55;
    }

    /* Badges as a light inline list: the form stays close to the top. */
    ul.ap-badges {
        gap: var(--space-1) var(--space-4);
    }

    .ap-badges li {
        min-height: 28px;
        padding: 0;
        border: 0;
        background: none;
        font-size: 0.875rem;
    }

    .ap-badges .icon {
        width: 16px;
        height: 16px;
    }
}
