/* Gospel Impressions Tracker - Frontend CSS
   Flame Edition v1.1.0 — Theme-aware via CSS custom properties
   ============================================================ */

/* ── Defaults (overridden by inline :root block from PHP) ── */
:root {
    --git-primary:       #e53935;
    --git-primary-dark:  #9c1717;
    --git-primary-mid:   #bf2e2e;
    --git-accent:        #ff8f00;
    --git-accent-mid:    #d17600;
    --git-accent-pale:   #fff3df;
    --git-accent-border: #f0b95a;
    --git-accent-text:   #8c4e00;
}

/* ── Wrapper & Layout ─────────────────────────────────── */
.git-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    max-width: 980px;
    margin: 0 auto;
    padding: 24px 16px;
    color: #212121;
}

.git-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 52px;
    align-items: flex-start;
    justify-content: center;
}

/* ── Flame Column ─────────────────────────────────────── */
.git-flame-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
}

.git-flame-svg-wrap { width: 210px; }
.git-flame-svg     { width: 100%; height: auto; overflow: visible; }

/* ── Flame Animations ─────────────────────────────────── */
@keyframes gitFlameFlicker {
    0%,  100% { transform: skewX(0deg)    scaleX(1);     }
    18%       { transform: skewX(1.4deg)  scaleX(1.01);  }
    36%       { transform: skewX(-1deg)   scaleX(0.99);  }
    54%       { transform: skewX(0.6deg)  scaleX(1.005); }
    72%       { transform: skewX(-1.2deg) scaleX(0.995); }
    90%       { transform: skewX(0.4deg)  scaleX(1.008); }
}
.git-flame-group {
    animation: gitFlameFlicker 3.8s ease-in-out infinite;
    transform-origin: 78px 510px;
}

@keyframes gitInnerFlicker {
    0%,  100% { transform: scaleX(1)    translateY(0);    }
    25%       { transform: scaleX(0.93) translateY(-4px); }
    50%       { transform: scaleX(1.05) translateY(3px);  }
    75%       { transform: scaleX(0.96) translateY(-2px); }
}
.git-inner-flame {
    animation: gitInnerFlicker 2.4s ease-in-out infinite;
    transform-origin: 78px 505px;
}

@keyframes gitTipPulse {
    0%,  100% { opacity: 0.55; transform: scale(1);    }
    50%       { opacity: 0.85; transform: scale(1.18); }
}
.git-tip-glow {
    animation: gitTipPulse 1.9s ease-in-out infinite;
    transform-origin: 78px 78px;
}

.git-flame-fill-rect {
    transition: y 1.9s cubic-bezier(.22,.61,.36,1),
                height 1.9s cubic-bezier(.22,.61,.36,1);
}

/* ── Stats Block ──────────────────────────────────────── */
.git-stats-block {
    text-align: center;
    margin-top: 22px;
    width: 100%;
    max-width: 280px;
}

.git-big-count {
    font-size: 54px;
    font-weight: 800;
    color: var(--git-primary);
    line-height: 1;
    letter-spacing: -2px;
}

.git-big-count-sub {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #90a4ae;
    margin: 5px 0 10px;
}

.git-goal-line {
    font-size: 14px;
    color: #546e7a;
    margin-bottom: 12px;
}

/* ── Progress Bar ─────────────────────────────────────── */
.git-prog-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.git-prog-bar {
    flex: 1;
    height: 10px;
    background: var(--git-accent-pale);
    border-radius: 5px;
    overflow: hidden;
}

.git-prog-fill {
    height: 100%;
    background: linear-gradient(90deg,
        var(--git-primary-dark),
        var(--git-primary),
        var(--git-accent-mid)
    );
    border-radius: 5px;
    transition: width 1.9s cubic-bezier(.22,.61,.36,1);
}

.git-prog-pct {
    min-width: 44px;
    font-size: 13px;
    font-weight: 700;
    color: var(--git-primary);
    text-align: right;
}

/* ── Deadline Pill ────────────────────────────────────── */
.git-deadline-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--git-accent-text);
    background: var(--git-accent-pale);
    border: 1px solid var(--git-accent-border);
    border-radius: 20px;
    padding: 5px 14px;
    margin-bottom: 4px;
}

/* ── Ticker Column ────────────────────────────────────── */
.git-ticker-col {
    flex: 1 1 280px;
    max-width: 480px;
    display: flex;
    flex-direction: column;
}

