/* =====================================================
   CANACIET FCPC - estilos compartidos de todas las páginas
   ===================================================== */

/* ============ Colores (claro y oscuro) ============ */
:root {
    color-scheme: light;
    --bg: #F3F6F9;
    --surface: #FFFFFF;
    --surface-2: #E6EDF4;
    --text: #121F2D;
    --muted: #4F6376;
    --line: #D5DEE7;
    --brand: #12304F;
    --link: #1F6396;
    --blue: #2A6FA3;
    --dark-blue: #12304F;
    --sky-blue: #7DB8E2;
    --on-blue: #12304F;
    --viewport: #0E2238;
    --header-bg: rgba(255, 255, 255, .92);
    --footer-bg: #12304F;
    --shadow: 0 1px 2px rgba(18, 48, 79, .06), 0 10px 28px rgba(18, 48, 79, .07);
    --focus: #1F6396;
    --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0B1621;
    --surface: #112334;
    --surface-2: #193249;
    --text: #E6EEF5;
    --muted: #9DB3C6;
    --line: #26425A;
    --brand: #9CC4E4;
    --link: #6DB2E3;
    --dark-blue: #4C86B8;
    --viewport: #07111B;
    --header-bg: rgba(11, 22, 33, .92);
    --footer-bg: #07111B;
    --shadow: none;
    --focus: #6DB2E3;
}

/* ============ Base ============ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--link);
}

h1,
h2,
h3,
p {
    margin: 0;
}

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 100;
    background: var(--sky-blue);
    color: var(--on-blue);
    padding: 10px 16px;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

.wrap {
    width: min(1200px, 100% - 40px);
    margin-inline: auto;
}

.section {
    padding-block: clamp(32px, 5vw, 64px);
}

.section-title {
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--brand);
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.subhead {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--brand);
}

/* Franja con los tres colores del logo */
.brand-stripe {
    height: 5px;
    background: linear-gradient(90deg, var(--blue) 0 34%, var(--dark-blue) 34% 67%, var(--sky-blue) 67% 100%);
}

/* ============ Botones ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 999px;
    border: 2px solid transparent;
    font: 600 0.95rem/1.2 var(--font);
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s, border-color .15s;
}

.btn-accent {
    background: var(--sky-blue);
    color: var(--on-blue);
}

.btn-accent:hover {
    background: #A9D2EF;
}

.btn-outline {
    border-color: var(--brand);
    color: var(--brand);
    background: transparent;
}

.btn-outline:hover {
    background: var(--link);
    color: var(--surface);
}

.btn-sm {
    padding: 9px 18px;
    font-size: 0.875rem;
}


/* ============ Encabezado ============ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 68px;
}

.brand {
    display: block;
    border-radius: 6px;
    line-height: 0;
    flex: none;
}

.brand img {
    height: 46px;
    width: auto;
}

[data-theme="dark"] .brand {
    background: #fff;
    padding: 5px 10px;
}

.nav {
    display: flex;
    gap: 2px;
}

.nav a {
    padding: 8px 13px;
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav a:hover {
    background: var(--surface-2);
}

.nav a[aria-current="page"] {
    background: var(--surface-2);
    color: var(--brand);
    font-weight: 700;
}

.bar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    color: var(--text);
    border: 0;
    cursor: pointer;
    transition: background-color .15s;
}

.icon-btn:hover {
    background: var(--line);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .i-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .i-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .i-moon {
    display: none;
}

.nav-toggle {
    display: none;
}

.nav-cta {
    display: none;
}

.bar-actions .btn {
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .nav-toggle {
        display: grid;
    }

    .bar-actions .btn {
        display: none;
    }

    .nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        flex-direction: column;
        gap: 0;
        padding: 8px 20px 16px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
    }

    .nav.is-open {
        display: flex;
    }

    .nav a {
        padding: 12px 8px;
        border-radius: 6px;
    }

    /* Botones principales dentro del menú desplegable */
    .nav.is-open .nav-cta {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding-top: 14px;
    }

    .nav .nav-cta .btn {
        padding: 12px 10px;
        border-radius: 999px;
        text-align: center;
        background: var(--sky-blue);
        color: var(--on-blue);
        font-weight: 600;
        font-size: 0.9rem;
    }

    .nav .nav-cta .btn:hover {
        background: #A9D2EF;
    }
}

