/* ═══════════════════════════════════════════════════════
   POPULART SEVILLA — FIXES CSS
   Contact page, Blog detail, Alerts, Stacking fixes
   Añadir al final de populart.css o cargar como archivo separado
   ═══════════════════════════════════════════════════════ */

/* ═══════ CRITICAL: STACKING & HERO CONTAINMENT ═══════ */
/* Ensures page-hero background stays within its bounds
   and content sections render above with opaque backgrounds */

.page-hero {
    position: relative !important;
    overflow: hidden !important;
    z-index: 0;
}

.page-hero__bg {
    position: absolute !important;
    inset: 0;
    z-index: 0;
}

.page-hero__content {
    position: relative;
    z-index: 2;
}

/* All sibling sections after page-hero get opaque backgrounds */
.page-hero ~ .intro,
.page-hero ~ .catalog-intro,
.page-hero ~ .cat-section,
.page-hero ~ .cat-banner,
.page-hero ~ .timeline,
.page-hero ~ .mission,
.page-hero ~ .collections,
.page-hero ~ .quote-banner,
.page-hero ~ .gallery,
.page-hero ~ .cta,
.page-hero ~ .section,
.page-hero ~ .blog-featured,
.page-hero ~ .blog-layout,
.page-hero ~ .toolbar,
.page-hero ~ .catalog,
.page-hero ~ .info-band,
.page-hero ~ .other-cats,
.page-hero ~ .contact-grid,
.page-hero ~ .footer {
    position: relative;
    z-index: 1;
}

.intro          { background: #FAF8F4 !important; }
.catalog-intro  { background: #FAF8F4 !important; }
.timeline       { background: #FDFCFA !important; }
.blog-featured  { background: #FDFCFA !important; }
.blog-layout    { background: #FAF8F4 !important; }
.toolbar        { background: #FAF8F4 !important; }
.catalog        { background: #FAF8F4 !important; }
.section        { background: #FAF8F4 !important; }
.footer         { background: #F5F0E8 !important; }

/* ═══════ PAGE HERO EXTRAS ═══════ */

/* Subtitle (used in catalogo, categoria, blog heroes) */
.page-hero__subtitle {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.75);
    max-width: 600px;
    line-height: 1.7;
    margin-top: 16px;
}

/* Background variant (used in contacto hero) */
.page-hero__background {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
}

.page-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(44,42,37,0.3) 0%, rgba(44,42,37,0.7) 100%);
}

/* ═══════ SECTION CONTAINER ═══════ */
.section {
    padding: 72px 72px 100px;
    background: var(--color-cream-light);
}

/* ═══════ ALERTS ═══════ */
.alert {
    padding: 16px 20px;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    margin-bottom: 28px;
    line-height: 1.5;
}

.alert--success {
    background: rgba(91, 123, 94, 0.08);
    border: 1px solid rgba(91, 123, 94, 0.2);
    color: #3D5A3F;
}

.alert--error {
    background: rgba(180, 70, 60, 0.06);
    border: 1px solid rgba(180, 70, 60, 0.15);
    color: #8B3A33;
}

/* ═══════ CONTACT PAGE ═══════ */
.contact-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 64px;
    align-items: start;
}

.contact-grid h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 500;
    color: var(--color-dark);
    margin-bottom: 28px;
}

.contact-grid__form .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
}

.contact-grid__form label {
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-dark);
    letter-spacing: 0.03em;
}

.contact-grid__form .form-input {
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 12px 16px;
    border: 1.5px solid rgba(44, 42, 37, 0.15);
    border-radius: 3px;
    background: var(--color-white);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.contact-grid__form .form-input:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(198, 153, 75, 0.1);
}

.contact-grid__form textarea.form-input {
    resize: vertical;
    min-height: 140px;
}

.contact-grid__form .form-error {
    font-size: 0.78rem;
    color: #8B3A33;
}

.contact-grid__form .btn {
    margin-top: 8px;
}

/* Contact info */
.contact-grid__info {
    background: var(--color-white);
    padding: 40px;
    border-radius: 4px;
    border: 1px solid rgba(44, 42, 37, 0.06);
}

.contact-grid__info p {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 24px;
}

.contact-grid__info p:last-child {
    margin-bottom: 0;
}

.contact-grid__info strong {
    font-weight: 600;
    color: var(--color-dark);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
}

/* ═══════ BLOG DETAIL ═══════ */
.blog-detail {
    padding: 72px 72px 100px;
    background: var(--color-cream-light);
    max-width: 1000px;
}

.blog-detail .breadcrumb {
    margin-bottom: 2rem;
}

.blog-detail .breadcrumb__list {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-detail .breadcrumb__list a {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-text-light);
    transition: color 0.2s;
}

.blog-detail .breadcrumb__list a:hover {
    color: var(--color-gold);
}

.blog-detail .breadcrumb__separator {
    color: var(--color-text-light);
    font-size: 0.8rem;
}

.blog-detail .breadcrumb__item--current {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-text);
}

.blog-detail__header {
    margin-bottom: 32px;
}

.blog-detail__title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    color: var(--color-dark);
    margin-bottom: 12px;
}