.git-ticker-heading {
    font-size: 18px;
    font-weight: 700;
    color: #37474f;
    margin: 0 0 18px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--git-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.git-ticker-icon { font-size: 1em; line-height: 1; display: inline-flex; align-items: center; }

/* ── Ticker Frame ─────────────────────────────────────── */
.git-ticker-frame {
    position: relative;
    border-radius: 14px;
    border: 1px solid #e0e0e0;
    background: #fff;
    box-shadow: 0 2px 18px rgba(0,0,0,.07);
    min-height: 100px;
    overflow: hidden;
}

.git-ticker-item {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 24px 28px;
    animation: gitSlideIn .45s ease both;
}

.git-ticker-item.active { display: flex; }

@keyframes gitSlideIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0);    }
}

.git-ti-name {
    font-size: 21px;
    font-weight: 700;
    color: #1a237e;
}

.git-ti-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.git-ti-badge {
    background: var(--git-accent-pale);
    color: var(--git-primary-dark);
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}

.git-ti-date {
    font-size: 13px;
    color: #90a4ae;
}

.git-ti-how {
    font-size: 14px;
    color: #5D4037;
    font-style: italic;
    line-height: 1.55;
    margin-top: 2px;
    border-left: 3px solid var(--git-accent);
    padding-left: 10px;
}

/* ── Navigation Dots ──────────────────────────────────── */
.git-ticker-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    margin-bottom: 4px;
}

.git-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #cfd8dc;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background .25s, transform .2s;
}

.git-dot.active,
.git-dot:hover {
    background: var(--git-primary);
    transform: scale(1.4);
}

/* ── CTA Button ───────────────────────────────────────── */
.git-cta-wrap {
    margin-top: 20px;
    text-align: center;
}

.git-cta-btn {
    display: inline-block;
    background: linear-gradient(135deg,
        var(--git-primary-dark),
        var(--git-primary) 55%,
        var(--git-accent-mid) 100%
    );
    color: #fff !important;
    text-decoration: none !important;
    padding: 15px 32px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    box-shadow: 0 5px 22px rgba(0,0,0,.18);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
    line-height: 1.3;
}

.git-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    opacity: 0.92;
    color: #fff !important;
}

.git-cta-btn:active { transform: translateY(-1px); }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
    .git-layout { gap: 32px; }
    .git-flame-col,
    .git-ticker-col { width: 100%; }
    .git-big-count { font-size: 46px; }
}

/* ══════════════════════════════════════════════════════════
   LANDSCAPE LAYOUT
   [gospel_impressions layout="landscape"]
   Three columns: compact flame | stats | ticker+button
   ═══════════════════════════════════════════════════════ */

/* ── Container ────────────────────────────────────────── */
.git-landscape.git-wrapper {
    max-width: 1100px;
    padding: 20px 16px;
}

.git-landscape .git-layout {
    flex-wrap: nowrap;
    gap: 28px;
    align-items: center;
}