@media (max-width: 380px) {
    .nav.is-open .nav-cta {
        grid-template-columns: 1fr;
    }
}

/* ============ Cabecera de página interior ============ */
.page-head {
    padding-block: clamp(32px, 5vw, 56px) 0;
}

.page-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 24px;
}

.page-head+.section {
    padding-top: 24px;
}

.page-title {
    font-weight: 800;
    font-size: clamp(2rem, 4.2vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
    color: var(--brand);
}

/* ============ Inicio ============ */
.intro {
    padding-block: clamp(18px, 2.6vw, 30px) 16px;
}

.intro h1 {
    display: inline-block;
    white-space: nowrap;
    font-weight: 800;
    font-size: clamp(1rem, 3.6vw, 3.2rem);
    /* el ajuste exacto lo hace canaciet.js */
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--brand);
}

.intro h1.is-long {
    display: block;
    white-space: normal;
    text-wrap: balance;
    /* reparte el texto en líneas parejas */
    font-size: clamp(1.1rem, 1.9vw, 1.5rem);
}

.intro-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    margin-top: 4px;
}

.hero-sub {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* ============ Carrusel de comunicados ============ */
.carousel {
    position: relative;
}

.car-viewport {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: 72vh;
    width: 100%;
    background: var(--viewport);
    border-radius: 10px;
}

.car-slide {
    position: absolute;
    inset: 0;
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease, visibility .5s;
}

.car-slide.is-active {
    opacity: 1;
    visibility: visible;
}

.car-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.car-caption {
    position: absolute;
    left: 0;
    bottom: 0;
    background: var(--sky-blue);
    color: var(--on-blue);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 8px 18px;
    border-top-right-radius: 10px;
}

.car-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .92);
    color: #1F3645;
    border: 0;
    cursor: pointer;
    transition: background-color .15s;
}

.car-btn:hover {
    background: var(--sky-blue);
}

.car-btn svg {
    width: 20px;
    height: 20px;
}

.car-prev {
    left: 14px;
}

.car-next {
    right: 14px;
}

.car-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 8px;
}

.car-dots {
    display: flex;
    flex-wrap: wrap;
}

.car-dots button {
    width: 36px;
    height: 28px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.car-dots button::after {
    content: "";
    display: block;
    width: 100%;
    height: 4px;
    margin-inline: 3px;
    background: var(--line);
    border-radius: 2px;
    transition: background-color .2s;
}

.car-dots button.is-active::after {
    background: var(--brand);
}

.car-pause {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 0;
    cursor: pointer;
    color: var(--muted);
    font: 500 0.85rem var(--font);
    padding: 4px 0;
}

.car-pause svg {
    width: 14px;
    height: 14px;
}

.car-pause .ico-play {
    display: none;
}

.car-pause.is-paused .ico-play {
    display: block;
}

.car-pause.is-paused .ico-pause {
    display: none;
}

@media (max-width: 700px) {
    .car-viewport {
        aspect-ratio: 4 / 3;
    }

    .car-btn {
        width: 40px;
        height: 40px;
    }
}

/* ============ Tarjetas ============ */
.card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s;
}

.card:hover {
    border-color: var(--link);
}

/* Accesos (inicio) */
.access-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

.access {
    padding: 22px;
    gap: 6px;
}

.access-ico {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--link);
}

.access-ico svg {
    width: 22px;
    height: 22px;
}

.access-title {
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.25;
    color: var(--brand);
}

.access-desc {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.45;
}

@media (min-width: 480px) {
    .access-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 760px) {
    .access-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Servicios */
.svc-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(4, 1fr);
}

.svc-thumb {
    aspect-ratio: 3 / 2;
    background: var(--surface-2);
}

.svc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.svc-name {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 18px;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.25;
    color: var(--brand);
}

.svc-name svg {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--link);
}

@media (max-width: 960px) {
    .svc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .svc-grid {
        grid-template-columns: 1fr;
    }
}

/* ============ Documentos ============ */
.search {
    position: relative;
    width: min(420px, 100%);
}

