/**
 * Content pages (Contenido artboard, visual system 2026-09, S5c W6)
 *
 * ¿Qué hacemos?, ¡Quiero publicitar mi evento!, Botón de arrepentimiento,
 * Audiovisuales: the page reads on the token scale (H1 36/40, body 16 muted,
 * 65ch measure), the site's button vocabulary (.ts-btn — the inline-styled
 * anchors are normalised by ticketsystem_tango_normalize_content_page()),
 * the newsletter card and the shared footer. Loaded on `is_page()` outside
 * WooCommerce pages and the front page.
 *
 * @package TicketSystemTango
 */

/* ── Frame ── */
.page .site-content .entry-header {
    padding: var(--ts-space-8) 0 0;
    margin: 0;
}

.page .entry-title {
    margin: 0 0 var(--ts-space-4);
    text-align: left;
}

.page .entry-content {
    max-width: var(--ts-container);
}

.page .ts-page {
    max-width: 720px;
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-10);
}

/* The inline-styled wrappers that the old builder left behind */
.page .ts-page > div {
    margin: 0 !important;      /* keep: inline — the DB markup carries margin:100px auto */
    max-width: none !important;
    text-align: left !important;
    padding: 0 !important;
}

.page .ts-page > div > div {
    margin: 0 !important;
    max-width: none !important;
    text-align: left !important;
}

/* ── Type ── */
.page .ts-page p {
    margin: 0 0 var(--ts-space-4);
    max-width: 65ch;
    color: var(--ts-on-surface-muted);
    font-family: var(--font-body) !important; /* keep: inline — Lato was set inline */
    font-size: var(--ts-fs-md) !important;
    line-height: var(--ts-lh-normal) !important;
}

.page .ts-page p:last-child {
    margin-bottom: 0;
}

.page .ts-page p em {
    color: var(--ts-on-surface);
    font-style: normal;
    font-weight: var(--ts-fw-semibold);
}

/* The lead paragraph: the page's thesis in Playfair 22 */
.page .ts-page > div > p:first-child,
.page .ts-page .ts-page__lead {
    font-family: var(--font-headings) !important;
    font-size: var(--ts-fs-xl) !important;
    line-height: 1.4 !important;
    color: var(--ts-on-surface);
    margin-top: 0;
    margin-bottom: var(--ts-space-4);
}

/* Paragraphs the old builder set in Playfair were section titles (each one
   opens its own wrapper div, so no :first-child guard — the page lead below
   is the later, more specific rule and wins for the first paragraph). */
.page .ts-page p.ts-page__heading {
    margin: var(--ts-space-8) 0 var(--ts-space-3);
    max-width: none;
    color: var(--ts-on-surface);
    font-family: var(--font-headings) !important;
    font-size: var(--ts-fs-xl) !important;
    line-height: var(--ts-lh-tight) !important;
}

.page .ts-page h2:not(:first-child),
.page .ts-page h3:not(:first-child) {
    margin-top: var(--ts-space-8);
}

.page .ts-page h2,
.page .ts-page h3 {
    margin: 0 0 var(--ts-space-3);
    color: var(--ts-on-surface) !important; /* keep: inline — the DB markup paints headings gold */
    font-family: var(--font-headings) !important;
    font-size: var(--ts-fs-xl) !important;
    line-height: var(--ts-lh-tight) !important;
    text-align: left !important;
}

/* "• item" paragraphs on the publish page read as a list */
.page .ts-page p.ts-page__bullet {
    position: relative;
    padding-left: 22px;
    margin-bottom: var(--ts-space-2);
}

.page .ts-page p.ts-page__bullet::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--ts-gold);
}

/* ── Actions: the site's buttons, stacked on phones ── */
.page .ts-page .ts-page__actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: var(--ts-space-2) 0 var(--ts-space-6) !important;
}

.page .ts-page .ts-page__actions .ts-btn {
    width: 100%;
    min-height: 48px;
    margin: 0 !important;
}

@media (min-width: 600px) {
    .page .ts-page .ts-page__actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .page .ts-page .ts-page__actions .ts-btn {
        width: auto;
        min-width: 220px;
    }
}

/* ── Newsletter card (appended on the content pages) ── */
.ts-page__newsletter {
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-3);
    padding: var(--ts-space-5) var(--ts-space-4);
    background: var(--ts-surface-1);
    border: 1px solid var(--ts-border-color);
    border-radius: var(--ts-radius);
    max-width: 720px;
}

.ts-page__newsletter h2 {
    margin: 0;
    font-family: var(--font-headings);
    font-size: var(--ts-fs-xl);
    color: var(--ts-on-surface);
}