.blog-detail__meta {
    font-family: var(--font-body);
    font-size: 0.82rem;
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-detail__image {
    margin-bottom: 40px;
    border-radius: 4px;
    overflow: hidden;
}

.blog-detail__image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.blog-detail__content {
    max-width: 720px;
}

.blog-detail__content p {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    line-height: 1.9;
    color: var(--color-text);
}

.blog-detail__content h2,
.blog-detail__content h3 {
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--color-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-detail__content h2 { font-size: 1.6rem; }
.blog-detail__content h3 { font-size: 1.3rem; }

.blog-detail__content ul,
.blog-detail__content ol {
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.blog-detail__content li {
    font-size: 0.95rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.blog-detail__content blockquote {
    border-left: 3px solid var(--color-gold);
    padding: 16px 24px;
    margin: 2rem 0;
    background: rgba(198, 153, 75, 0.04);
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--color-text);
    line-height: 1.7;
}

.blog-detail__content img {
    border-radius: 4px;
    margin: 2rem 0;
}

/* Related posts in blog detail */
.related .blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 900px) {
    .section {
        padding: 48px 28px 72px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .blog-detail {
        padding: 48px 28px 72px;
    }

    .related .blog-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .contact-grid__info {
        padding: 28px;
    }
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES — MÓVIL / TABLET
   Estas reglas se cargan después de populart.css para
   corregir bloques (footer, visit, timeline) que se
   redefinían más abajo en el archivo base y rompían el
   comportamiento responsive.
   ═══════════════════════════════════════════════════════ */

/* Evita el desbordamiento horizontal que descuadraba la
   maquetación (footer "fijo en ancho", modales cortados…). */
html,
body {
    overflow-x: hidden;
    max-width: 100%;
}

.main {
    max-width: 100%;
    overflow-x: hidden;
}

@media (max-width: 900px) {
    /* ── FOOTER ── */
    .footer {
        padding: 48px 28px 24px;
    }
    .footer__top {
        grid-template-columns: 1fr;
        gap: 32px;
    }
    .footer__bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
        align-items: center;
    }
    .footer__social {
        justify-content: center;
        flex-wrap: wrap;
    }
    .footer__newsletter {
        max-width: 420px;
    }

    /* ── VISIT (home) ── */
    .visit {
        grid-template-columns: 1fr;
    }
    .visit__map {
        min-height: 300px;
    }
    .visit__content {
        padding: 56px 28px;
    }

    /* ── TIMELINE (presentación) — raíl a la izquierda ── */
    .timeline__track {
        max-width: 640px;
    }
    .timeline__item {
        grid-template-columns: 40px 1fr;
        column-gap: 20px;
        align-items: start;
        margin-bottom: 40px;
    }
    .timeline__item:nth-child(odd) .timeline__content,
    .timeline__item:nth-child(even) .timeline__content {
        grid-column: 2;
        grid-row: 1;
        text-align: left;
        padding-left: 0;
        padding-right: 0;
    }
    .timeline__item:nth-child(odd) .timeline__dot,
    .timeline__item:nth-child(even) .timeline__dot {
        grid-column: 1;
        grid-row: 1;
        justify-self: center;
        margin-top: 6px;
    }
    .timeline__item:nth-child(odd) .timeline__year-cell,
    .timeline__item:nth-child(even) .timeline__year-cell {
        display: none;
    }
    .timeline__track::before {
        left: 20px;
        transform: none;
    }
}

@media (max-width: 600px) {
    .footer__newsletter {
        max-width: 100%;
    }
    .timeline {
        padding-left: 20px;
        padding-right: 20px;
    }
    .timeline__content h3 {
        font-size: 1.15rem;
    }
}
