/* ================= THEME ================= */
:root {
    --bg: #0e3040;
    --calendar: #124054;
    --card: #123546;
    --panel: #16394b;
    --panel-2: #0f2f40;
    --text: #eaf3f9;
    --muted: #a8c0cf;
    --accent: #ffcc33;
    --accent-2: #ffa117;
    --stroke: rgba(255, 255, 255, .12);
    --stroke-2: rgba(255, 255, 255, .08);
    --pill: #1d4860;
    --search-background: #1d4860;
    --industry-btn-background: #1d4860;
    --pill-text: #fff;
    --success: #21d3a6;
    --danger: #ff6b6b;

    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;

    --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, .35);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .25);

    --container-max: 1300px;

    /* Unified control heights */
    --control-h: 40px;
    /* top-line controls */
    --ctl-height-sm: 34px;
    /* small controls (Day/Week/Month/date chip) */
    --ctl-radius: 10px;

    --industry-btn-w: 190px;
    /* <- pick your fixed width */


}

/* ================ BASE ================ */
* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
    background:
        radial-gradient(1200px 600px at 20% -10%, #154158 0%, transparent 60%),
        linear-gradient(180deg, #0f2e3e 0%, #0b2633 100%);
    color: var(--text);
}

main.site-content {
    padding: 28px 24px;
    max-width: var(--container-max);
    margin: 0 auto
}

/* ============== CARD SHELL ============== */
.calendar {
    background: var(--calendar);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: saturate(120%) blur(2px);
}

/* ============== FILTERS STRIP ============== */
.filters {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: nowrap;
    margin-bottom: 12px;
}

.filter-group {
    position: relative;
    background: transparent;
    border: 0;
    padding: 0;
    flex: 1;
    min-width: 180px;
    display: flex;
    flex-direction: column;
}

/* widths */
.filter-group:has(.select-menu[data-type="region"]) {
    flex: 0 1 220px;
    min-width: 220px
}

.filter-group:has(.industry-select),
.filter-group:has(.industry-row) {
    flex: 4 1 640px;
    min-width: 520px
}

.filter-group.categories {
    flex: 1.6 1 320px;
    min-width: 260px;
    max-width: 380px
}

/* Floating section label */
.centered-label {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 8px;
    font-size: .78rem;
    letter-spacing: .02em;
    font-weight: 800;
    color: var(--accent-2);
    background: var(--calendar);
    border-radius: 999px;
    white-space: nowrap;
    text-transform: uppercase;
    z-index: 2;
}

/* ============== SELECT MENUS (Region etc.) ============== */
.select-menu {
    position: relative
}

.select-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    background: var(--calendar);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 0 12px;
    height: var(--control-h);
    color: #fff;
    cursor: pointer;
    line-height: 1.1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
    transition: box-shadow .15s ease, border-color .15s ease, transform .06s ease;
}

.select-btn:hover {
    border-color: rgba(255, 255, 255, .18)
}

.select-btn:active {
    transform: translateY(1px)
}

.select-btn .fa-chevron-down {
    opacity: .8
}

/* Dropdown panel */
.dropdown-content {
    position: absolute;
    z-index: 30;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    background: #e8eef3;
    color: #0a2837;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid #d4e1eb;
    display: none;
    max-height: 340px;
    overflow: auto;
}

.select-menu.open .dropdown-content {
    display: block
}

/* Search inside dropdowns */
.layout .search-bar-container {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    gap: 8px;
    padding: 10px;
    background: #f6fbff;
    border-bottom: 1px solid #d4e1eb;
}

.layout .search-bar-container .search-input {
    flex: 1;
    border: 1px solid #c7d9e6;
    border-radius: 10px;
    padding: 9px 10px;
    outline: 0;
}

.layout .search-bar-container .clear-search {
    border: 1px solid #c7d9e6;
    background: #ecf5fb;
    border-radius: 10px;
    padding: 0 10px;
    cursor: pointer;
}

.options {
    list-style: none;
    margin: 0;
    padding: 8px
}

.bloc-item,
.option {
    padding: 8px 10px;
    border-radius: 8px;
    transition: background .15s ease
}

.bloc-item:hover,
.option:hover {
    background: #dfeaf2
}

.nested,
.sub-region {
    list-style: none;
    margin: 0 0 0 16px;
    padding: 0
}