.ts-page__newsletter p {
    margin: 0;
    color: var(--ts-on-surface-muted);
    font-size: var(--ts-fs-sm);
}

.ts-page__newsletter .wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: var(--ts-space-3);
}

.ts-page__newsletter .wpcf7-form p {
    margin: 0;
    max-width: none;
}

.ts-page__newsletter .wpcf7-form br {
    display: none;
}

.ts-page__newsletter .wpcf7-form-control:not(.wpcf7-submit) {
    width: 100%;
    min-height: 48px;
    padding: 0 var(--ts-space-4) !important; /* keep: theme — the input rule pads with !important */
    background: var(--ts-surface-2) !important;
    border: 1px solid var(--ts-border-color) !important;
    border-radius: var(--ts-radius-sm) !important;
    color: var(--ts-on-surface) !important;
    font-size: var(--ts-fs-sm);
}

.ts-page__newsletter .wpcf7-submit {
    width: 100%;
    min-height: 48px;
    border-radius: var(--ts-radius-sm) !important; /* keep: theme — gold rule */
    font-size: var(--ts-fs-sm);
    letter-spacing: var(--ts-ls-caps);
}

/* ── Contact form (Botón de arrepentimiento) ── */
.page .ts-page .wpcf7-form p {
    max-width: none;
}

.page .ts-page .wpcf7 label {
    display: block;
    margin-bottom: var(--ts-space-2);
    color: var(--ts-on-surface-muted);
    font-size: var(--ts-fs-sm);
}

.page .ts-page .wpcf7-form-control-wrap {
    display: block;
}

.page .ts-page .wpcf7-form-control:not(.wpcf7-submit) {
    width: 100%;
    box-sizing: border-box;
}

.page .ts-page .wpcf7-submit {
    min-height: 48px;
    border-radius: var(--ts-radius-sm) !important; /* keep: theme — gold rule */
}

/* ── Audiovisuales: sticky chip strip (in-page anchors) ── */
.page .ts-page__chips {
    position: sticky;
    top: var(--ts-header-h);
    z-index: calc(var(--ts-z-sticky) - 1);
    display: flex;
    gap: var(--ts-space-2);
    margin: 0 calc(-1 * var(--ts-gutter));
    padding: var(--ts-space-2) var(--ts-gutter);
    background: var(--ts-black);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}

.page .ts-page__chips::-webkit-scrollbar {
    display: none;
}

.page .ts-page__chips .ts-chip,
.page .ts-page__chips a.ts-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    min-height: var(--ts-tap);
    padding: 0 14px;
    border: 1px solid var(--ts-border-color);
    border-radius: var(--ts-radius-pill);
    color: var(--ts-on-surface);
    font-family: var(--font-body);
    font-size: var(--ts-fs-sm);
    font-weight: var(--ts-fw-medium);
    text-decoration: none;
    white-space: nowrap;
    scroll-snap-align: start;
}

.page .ts-page__chips a.ts-chip:hover,
.page .ts-page__chips a.ts-chip:focus-visible {
    border-color: var(--ts-gold);
    color: var(--ts-gold);
}

.page .ts-page--elementor h2[id] {
    scroll-margin-top: calc(var(--ts-header-h) + 60px);
}

.page .ts-page--elementor .ts-page__lead {
    max-width: 65ch;
    margin: 0 0 var(--ts-space-4);
    color: var(--ts-on-surface-muted);
    font-family: var(--font-body);
    font-size: var(--ts-fs-md);
    line-height: var(--ts-lh-normal);
}

/* ── Audiovisuales (Elementor video grid) ── */
.ts-video__alternative {
    margin: var(--ts-space-2) 0 var(--ts-space-4);
}

.page .ts-video__fallback {
    display: inline-flex;
    align-items: center;
    min-height: var(--ts-tap);
    color: var(--ts-gold);
    font-family: inherit;
    font-size: var(--ts-fs-sm);
    text-decoration: underline;
    text-underline-offset: .2em;
    overflow-wrap: anywhere;
}

.page .ts-video__fallback:focus-visible {
    outline: 2px solid var(--ts-gold);
    outline-offset: 3px;
}
.page-audiovisuales .elementor-spacer .elementor-spacer-inner,
.page .ts-page--elementor .elementor-spacer .elementor-spacer-inner {
    height: var(--ts-space-6) !important; /* keep: vendor — Elementor sets the height inline via a CSS variable */
}

.page .ts-page--elementor .elementor-widget-container,
.page .ts-page--elementor .e-con-inner {
    max-width: var(--ts-container);
}

.page .ts-page--elementor .elementor-video,
.page .ts-page--elementor iframe {
    border-radius: var(--ts-radius);
    overflow: hidden;
}