/* ── Col 1: Compact flame ─────────────────────────────── */
.git-landscape .git-flame-col {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.git-landscape .git-flame-svg-wrap {
    width: 88px;
}

/* ── Scale bar beside compact flame ──────────────────── */
.git-ls-scale {
    display: flex;
    align-items: stretch;
    gap: 6px;
    width: 88px;
    height: 48px;
}

.git-ls-scale-track {
    width: 8px;
    background: var(--git-accent-pale);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.git-ls-scale-fill {
    width: 100%;
    background: linear-gradient(180deg,
        var(--git-accent) 0%,
        var(--git-primary) 60%,
        var(--git-primary-dark) 100%
    );
    border-radius: 4px;
    transition: height 1.9s cubic-bezier(.22,.61,.36,1);
}

.git-ls-scale-labels {
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    flex: 1;
}

.git-ls-scale-label {
    font-size: 9px;
    color: #90a4ae;
    line-height: 1;
    white-space: nowrap;
}

/* ── Col 2: Stats ─────────────────────────────────────── */
.git-stats-col {
    flex: 1 1 180px;
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.git-landscape .git-stats-block {
    text-align: center;
    max-width: 240px;
    width: 100%;
    margin-top: 0;
}

.git-landscape .git-big-count {
    font-size: 56px;
}

/* ── Col 3: Ticker ────────────────────────────────────── */
.git-landscape .git-ticker-col {
    flex: 1.6 1 260px;
    min-width: 0;
    max-width: 460px;
}

.git-landscape .git-ticker-frame {
    min-height: 100px;
}

.git-landscape .git-ticker-item {
    padding: 18px 22px;
}

.git-landscape .git-ti-name {
    font-size: 18px;
}

/* ── Landscape CTA: centered, full-width ──────────────── */
.git-landscape .git-cta-wrap {
    margin-top: 16px;
    text-align: center;
}

.git-landscape .git-cta-btn {
    display: block;
    text-align: center;
    width: 100%;
    padding: 14px 20px;
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════ */

/* ── Landscape: tablet (≤900px) — stack stats under flame */
@media (max-width: 900px) {
    .git-landscape .git-layout {
        flex-wrap: wrap;
        gap: 24px;
        justify-content: center;
    }

    /* Row 1: flame (left) + stats (right) */
    .git-landscape .git-flame-col {
        flex: 0 0 auto;
        align-self: flex-start;
    }

    .git-stats-col {
        flex: 1 1 160px;
        min-width: 150px;
        justify-content: flex-start;
    }

    .git-landscape .git-stats-block {
        text-align: left;
    }

    .git-landscape .git-prog-wrap {
        justify-content: flex-start;
    }

    /* Row 2: ticker full width */
    .git-landscape .git-ticker-col {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* ── Landscape + Portrait: mobile (≤600px) — single column */
@media (max-width: 600px) {
    /* Landscape mobile: all stack */
    .git-landscape .git-layout {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .git-landscape .git-flame-col,
    .git-stats-col,
    .git-landscape .git-ticker-col {
        width: 100%;
        flex: none;
    }

    .git-landscape .git-flame-col {
        flex-direction: row;
        justify-content: center;
        align-items: flex-end;
        gap: 12px;
        width: auto;
    }

    .git-landscape .git-flame-svg-wrap {
        width: 72px;
    }

    .git-ls-scale {
        height: 56px;
        width: auto;
    }

    .git-stats-col {
        justify-content: center;
    }

    .git-landscape .git-stats-block {
        text-align: center;
    }

    /* Portrait mobile — already stacks via existing rules */
    .git-portrait .git-layout {
        flex-direction: column;
        align-items: center;
        gap: 24px;
    }

    .git-portrait .git-flame-col,
    .git-portrait .git-ticker-col {
        width: 100%;
        flex: none;
    }

    .git-portrait .git-flame-svg-wrap {
        width: 160px;
        margin: 0 auto;
    }
}

/* ══════════════════════════════════════════════════════════
   BUTTON VARIANTS
   ═══════════════════════════════════════════════════════ */

/* Base styles shared by all button variants */
.git-cta-btn {
    display: inline-block;
    padding: 15px 32px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-decoration: none !important;
    line-height: 1.3;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease, background .2s ease;
    cursor: pointer;
    border: none;
}
.git-cta-btn:active { transform: translateY(-1px); }

/* ── Shape ────────────────────────────────────────────── */
.git-btn-pill      { border-radius: 50px; }
.git-btn-rectangle { border-radius: 8px;  }

/* ── Fill (default) ───────────────────────────────────── */
.git-btn-fill {
    background: linear-gradient(135deg,
        var(--git-primary-dark),
        var(--git-primary) 55%,
        var(--git-accent-mid) 100%
    );
    color: #fff !important;
    box-shadow: 0 5px 22px rgba(0,0,0,.18);
}
.git-btn-fill:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
    opacity: 0.92;
    color: #fff !important;
}

/* ── Outline ──────────────────────────────────────────── */
.git-btn-outline {
    background: transparent;
    color: var(--git-primary) !important;
    border: 2px solid var(--git-primary);
    box-shadow: none;
}
.git-btn-outline:hover {
    background: var(--git-primary);
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
}

/* ══════════════════════════════════════════════════════════
   LANDSCAPE — UPDATED: bigger flame, no scale bar,
   tick marks now inside SVG, section padding
   ═══════════════════════════════════════════════════════ */

/* Top/bottom breathing room for both layouts */
.git-wrapper {
    padding-top: 10px;
    padding-bottom: 10px;
}
.git-landscape.git-wrapper {
    max-width: 1100px;
    padding-top: 10px;
    padding-bottom: 10px;
}

/* 3-col flex row */
.git-landscape .git-layout {
    flex-wrap: nowrap;
    gap: 32px;
    align-items: center;
}

/* Col 1: flame constrained to 350px tall */
.git-landscape .git-flame-col {
    flex: 0 0 auto;
    align-self: flex-start;
}
.git-landscape .git-flame-svg-wrap {
    width: auto;
}
.git-landscape .git-flame-svg {
    height: 350px;
    width: auto;
}

/* Col 2: stats */
.git-stats-col {
    flex: 1 1 180px;
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.git-landscape .git-stats-block {
    text-align: center;
    max-width: 250px;
    width: 100%;
    margin-top: 0;
}
.git-landscape .git-big-count { font-size: 56px; }

/* Col 3: ticker — heading nowrap */
.git-landscape .git-ticker-col {
    flex: 1.6 0 300px;
    min-width: 300px;
    max-width: 500px;
}
.git-landscape .git-ticker-heading {
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
}
.git-landscape .git-ticker-frame  { min-height: 100px; }
.git-landscape .git-ticker-item   { padding: 18px 22px; }
.git-landscape .git-ti-name       { font-size: 18px; }

/* Full-width button in landscape */
.git-landscape .git-cta-wrap { margin-top: 16px; text-align: center; }
.git-landscape .git-cta-btn  { display: block; width: 100%; text-align: center; padding: 14px 20px; }

/* ── Responsive ───────────────────────────────────────── */

/* Tablet ≤900px: flame+stats pair, ticker below */
@media (max-width: 900px) {
    .git-landscape .git-layout {
        flex-wrap: wrap;
        gap: 24px;
        justify-content: center;
    }
    .git-landscape .git-flame-col { flex: 0 0 auto; align-self: flex-start; }
    .git-stats-col                { flex: 1 1 160px; min-width: 150px; justify-content: flex-start; }
    .git-landscape .git-stats-block { text-align: left; }
    .git-landscape .git-ticker-col { flex: 1 1 100%; max-width: 100%; }
    .git-landscape .git-ticker-heading { white-space: nowrap !important; }
}

/* Mobile ≤600px: single column */
@media (max-width: 600px) {
    .git-landscape .git-layout    { flex-direction: column; align-items: center; gap: 20px; }
    .git-landscape .git-flame-col,
    .git-stats-col,
    .git-landscape .git-ticker-col { width: 100%; flex: none; }
    .git-landscape .git-flame-svg-wrap { width: auto; margin: 0 auto; }
    .git-landscape .git-flame-svg { height: 220px; width: auto; }
    .git-stats-col                { justify-content: center; }
    .git-landscape .git-stats-block { text-align: center; }

    .git-portrait .git-layout     { flex-direction: column; align-items: center; gap: 24px; }
    .git-portrait .git-flame-col,
    .git-portrait .git-ticker-col  { width: 100%; flex: none; }
    .git-portrait .git-flame-svg-wrap { width: 160px; margin: 0 auto; }
}

/* ══════════════════════════════════════════════════════════
   SPEEDOMETER GRAPHIC
   ═══════════════════════════════════════════════════════ */

/* Portrait: centered, max-width to keep it readable */
.git-portrait .git-speedo-svg-wrap {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 8px;
}
.git-speedo-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

/* Landscape: height-constrained like flame */
.git-landscape .git-speedo-svg-wrap {
    width: 320px;
}
.git-landscape .git-speedo-svg {
    width: 100%;
    height: auto;
}

/* Needle + arc entrance animation driven by JS (same as flame) */
.git-speedo-arc {
    transition: stroke-dasharray 1.9s cubic-bezier(.22,.61,.36,1);
}
.git-speedo-needle {
    transition: transform 1.9s cubic-bezier(.22,.61,.36,1);
}

/* Portrait: when speedometer is used, stats sit below the gauge  */
.git-portrait .git-flame-col .git-speedo-svg-wrap + .git-stats-block {
    margin-top: 4px;
}

/* Mobile */
@media (max-width: 600px) {
    .git-landscape .git-speedo-svg-wrap { width: 260px; margin: 0 auto; }
}

/* ══════════════════════════════════════════════════════════
   IMPRESSION TYPE — FOLDED CORNER RIBBON
   Text=#3d83cd  Tell=#f58f35  Bring=#3baaad
   ═══════════════════════════════════════════════════════ */

/* Ticker frame needs overflow:visible so ribbon doesn't clip */
.git-ticker-frame {
    overflow: visible;
}

/* Each item needs relative + clip for the ribbon fold */
.git-ticker-item {
    position: relative;
    overflow: hidden;
}

/* Ribbon container — top-right corner box */
.git-ti-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

/* The diagonal band */
.git-ti-ribbon span {
    position: absolute;
    display: block;
    width: 112px;
    padding: 5px 0;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.8px;
    color: #fff;
    top: 18px;
    right: -28px;
    transform: rotate(45deg);
    line-height: 1.3;
}
