/* ==========================================================================
   Ajustes de diseño para móviles
   1) Todo el texto de las secciones se centra.
   2) Orden de lectura en cada sección: título, imagen y luego la información.
   Se carga después de app.css y header.css, por eso solo contiene ajustes.
   ========================================================================== */

/* En escritorio los dos bloques informativos comparten el mismo borde
   izquierdo y por eso se mantienen alineados al cambiar de idioma. */
.contact-promise {
    max-width: 100%;
}

/* Mantiene la franja de valores centrada tanto en fila como apilada. */
.values-inner {
    align-items: center;
    justify-content: center;
    text-align: center;
}

.values-inner p {
    justify-content: center;
    text-align: center;
}

@media (max-width: 1023px) {
    /* Barra superior y menú lateral */
    .header-topbar-inner {
        justify-content: center;
    }

    .mobile-drawer-heading {
        position: relative;
        justify-content: center;
        text-align: center;
    }

    .mobile-drawer-heading .drawer-close {
        position: absolute;
        top: 0;
        right: 0;
    }

    .site-header .primary-navigation .nav-link,
    .site-header .primary-navigation .nav-link:link,
    .site-header .primary-navigation .nav-link:visited {
        justify-content: center;
        text-align: center;
    }
}

@media (max-width: 800px) {
    /* ---------- Portada: título, imagen, información ---------- */
    .hero {
        display: flex;
        flex-direction: column;
        padding: 46px 32px 50px;
        text-align: center;
    }

    .hero-copy {
        display: contents;
    }

    .hero .eyebrow {
        order: 1;
        justify-content: center;
    }

    .hero h1 {
        order: 2;
        max-width: none;
        margin-bottom: 0;
    }

    .hero-photo {
        order: 3;
        min-height: 330px;
        margin: 26px -32px;
    }

    .hero-description {
        order: 4;
        max-width: none;
        margin-bottom: 22px;
    }

    .hero-copy > .button {
        order: 5;
        align-self: center;
    }

    .hero-signature {
        order: 6;
        justify-content: center;
    }

    /* ---------- Franja de valores ---------- */
    .values-inner {
        justify-content: center;
        text-align: center;
    }

    /* ---------- Quiénes somos: título, imagen, información ---------- */
    .about-section > .section-kicker {
        justify-content: center;
        text-align: center;
    }

    .about-grid {
        display: flex;
        flex-direction: column;
        gap: 17px;
        text-align: center;
    }

    .about-copy {
        display: contents;
    }

    .about-copy > h2 {
        order: 1;
        max-width: none;
        margin-bottom: 0;
    }

    .about-grid > .about-art {
        order: 2;
        margin: 9px 0 6px;
    }

    .about-copy > p:not(.eyebrow) {
        order: 3;
        margin-bottom: 0;
    }

    .about-copy > blockquote {
        order: 4;
        flex-direction: column;
        align-items: center;
        gap: 7px;
        margin: 6px 0;
        border-left: 0;
        border-top: 1px solid var(--gold);
        border-bottom: 1px solid var(--gold);
        padding: 15px 0;
        text-align: center;
    }

    .about-copy > .text-link {
        order: 5;
        align-self: center;
    }

    /* ---------- Áreas de práctica ---------- */
    .practice-card {
        align-items: center;
        text-align: center;
    }

    .practice-icon,
    .practice-card > a {
        align-self: center;
    }

    .practice-card h3 {
        max-width: none;
    }

    /* ---------- Nuestra abogada: título, imagen, información ---------- */
    .leadership-grid {
        display: flex;
        flex-direction: column;
        gap: 17px;
        text-align: center;
    }

    .leadership-copy {
        display: contents;
    }

    .leadership-copy > .section-kicker {
        order: 1;
        justify-content: center;
        text-align: center;
    }

    .leadership-copy > h2 {
        order: 2;
        max-width: none;
        margin-bottom: 0;
    }

    .leadership-grid > .founder-card {
        order: 3;
        margin: 9px 0 4px;
    }

    .leadership-copy > .founder-role {
        order: 4;
        align-items: center;
    }

    .leadership-copy > p:not(.founder-role) {
        order: 5;
        margin-bottom: 0;
    }

    .leadership-copy > .button-outline {
        order: 6;
        align-self: center;
    }

    .founder-card-top,
    .founder-card-bottom {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        justify-content: center;
        text-align: center;
    }

    /* ---------- Contacto ---------- */
    .contact-inner {
        text-align: center;
    }

    .contact-copy h2,
    .contact-intro,
    .contact-note {
        max-width: none;
        margin-right: auto;
        margin-left: auto;
    }

    .contact-promises {
        align-items: center;
        justify-content: center;
    }

    .contact-promise {
        flex-direction: column;
        gap: 9px;
        text-align: center;
    }

    .form-heading {
        flex-direction: column;
        align-items: center;
        gap: 6px;
        text-align: center;
    }

    .form-field label:not(.consent-label),
    .field-error,
    .form-error-summary,
    .consent-label {
        text-align: center;
    }

    /* ---------- Pie de página ---------- */
    .footer-main,
    .footer-bottom {
        text-align: center;
    }

    .footer-branding {
        align-items: center;
    }

    .footer-navigation,
    .footer-contact h2 {
        justify-content: center;
        text-align: center;
    }

    .footer-contact-link {
        flex-direction: column;
        gap: 7px;
        text-align: center;
    }

    /* ---------- Política de tratamiento de datos ---------- */
    .policy-content .eyebrow {
        justify-content: center;
    }

    .policy-content h1 {
        max-width: none;
        text-align: center;
    }

    .policy-lead {
        margin-right: auto;
        margin-left: auto;
        text-align: center;
    }

    .policy-updated,
    .policy-content h2 {
        text-align: center;
    }

    .policy-content .policy-back {
        display: flex;
        width: fit-content;
        margin-right: auto;
        margin-left: auto;
    }

    .policy-callout {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }
}

@media (max-width: 560px) {
    /* La portada mantiene la imagen a todo el ancho */
    .hero {
        padding: 42px 25px 44px;
    }

    .hero-photo {
        min-height: 280px;
        margin: 22px -25px;
    }

    .about-grid > .about-art,
    .leadership-grid > .founder-card {
        margin: 6px 0 4px;
    }

    .values-inner {
        align-items: center;
        text-align: center;
    }
}

/* Keep form controls readable without automatic zoom on mobile browsers. */
@media (max-width: 800px) {
    .form-field input:not([type="checkbox"]),
    .form-field select,
    .form-field textarea {
        font-size: 16px;
    }

    .form-submit-row {
        flex-direction: column;
        align-items: stretch;
    }

    .form-submit {
        width: 100%;
        min-width: 0;
    }
}

.form-modal-card {
    max-height: calc(100dvh - 44px);
    overflow-y: auto;
}

.form-submit:disabled {
    cursor: wait;
    opacity: .7;
}
