/* =======================================================
   Content Hero — Frontend Styles
   CSS custom properties are injected inline by PHP
   ======================================================= */

.ch-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #111;
    font-family: inherit;
    box-sizing: border-box;
}

.ch-hero *, .ch-hero *::before, .ch-hero *::after { box-sizing: inherit; }

/* ---- Track & slides ---- */

.ch-track {
    position: relative;
    width: 100%;
    height: var(--ch-height, 540px);
}

.ch-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity var(--ch-transition, 700ms) ease;
    pointer-events: none;
}

.ch-slide.is-active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
    height: var(--ch-height, 540px);
}

/* ---- Background image ---- */

.ch-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.04);
    transition: transform 7s ease;
}

.ch-slide.is-active .ch-bg { transform: scale(1); }

/* ---- Overlay ---- */

.ch-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        var(--ch-overlay, rgba(0,0,0,0.70)) 0%,
        rgba(0,0,0,0.10) 65%,
        transparent 100%
    );
}

/* ---- Content ---- */

.ch-content {
    position: relative;
    z-index: 2;
    padding: 48px 80px;
    max-width: 760px;
    color: var(--ch-text, #ffffff);
}

.ch-tag {
    display: inline-block;
    background: var(--ch-accent, #c8102e);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 2px;
    margin-bottom: 14px;
}

.ch-title {
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 14px;
}

.ch-title a { color: var(--ch-text, #ffffff); text-decoration: none; transition: opacity 0.2s; }
.ch-title a:hover { opacity: 0.82; }

.ch-excerpt {
    font-size: clamp(0.88rem, 1.6vw, 1rem);
    line-height: 1.7;
    color: var(--ch-text, #ffffff);
    opacity: 0.85;
    margin: 0 0 16px;
}

.ch-meta { margin-bottom: 22px; }

.ch-date { font-size: 0.8rem; opacity: 0.6; letter-spacing: 0.3px; }

.ch-btn {
    display: inline-block;
    background: var(--ch-accent, #c8102e);
    color: #fff !important;
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-decoration: none !important;
    padding: 11px 26px;
    border-radius: 3px;
    transition: filter 0.2s, transform 0.15s;
    border: none;
    cursor: pointer;
}

.ch-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }

/* ---- Slide animation ---- */

.ch-anim-slide .ch-track { display: flex; overflow: hidden; }

.ch-anim-slide .ch-slide {
    position: relative;
    flex: 0 0 100%;
    opacity: 1;
    pointer-events: auto;
    height: var(--ch-height, 540px);
    align-items: flex-end;
}

/* ---- Boxed mode ---- */

.ch-mode-boxed .ch-boxed-wrap {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* ---- Split mode ---- */

.ch-mode-split .ch-track { height: var(--ch-height, 540px); }
.ch-mode-split .ch-slide { align-items: stretch; }
.ch-mode-split .ch-slide.is-active { display: flex; height: var(--ch-height, 540px); }

.ch-split-image {
    flex: 0 0 50%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ch-split-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px 52px;
    background: #1a1a2e;
    color: var(--ch-text, #ffffff);
    overflow: auto;
}

/* ---- Vertical alignment ---- */

.ch-valign-top    .ch-slide { align-items: flex-start; }
.ch-valign-center .ch-slide { align-items: center; }
.ch-valign-bottom .ch-slide { align-items: flex-end; }

.ch-valign-top    .ch-slide.is-active { align-items: flex-start; }
.ch-valign-center .ch-slide.is-active { align-items: center; }
.ch-valign-bottom .ch-slide.is-active { align-items: flex-end; }

/* Center and top: extend overlay to cover full height */
.ch-valign-center .ch-overlay,
.ch-valign-top    .ch-overlay {
    background: linear-gradient(
        to bottom,
        rgba(0,0,0,0.15) 0%,
        var(--ch-overlay, rgba(0,0,0,0.55)) 40%,
        var(--ch-overlay, rgba(0,0,0,0.55)) 60%,
        rgba(0,0,0,0.15) 100%
    );
}

/* Split mode — vertical alignment maps to justify-content */
.ch-valign-top    .ch-split-content { justify-content: flex-start; }
.ch-valign-center .ch-split-content { justify-content: center; }
.ch-valign-bottom .ch-split-content { justify-content: flex-end; }

/* ---- Text alignment ---- */

.ch-align-center .ch-content,
.ch-align-center .ch-split-content { text-align: center; margin-left: auto; margin-right: auto; }

.ch-align-right .ch-content,
.ch-align-right .ch-split-content { text-align: right; margin-left: auto; }

/* ---- Arrows ---- */

.ch-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 46px;
    height: 46px;
    background: rgba(0,0,0,0.38);
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    padding: 0;
}

.ch-arrow:hover { background: var(--ch-accent, #c8102e); border-color: transparent; }
.ch-arrow svg { width: 20px; height: 20px; display: block; }
.ch-prev { left: 18px; }
.ch-next { right: 18px; }

/* ---- Dots ---- */

.ch-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.ch-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.ch-dot.is-active { background: #fff; border-color: #fff; transform: scale(1.3); }

/* ---- Progress bar ---- */

.ch-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--ch-accent, #c8102e);
    width: 0%;
    z-index: 10;
}

/* ---- Fallback ---- */

.ch-no-posts { padding: 40px; text-align: center; color: #666; }

/* ---- Responsive ---- */

@media ( max-width: 768px ) {
    .ch-track,
    .ch-slide.is-active,
    .ch-anim-slide .ch-slide { height: var(--ch-mobile-h, 360px) !important; }

    .ch-mode-split .ch-track,
    .ch-mode-split .ch-slide.is-active { height: auto !important; }

    .ch-mode-split .ch-slide.is-active { flex-direction: column; }
    .ch-split-image { flex: 0 0 220px; width: 100%; }
    .ch-split-content { padding: 28px 24px; }
    .ch-content { padding: 28px 52px; }

    .ch-arrow { width: 36px; height: 36px; }
    .ch-arrow svg { width: 16px; height: 16px; }
    .ch-prev { left: 8px; }
    .ch-next { right: 8px; }
}

@media ( max-width: 480px ) {
    .ch-content { padding: 20px 16px; }
}
