/* ==========================================================================
   FUNDACIÓN NÁJERA - ESTILO INSTITUCIONAL
   ========================================================================== */

/* Design Tokens & Reset */
:root {
    --font-primary: 'Cormorant', Georgia, serif;
    --color-bg-dark: #000000;
    --color-text-white: rgba(255, 255, 255, 0.95);
    --color-text-silver: rgba(255, 255, 255, 0.76);
    --color-text-muted: rgba(255, 255, 255, 0.42);
    --color-overlay: rgba(0, 0, 0, 0.84);
    --color-overlay-gradient-start: rgba(0, 0, 0, 0.95);
    --color-overlay-gradient-end: rgba(0, 0, 0, 0.68);
    
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-smooth: all 0.8s var(--ease-out-expo);
    --transition-fade: opacity 0.5s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-dark);
    font-family: var(--font-primary);
    color: var(--color-text-white);
    overflow: hidden; /* Handled by scroll container */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Background Image Layer (Inside the Card) */
.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    /* Full color (grayscale filter removed) */
}

.bg-image.loaded {
    opacity: 1;
}

/* Card 65% Dark Opacity Overlay (10% less dark for legibility/visibility) */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65); /* 65% dark opacity overlay */
    z-index: 2;
    pointer-events: none;
}

/* Card Outward Glow (Ambilight effect on page background) */
.card-glow-wrapper {
    position: absolute;
    width: 520px; /* Scaled back up 10% */
    height: 520px;
    z-index: 5;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bg-image-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(32px) saturate(135%) brightness(0.85); /* 10% more diffused blur */
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    transform: scale(1.03); /* Close framing for soft square silhouette */
}

.bg-image-glow.loaded {
    opacity: 0.32; /* 10% more visible color glow */
}

/* Header & Logo styling (Increased padding to borders) */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 6rem;
    z-index: 100;
    background: none; /* Transparent background, shadow removed */
    display: flex;
    align-items: center;
    padding-left: 3rem;
    opacity: 0;
    animation: fadeIn 1.5s var(--ease-out-expo) forwards;
    animation-delay: 0.3s;
}

.logo {
    display: block;
    width: 176px;
    height: auto;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5));
}

/* Language Selector styling (Increased padding to borders) */
.lang-selector {
    margin-left: auto;
    margin-right: 3rem;
    display: flex;
    align-items: center;
    gap: 0.1rem;
    pointer-events: auto;
}

.lang-btn {
    background: none;
    border: none;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.2rem 0.5rem;
}

.lang-btn:hover {
    color: rgba(255, 255, 255, 0.85);
}

