/* Explain: Styles for site components, including member photo framing and timeline animations. */
.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border-color);
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--sage-dark);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.section-kicker::before {
    display: inline-block;
    width: 2.4rem;
    height: 1px;
    background: var(--accent-color);
    content: "";
}

.glass-panel {
    border: 1px solid var(--glass-border);
    background: linear-gradient(145deg, rgba(250, 248, 252, 0.78), rgba(255, 255, 255, 0.48));
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
}

.arch-frame {
    position: relative;
    overflow: hidden;
    border: 2px solid var(--primary-color) !important;
    background: var(--surface-color);
    box-shadow: var(--shadow-soft);
}

.arch-frame::after {
    position: absolute;
    inset: 1.1rem;
    border: 1px solid rgba(250, 248, 252, 0.62);
    border-radius: inherit;
    content: "";
    pointer-events: none;
}

.arch-frame-large {
    height: min(74vh, 720px);
    min-height: 500px;
    border-radius: 999px 999px 2.5rem 2.5rem;
}

.arch-frame-medium {
    height: 620px;
    max-width: 450px;
    border-radius: 999px 999px 2.1rem 2.1rem;
}

.floating-note {
    position: absolute;
    right: -1.5rem;
    bottom: 4rem;
    display: flex;
    max-width: 250px;
    align-items: center;
    gap: 0.85rem;
    border-radius: 999px;
    padding: 1rem 1.2rem;
    color: var(--text-color);
    font-size: 0.82rem;
    font-weight: 600;
}

.story-card {
    position: absolute;
    right: 0;
    bottom: 2.5rem;
    max-width: 290px;
    border-radius: 2rem;
    padding: 1.5rem;
}

.quiet-detail,
.amenity-row,
.contact-note {
    border: 1px solid var(--glass-border);
    border-radius: 1.6rem;
    background: rgba(250, 248, 252, 0.58);
    padding: 1.25rem;
}

.quiet-detail span {
    display: inline-flex;
    margin-bottom: 0.9rem;
    color: var(--accent-color);
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 600;
}

.quiet-detail p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.75;
}

.class-card {
    min-height: 360px;
    border-radius: 2.2rem;
    padding: 2rem;
    transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

.class-card:hover {
    border-color: rgba(88, 28, 135, 0.58);
    box-shadow: 0 26px 80px rgba(88, 28, 135, 0.11);
    transform: translateY(-6px);
}

.amenity-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem;
}

.amenity-dot {
    width: 0.8rem;
    height: 0.8rem;
    margin-top: 0.4rem;
    border-radius: 999px;
    background: var(--accent-color);
    box-shadow: 0 0 0 0.45rem var(--terracotta-soft);
}

.amenity-image-wrap {
    height: 660px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    border-radius: 3rem 999px 999px 3rem;
    box-shadow: var(--shadow-soft);
}

.booking-overlay-panel {
    border-radius: 2.4rem;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.booking-form {
    border-radius: 1.4rem;
    padding: 1rem;
}

@media (min-width: 640px) {
    .booking-form {
        border-radius: 2.4rem;
        padding: clamp(1.5rem, 4vw, 2.5rem);
    }
}

.form-label {
    display: block;
    margin-bottom: 0.55rem;
    color: var(--text-color);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.form-required {
    margin-left: 0.15rem;
    color: var(--accent-color);
}

.form-required-note {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

.form-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 0.9rem;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.5;
}

.form-status {
    display: block;
    border-radius: 1rem;
    border: 1px solid var(--glass-border);
    background: rgba(88, 28, 135, 0.05);
    padding: 0.9rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.55;
}

.form-status:empty {
    display: none;
    border: 0;
    padding: 0;
}

.form-status.success {
    color: #581c87;
    background: rgba(88, 28, 135, 0.09);
    border-color: rgba(88, 28, 135, 0.28);
}

.form-status.error {
    color: #9f1239;
    background: rgba(159, 18, 57, 0.08);
    border-color: rgba(159, 18, 57, 0.28);
}

.form-status.pending {
    color: var(--text-muted);
    background: rgba(88, 28, 135, 0.05);
    border-color: var(--glass-border);
}

.field-error {
    margin-top: 0.4rem;
    color: #9f1239;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
}

.field-error.hidden {
    display: none;
}

.input-error {
    border-color: #9f1239 !important;
}

.input-error:focus {
    border-color: #9f1239 !important;
}

select option {
    background-color: #ffffff;
    color: #1e1b24;
}

.cal-dot {
    display: inline-block;
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 999px;
}

.cal-dot-event {
    background: var(--accent-color);
}

.cal-dot-event.is-selected {
    background: #ffffff;
}

.cal-dot-holiday {
    background: var(--holiday-gold);
}

.cal-dot-holiday.is-selected {
    box-shadow: 0 0 0 1.5px #ffffff;
}

.cal-holiday-date {
    color: var(--holiday-gold);
}

.cal-holiday-badge {
    background: rgba(201, 162, 39, 0.16);
    color: #8a6d0b;
}

.titular-thumb {
    opacity: 0.5;
}

.titular-thumb.is-active {
    opacity: 1;
    border-color: var(--accent-color);
    box-shadow: 0 10px 24px rgba(88, 28, 135, 0.2);
}

.mobile-book-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 45;
    border-top: 1px solid var(--glass-border);
    background: rgba(250, 248, 252, 0.86);
    padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
    backdrop-filter: blur(18px);
}

.booking-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    overflow-y: auto;
    background: rgba(30, 27, 36, 0.32);
    padding: 1rem;
}