.search input {
    width: 100%;
    padding: 12px 18px 12px 46px;
    border-radius: 999px;
    border: 2px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font: 500 0.95rem var(--font);
}

.search input::placeholder {
    color: var(--muted);
}

.search input:focus {
    outline: none;
    border-color: var(--link);
}

.search svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--muted);
    pointer-events: none;
}

.docs-status {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.9rem;
}

.docs-status:empty {
    margin: 0;
}

.doc-groups {
    display: grid;
    gap: 24px;
    align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 800px) {
    .doc-groups {
        grid-template-columns: 1fr;
    }
}

.doc-group {
    display: block;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 20px 22px 12px;
}

.doc-group[hidden] {
    display: none;
}

.doc-group h2,
.doc-group h3 {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--brand);
    margin-bottom: 8px;
}

.doc-count {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--muted);
}

.doc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.doc-list li {
    border-top: 1px solid var(--line);
}

.doc-list li[hidden] {
    display: none;
}

.doc-list a {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    color: var(--text);
    text-decoration: none;
    font-size: 0.925rem;
    line-height: 1.4;
}

.doc-list a::before {
    content: "";
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    background: var(--link);
    --ico-page: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.5.5l3-3a5 5 0 0 0-7-7l-1.7 1.7'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.5-.5l-3 3a5 5 0 0 0 7 7l1.7-1.7'/%3E%3C/svg%3E");
    -webkit-mask: var(--ico-page) center / contain no-repeat;
    mask: var(--ico-page) center / contain no-repeat;
}

.doc-list a[href$=".pdf" i]::before {
    --ico-pdf: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z'/%3E%3Cpath d='M14 3v5h5M9 13h6M9 17h6'/%3E%3C/svg%3E");
    -webkit-mask-image: var(--ico-pdf);
    mask-image: var(--ico-pdf);
}

.doc-list a:hover {
    color: var(--link);
    text-decoration: underline;
}

.doc-single {
    max-width: 760px;
}

/* ============ Vivienda ============ */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 44px;
}

.strip-ctrl {
    display: flex;
    gap: 8px;
}

.strip {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    scrollbar-width: thin;
}

.strip-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    height: clamp(240px, 32vw, 380px);
    min-width: 220px;
    background: var(--surface-2);
    border-radius: 8px;
    overflow: hidden;
}

.strip-item img {
    height: 100%;
    width: auto;
}

.strip-ctrl[hidden] {
    display: none;
}

.project {
    scroll-margin-top: 90px;
}

.project+.project {
    margin-top: 56px;
}

.subhead-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-btn {
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--link);
    border: 2px solid var(--link);
    cursor: pointer;
    transition: background-color .15s, color .15s;
}

.info-btn:hover {
    background: var(--link);
    color: var(--surface);
}

.info-btn svg {
    width: 16px;
    height: 16px;
}

.modal-body p+p {
    margin-top: 10px;
}

.modal-body .btn {
    margin-top: 16px;
}

/* ============ Nosotros: misión, visión e historia ============ */
.mv-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 800px) {
    .mv-grid {
        grid-template-columns: 1fr;
    }
}

.mv-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 5px solid var(--blue);
    border-radius: 10px;
    padding: clamp(22px, 3vw, 34px);
}

.mv-card.vision {
    border-top-color: var(--dark-blue);
}

.mv-card h2 {
    font-weight: 800;
    font-size: clamp(1.5rem, 2.6vw, 2rem);
    letter-spacing: -0.02em;
    color: var(--brand);
    margin-bottom: 14px;
}

.mv-card p {
    font-size: 1.05rem;
    line-height: 1.75;
}

/* Valores: 3 tarjetas arriba y 2 abajo en escritorio */
.value-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, 1fr);
}

.value-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 5px solid var(--blue);
    border-radius: 10px;
    padding: 22px 24px;
}

.value-card:nth-child(3n+2) {
    border-left-color: var(--dark-blue);
}

.value-card:nth-child(3n) {
    border-left-color: var(--sky-blue);
}

.value-card h3 {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--brand);
    margin-bottom: 8px;
}

.value-card p {
    line-height: 1.65;
}

@media (max-width: 900px) {
    .value-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .value-grid {
        grid-template-columns: 1fr;
    }
}

.prose {
    max-width: 72ch;
}

