/* RankwellPress Pro bundle: pro-utility */

/* --- utility-section.css --- */
/* ==========================================================================
   RankwellPress Pro
   Utility Section — Premium Editorial Version
   Rows aligned · Breaking · Currency · Breadcrumbs

   CUSTOMIZER WIRING — this revision
   ─────────────────────────────────────────────────────────
   Every colour that identifies the site's brand is wired to
   the theme's dynamic CSS variables. Presets, Customizer
   changes, and Reset Colours all affect these elements.

   Tokens read (from DynamicCSSCompiler output):
     --rw-bg-content             (content_bg_color)
     --rw-border-light           (border_color)
     --rw-text-heading           (heading_color)
     --rw-text-muted             (meta_text_color)
     --rw-text-inverse           (primary_text_color)
     --rw-color-primary          (primary_color)
     --rw-container-desktop      (container_width_desktop)

   Every var() keeps the previous hardcoded value as fallback,
   so rendering is identical if the CSS-vars pipeline ever
   fails to emit a token.

   DESIGN NOTES
   - Both ticker label pills (Breaking + Currency) read
     --rw-color-primary. They are the two most prominent
     chrome elements on the page; they should carry the
     site's brand colour, not the secondary badge colour.
   - Ticker item text reads --rw-text-heading (the same token
     used for article titles) — the ticker reads as headline
     chrome, not as meta text.
   - Breadcrumb colours are utility chrome — they follow text
     tokens, not brand. Only the hover state takes brand colour.
   - Dark-mode overrides keep working; they win by specificity
     after the variables resolve.

   VERTICAL RHYTHM
   - Row min-height is 34px desktop / 32px mobile. Tight enough
     to bring headlines up, tall enough to keep label pills and
     text breathing.
   - The section carries a normal 8px top margin (keeps the card
     off the header) and 12px bottom margin, then a "+ *" rule
     neutralises the top margin of the first block below it. That
     collapses the theme's default main-content padding into a
     tight 8px gap, without compressing the utility card itself.
   ========================================================================== */