.booking-overlay.is-open {
    display: block;
}

.booking-overlay-panel {
    min-height: calc(100vh - 2rem);
    background: var(--background-color);
    box-shadow: 0 30px 90px rgba(30, 27, 36, 0.22);
}

@media (max-width: 767px) {
    .section-kicker::before {
        width: 1.6rem;
    }

    .arch-frame-large,
    .arch-frame-medium,
    .amenity-image-wrap {
        height: 510px;
        min-height: 0;
    }

    .arch-frame-large {
        margin-right: auto;
        margin-left: auto;
        width: min(100%, 450px);
    }

    .floating-note,
    .story-card {
        position: relative;
        right: auto;
        bottom: auto;
        margin: -2.5rem auto 0;
    }

    .amenity-image-wrap {
        border-radius: 999px 999px 2rem 2rem;
    }
}

.merch-card {
    transition: transform 500ms ease, box-shadow 500ms ease, border-color 500ms ease;
}

.merch-card:hover {
    border-color: rgba(88, 28, 135, 0.38);
    box-shadow: 0 16px 44px rgba(88, 28, 135, 0.08);
    transform: translateY(-2px);
}

.merch-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
}

.merch-card-media img {
    transition: transform 650ms ease;
}

.merch-card:hover .merch-card-media img {
    transform: scale(1.02);
}

.merch-card-name {
    min-height: 2.5rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.merch-card-price {
    min-height: 1.5rem;
}

@media (min-width: 640px) {
    .merch-card-name {
        min-height: 2.75rem;
    }

    .merch-card-price {
        min-height: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .merch-card-name {
        min-height: 3.25rem;
    }

    .merch-card-price {
        min-height: 2.25rem;
    }
}

@media (min-width: 1280px) {
    .merch-card-name {
        min-height: 3.5rem;
    }
}

.success-checkmark {
    width: 104px;
    height: 104px;
}

.checkmark {
    width: 100%;
    height: 100%;
}

.checkmark-circle {
    stroke: var(--primary-color);
    stroke-width: 2;
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-miterlimit: 10;
    stroke-linecap: round;
    fill: none;
    animation: checkmark-stroke 0.65s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-linecap: round;
    transform-origin: 50% 50%;
    animation: checkmark-stroke 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.75s forwards;
}

@keyframes checkmark-stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .checkmark-circle,
    .checkmark-check {
        animation-duration: 0.01s;
        animation-delay: 0s;
    }
}

/* Línea del tiempo (Historia) */
.timeline-container {
    position: relative;
}

.timeline-rail {
    position: absolute;
    top: 1.375rem;
    bottom: 1.5rem;
    left: 1.375rem;
    width: 2px;
    transform: translateX(-1px);
    border-radius: 999px;
    background: linear-gradient(to bottom, var(--accent-color) 0%, rgba(88, 28, 135, 0.4) 45%, var(--glass-border) 100%);
}

.timeline-item {
    position: relative;
}

.timeline-item .timeline-dot {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: flex;
    height: 2.75rem;
    width: 2.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--glass-border);
    background: var(--background-color);
    color: var(--accent-color);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
}

.timeline-card {
    transition: border-color 300ms ease, box-shadow 300ms ease, transform 300ms ease;
}

.timeline-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.55rem 0.9rem;
}

.timeline-year {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--sage-soft);
    padding: 0.35rem 0.9rem;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--sage-dark);
}

.timeline-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.12rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text-color);
}