.pill {
    display: inline-block;
    background: #dfeaf2;
    color: #0e3040;
    border-radius: 999px;
    font-size: .7rem;
    padding: 2px 8px;
    margin-left: 8px;
    font-weight: 700
}

.region {
    font-size: .7rem;
    color: #6b8596;
    margin-left: 8px
}

.sub-region.collapsed {
    display: none
}

.expand-sub {
    margin-left: 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: #4b6b80;
    font-size: .9rem
}

/* Quick reset row (inside Region) */
#regionQuick {
    display: flex;
    gap: 8px;
    padding: 10px 10px 0 10px
}

#regionQuick .preset-inline {
    background: #f7fbff;
    border: 1px solid #c7d9e6;
    border-radius: 8px;
    cursor: pointer;
    padding: 6px 10px;
    font-weight: 700;
}

#regionQuick .preset-inline:hover {
    background: #eef6fd
}

/* ============== INDUSTRY MULTI-SELECT ============== */
.industry-select {
    position: relative;
    width: 100%
}

.industry-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--industry-btn-background);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 0 12px;
    height: var(--control-h);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    line-height: 1;
}

/* Keep icon a stable size; let text ellipsis instead of growing button */
.industry-btn .icon {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    order: 2;
    margin-left: 8px;
    margin-right: 0;
}

.industry-btn #industryBtnLabel {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    /* <- prevents width changes */
}

.industry-btn #industryBtnLabel {
    order: 1;
}



.filter-svg {
    width: 20px;
    height: 20px
}

.industry-popover {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    /* anchor to the left of the button */
    right: auto;
    /* don't constrain to button width */
    width: 520px;
    /* <- wider */
    max-width: min(640px, 92vw);
    background: var(--panel-2);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 10px;
    z-index: 100;
    /* ensure it sits above everything */
}

/* more columns inside the panel */
.industry-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 8px;
}

.industry-grid .chk {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--panel);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14px;
}

.industry-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--stroke);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer
}

.btn {
    background: #1d5b73;
    border: 1px solid var(--stroke);
    color: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer
}

.industry-row:focus-within {
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, .05) inset,
        0 0 0 2px var(--accent, #f6c54b);
}


/* responsive fallback */
@media (max-width: 720px) {
    .industry-popover {
        width: auto;
        max-width: 94vw;
    }

    .industry-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}



/* Pill strip */
.topic-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px
}

.topic-pills .pill {
    background: var(--pill);
    color: var(--pill-text);
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: .82rem;
    border: 1px solid var(--stroke-2);
    cursor: pointer;
    user-select: none;
    transition: filter .15s ease, transform .06s ease;
    white-space: nowrap;
}

.topic-pills .pill:hover {
    filter: brightness(1.08)
}

.topic-pills .pill.active {
    background: var(--accent);
    color: #0a1738;
    border-color: #c19a00
}

/* Special pills: All / More + hidden state */
.topic-pills .pill.special {
    background: var(--panel);
    color: #eaf3f9;
    border: 1px dashed var(--stroke)
}

.topic-pills .pill.more {
    background: transparent;
    color: var(--muted);
    border: 1px dashed var(--stroke)
}

.topic-pills .pill.is-hidden {
    display: none
}

/* More dropdown (ported from older design) */
.more-menu {
    position: absolute;
    top: 100%;
    margin-top: 10px;
    left: 0;
    min-width: 280px;
    max-width: 360px;
    max-height: 320px;
    overflow: auto;
    background: var(--panel-2);
    color: var(--text);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    padding: 8px;
    display: none;
    z-index: 110;
}

.more-menu.open {
    display: block;
}

.more-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px 8px;
    font-weight: 800
}

.more-menu .option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px
}

.more-menu .option:hover {
    background: rgba(255, 255, 255, .06)
}

.more-menu .option input {
    accent-color: var(--accent)
}

/* helper buttons in header */
.btn-mini {
    background: transparent;
    color: #e5edf5;
    border: 1px solid var(--stroke);
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
}

.btn-mini:hover {
    background: rgba(255, 255, 255, .06)
}



/* === NEW: keep Industry button + pills on the same line === */
.industry-row {
    position: relative;
    /* keeps the More menu anchored */
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;

    /* NEW: group box visuals */
    padding: 10px 12px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .015));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .04),
        0 2px 10px rgba(0, 0, 0, .12);
}

