@import url("./base.css");

/* Páginas legales */
.legal-page {
    margin-top: 1.5rem;
}

.legal-layout {
    grid-template-columns: 1fr;
}

.legal-layout .about-main {
    grid-column: span 1;
}

.legal-meta {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    opacity: 0.75;
}

.legal-heading {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 400;
    margin: 2.5rem 0 1rem;
    line-height: 1.2;
}

.legal-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.legal-card-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.legal-page .about-text a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-legal {
    font-size: 0.75rem;
    color: rgba(245, 241, 236, 0.5);
    text-decoration: none;
    font-weight: 300;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.footer-legal:hover {
    color: var(--cream);
}

@media (max-width: 768px) {
    .legal-cards {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-wrap: wrap;
        gap: 0.75rem 1.5rem;
    }
}

/* Ajustes de web 2 */
.svc-link {
    color: var(--terracotta);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
}

.svc-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Financiación: mismo lenguaje visual que contact-intro */
#contact + .financing-section {
    padding-top: 0;
}

.financing-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.financing-section .contact-title {
    margin-bottom: 1.25rem;
}

.financing-section .contact-intro .contact-text {
    max-width: 42rem;
}

.financing-section .contact-intro .contact-text + .contact-text {
    margin-top: -1.25rem;
}

.financing-section .contact-chips {
    margin-bottom: 2.5rem;
}

.financing-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem 2.5rem;
    margin-bottom: 2rem;
}

.financing-details .contact-text {
    margin-bottom: 0;
    max-width: none;
    font-size: 0.9rem;
}

.financing-section .financing-note {
    margin-bottom: 0;
    max-width: none;
}

@media (min-width: 1024px) {
    .financing-section .financing-note {
        white-space: nowrap;
    }
}

@media (max-width: 1024px) {
    .financing-details {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .financing-details {
        grid-template-columns: repeat(2, 1fr);
    }

    .financing-details .contact-text:last-child {
        grid-column: 1 / -1;
    }
}

/* Contacto y financiación: intro y formulario en dos filas */
#contact .contact-layout {
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 3.5rem);
}

#contact .contact-title {
    margin-bottom: 1.25rem;
}

#contact .contact-text {
    margin-bottom: 1.75rem;
    max-width: 42rem;
}

#contact .contact-form-card {
    width: 100%;
    padding: clamp(1.75rem, 4vw, 2.75rem);
}

#contact .contact-form-card .cform-title {
    margin-bottom: 1.5rem;
}

/* Formulario en varias columnas (menos scroll vertical) */
@media (min-width: 900px) {
    #contact #residentialContactForm {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.15rem 1.75rem;
        align-items: start;
    }

    #contact #residentialContactForm > .cform-group,
    #contact #residentialContactForm > .cform-row {
        margin-bottom: 0;
    }

    #contact #residentialContactForm > .cform-row,
    #contact #residentialContactForm > .cform-group:has([name="metodo_constructivo"]),
    #contact #residentialContactForm > .cform-group:has(textarea),
    #contact #residentialContactForm > .cform-feedback,
    #contact #residentialContactForm > .btn-submit-editorial {
        grid-column: 1 / -1;
    }

    #contact #residentialContactForm > .cform-group:has(textarea) textarea {
        min-height: 100px;
        height: 100px;
    }
}

@media (min-width: 1200px) {
    #contact #residentialContactForm {
        gap: 1.25rem 2rem;
    }

    #contact .contact-form-card {
        padding: 2.5rem 3rem;
    }
}

/* Respiración: primera sección tras hero y footer */
.hero + section,
.hero + .marquee + section {
    margin-top: 3.5rem !important;
}

footer {
    margin-top: 3.5rem !important;
}

/* Tarjetas de metodología con imagen (título y paso van en la imagen) */
.services-cards--media .svc-card--media {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.svc-card-media {
    position: relative;
    background: var(--cream);
    line-height: 0;
}

.svc-card-media img {
    width: 100%;
    height: auto;
    display: block;
}

.svc-card-step {
    display: none;
}

.svc-card--media .svc-name {
    margin: 0;
    padding: 1.35rem 2.25rem 0.5rem;
    font-family: var(--font-sans, "Space Grotesk", sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.svc-card--media .svc-desc {
    margin: 0;
    padding: 0 2.25rem 2rem;
}

#metodologia .services-cards--media {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 1024px) {
    #metodologia .services-cards--media {
        grid-template-columns: repeat(2, 1fr);
    }

    .svc-card--media .svc-name {
        padding: 1.25rem 2rem 0.5rem;
    }

    .svc-card--media .svc-desc {
        padding: 0 2rem 1.75rem;
    }
}

@media (max-width: 768px) {
    #metodologia .services-cards--media {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .svc-card--media .svc-name {
        padding: 1.15rem 1.75rem 0.45rem;
        font-size: 0.88rem;
    }

    .svc-card--media .svc-desc {
        padding: 0 1.75rem 1.65rem;
    }
}

/* Galería de proyecto (obra pública) */
.project-gallery {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    grid-template-rows: auto auto;
    gap: 1rem;
}

.project-gallery-item {
    margin: 0;
    overflow: hidden;
    border-radius: 2px;
    background: var(--cream);
    line-height: 0;
}

.project-gallery-item--wide {
    grid-column: 1 / -1;
}

.project-gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

.project-gallery-item:not(.project-gallery-item--wide) img {
    aspect-ratio: 4 / 3;
    min-height: 220px;
}

@media (max-width: 768px) {
    .project-gallery {
        grid-template-columns: 1fr;
    }

    .project-gallery-item--wide {
        grid-column: auto;
    }
}

/* Modelo residencial: planos legibles */
.project-gallery--modelo .project-gallery-item:not(.project-gallery-item--wide) img {
    object-fit: contain;
    aspect-ratio: auto;
    min-height: 0;
    padding: 0.5rem;
}

.model-subsections {
    display: flex;
    flex-direction: column;
    gap: clamp(1.25rem, 2.5vw, 1.75rem);
}

.model-subsection {
    background: var(--cream);
    border: 1px solid rgba(17, 17, 17, 0.08);
    border-radius: 20px;
    padding: clamp(2rem, 4vw, 3rem);
}

.model-subsection-header {
    margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
    padding-bottom: clamp(1.25rem, 2.5vw, 1.75rem);
    border-bottom: 1px solid rgba(17, 17, 17, 0.08);
}

.model-subsection-header .section-tag {
    margin-bottom: 0.75rem;
}

.model-subsection-title {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 2.8vw, 2.15rem);
    font-weight: 400;
    line-height: 1.2;
    margin: 0;
    color: var(--gray-900);
}

.model-subsection-body > .about-text:first-child {
    margin-top: 0;
}

.model-subsection .about-layout {
    margin-bottom: 2rem;
}

.model-subsection-body > .about-text[style],
.model-subsection-body > .about-text.anim {
    margin-bottom: 2rem;
}

/* Home: destacado Modelo M3-01 */
.home-model-layout {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    margin-top: 0.5rem;
}

.home-model-media {
    margin: 0;
    border-radius: 4px;
    overflow: hidden;
}

.home-model-media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.home-model-copy .about-text + .about-text {
    margin-top: 1rem;
}

.home-model-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    margin: 1.25rem 0 1.5rem;
    font-size: 0.88rem;
    color: var(--gray-600);
}

.home-model-stats span strong {
    color: var(--gray-900);
    font-weight: 600;
}

@media (max-width: 900px) {
    .home-model-layout {
        grid-template-columns: 1fr;
    }
}