.page .ts-page--elementor .read-more-btn {
    display: inline-flex;
    align-items: center;
    min-height: var(--ts-tap);
    padding: 0 var(--ts-space-4);
    border: 1px solid var(--ts-border-color);
    border-radius: var(--ts-radius-sm);
    color: var(--ts-on-surface-muted);
    font-family: var(--font-body);
    font-size: var(--ts-fs-sm);
    font-weight: var(--ts-fw-semibold);
    letter-spacing: var(--ts-ls-caps);
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    background: transparent;
    box-shadow: none;
}

.page .ts-page--elementor .read-more-btn:hover {
    color: var(--ts-gold);
    border-color: var(--ts-gold);
}

/* Keep the description fade inside its text, clear of the disclosure action. */
.page .ts-page--elementor .read-more-container > .fade-overlay {
    display: none;
}

.page .ts-page--elementor .read-more-text::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 2.5em;
    background: linear-gradient(to bottom, transparent, var(--ts-surface-0));
    pointer-events: none;
}

:where(.page) .ts-page--elementor .read-more-toggle:checked ~ .read-more-text {
    max-height: none;
}

:where(.page) .ts-page--elementor .read-more-toggle:checked ~ :where(.read-more-text)::after,
:where(.page) .ts-page--elementor .read-more-container.is-complete :where(.read-more-text)::after {
    display: none;
}

/* Wrapped titles keep their full height; reserve a real two-line body preview. */
.page .ts-page--elementor .read-more-text:has(> .tev-video-title) {
    white-space: normal;
    max-height: none;
}

.page .ts-page--elementor .tev-video-description {
    white-space: pre-line;
    margin-top: var(--ts-space-2);
    max-height: 4lh;
    overflow: hidden;
}

:where(.page) .ts-page--elementor .read-more-text:has(> .tev-video-title)::after {
    height: 1lh;
}

.ts-page--elementor .read-more-toggle:checked ~ .read-more-text > :where(.tev-video-description) {
    max-height: none;
}

.page .ts-page--elementor button.read-more-btn::after {
    content: none;
}

.page .ts-page--elementor .read-more-btn[hidden] {
    display: none;
}

.page .ts-page--elementor .read-more-btn:focus-visible {
    outline: 2px solid var(--ts-gold);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    .page .ts-page--elementor .read-more-text {
        transition: none;
    }
}

.page .ts-page--elementor .tc_event_data_widget {
    color: var(--ts-gold);
    font-family: var(--font-body);
    font-size: var(--ts-fs-sm);
    font-weight: var(--ts-fw-semibold);
}

.page .ts-page--elementor .elementor-heading-title {
    font-family: var(--font-headings);
    color: var(--ts-on-surface);
}


/* Center the existing reading measure on wide screens. */
@media (min-width: 1024px) {
    .page .ts-page {
        margin-left: auto;
        margin-right: auto;
    }
}


@media (min-width: 1024px) {
    .page .hentry:has(.ts-page) .entry-header {
        max-width: 720px;
        margin-left: auto;
        margin-right: auto;
    }
}

.page .ts-page--elementor .tev-video-title {
    font-weight: var(--ts-fw-semibold);
    color: var(--ts-on-surface);
}

/* A blocked player retains a visible frame with a play overlay that opens the
   provider; once the real player iframe exists the overlay steps aside. */
.ts-video-player {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--ts-border-color);
    border-radius: var(--ts-radius-lg);
    background: var(--ts-surface-1);
}
.ts-video-player .elementor-wrapper {
    position: relative;
    z-index: 1;
}
.page .ts-video-player .ts-video__fallback.ts-video__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--ts-space-3);
    min-height: 0;
    padding: var(--ts-space-4);
    color: var(--ts-gold);
    text-align: center;
    text-decoration: none;
}
.ts-video__play {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1px solid var(--ts-gold);
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
}
.ts-video__play::before {
    content: '';
    margin-left: 5px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 18px solid var(--ts-gold);
}
.ts-video__overlay-label {
    font-size: var(--ts-fs-sm);
    text-decoration: underline;
    text-underline-offset: .2em;
}
.page .ts-video-player .ts-video__overlay:hover .ts-video__play {
    background: var(--ts-gold-soft);
}
.page .ts-video-player .ts-video__overlay:focus-visible {
    outline: 2px solid var(--ts-gold);
    outline-offset: -4px;
}
/* (0,4,1): must beat the overlay's own (0,4,0) display rule above. */
.page .ts-video-player:has(iframe) .ts-video__fallback.ts-video__overlay {
    display: none;
}
