/* Landing page (Default.aspx) */

body {
    background: var(--archivo-fondo);
}

.container-lg.body-content {
    max-width: 1620px;
}

/* ── Layout principal: logo lateral + contenido ── */

.landing-page {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: clamp(1.5rem, 3vw, 4rem);
    min-height: calc(100vh - 76px);
    align-items: center;
    padding: clamp(1.5rem, 3vw, 3rem) clamp(1.5rem, 3vw, 3rem) 130px 0;
    color: #1f2733;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ── Logo lateral ── */

.landing-hero-logo {
    position: relative;
    width: clamp(280px, 42vw, 600px);
    aspect-ratio: 1;
}

.landing-hero-logo::before {
    content: "";
    position: absolute;
    inset: -60px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(154, 123, 63, .38) 0%, rgba(154, 123, 63, .14) 45%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.landing-hero-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

/* ── Columna de contenido ── */

.landing-content {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.landing-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ── Título en dos niveles ── */

.landing-hero h1 {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .06em;
    line-height: 1.05;
}

.h1-line1 {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: clamp(1.1rem, 2.5vw, 2rem);
    font-weight: 400;
    font-style: italic;
    color: #6b5e4a;
    letter-spacing: .015em;
}

.h1-line2 {
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: clamp(2.4rem, 5.5vw, 5rem);
    font-weight: 700;
    color: #1f2733;
    letter-spacing: -.025em;
}

.landing-subtitle {
    margin: .85rem 0 0;
    color: #6b5e4a;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-style: italic;
    line-height: 1.45;
}

/* ── Separador ornamental ── */

.landing-rule {
    display: flex;
    align-items: center;
    gap: .85rem;
    width: min(220px, 100%);
    margin: .8rem 0;
}

.landing-rule::before,
.landing-rule::after {
    content: "";
    flex: 1;
    height: 1px;
}

.landing-rule::before {
    background: linear-gradient(90deg, transparent, #9a7b3f);
}

.landing-rule::after {
    background: linear-gradient(90deg, #9a7b3f, transparent);
}

.landing-ornament {
    color: #9a7b3f;
    font-size: .82rem;
    flex-shrink: 0;
}

/* ── Texto descriptivo ── */

.landing-text {
    max-width: none;
    margin: 0;
    color: #5d6470;
    font-size: clamp(1rem, 1.8vw, 1.05rem);
    line-height: 1.72;
}

.landing-paragraph-gap {
    display: block;
    height: .45rem;
}

/* ── Botón CTA ── */

.landing-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    margin-top: 1.5rem;
    min-height: 56px;
    padding: 0 2.25rem;
    border-radius: 999px;
    background: #7a2e2c;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: .01em;
    box-shadow: 0 14px 34px rgba(122, 46, 44, .22);
    transition: transform .16s ease, background-color .16s ease, box-shadow .16s ease;
}

.landing-search-btn:hover,
.landing-search-btn:focus {
    background: #5c2120;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 18px 42px rgba(122, 46, 44, .28);
}

/* ── Tiles de navegación ── */

.landing-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .9rem;
    width: 100%;
}

.landing-tile {
    display: grid;
    gap: .5rem;
    padding: 1.35rem 1.25rem;
    background: rgba(251, 249, 244, .72);
    border: 1px solid rgba(227, 221, 208, .9);
    border-top: 2px solid rgba(154, 123, 63, .45);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform .16s ease, box-shadow .16s ease, border-top-color .16s ease, background .16s ease;
}

.landing-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(31, 39, 51, .12);
    border-top-color: #7a2e2c;
    background: #fbf9f4;
    text-decoration: none;
    color: inherit;
}

.landing-tile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(122, 46, 44, .1);
    border-radius: 8px;
    color: #7a2e2c;
    font-size: .95rem;
}

.landing-tile-title {
    display: block;
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #1f2733;
    margin-top: .25rem;
}

.landing-tile-text {
    display: block;
    font-size: .84rem;
    color: #5d6470;
    line-height: 1.45;
}

/* ── "WebCADIEM en cifras" (esquina, hover/click) ── */

.landing-stats {
    position: fixed;
    top: 78px;
    right: 1rem;
    z-index: 150;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.landing-stats-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 38px;
    padding: 0 .95rem;
    border: 1px solid rgba(154, 123, 63, .35);
    border-radius: 999px;
    background: rgba(251, 249, 244, .92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #7a2e2c;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 6px 18px rgba(31, 39, 51, .1);
    cursor: pointer;
    transition: background-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.landing-stats-toggle:hover,
.landing-stats-toggle:focus-visible,
.landing-stats.is-open .landing-stats-toggle {
    background: #fbf9f4;
    box-shadow: 0 10px 26px rgba(31, 39, 51, .16);
    transform: translateY(-1px);
}

.landing-stats-panel {
    position: absolute;
    top: calc(100% + .5rem);
    right: 0;
    width: min(300px, calc(100vw - 2rem));
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(227, 221, 208, .9);
    border-top: 2px solid #9a7b3f;
    border-radius: 14px;
    background: #fbf9f4;
    box-shadow: 0 18px 44px rgba(31, 39, 51, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}

.landing-stats:hover .landing-stats-panel,
.landing-stats.is-open .landing-stats-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
}

.landing-stats-panel ul {
    display: grid;
    gap: .65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.landing-stats-panel li {
    font-size: .88rem;
    line-height: 1.4;
    color: #5d6470;
}

.landing-stats-panel strong {
    margin-right: .3rem;
    color: #1f2733;
    font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
    font-weight: 700;
}

.landing-stats-panel li span {
    color: #9a7b3f;
    font-size: .78rem;
}

.landing-stats-updated {
    margin: .85rem 0 0;
    padding-top: .75rem;
    border-top: 1px solid rgba(227, 221, 208, .9);
    color: #9a7b3f;
    font-size: .76rem;
    font-style: italic;
}

@media (max-width: 900px) {
    .landing-stats { top: 72px; }
}

/* ── Footer ── */

.landing-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    padding: clamp(.6rem, 1.5vw, 1rem) clamp(1rem, 3vw, 2rem);
    border-top: 1px solid rgba(154, 123, 63, .35);
    background: rgba(239, 234, 224, .92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.landing-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
}

.landing-footer-logos {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1fr);
    grid-template-areas: "gobcan iatext clariah sclapalma";
    align-items: center;
    column-gap: clamp(48px, 10vw, 160px);
}

.logo-gobcan {
    grid-area: gobcan;
    justify-self: right;
    --logo-h: clamp(36px, 5vw, 62px);
    --logo-w: 220px;
}

.logo-iatext {
    grid-area: iatext;
    justify-self: center;
    --logo-h: clamp(48px, 7vw, 80px);
    --logo-w: 350px;
}

.logo-clariah {
    grid-area: clariah;
    justify-self: center;
    --logo-h: clamp(22px, 3.5vw, 36px);
    --logo-w: 180px;
}

.logo-sclapalma {
    grid-area: sclapalma;
    justify-self: left;
    --logo-h: clamp(36px, 5vw, 62px);
    --logo-w: 220px;
}

.landing-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.landing-logo img {
    display: block;
    height: var(--logo-h);
    max-width: var(--logo-w);
    width: auto;
    object-fit: contain;
    opacity: 1;
    transition: transform .15s ease;
}

.landing-logo:hover img {
    transform: translateY(-1px);
}

/* ── Animaciones de entrada ── */

@keyframes lp-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes lp-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.landing-hero-logo  { animation: lp-fade-in .7s ease both; }
.landing-hero h1    { animation: lp-fade-up .65s .18s ease both; }
.landing-subtitle   { animation: lp-fade-up .55s .3s ease both; }
.landing-rule       { animation: lp-fade-in .5s .42s ease both; }
.landing-text       { animation: lp-fade-up .55s .55s ease both; }
.landing-search-btn { animation: lp-fade-up .55s .7s ease both; }
.landing-nav        { animation: lp-fade-up .65s .9s ease both; }

@media (prefers-reduced-motion: reduce) {
    .landing-hero-logo,
    .landing-hero h1,
    .landing-subtitle,
    .landing-rule,
    .landing-text,
    .landing-search-btn,
    .landing-nav { animation: none; }
}

/* ── Responsive: colapso a columna única ── */

@media (max-width: 820px) {
    .landing-page {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 76px);
        align-items: center;
        text-align: center;
        padding: clamp(2rem, 5vw, 4rem) 1.25rem 150px;
    }

    .landing-hero-logo {
        width: clamp(120px, 32vw, 200px);
        margin: 0 auto;
    }

    .landing-hero {
        align-items: center;
    }

    .landing-hero h1 {
        align-items: center;
    }

    .landing-rule {
        margin: 1.6rem auto;
    }

    .landing-text {
        max-width: 560px;
        margin: 0 auto;
    }
}

@media (max-width: 1200px) {
    .landing-footer-logos {
        grid-template-columns: 1fr;
        grid-template-areas:
            "iatext"
            "gobcan"
            "clariah"
            "sclapalma";
        row-gap: 1rem;
        justify-items: center;
    }

    .logo-gobcan,
    .logo-iatext,
    .logo-clariah,
    .logo-sclapalma {
        justify-self: center;
    }

    .logo-iatext    { --logo-h: 44px; --logo-w: 70vw; }
    .logo-gobcan    { --logo-h: 34px; --logo-w: 62vw; }
    .logo-clariah   { --logo-h: 24px; --logo-w: 55vw; }
    .logo-sclapalma { --logo-h: 34px; --logo-w: 62vw; }
}

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