/* ----------------------------------------------------------------------
   HISTORY PREMIUM EDITORIAL CONCEPT
   Encapsulated scope: .timeline-editorial-concept
   No impact on legacy timeline-item or other pages.
   ---------------------------------------------------------------------- */

/* CRITICAL OVERRIDE: Kill legacy grid position conflicts */
.timeline-container .timeline-line,
.timeline-container .timeline-progress {
    display: none !important; /* Hiding intersecting legacy lines for pure asymmetric rhythm */
}

.timeline-item.timeline-editorial-concept .timeline-dot {
    display: none !important; /* Hiding legacy circles */
}

.timeline-item.timeline-editorial-concept:nth-child(even) .timeline-content,
.timeline-item.timeline-editorial-concept:nth-child(odd) .timeline-content,
.timeline-item.timeline-editorial-concept:nth-child(even) .timeline-image,
.timeline-item.timeline-editorial-concept:nth-child(odd) .timeline-image {
    grid-column: auto !important;
    grid-row: auto !important;
    text-align: left !important;
}

/* 1. The Atmosphere Wrapper (Blueprint Pattern) */
.timeline-editorial-concept {
    display: grid !important; /* Force grid layout over standard flex */
    grid-template-columns: 4fr 6fr !important; /* Asymmetrical rhythm */
    gap: clamp(2rem, 6vw, 6.25rem) !important;
    margin-bottom: 120px;
    position: relative;
    align-items: center;
    background-color: transparent;
    padding: 3rem 2rem;
    border-radius: 12px;
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s ease;
}

/* Technical Blueprint Sub-background for the wrapper */
.timeline-editorial-concept::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: 
        radial-gradient(var(--gray-200) 1px, transparent 1px),
        radial-gradient(var(--gray-200) 1px, transparent 1px);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    opacity: 0.4;
    border-radius: 8px;
    pointer-events: none;
}

/* 2. Architectural Guidance Line (Cota) */
.timeline-editorial-concept .timeline-editorial-guideline {
    position: absolute;
    left: -30px;
    top: 50%;
    width: 40px;
    height: 1px;
    background-color: var(--accent-color);
    transform: translateY(-50%) scaleX(0);
    transform-origin: left center;
    transition: transform 1s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s;
    z-index: 3;
}

.timeline-editorial-concept.active .timeline-editorial-guideline {
    transform: translateY(-50%) scaleX(1);
}

/* 3. Editorial Typography & Layout */
.timeline-editorial-concept .timeline-content {
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left !important; /* Clean left-alignment for editorial feel */
}

/* Minimalist, sharp year with modern Serif styling */
.timeline-editorial-concept .timeline-year {
    font-family: var(--font-heading) !important;
    font-size: clamp(3.5rem, 6vw, 5.5rem) !important; /* Highly dynamic fluid font */
    font-weight: 200 !important;
    color: var(--primary-color) !important;
    opacity: 0.15 !important;
    letter-spacing: -4px !important;
    line-height: 0.8 !important;
    margin-bottom: 1.5rem !important;
    transform: translateY(20px);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s, opacity 0.8s ease;
}

.timeline-editorial-concept.active .timeline-year {
    opacity: 0.3 !important;
    transform: translateY(0);
}

.timeline-editorial-concept .timeline-title {
    font-family: var(--font-heading) !important;
    font-size: clamp(1.8rem, 3vw, 2.5rem) !important; /* Refined fluid scale */
    font-weight: 300 !important;
    letter-spacing: -1px !important;
    line-height: 1.2 !important;
    color: var(--text-main) !important;
    margin-bottom: 1.25rem !important;
    border-left: 3px solid var(--accent-color);
    padding-left: 1.5rem;
}

.timeline-editorial-concept .timeline-desc {
    font-size: clamp(1rem, 1.5vw, 1.15rem) !important;
    color: var(--gray-600) !important;
    line-height: 1.7 !important;
    padding-left: 1.75rem; /* Aligns under the title border */
    max-width: 480px;
}

/* 4. Cinematic Image Mask Reveal */
.timeline-editorial-concept .timeline-image {
    position: relative;
    overflow: hidden;
    border-radius: 4px !important; /* Sharper, technical corners */
    box-shadow: var(--shadow-md) !important;
    aspect-ratio: 16/10 !important; /* Modern editorial wide format */
    transform: scale(0.98);
    opacity: 0.8;
    transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease;
    clip-path: inset(0 100% 0 0); /* Mask hidden from right */
}

.timeline-editorial-concept.active .timeline-image {
    clip-path: inset(0 0 0 0); /* Complete reveal slide */
    transform: scale(1);
    opacity: 1;
}

.timeline-editorial-concept .timeline-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center top !important; /* Ensures faces/roofs are prioritized in the crop */
    transition: transform 2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    transform: scale(1.1) translateX(-10px); /* Start slightly zoomed & offset */
}