.lang-btn.active {
    color: #ffffff;
    font-weight: 500;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.lang-separator {
    color: rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

/* Scroll Container */
.scroll-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Disabled page scroll */
    z-index: 10;
}

/* Scrollbar Styling (Removed since internal scroll hides scrollbars) */
.manifesto-body::-webkit-scrollbar {
    display: none;
}

/* Scroll Progress Bar Removed */

/* Content Wrapper & Manifesto Layout */
.content-wrapper {
    width: 100%;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for perfect mobile vertical centering */
    display: flex;
    justify-content: center;
    align-items: center; /* Center the card vertically and horizontally */
    padding: 0; /* Extremely thin general page padding */
}

.manifesto {
    background-color: #000000; /* Fallback black behind the image */
    width: 520px; /* Scaled back up 10% */
    height: 520px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    padding: 1.25rem; /* Very thin padding inside the square */
    display: flex;
    flex-direction: column;
    justify-content: stretch;
    position: relative;
    z-index: 10; /* Sits on top of the card glow (z-index 5) */
    box-shadow: none; /* Shadow removed */
    border: 1px solid rgba(255, 255, 255, 0.05); /* Fine elegant border outline */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1.8s var(--ease-out-expo) forwards;
    animation-delay: 0.6s;
    transition: opacity 0.4s ease, transform 0.4s var(--ease-out-expo);
    overflow: hidden; /* Clips background-image and overlay to card borders */
}

/* Lead Paragraph (First line: bigger, bolder, visually distinctive, italic with left border) */
.lead-paragraph {
    font-size: 1.98rem; /* 20% bigger than 1.65rem */
    font-weight: 700; /* Bolder (Bold weight) */
    line-height: 1.45;
    font-style: italic;
    color: var(--color-text-white);
    border-left: 2px solid rgba(255, 255, 255, 0.25);
    padding-left: 1.5rem;
    margin-bottom: 2.2rem;
    text-align: left;
    text-transform: none;
}

/* Final Sentence (Last lines: bigger, bolder, visually distinctive, italic with left border) */
.final-sentence {
    font-size: 1.80rem; /* 20% bigger than 1.50rem */
    font-weight: 700; /* Bolder (Bold weight) */
    line-height: 1.45;
    font-style: italic;
    color: var(--color-text-white);
    border-left: 2px solid rgba(255, 255, 255, 0.25);
    padding-left: 1.5rem;
    margin-top: 2.2rem;
    margin-bottom: 1rem;
    text-align: left;
    text-transform: none;
}

/* Manifesto Body Text Container (Internal Scroll with Fading Masks) */
.manifesto-body {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
    padding: 2.5rem 0; /* padding so text doesn't touch the masked edges immediately */
    
    position: relative;
    z-index: 10; /* Sits on top of background image (z-index 1) and overlay (z-index 2) */
    
    /* Masterful top & bottom fading gradient mask */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 15%, black 85%, transparent 100%);
    
    /* Hide scrollbars */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.manifesto-body p {
    font-size: 1.10rem; /* 10% smaller */
    font-weight: 300;
    line-height: 1.9;
    color: var(--color-text-silver);
    text-align: justify;
    letter-spacing: 0.01em;
}



/* Footer & Location Label (Bottom Center Outside the Card) */
.footer {
    position: fixed;
    bottom: 2rem;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 100;
}

.location-label {
    font-size: 0.65rem; /* Very small */
    font-weight: 400;
    color: rgba(255, 255, 255, 0.45); /* Subtle white text */
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.6s var(--ease-out-expo);
}

.location-label.active {
    opacity: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVE DESIGN (Adaptive Layout)
   ========================================================================== */

/* Medium Screens (Tablets / Small Desktops) */
@media (max-width: 1024px) {
    .header {
        top: 0;
        left: 0;
        height: 5.5rem;
        padding-left: 2.5rem;
    }
    
    .logo {
        width: 144px;
    }
    
    .lang-selector {
        margin-right: 2.5rem;
    }
    
    .content-wrapper {
        padding: 0;
        height: 100vh;
        height: 100dvh; /* Dynamic centering */
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .manifesto {
        width: 465px; /* Scaled back up 10% */
        height: 465px;
        padding: 1.15rem; /* Very thin padding */
    }
    
    .card-glow-wrapper {
        width: 465px;
        height: 465px;
    }
    
    .lead-paragraph {
        font-size: 1.74rem; /* 20% bigger than 1.45rem */
        font-weight: 700;
    }
    
    .final-sentence {
        font-size: 1.62rem; /* 20% bigger than 1.35rem */
        font-weight: 700;
    }
    .footer {
        bottom: 1.5rem;
    }
    
    .location-label {
        font-size: 0.6rem;
        max-width: 100%;
    }
}

/* Mobile Devices */
@media (max-width: 768px) {
    /* Make header and logo flow with content instead of overlapping */
    .header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 5rem;
        padding-left: 2rem;
        display: flex;
        align-items: center;
        background: none; /* Transparent background, shadow removed */
        pointer-events: auto;
    }
    
    .logo {
        width: 138px; /* 15% bigger than 120px */
    }
    
    .lang-selector {
        margin-right: 2rem;
    }
    
    .content-wrapper {
        padding: 0;
        height: 100vh;
        height: 100dvh; /* Dynamic centering to avoid browser bar offsets */
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    .manifesto {
        width: calc(100vw - 2rem); /* Scaled back up 10% on mobile */
        height: calc(100vw - 2rem);
        max-width: 355px; /* Scaled back up 10% */
        max-height: 355px;
        padding: 0.95rem; /* Very thin padding */
    }
    
    .card-glow-wrapper {
        width: calc(100vw - 2rem);
        height: calc(100vw - 2rem);
        max-width: 355px;
        max-height: 355px;
    }
    
    .lead-paragraph {
        font-size: 1.56rem; /* 20% bigger than 1.30rem */
        font-weight: 700;
        line-height: 1.35;
        margin-bottom: 1.2rem;
        text-align: left;
    }
    
    .final-sentence {
        font-size: 1.44rem; /* 20% bigger than 1.20rem */
        font-weight: 700;
        margin-top: 1.4rem;
        text-align: left;
    }
    
    .manifesto-body {
        gap: 1.8rem;
    }
    
    .manifesto-body p {
        font-size: 1.03rem; /* 10% smaller */
        line-height: 1.75;
        text-align: left; /* Better readability on small screens */
    }
    
    .highlighted-sentence {
        font-size: 1.25rem !important;
        padding-left: 1rem;
    }
    
    .footer {
        bottom: 1.25rem;
    }
    
    .location-label {
        font-size: 0.55rem;
    }
}