.timeline-text {
    margin-top: 1rem;
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-muted);
}

.timeline-text--soft {
    margin-top: 0.7rem;
}

@media (min-width: 640px) {
    .timeline-rail {
        top: 1.75rem;
        left: 1.75rem;
    }

    .timeline-item .timeline-dot {
        height: 3.5rem;
        width: 3.5rem;
    }

    .timeline-title {
        font-size: 1.3rem;
    }
}

/* Aparición gradual y escalonada al desplazarse */
.timeline-ready .timeline-item {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: var(--timeline-delay, 0ms);
}

.timeline-ready .timeline-item.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-ready .timeline-item .timeline-dot {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.5s ease, transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition-delay: calc(var(--timeline-delay, 0ms) + 120ms);
}

.timeline-ready .timeline-item.is-visible .timeline-dot {
    opacity: 1;
    transform: scale(1);
}

.year-badge {
    letter-spacing: 0.02em;
}

/* Ficha de miembro: encuadre uniforme de las fotos dentro del círculo */
.member-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 16%;
}

/* Ficha de procesión: fecha y hora destacadas */
.procession-when {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1.35rem 1.5rem 1.25rem;
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.14), rgba(107, 33, 168, 0.04));
    border-bottom: 1px solid var(--glass-border);
}

.procession-when-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.45rem;
    border-radius: 999px;
    background: var(--sage-soft);
    padding: 0.4rem 0.85rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sage-dark);
}

.procession-when-title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.02em;
    color: var(--text-color);
}

.procession-when-meta {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.15rem;
}

.procession-when-date {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.25rem;
}

.procession-when-day {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--sage-dark);
}

.procession-when-date time {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-color);
}

.procession-when-time {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.procession-when-time-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--sage-dark);
}

.procession-when-time-value {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--primary-color);
}

.procession-when-time-unit {
    font-size: 0.85rem;
    font-weight: 600;
}

.procession-when-extra {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    background: var(--background-color);
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.procession-when-extra i {
    color: var(--accent-color);
}

.procession-when-extra strong {
    color: var(--text-color);
}

@media (max-width: 480px) {
    .procession-when {
        padding: 1rem 1.15rem;
    }

    .procession-when-time-value {
        font-size: 1.7rem;
    }
}

/* Pestañas del recorrido (solo móvil) */
.recorrido-tab {
    border-radius: 999px;
    padding: 0.5rem 1.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: background-color 200ms ease, color 200ms ease;
}

.recorrido-tab.is-active {
    background: var(--accent-color);
    color: #ffffff;
}

@media (max-width: 1023px) {
    .recorrido-panel.is-hidden {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .timeline-ready .timeline-item,
    .timeline-ready .timeline-item .timeline-dot {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* Prosa legal: Aviso Legal y Política de Privacidad */
.legal-prose > * {
    margin: 0;
}

.legal-prose > * + * {
    margin-top: 1.5rem;
}

.legal-prose h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    color: var(--text-color);
}

.legal-prose > h2:not(:first-child) {
    padding-top: 1.75rem;
    border-top: 1px solid var(--glass-border);
}

.legal-prose p,
.legal-prose li {
    font-size: 0.95rem;
    line-height: 1.9;
    color: var(--text-muted);
}

.legal-prose strong {
    font-weight: 600;
    color: var(--text-color);
}

.legal-prose ul {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.legal-prose a {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 200ms ease;
}

.legal-prose a:hover {
    color: var(--primary-hover);
}

@media (min-width: 640px) {
    .legal-prose > * + * {
        margin-top: 1.75rem;
    }

    .legal-prose h2 {
        font-size: 1.4rem;
    }

    .legal-prose > h2:not(:first-child) {
        padding-top: 2rem;
    }

    .legal-prose p,
    .legal-prose li {
        font-size: 1rem;
        line-height: 2;
    }
}

/* Aparición suave de los encabezados de páginas interiores */
.page-header-reveal > * {
    opacity: 0;
    transform: translateY(12px);
    animation: page-header-fade 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.page-header-reveal > *:nth-child(1) {
    animation-delay: 0.04s;
}

.page-header-reveal > *:nth-child(2) {
    animation-delay: 0.12s;
}

.page-header-reveal > *:nth-child(3) {
    animation-delay: 0.2s;
}

.page-header-reveal > *:nth-child(4) {
    animation-delay: 0.28s;
}

@keyframes page-header-fade {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-header-reveal > * {
        opacity: 1;
        transform: none;
        animation: none;
    }
}
