@font-face {
    font-family: "Neurial";
    src: url("../fonts/NeurialGrotesk-Regular.otf") format("opentype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Neurial";
    src: url("../fonts/NeurialGrotesk-Light.otf") format("opentype");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Neurial";
    src: url("../fonts/NeurialGrotesk-Medium.otf") format("opentype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Neurial";
    src: url("../fonts/NeurialGrotesk-Bold.otf") format("opentype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --primario: #00548b;
    --secundario: #004168;
    --terciario: #005c99;
    --gris-primario: #bdbbbb;
    --gris-secundario: #c9c7c7;
    --gris-terciario: #a3a2a2;
    --light: #e9e9ec;
    --soft: #f1efef;
    --white: #ffffff;
    --ink: #004168;
    --muted: #6f7d87;
    --line: rgba(0, 84, 139, 0.16);
    --header-height: 82px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 16px);
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--white);
    font-family: "Neurial", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 5500;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    min-height: var(--header-height);
    padding: 20px clamp(22px, 5vw, 72px);
    color: var(--white);
    background: var(--primario);
    border-bottom: 1px solid var(--white);
    transition: min-height 180ms ease, padding 180ms ease, background-color 180ms ease;
}

.site-header.is-compact {
    min-height: 60px;
    padding-top: 8px;
    padding-bottom: 8px;
}

.brand img {
    display: block;
    width: 170px;
    height: auto;
    filter: brightness(0) invert(1);
}

.main-nav,
.social-links,
.footer-social {
    display: flex;
    align-items: center;
}

.main-nav {
    justify-content: center;
    gap: clamp(8px, 1.2vw, 18px);
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 10px;
    color: var(--white);
    font-size: clamp(12px, 1vw, 15px);
    font-weight: 300;
    letter-spacing: 0;
    transition: background-color 180ms ease, font-weight 180ms ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    background: var(--secundario);
    font-weight: 700;
    outline: 0;
}

.social-links,
.footer-social {
    gap: 12px;
}

.social-links img,
.footer-social img {
    display: block;
    filter: brightness(0) invert(1);
}

main {
    padding-top: var(--header-height);
}


.eyebrow {
    margin: 0;
    color: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.home-hero h1 {
    max-width: 820px;
    margin: 0;
    color: var(--white);
    font-size: clamp(42px, 6vw, 86px);
    font-weight: 300;
    line-height: 0.98;
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    color: var(--white);
    background: var(--secundario);
    border: 1px solid var(--secundario);
    border-radius: 0;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.button:disabled,
button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.button:hover,
.button:focus-visible {
    color: var(--primario);
    background: var(--white);
    outline: 0;
}

.button-light {
    width: fit-content;
    color: var(--white);
    background: var(--secundario);
    border-color: var(--white);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section {
    padding: clamp(64px, 7vw, 108px) clamp(18px, 5vw, 72px);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 34px;
}

.section-title {
    margin: 0;
    color: var(--primario);
    font-size: clamp(34px, 4vw, 62px);
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
}

.section-link {
    color: var(--primario);
    font-size: clamp(18px, 2vw, 25px);
    font-weight: 300;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: transform 180ms ease, font-weight 180ms ease;
}

.section-link:hover {
    transform: scale(1.04);
    font-weight: 700;
}


.site-footer {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 1fr auto;
    gap: 34px;
    align-items: start;
    padding: 56px clamp(18px, 5vw, 72px);
    color: var(--white);
    background: var(--primario);
    border-top: 1px solid var(--white);
}

.footer-logo {
    width: 240px;
    height: auto;
    margin-bottom: 22px;
    filter: brightness(0) invert(1);
}

.site-footer p {
    margin: 4px 0;
    font-weight: 300;
}

.footer-social {
    margin-top: 20px;
}

.footer-nav {
    display: grid;
    gap: 4px;
}

.footer-nav a {
    color: var(--white);
    font-size: 15px;
    font-weight: 300;
}

.footer-nav a:hover {
    text-decoration: underline;
}

.footer-alliances p {
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-alliances div {
    display: flex;
    align-items: center;
    gap: 18px;
}

.footer-alliances img {
    max-width: 110px;
    max-height: 70px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.footer-certifications {
    display: flex;
    gap: 18px;
}

.footer-certifications img {
    width: auto;
    height: 130px;
    filter: brightness(0) invert(1);
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.card {
    min-height: 220px;
    padding: 24px;
    background: var(--soft);
    border: 1px solid var(--line);
}

.card h2,
.card h3 {
    margin: 0 0 12px;
    color: var(--primario);
}

.admin-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background: var(--soft);
}

.admin-panel {
    width: min(100%, 420px);
    padding: 28px;
    background: var(--white);
    border: 1px solid var(--line);
}

.admin-panel label {
    display: grid;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 14px;
}

.admin-panel input,
.admin-form input,
.admin-form textarea,
.admin-home-form select {
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    color: var(--ink);
    border: 1px solid var(--line);
    font: inherit;
    font-weight: 400;
}

.admin-dashboard {
    max-width: 1040px;
    margin: 0 auto;
    padding: 48px 24px;
}

.admin-form {
    display: grid;
    gap: 18px;
}

.admin-form label {
    display: grid;
    gap: 8px;
    color: var(--primario);
    font-weight: 700;
}

.admin-form textarea {
    resize: vertical;
}

.admin-page-actions,
.admin-sticky-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 28px;
}

.admin-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.admin-section-heading h2 {
    margin: 4px 0 8px;
}

.admin-section-heading p:last-child {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
}

.admin-notice {
    padding: 12px 14px;
    border: 1px solid var(--line);
}

.admin-notice--success {
    color: #214f2d;
    background: #edf7ef;
    border-color: #9fc7a8;
}

.admin-sort-status {
    min-height: 24px;
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 14px;
}

.admin-sort-list {
    display: grid;
    gap: 8px;
}

.admin-sort-item {
    display: grid;
    grid-template-columns: 34px 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 10px 12px;
    background: var(--white);
    border: 1px solid var(--line);
}

.admin-sort-item.is-dragging {
    opacity: 0.45;
    border-color: var(--primario);
}

.admin-drag-handle {
    display: grid;
    width: 34px;
    min-height: 44px;
    place-items: center;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: grab;
    user-select: none;
}

.admin-drag-handle:active {
    cursor: grabbing;
}

.admin-sort-position {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.admin-sort-project {
    min-width: 0;
}

.admin-sort-project strong,
.admin-sort-project small {
    display: block;
}

.admin-sort-project small {
    margin-top: 4px;
    color: var(--muted);
}

.admin-sort-controls {
    display: flex;
    gap: 6px;
}

.button-compact {
    min-height: 40px;
    padding: 7px 10px;
}

.admin-home-form {
    display: grid;
    gap: 18px;
}

.admin-home-group {
    margin: 0;
    padding: 20px;
    border: 1px solid var(--line);
}

.admin-home-group legend {
    padding: 0 8px;
    color: var(--primario);
    font-size: 20px;
    font-weight: 700;
}

.admin-home-group > p {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 14px;
}

.admin-home-slots {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-home-slots label {
    display: grid;
    gap: 7px;
    color: var(--primario);
    font-size: 14px;
    font-weight: 700;
}

.admin-sticky-actions {
    position: sticky;
    z-index: 10;
    bottom: 0;
    align-items: center;
    margin-bottom: 0;
    padding: 14px 0;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid var(--line);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-table {
    display: grid;
    gap: 10px;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.admin-logout-form {
    margin: 0;
}

.link-button {
    min-height: 44px;
    padding: 8px 12px;
    color: var(--primario);
    background: transparent;
    border: 0;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.link-button:hover,
.link-button:focus-visible {
    text-decoration: underline;
}

.admin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
}

.admin-row small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.admin-gallery-manager {
    min-width: 0;
    margin: 8px 0;
    padding: 20px;
    border: 1px solid var(--line);
}

.admin-gallery-manager legend {
    padding: 0 8px;
    color: var(--primario);
    font-size: 20px;
    font-weight: 700;
}

.admin-gallery-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.admin-gallery-heading p {
    max-width: 690px;
    margin: 0;
    color: var(--muted);
    font-weight: 400;
}

.admin-gallery-heading strong {
    flex: 0 0 auto;
    color: var(--primario);
    font-variant-numeric: tabular-nums;
}

.admin-gallery-status {
    min-height: 22px;
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 14px;
}

.admin-gallery-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-gallery-item {
    min-width: 0;
    padding: 14px;
    background: var(--white);
    border: 1px solid var(--line);
}

.admin-gallery-item.is-empty {
    background: var(--soft);
    border-style: dashed;
}

.admin-gallery-item.is-dragging {
    opacity: 0.45;
    border-color: var(--primario);
}

.admin-gallery-item.is-pending-delete {
    background: #fff4f2;
    border-color: #b65446;
}

.admin-gallery-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    margin-bottom: 8px;
}

.admin-gallery-position {
    color: var(--primario);
    font-size: 15px;
    font-weight: 700;
}

.admin-gallery-drag {
    display: grid;
    width: 44px;
    min-height: 44px;
    place-items: center;
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
    cursor: grab;
    user-select: none;
}

.admin-gallery-drag:active {
    cursor: grabbing;
}

.admin-gallery-preview {
    display: grid;
    width: 100%;
    aspect-ratio: 4 / 3;
    place-items: center;
    margin-bottom: 14px;
    overflow: hidden;
    color: var(--muted);
    background: var(--light);
}

.admin-gallery-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-gallery-file-label {
    margin-bottom: 14px;
}

.admin-gallery-item label small {
    color: var(--muted);
    font-weight: 400;
}

.admin-gallery-item__status {
    min-height: 22px;
    margin: 12px 0 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.admin-gallery-item.is-pending-delete .admin-gallery-item__status {
    color: #8b2f23;
}

.admin-gallery-item__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-gallery-delete {
    color: #8b2f23;
    border-color: #b65446;
}

.button-secondary {
    color: var(--primario);
    background: var(--white);
}


@media (max-width: 1100px) {
    .site-footer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .grid,
    .admin-grid,
    .admin-home-slots,
    .admin-gallery-list,
    .site-footer {
        grid-template-columns: 1fr;
    }

    .admin-gallery-heading {
        flex-direction: column;
    }

    .admin-section-heading {
        flex-direction: column;
    }

    .admin-sort-item {
        grid-template-columns: 34px 30px minmax(0, 1fr);
    }

    .admin-sort-controls {
        grid-column: 2 / -1;
    }

    .footer-certifications img {
        height: 100px;
    }
}

.nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-direction: column;
    color: var(--white);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 0;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--white);
    transition: transform 180ms ease, opacity 180ms ease;
}

.nav-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/*
 * Ajustes de paridad visual con el tema original edilizia-themeV2.00.
 * Se carga después de site.css para mantener aislada la reconstrucción.
 */

:root {
    --header-height: 84px;
    --header-compact-height: 42px;
}

.site-header {
    grid-template-columns: auto 1fr auto;
    gap: 0;
    min-height: var(--header-height);
    padding: 20px clamp(24px, 2.5vw, 40px);
    background: var(--primario);
    transition: min-height 500ms ease-in-out, padding 300ms ease;
}

.site-header.is-compact {
    min-height: var(--header-compact-height);
    padding: 0 clamp(24px, 2.5vw, 40px);
}

.brand img {
    width: 169px;
    height: 32px;
}

.main-nav {
    gap: 0;
}

.main-nav a {
    min-height: 40px;
    margin-right: 8px;
    padding: 8px;
    font-size: 12px;
    font-weight: 300;
}

.social-links {
    gap: 10px;
}

.social-links a {
    position: relative;
    display: grid;
    width: 25px;
    height: 25px;
    place-items: center;
}

.social-links .social-icon {
    position: absolute;
    inset: 0;
    display: block;
    width: 25px;
    height: 25px;
    transition: opacity 180ms ease;
}

.social-links .social-icon--filled {
    opacity: 0;
}

.social-links a:hover .social-icon--outline,
.social-links a:focus-visible .social-icon--outline {
    opacity: 0;
}

.social-links a:hover .social-icon--filled,
.social-links a:focus-visible .social-icon--filled {
    opacity: 1;
}

.home-hero {
    position: relative;
    display: block;
    width: 100%;
    height: 700px;
    min-height: 700px;
    margin-top: calc(var(--header-height) * -1);
    overflow: hidden;
    background: var(--secundario);
}

.home-hero::before {
    display: none;
}

.home-hero__video {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.home-hero__video iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: max(100vw, 1244.44px);
    height: max(700px, 56.25vw);
    border: 0;
    transform: translate(-50%, -50%);
}

@media (min-width: 1300px) {
    .main-nav a {
        font-size: 15px;
        padding-top: 10px;
        padding-bottom: 10px;
    }
}

@media (max-width: 991px) {
    :root {
        --header-height: 64px;
    }

    .site-header,
    .site-header.is-compact {
        position: fixed;
        grid-template-columns: 44px 1fr auto;
        gap: 10px;
        min-height: var(--header-height);
        padding: 10px 14px;
    }

    .brand {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }

    .brand img {
        width: 114px;
        height: auto;
    }

    .nav-toggle {
        grid-column: 1;
        grid-row: 1;
        border: 0;
    }

    .social-links {
        grid-column: 3;
        grid-row: 1;
        gap: 5px;
    }

    .social-links a,
    .social-links .social-icon {
        width: 20px;
        height: 20px;
    }

    .main-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        background: var(--primario);
    }

    .main-nav a {
        margin: 0;
        padding: 0 12px;
        font-size: 15px;
    }

    main {
        padding-top: var(--header-height);
    }

    .home-hero {
        height: 400px;
        min-height: 400px;
        margin-top: calc(var(--header-height) * -1);
    }

    .home-hero__video iframe {
        width: max(100vw, 711.11px);
        height: max(400px, 56.25vw);
    }
}

@media (max-width: 399px) {
    .brand img {
        width: 89px;
    }

    .social-links a,
    .social-links .social-icon {
        width: 18px;
        height: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .social-links .social-icon {
        transition: none;
    }

    .home-hero__video iframe {
        display: none;
    }

    .home-hero__video {
        background: var(--secundario) url("../images/grupal-24-editada.webp") center / cover no-repeat;
    }
}

@media (max-width: 991px) {
    .nav-toggle {
        display: inline-flex;
    }

    .main-nav {
        display: none;
        justify-content: stretch;
        width: 100%;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.35);
    }

    .main-nav.is-open {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0;
    }

    .main-nav a {
        min-height: 44px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    }
}


.whatsapp-contact {
    position: fixed; right: max(22px, env(safe-area-inset-right));
    bottom: max(22px, env(safe-area-inset-bottom)); z-index: 90;
    display: grid; place-items: center; width: 56px; height: 56px;
    border-radius: 50%; color: #fff; background: #128c4a;
    border: 2px solid #fff; box-shadow: 0 3px 14px #002b4633;
    transition: background-color 180ms ease;
}
.whatsapp-contact:hover { background: #0b6b38; }
.whatsapp-contact:focus-visible { outline: 3px solid #f2b544; outline-offset: 4px; }
@media (max-width: 640px) {
    .whatsapp-contact { right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); width: 52px; height: 52px; }
}
.admin-session-notice {
    position: sticky;
    z-index: 20;
    top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 0 0 20px;
    padding: 16px;
    border: 2px solid #a46500;
    background: #fff4d6;
    color: #442d00;
    box-shadow: 0 8px 24px rgba(0, 43, 70, .16);
}
.admin-session-notice[hidden] { display: none; }
.admin-session-notice p { margin: 0; }
@media (max-width: 600px) {
    .admin-session-notice { align-items: stretch; flex-direction: column; }
}