.industry-row .industry-select {
    flex: 0 0 var(--industry-btn-w);
    width: var(--industry-btn-w);
}

.industry-row .industry-btn {
    width: 100% !important;
    /* was auto; now fill the fixed slot */
    min-width: 0;
    /* allow content to shrink inside */
    justify-content: flex-start;
}

/* Pills take the remaining space */
.industry-row .topic-pills {
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow-x: auto;
}


/* ============== CATEGORIES (chips) ============== */
.filter-group-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    background: var(--calendar);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    padding: 6px 10px;
    /* height: var(--control-h); */
}

.filter-group-checkbox label {
    background: transparent;
    border: 1px solid var(--stroke);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: .86rem;
    cursor: pointer;
    white-space: nowrap;
}

.filter-group-checkbox input {
    margin-right: 6px
}

/* Focus ring (a11y) */
.select-btn:focus-visible,
.btn-ghost:focus-visible,
.industry-btn:focus-visible,
.filter-group-checkbox label:focus-within,
.topic-pills .pill:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .25);
    outline-offset: 2px;
}

/* ============== CONTROLS BAR ============== */
.controls {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 14px;
    margin: 18px 0 12px;
    padding: 10px;
    border: 1px solid var(--stroke);
    border-radius: 12px;
    background: var(--calendar);
}

.controls-left {
    justify-self: start;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 12px
}

.controls-center {
    justify-self: center;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 6px
}

.controls-right {
    justify-self: end;
    min-width: 360px;
    display: flex;
    align-items: center;
    gap: 12px
}

.search-bar {
    background: var(--search-background);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    color: #fff;
    padding: 10px 12px;
    min-width: 220px;
    height: var(--control-h);
}

/* View toggle (compact) */
.view-options {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--ctl-height-sm);
    border-radius: var(--ctl-radius);
    background: var(--panel-2);
    border: 1px solid var(--stroke);
    overflow: hidden;
}

.view-option {
    height: 100%;
    padding: 0 12px;
    font-size: .85rem;
    letter-spacing: .01em;
    color: #e5edf5;
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.view-option+.view-option {
    border-left: 1px solid var(--stroke)
}

.view-option:hover {
    background: rgba(255, 255, 255, .05)
}

.view-option.active {
    background: var(--accent);
    color: #0a1738;
    font-weight: 800;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .08)
}

.view-option:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .25);
    outline-offset: -2px
}

/* Date chip + icon buttons sized to small control height */
.date-picker a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 200px;
    height: var(--ctl-height-sm);
    text-decoration: none;
    color: var(--accent-2);
    position: relative;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid var(--stroke);
    background: var(--panel-2);
}

.date-picker .fa-calendar-alt {
    color: var(--accent-2)
}

.date-picker .date-text {
    color: #cfdbe4
}

.date-picker .date-range-text {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--accent-2);
    font-size: 12px;
    font-weight: 800;
    background: var(--panel);
    padding: 2px 8px;
    /* border: 1px solid var(--stroke); */
    border-radius: 999px;
    display: none;
    z-index: 5;
    letter-spacing: .02em;
}

.date-picker .date-input-group {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    gap: 6px;
    width: 90%;
    max-width: 200px;
}

.date-picker .date-input {
    width: 70px;
    text-align: center;
    font-size: 13px;
    background: transparent;
    color: #fff;
    outline: 0;
    border: 0
}

.date-picker .close-btn {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--accent-2);
    cursor: pointer;
    opacity: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center
}

.date-picker .close-btn::before {
    content: "×";
    font-weight: 900
}

.date-picker a.active .date-range-text {
    display: block
}

.date-picker a.active .date-input-group {
    display: flex
}

.date-picker a.active .date-label {
    display: none
}

.date-picker a.active .close-btn {
    opacity: 1
}

.icon-button {
    height: var(--ctl-height-sm);
    min-width: var(--ctl-height-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--panel-2);
    border: 1px solid var(--stroke);
    border-radius: 12px;
    color: #e5edf5;
    transition: transform .06s ease
}

.icon-button:hover {
    border-color: rgba(255, 255, 255, .18)
}

.icon-button:active {
    transform: translateY(1px)
}

/* Clock */
.clock svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-right: 4px
}

#face {
    fill: none;
    stroke: #e5edf5;
    stroke-width: 18;
    opacity: .8
}