.timeline-editorial-concept.active .timeline-image img {
    transform: scale(1) translateX(0); /* Smooth internal settle */
}

/* Decorative architectural grid tag */
.timeline-editorial-concept .timeline-image::after {
    content: attr(data-latlong); /* Pull coordinates dynamically from data attribute */
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-family: monospace;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--white);
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 8px;
    border-radius: 2px;
    opacity: 0.7;
}

/* ----------------------------------------------------------------------
   5. ALTERNATING RHYTHM: REVERSE MODIFIER
   ---------------------------------------------------------------------- */

.timeline-editorial-concept.timeline-editorial--reverse {
    grid-template-columns: 6fr 4fr !important; /* Mirrored asymmetry: Image 60% | Text 40% */
}

.timeline-editorial-concept.timeline-editorial--reverse .timeline-content {
    order: 2; /* Pushes text to the second column */
    padding-left: 1.5rem !important;
}

.timeline-editorial-concept.timeline-editorial--reverse .timeline-image {
    order: 1; /* Pulls image to the first column */
    clip-path: inset(0 0 0 100%); /* Opposite cinematic reveal direction (opens left-to-right) */
}

.timeline-editorial-concept.timeline-editorial--reverse.active .timeline-image {
    clip-path: inset(0 0 0 0);
}

.timeline-editorial-concept.timeline-editorial--reverse .timeline-editorial-guideline {
    left: auto;
    right: -30px;
    transform-origin: right center;
}

/* ----------------------------------------------------------------------
   RESPONSIVE ENGINE: TABLET & MOBILE AUDIT (NO ANIMATIONS)
   ---------------------------------------------------------------------- */

/* Tableta & iPad (Medium Screens: <= 1024px) */
@media (max-width: 1024px) {
    /* 1. FORCE COLLAPSE: Decimate legacy and reverse column overrides */
    .timeline-editorial-concept,
    .timeline-editorial-concept.timeline-editorial--reverse {
        grid-template-columns: 1fr !important; /* Absolute vertical stack */
        gap: 1.75rem !important;
        padding: 2rem 1.5rem !important;
        margin-bottom: 60px !important;
        border-radius: 8px !important;
    }

    /* 2. NEUTRALIZE ANIMATIONS: Instant state for mobile performance */
    .timeline-editorial-concept .timeline-image,
    .timeline-editorial-concept.timeline-editorial--reverse .timeline-image,
    .timeline-editorial-concept.active .timeline-image {
        clip-path: none !important; /* Kill reveal slide */
        opacity: 1 !important;
        transform: none !important; /* Kill entry scales */
        transition: none !important; 
        order: 1 !important; /* Image ALWAYS on top */
        aspect-ratio: 16/9 !important; /* Perfect cinematic mobile ratio */
        width: 100% !important;
        box-shadow: var(--shadow-sm) !important;
    }

    .timeline-editorial-concept .timeline-image img,
    .timeline-editorial-concept.active .timeline-image img {
        transform: none !important; /* Kill internal zoom */
        transition: none !important;
    }

    /* 3. UNIFY CONTENT STACK */
    .timeline-editorial-concept .timeline-content,
    .timeline-editorial-concept.timeline-editorial--reverse .timeline-content {
        order: 2 !important; /* Text ALWAYS below the image */
        padding: 0 !important;
        text-align: left !important;
    }

    .timeline-editorial-concept .timeline-year,
    .timeline-editorial-concept.active .timeline-year {
        font-size: clamp(3rem, 8vw, 4rem) !important;
        opacity: 0.25 !important;
        transform: none !important;
        margin-bottom: 1rem !important;
    }

    .timeline-editorial-concept .timeline-title {
        font-size: clamp(1.6rem, 4vw, 2rem) !important;
        padding-left: 1.25rem !important;
        margin-bottom: 1rem !important;
    }

    .timeline-editorial-concept .timeline-desc {
        padding-left: 1.5rem !important;
        font-size: 1rem !important;
        max-width: 100% !important;
    }

    .timeline-editorial-concept .timeline-editorial-guideline {
        display: none !important; /* Remove guidelines on mobile stack */
    }
}

/* Teléfonos Inteligentes (Small Screens: <= 768px) */
@media (max-width: 768px) {
    .timeline-editorial-concept,
    .timeline-editorial-concept.timeline-editorial--reverse {
        padding: 1rem !important;
        margin-bottom: 45px !important;
        border-radius: 0 !important;
    }

    .timeline-editorial-concept::before {
        background-size: 15px 15px !important; /* Fine detail mobile blueprint */
    }
    
    .timeline-editorial-concept .timeline-title {
        padding-left: 1rem !important;
    }

    .timeline-editorial-concept .timeline-desc {
        padding-left: 1.2rem !important;
    }
}
