/* =============================================================================
 * Org Website Footer - Strip System (parallel rules)
 * =============================================================================
 *
 * The footer reuses the header's strip render path (StripRenderHelper)
 * and emits the same `.website-header-strip-*` / `.website-header-section-*`
 * class names. The runtime rules in web/css/website-header-strips.css are
 * scoped under `.website-header`, so they don't reach footer placements.
 * This file re-scopes the rules that matter for the footer under
 * `.website-footer` and adds the dropup overrides for popovers placed at
 * the bottom of the viewport.
 *
 * Loaded conditionally by views/layouts/website.php only when at least
 * one of the two footer strip slots is populated, so orgs without strips
 * don't pay the byte cost.
 */

/* ---------- Strip wrapper ------------------------------------------------ */

.website-footer .website-header-strip {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.website-footer .website-header-strip:first-of-type {
    border-top: none;
}

.website-footer .website-header-strip-row {
    min-height: 48px;
    gap: 1rem;
}

/* ---------- Per-strip padding ------------------------------------------- */

.website-footer .website-header-strip-pad-tight .website-header-strip-row {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    min-height: 36px;
}

.website-footer .website-header-strip-pad-normal .website-header-strip-row {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.website-footer .website-header-strip-pad-loose .website-header-strip-row {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

/* ---------- Per-strip vertical alignment -------------------------------- */

.website-footer .website-header-strip-align-start .website-header-strip-row {
    align-items: flex-start;
}

.website-footer .website-header-strip-align-end .website-header-strip-row {
    align-items: flex-end;
}

/* ---------- Per-strip backgrounds --------------------------------------- */

/* Footer strips inherit the footer's own colour palette by default
   (surface = "let the footer's bg show through"); the other variants let
   the strip stand out from the rest of the footer (e.g. a coloured
   pre-footer CTA banner). */
.website-footer .website-header-strip-bg-surface {
    background-color: transparent;
    color: inherit;
}

.website-footer .website-header-strip-bg-primary {
    background-color: var(--website-primary, #0d6efd);
    color: var(--website-on-primary, #fff);
}

.website-footer .website-header-strip-bg-primary a {
    color: var(--website-on-primary, #fff);
}

.website-footer .website-header-strip-bg-dark {
    background-color: #1a1a1a;
    color: #fff;
}

.website-footer .website-header-strip-bg-dark a {
    color: #fff;
}

/* On dark / primary footer bands, redefine the muted/secondary tokens to
   light values - same fix the header strips carry. Descendants that color
   themselves with var(--text-muted) / var(--text-secondary) (the language
   switcher separator, social labels, hour badges, "by subscribing" small
   print) otherwise keep a mid-grey that washes out on the near-black / brand
   background. */
.website-footer .website-header-strip-bg-dark,
.website-footer .website-header-strip-bg-primary {
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-secondary: rgba(255, 255, 255, 0.85);
    --bs-secondary-color: rgba(255, 255, 255, 0.7);
}

.website-footer .website-header-strip-bg-light {
    background-color: #f8f9fa;
    color: #1a1a1a;
}

.website-footer .website-header-strip-bg-transparent {
    background-color: transparent;
}

/* Custom per-strip color (shared StripRenderHelper path). Same inline-var
   contract as the header; re-scoped under .website-footer. */
.website-footer .website-header-strip-bg-custom {
    background-color: var(--strip-custom-bg);
    color: var(--strip-custom-fg);
}

.website-footer .website-header-strip-bg-custom a {
    color: inherit;
}

.website-footer .website-header-strip-bg-custom--dark {
    --text-muted: rgba(255, 255, 255, 0.7);
    --text-secondary: rgba(255, 255, 255, 0.85);
    --bs-secondary-color: rgba(255, 255, 255, 0.7);
}

/* Footer slot positions (pre / post). Pre sits above the column row;
   post below the copyright. Both get a touch of vertical breathing so
   they don't crowd the surrounding footer chrome. */
.website-footer-strip-slot-pre {
    margin-bottom: 0.5rem;
}

.website-footer-strip-slot-post {
    margin-top: 0.5rem;
}

/* ---------- Zones (left / center / right) ------------------------------- */

.website-footer .website-header-zone {
    min-width: 0;
}

.website-footer .website-header-zone-left {
    flex: 0 0 auto;
}

.website-footer .website-header-zone-center {
    flex: 1 1 auto;
}

.website-footer .website-header-zone-right {
    flex: 0 0 auto;
}

/* ---------- Section wrappers -------------------------------------------- */

.website-footer .website-header-section,
.website-footer .website-header-section-wrap {
    display: inline-flex;
    align-items: center;
}

/* Brand-area anchors keep their inherited colour and lose the default
   underline so a logo / wordmark inside a footer strip behaves like the
   header version. */
.website-footer .website-header-section-logo,
.website-footer .website-header-section-wordmark,
.website-footer .website-header-section-brand-combo {
    color: inherit;
    text-decoration: none;
}

.website-footer .website-header-section-logo:hover,
.website-footer .website-header-section-wordmark:hover,
.website-footer .website-header-section-brand-combo:hover,
.website-footer .website-header-section-logo:focus,
.website-footer .website-header-section-wordmark:focus,
.website-footer .website-header-section-brand-combo:focus {
    color: inherit;
    text-decoration: none;
}

/* Logo size in footer is smaller than header by default - footer logos
   are usually a sign-off, not the main brand mark. */
.website-footer .website-header-logo {
    max-height: 32px;
    width: auto;
}

.website-footer .website-header-wordmark {
    font-family: var(--font-family-brand, var(--font-family-heading));
    font-weight: 600;
    white-space: nowrap;
}

/* ---------- Language switcher in footer --------------------------------- */

.website-footer .website-header-section-language .language-text-links {
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
}

.website-footer .website-header-section-language .language-separator {
    display: inline;
    opacity: 0.5;
    color: var(--text-muted, currentColor);
    margin: 0 0.15rem;
}

.website-footer .website-header-section-language .language-flags {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
}

/* ---------- Social icons in footer -------------------------------------- */

.website-footer .website-header-section-social a {
    color: inherit;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.15s ease;
}

.website-footer .website-header-section-social a:hover {
    opacity: 1;
}

.website-footer .website-header-section-social .rounded-circle,
.website-footer .website-header-section-social .rounded {
    width: 32px;
    height: 32px;
}

/* ---------- Dropup popovers for theme / language switchers -------------- */

/* The section wrapping logic (ThemeSwitcherSection / LanguageSwitcherSection)
   emits .dropup instead of .dropdown when location='footer'. Bootstrap
   already styles .dropup with the menu rendered upward, but a few small
   nudges keep the menu inside the viewport and visually attached to the
   toggle button when placed near the very bottom of a page. */

.website-footer .dropup > .dropdown-menu {
    margin-bottom: 0.25rem;
}

/* The default .dropdown-menu-end alignment is right-edge of the toggle.
   In a footer post-strip placed in the right zone, that's still the
   right call - so no override needed for end-alignment. */

/* ---------- Tarok widget (helpers/header_sections/TarokSection.php) ------
   Unscoped on purpose: the community footer (FooterWidget) and the org
   footer use different wrapper classes. Colors derive from currentColor so
   the widget reads on light, dark, primary and custom strip bands alike. */

.website-tarok-widget {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    background: color-mix(in srgb, currentColor 5%, transparent);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.website-tarok-widget:hover,
.website-tarok-widget:focus-visible {
    color: inherit;
    background: color-mix(in srgb, currentColor 10%, transparent);
    border-color: color-mix(in srgb, currentColor 40%, transparent);
}

.website-tarok-widget-icon {
    font-size: 1.4em;
    line-height: 1;
}

.website-tarok-widget-live {
    font-size: 0.8em;
    opacity: 0.75;
}

.website-tarok-widget-live::before {
    content: "";
    display: inline-block;
    width: 0.5em;
    height: 0.5em;
    margin-right: 0.35em;
    border-radius: 50%;
    background: #2ecc71;
    vertical-align: 0.05em;
}

/* Chip: one compact inline row. */
.website-tarok-widget--chip {
    gap: 0.5rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.9rem;
}

.website-tarok-widget--chip .website-tarok-widget-icon {
    font-size: 1.1em;
}

/* Card: icon | title + text + live count | CTA. */
.website-tarok-widget--card {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    max-width: 100%;
}

.website-tarok-widget-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.website-tarok-widget-title {
    font-weight: 700;
}

.website-tarok-widget-text {
    font-size: 0.85em;
    opacity: 0.8;
}

.website-tarok-widget-cta {
    flex-shrink: 0;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9em;
    background: color-mix(in srgb, currentColor 14%, transparent);
}

@media (max-width: 575.98px) {
    .website-tarok-widget--card {
        flex-wrap: wrap;
    }

    .website-tarok-widget--card .website-tarok-widget-body {
        flex: 1 1 60%;
    }
}

/* Strip (default): one hairline-thin row that spans its zone - cycling suit,
   title, tagline, live dot, CTA - with a slow light sweep. The section wrap
   is inline-flex, so it is stretched here to let the ribbon run full width. */
.website-header-section-wrap:has(> .website-tarok-widget--strip) {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
}

.website-tarok-widget--strip {
    position: relative;
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    gap: 0.5rem;
    min-width: 0;
    padding: 0.2rem 0.9rem;
    border-width: 1px 0;
    border-radius: 0;
    background: color-mix(in srgb, currentColor 3%, transparent);
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
}

.website-tarok-widget--strip::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 35%, color-mix(in srgb, currentColor 12%, transparent) 50%, transparent 65%);
    background-size: 250% 100%;
    background-position: 150% 0;
    pointer-events: none;
    animation: website-tarok-sweep 7s ease-in-out infinite;
}

.website-tarok-widget--strip .website-tarok-widget-title {
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.website-tarok-widget--strip .website-tarok-widget-text {
    font-size: 1em;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.website-tarok-widget--strip .website-tarok-widget-live {
    font-size: 1em;
}

.website-tarok-widget--strip .website-tarok-widget-live::before,
.website-tarok-widget--chip .website-tarok-widget-live::before {
    animation: website-tarok-pulse 2s ease-in-out infinite;
}

/* Nobody playing (strip + chip): the slot invites instead, with a still,
   neutral dot. */
.website-tarok-widget .website-tarok-widget-live--idle::before {
    background: currentColor;
    opacity: 0.5;
    animation: none;
}

.website-tarok-widget-sep {
    opacity: 0.4;
}

.website-tarok-widget--strip .website-tarok-widget-cta {
    padding: 0;
    margin-left: 0.25rem;
    background: none;
    font-size: 1em;
}

.website-tarok-widget-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}

.website-tarok-widget--strip:hover .website-tarok-widget-arrow,
.website-tarok-widget--strip:focus-visible .website-tarok-widget-arrow {
    transform: translateX(3px);
}

/* Suit cycler: four glyphs stacked on a tiny white card face, each shown
   for a quarter of the loop, alternating black, red, black, red. The card
   face keeps the black suits readable on dark and primary footer bands. */
.website-tarok-widget-suits {
    position: relative;
    display: inline-block;
    width: 1.15em;
    height: 1.4em;
    flex-shrink: 0;
    font-size: 1em;
    line-height: 1.4em;
    text-align: center;
    background: #fff;
    border-radius: 0.2em;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* Two-class selectors so the colors beat the community footer's
   `.footer-widget span { color: inherit }` (footer.css). */
.website-tarok-widget-suits .website-tarok-widget-suit {
    position: absolute;
    inset: 0;
    opacity: 0;
    color: #111;
    animation: website-tarok-suit 8s ease-in-out infinite;
}

.website-tarok-widget-suits .website-tarok-widget-suit--0 { animation-delay: 0s; }
.website-tarok-widget-suits .website-tarok-widget-suit--1 { animation-delay: 2s; color: #d62828; }
.website-tarok-widget-suits .website-tarok-widget-suit--2 { animation-delay: 4s; }
.website-tarok-widget-suits .website-tarok-widget-suit--3 { animation-delay: 6s; color: #d62828; }

@keyframes website-tarok-suit {
    0% { opacity: 0; transform: translateY(40%); }
    5%, 22% { opacity: 1; transform: translateY(0); }
    27%, 100% { opacity: 0; transform: translateY(-40%); }
}

@keyframes website-tarok-sweep {
    0%, 20% { background-position: 150% 0; }
    80%, 100% { background-position: -50% 0; }
}

@keyframes website-tarok-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6); }
    50% { box-shadow: 0 0 0 0.3em rgba(46, 204, 113, 0); }
}

@media (max-width: 575.98px) {
    .website-tarok-widget--strip .website-tarok-widget-text,
    .website-tarok-widget--strip .website-tarok-widget-text + .website-tarok-widget-sep {
        display: none;
    }

    .website-tarok-widget--strip .website-tarok-widget-title + .website-tarok-widget-sep {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .website-tarok-widget--strip::after,
    .website-tarok-widget--strip .website-tarok-widget-live::before,
    .website-tarok-widget--chip .website-tarok-widget-live::before {
        animation: none;
    }

    .website-tarok-widget-suits .website-tarok-widget-suit {
        animation: none;
    }

    .website-tarok-widget-suits .website-tarok-widget-suit--0 {
        opacity: 1;
    }
}