.rwp-utility-section {
    background: var(--rw-bg-content, #fff);
    border: 1px solid color-mix(in srgb, var(--rw-border-light, #e5e7eb) 60%, transparent);
    border-radius: 8px;
    box-shadow:
        0 1px 2px rgba(15, 30, 51, 0.04),
        0 4px 12px rgba(15, 30, 51, 0.04);

    /* Symmetric sides, tight top, slightly larger bottom to
       separate the card from whatever follows. */
    margin: 8px auto 12px;
    max-width: var(--rw-container-desktop, 1200px);
    overflow: hidden;
    position: relative;
}

/* Subtle top accent */
.rwp-utility-section::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 2px;
    background: var(--rw-color-primary, #0d7c3e);
    opacity: .12;
}

/* Remove heavy left accent */
.rwp-utility-section::after {
    display: none;
}

/* ==========================================================================
   FLOW INTO CONTENT
   ─────────────────────────────────────────────────────────
   The utility section closes itself visually with a border,
   radius, and shadow — it doesn't need a large gap beneath it.
   Neutralise the top margin of the first block below so readers
   reach the stories sooner.

   Safe because:
     · `+ *` matches only the immediate next sibling, never
       descendants.
     · margin-top: 8px is a tighter value than the theme default
       (~24–48px combined padding + widget margin).
     · The section's own top margin, internal padding, and row
       heights are untouched.
   ========================================================================== */

.rwp-utility-section + * {
    margin-top: 8px;
}

.rwp-utility-section + .rwp-widget,
.rwp-utility-section + .widget,
.rwp-utility-section + section,
.rwp-utility-section + .rankwellpress-posts-wrapper,
.rwp-utility-section + .rankwellpress-hero-grid,
.rwp-utility-section + .rankwellpress-headlines-widget,
.rwp-utility-section + .rankwellpress-flex-news-widget,
.rwp-utility-section + .rankwellpress-featured-news-widget {
    margin-top: 8px;
}

/* ==========================================================================
   ROW RESET — consistent left alignment
   ========================================================================== */

.rwp-utility-section .rwp-breaking-news-ticker,
.rwp-utility-section .rwp-currency-ticker,
.rwp-utility-section .rankwellpress-breadcrumbs {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 0 10px !important;
    padding-left: 10px !important;
    box-sizing: border-box;
}

/* ==========================================================================
   CONSISTENT ROW HEIGHT
   34px desktop — tight enough to save vertical space, tall enough
   for label pills and legible ticker text.
   ========================================================================== */

.rwp-utility-section .rwp-breaking-news-ticker,
.rwp-utility-section .rwp-currency-ticker,
.rwp-utility-section .rankwellpress-breadcrumbs,
.rwp-utility-section .rankwellpress-breadcrumbs .rankwellpress-container,
.rwp-utility-section .rwp-currency-ticker-inner {
    min-height: 34px;
    display: flex;
    align-items: center;
}

/* ==========================================================================
   DIVIDERS
   Divider only between rows. On non-single views the currency
   ticker becomes the last row, so it shouldn't carry a trailing
   bottom border.
   ========================================================================== */

.rwp-utility-section .rwp-breaking-news-ticker:not(:last-child),
.rwp-utility-section .rwp-currency-ticker:not(:last-child) {
    border-bottom: 1px solid color-mix(in srgb, var(--rw-border-light, #e5e7eb) 40%, transparent);
}

/* ==========================================================================
   LABELS — aligned to the same left edge
   ========================================================================== */

.rwp-utility-section .rwp-ticker-label,
.rwp-utility-section .rwp-currency-ticker-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 5px 12px !important;
    margin-left: 0 !important;
    margin-right: 10px !important;

    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: .08em !important;
    text-transform: uppercase !important;

    border-radius: 6px;
    line-height: 1;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Both labels read the site's Primary Brand colour so they
   sit at the top of the visual hierarchy alongside the header,
   buttons, links, and other brand chrome. */
.rwp-utility-section .rwp-ticker-label,
.rwp-utility-section .rwp-currency-ticker-label {
    background: var(--rw-color-primary, #0d7c3e) !important;
    color: var(--rw-text-inverse, #ffffff) !important;
}

/* ==========================================================================
   BREAKING NEWS
   ========================================================================== */

.rwp-utility-section .rwp-ticker-viewport {
    flex: 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    height: 100%;
}

.rwp-utility-section .rwp-ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    will-change: transform;
    animation: rwpTickerScroll var(--rwp-ticker-speed, 28s) linear infinite;
}

.rwp-utility-section .rwp-ticker-viewport:hover .rwp-ticker-track {
    animation-play-state: paused;
}

.rwp-utility-section .rwp-ticker-item {
    display: flex;
    align-items: center;
    padding: 0 14px;
    position: relative;
}

.rwp-utility-section .rwp-ticker-item::after {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--rw-color-primary, #0d7c3e) 45%, transparent);

    position: absolute;
    right: -2px;
    top: 50%;
    transform: translateY(-50%);
}

.rwp-utility-section .rwp-ticker-item:last-child::after {
    display: none;
}

.rwp-utility-section .rwp-ticker-item-link {
    color: var(--rw-text-heading, #0f1e33) !important;
    text-decoration: none !important;
    font-size: .86rem !important;
    font-weight: 600 !important;
    text-shadow: none !important;
    background: transparent !important;
}

.rwp-utility-section .rwp-ticker-item-link:hover,
.rwp-utility-section .rwp-ticker-item-link:focus-visible {
    color: var(--rw-color-primary, #0d7c3e) !important;
    text-decoration: underline !important;
}

/* ==========================================================================
   CURRENCY
   ========================================================================== */

.rwp-utility-section .rwp-currency-ticker-inner {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 !important;
}

.rwp-utility-section .rwp-currency-ticker-wrapper {
    flex: 1;
    overflow: hidden;
}

.rwp-utility-section .rwp-currency-ticker-track {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    animation-name: rwp-ticker-scroll;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

.rwp-utility-section .rwp-currency-ticker-wrapper:hover .rwp-currency-ticker-track {
    animation-play-state: paused;
}

.rwp-utility-section .rwp-currency-ticker-item {
    display: inline-flex;
    align-items: center;

    font-size: .82rem;
    font-weight: 600;

    color: var(--rw-text-heading, #0f1e33) !important;
    -webkit-text-fill-color: var(--rw-text-heading, #0f1e33) !important;
}

.rwp-utility-section .rwp-currency-ticker-item strong {
    font-weight: 700;
    color: var(--rw-text-heading, #0f1e33) !important;
    -webkit-text-fill-color: var(--rw-text-heading, #0f1e33) !important;
}

.rwp-utility-section .rwp-currency-ticker-item::after {
    content: "•";
    margin: 0 10px;
    color: color-mix(in srgb, var(--rw-text-heading, #0f1e33) 35%, transparent);
}

.rwp-utility-section .rwp-currency-ticker-item:last-child::after {
    display: none;
}

/* ==========================================================================
   BREADCRUMB
   ========================================================================== */

.rwp-utility-section .rankwellpress-breadcrumbs {
    /* Neutral tint — intentionally not the brand colour.
       Breadcrumbs are wayfinding chrome, they should recede. */
    background: color-mix(in srgb, var(--rw-text-heading, #0f1e33) 2%, transparent);
}

.rwp-utility-section .rankwellpress-breadcrumbs .rankwellpress-container {
    width: 100%;
    padding: 0 !important;
    display: flex;
    align-items: center;
    height: 100%;
}

.rwp-utility-section .breadcrumb-inner {
    display: flex;
    align-items: center;
    gap: 6px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: .82rem;
    width: 100%;
}

.rwp-utility-section .breadcrumb-item,
.rwp-utility-section .breadcrumb-item a {
    color: var(--rw-text-muted, #6b7280) !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.rwp-utility-section .breadcrumb-item a:hover {
    color: var(--rw-color-primary, #0d7c3e) !important;
}

.rwp-utility-section .breadcrumb-current {
    color: var(--rw-text-heading, #0f1e33) !important;
    font-weight: 600;
}

.rwp-utility-section .breadcrumb-separator {
    color: var(--rw-border-light, #cbd5e1);
    margin: 0 2px;
    flex-shrink: 0;
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes rwpTickerScroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes rwp-ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ==========================================================================
   DARK MODE
   ========================================================================== */

html[data-theme="dark"] .rwp-utility-section {
    background: var(--rw-bg-content, #1b1f27);
    border-color: var(--rw-border-light, rgba(255,255,255,.08));

    box-shadow:
        0 1px 2px rgba(0,0,0,.25),
        0 4px 12px rgba(0,0,0,.20);
}

html[data-theme="dark"] .rankwellpress-breadcrumbs {
    background: rgba(255,255,255,.03);
}

html[data-theme="dark"] .rwp-ticker-item-link,
html[data-theme="dark"] .rwp-currency-ticker-item,
html[data-theme="dark"] .rwp-currency-ticker-item strong {
    color: var(--rw-text-heading, #f3f4f6) !important;
    -webkit-text-fill-color: var(--rw-text-heading, #f3f4f6) !important;
}

html[data-theme="dark"] .breadcrumb-item,
html[data-theme="dark"] .breadcrumb-item a {
    color: var(--rw-text-muted, #94a3b8) !important;
    -webkit-text-fill-color: var(--rw-text-muted, #94a3b8) !important;
}

html[data-theme="dark"] .breadcrumb-current {
    color: var(--rw-text-heading, #f8fafc) !important;
    -webkit-text-fill-color: var(--rw-text-heading, #f8fafc) !important;
}

html[data-theme="dark"] .breadcrumb-separator {
    color: var(--rw-border-light, #475569);
}

/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 768px) {

    .rwp-utility-section {
        border-radius: 6px;
        margin: 6px auto 10px;
    }

    .rwp-utility-section .rwp-breaking-news-ticker,
    .rwp-utility-section .rwp-currency-ticker,
    .rwp-utility-section .rankwellpress-breadcrumbs,
    .rwp-utility-section .rankwellpress-breadcrumbs .rankwellpress-container,
    .rwp-utility-section .rwp-currency-ticker-inner {
        /* 32px mobile — tighter than desktop to save more fold
           space on small screens where every pixel counts. */
        min-height: 32px;
    }

    /* Keep left alignment on mobile */
    .rwp-utility-section .rwp-breaking-news-ticker,
    .rwp-utility-section .rwp-currency-ticker,
    .rwp-utility-section .rankwellpress-breadcrumbs {
        padding: 0 8px !important;
        padding-left: 8px !important;
    }

    .rwp-utility-section .rwp-ticker-label,
    .rwp-utility-section .rwp-currency-ticker-label {
        font-size: 10px !important;
        padding: 4px 10px !important;
        margin-left: 0 !important;
        margin-right: 8px !important;
        letter-spacing: .08em !important;
    }

    .rwp-utility-section .rwp-ticker-item-link {
        font-size: .78rem !important;
    }

    .rwp-utility-section .rwp-currency-ticker-item {
        font-size: .76rem;
    }

    .rwp-utility-section .breadcrumb-inner {
        font-size: .74rem;
    }

    /* Even tighter flow-into-content on mobile — first headline
       should be reachable with minimal thumb travel. */
    .rwp-utility-section + * {
        margin-top: 6px;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .rwp-utility-section .rwp-ticker-track,
    .rwp-utility-section .rwp-currency-ticker-track {
        animation: none !important;
    }
}

/* ==========================================================================
   PRINT
   ========================================================================== */

@media print {
    .rwp-utility-section {
        display: none !important;
    }
}