.prose p {
    font-size: 1.05rem;
    line-height: 1.8;
}

.prose p+p {
    margin-top: 1em;
}

/* ============ CANACIET (institucional y contacto) ============ */
.inst-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    align-items: start;
}

.contact-grid {
    display: grid;
    gap: 40px;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    align-items: start;
}

.contact-column {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.contact-block h3 {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--brand);
    margin-bottom: 12px;
}

.contact-block address {
    font-style: normal;
    line-height: 1.7;
}

.address-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
}

.address-row address {
    flex: 1 1 auto;
}

.map-frame {
    aspect-ratio: 16 / 10;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface-2);
}

.map-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.contact-column iframe {
    width: 100%;
    height: 320px;
    border: 0;
    border-radius: 12px;
}

.contact-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 220px));
    gap: 12px;
}

.contact-grid h3 {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--brand);
    margin-bottom: 8px;
}

.contact-grid p {
    margin-bottom: 6px;
}

@media (max-width: 600px) {
    .contact-buttons {
        grid-template-columns: 1fr;
    }
}

/* Correo y teléfono */
.contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 14px;
}

.contact-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.contact-item>span:not(.contact-ico) {
    flex: 1 1 auto;
}

.contact-ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--link);
}

.contact-ico svg {
    width: 20px;
    height: 20px;
}

.contact-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
}

.contact-value {
    font-weight: 600;
    font-size: 1.05rem;
    overflow-wrap: anywhere;
}

/* Tarjetas de WhatsApp */
.wa-list {
    --wa: #1B9A4E;
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.wa-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
    text-decoration: none;
    transition: border-color .15s, background-color .15s;
}

.wa-card:hover {
    border-color: var(--wa);
    background: var(--surface-2);
}

.wa-ico {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--wa);
    color: #fff;
}

.wa-ico svg {
    width: 28px;
    height: 28px;
}

.wa-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.wa-area {
    font-weight: 700;
    line-height: 1.25;
    color: var(--brand);
}

.wa-num {
    font-size: 1.05rem;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.wa-go {
    flex: none;
    width: 20px;
    height: 20px;
    color: var(--muted);
    transition: color .15s, transform .15s;
}

.wa-card:hover .wa-go {
    color: var(--wa);
    transform: translate(2px, -2px);
}

/* ============ Pie de página (compacto) ============ */
.footer {
    background: var(--footer-bg);
    color: #C5D2DB;
    margin-top: 24px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.footer a {
    color: #fff;
}

.footer-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 48px;
    padding-block: 22px 14px;
}

.footer h3 {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--sky-blue);
    margin-bottom: 2px;
}

.footer p {
    margin: 0 0 2px;
}

.footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer li {
    margin-bottom: 2px;
}

.footer-logo {
    display: inline-block;
    background: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    line-height: 0;
}

.footer-logo img {
    max-width: 110px;
    height: auto;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding-block: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, .15);
    font-size: 0.8125rem;
}

.footer-bottom .counter {
    display: flex;
    align-items: center;
    gap: 14px;
}

@media (max-width: 700px) {
    .footer-grid {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
}

/* ============ Ventanas emergentes ============ */
dialog.modal {
    width: min(560px, 92vw);
    max-height: 90vh;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
}

dialog.modal.lg {
    width: min(860px, 92vw);
}

dialog.modal::backdrop {
    background: rgba(10, 19, 26, .65);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line);
}

.modal-head h2 {
    font-weight: 700;
    font-size: 1.15rem;
    color: var(--brand);
}

.modal-head form {
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 0;
    background: var(--surface-2);
    color: var(--text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.modal-close:hover {
    background: var(--sky-blue);
    color: var(--on-blue);
}

.modal-body {
    padding: 18px;
}

.modal-body img {
    width: 100%;
    height: auto;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
    }
}

/* Botones dentro de los diálogos de proyecto */
.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions .btn {
    margin-top: 0;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex: none;
}

/* Texto largo en el diálogo: lista ordenada y cabecera siempre visible al desplazar */
.modal-body ul {
    margin: 8px 0 0;
    padding-left: 1.3em;
}

.modal-body li+li {
    margin-top: 4px;
}

.modal-head {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
}