#quarter-markers {
    stroke: #e5edf5;
    stroke-width: 18;
    stroke-linecap: round;
    opacity: .35
}

#markers {
    stroke: #9fb4c3;
    stroke-width: 12;
    stroke-linecap: round;
    opacity: .25
}

#hour,
#min,
#sec {
    stroke: #ffcc33;
    stroke-linecap: round
}

#hour {
    stroke-width: 18
}

#min {
    stroke-width: 12
}

#sec {
    stroke-width: 8
}

.digital {
    display: flex;
    flex-direction: column;
    line-height: 1.15
}

.digital-row {
    display: flex;
    align-items: baseline;
    gap: 8px
}

.digital-time {
    font-weight: 800;
    font-size: 1.28rem
}

.digital-tz,
.digital-off {
    font-size: .92rem;
    color: #d9e6f2;
    opacity: .9
}

.digital-sep {
    opacity: .7
}

/* ============== TABLE ============== */
.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--stroke);
}

.calendar-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #16394b;
    color: #cfe0ec;
    font-weight: 700;
    letter-spacing: .02em;
    border-bottom: 1px solid var(--stroke);
}

.calendar-table th,
.calendar-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 12px 10px;
    color: #e5edf5;
    text-align: left;
}

.calendar-table tbody tr {
    background: linear-gradient(180deg, rgba(255, 255, 255, .015) 0%, rgba(255, 255, 255, 0) 100%)
}

.calendar-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, .02)
}

.calendar-table tbody tr:hover {
    background: rgba(255, 255, 255, .04)
}

.col-date {
    width: 7%
}

.col-time {
    width: 6%
}

.col-region {
    width: 9%
}

.col-toggle {
    width: 34px
}

.col-bell {
    width: 54px
}

.col-period {
    width: 8%
}

.col-metric {
    width: 7%;
    min-width: 68px
}

.calendar-table thead th:nth-child(4),
.calendar-table thead th:nth-child(6) {
    color: transparent
}

/* toggle + bell */
.toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--panel-2);
    border: 1px solid var(--stroke);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    line-height: 1;
    user-select: none;
    transition: filter .15s ease, transform .06s ease
}

.toggle-btn:hover {
    filter: brightness(1.08)
}

.toggle-btn:active {
    transform: translateY(1px)
}

.bell-btn {
    background: var(--panel-2);
    border: 1px solid var(--stroke);
    border-radius: 10px;
    width: 38px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: filter .15s ease, transform .06s ease
}

.bell-btn:hover {
    filter: brightness(1.08)
}

.bell-btn:active {
    transform: translateY(1px)
}

.bell-btn[aria-pressed="true"] {
    background: #ffd36a;
    border-color: #c19a00;
    color: #0a1738;
    font-weight: 800
}

/* subrows (expand) */
.subrow {
    display: none;
    opacity: 0;
    transition: opacity .22s ease
}

.subrow.visible {
    display: table-row;
    opacity: 1
}

/* ============== RESPONSIVE ============== */
@media (max-width:1180px) {
    .filters {
        flex-wrap: wrap
    }
}

@media (max-width:960px) {
    .controls {
        grid-template-columns: 1fr;
        row-gap: 10px
    }

    .controls-left,
    .controls-center,
    .controls-right {
        justify-self: stretch
    }

    .controls-right {
        justify-content: flex-start
    }

    .search-bar {
        min-width: 0;
        width: 100%
    }
}

/* small polish */
::selection {
    background: #174c63;
    color: #fff
}

/* Inline row for Industry button + pills */

/* Custom page */
.sth-glance-box {
    display: none;
}

.page-template-tpl-calenda-v2 .layout {
    /* grid-template-columns: 155px 1fr 145px; */
    grid-template-columns: 175px 1fr 0;
    gap: 0;
}

.page-template-tpl-calenda-v2 .layout,
.page-template-tpl-calenda-v2 .site-footer .footer-content,
.page-template-tpl-calenda-v2 .site-footer .footer-bottom,
.page-template-tpl-calenda-v2 .header-limiter {
    max-width: 1680px;
}

.page-template-tpl-calenda-v2 .dropdown-content {
    transform: unset;
}

.page-template-tpl-calenda-v2 .controls {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.page-template-tpl-calenda-v2 #triggerSearch {
    display: none;
}

#calendarBody td a {
    display: block;
}

#calendarBody td a:hover {
    color: var(--accent);
}