:root {
    --tso-color-page-bg: #f4f7fb;
    --tso-color-surface: #ffffff;
    --tso-color-surface-elevated: #f8fbff;
    --tso-color-text-primary: #11253d;
    --tso-color-text-secondary: #2d435f;
    --tso-color-text-muted: #5f6f83;
    --tso-color-border: #d6deea;
    --tso-color-link: #0c4a86;
    --tso-color-focus: #d6452b;
    --tso-color-success: #1b7f47;
    --tso-color-warning: #9a6400;
    --tso-color-error: #a12628;
    --tso-color-topbar-bg: #eef3f9;
    --tso-color-topbar-fg: #11253d;
    --tso-color-topbar-badge-bg: rgba(17, 37, 61, 0.12);

    --tso-layout-content-max-width: 860px;
    --tso-layout-gutter: 20px;
    --tso-layout-section-spacing: 28px;
    --tso-font-scale: 100%;

    --tso-space-1: 4px;
    --tso-space-2: 8px;
    --tso-space-3: 12px;
    --tso-space-4: 16px;
    --tso-space-5: 24px;
    --tso-space-6: 32px;
    --tso-space-7: 40px;

    --tso-radius-sm: 4px;
    --tso-radius-md: 8px;
    --tso-radius-lg: 14px;
    --tso-border-width: 1px;
    --tso-shadow-1: 0 8px 20px rgba(9, 27, 51, 0.08);
    --tso-transition-fast: 160ms;
    --tso-focus-outline: 2px solid var(--tso-color-focus);

    --tso-font-line-height-body: 1.65;
    --tso-font-line-height-heading: 1.25;

    --primary-color: var(--tso-color-primary);
    --theme-color: var(--tso-color-primary);
    --body-bg: var(--tso-color-page-bg);
    --clr-background: var(--tso-color-surface);
    --clr-sub-background: var(--tso-color-surface-elevated);
    --clr-foreground: var(--tso-color-text-primary);
    --clr-sub-border: var(--tso-color-border);
    --text-color-normal: var(--tso-color-text-primary);
    --light-bg-color: var(--tso-color-surface-elevated);
    --background-color-white: var(--tso-color-surface);
    --color-text-white: #ffffff;
    --font-line-height-body: var(--tso-font-line-height-body);
}

html,
body {
    background-color: var(--tso-color-page-bg);
    color: var(--tso-color-text-primary);
}

html {
    font-size: var(--tso-font-scale);
}

a {
    color: var(--tso-color-link);
}

a:hover,
a:focus {
    color: var(--tso-color-primary);
}

:focus-visible {
    outline: var(--tso-focus-outline);
    outline-offset: 2px;
}

.site,
.site-header,
.site-footer,
.widget,
.site-main article {
    background-color: var(--tso-color-surface);
}

body {
    background-color: var(--body-bg);
}

.widget,
.site-main article,
.site-header,
.site-footer-top,
.site-footer-bottom {
    border-color: var(--tso-color-border);
}

body,
button,
input,
select,
optgroup,
textarea {
    line-height: var(--tso-font-line-height-body);
    color: var(--tso-color-text-primary);
}

h1,
h2,
h3,
h4,
h5,
h6,
.site-title,
.widget-title {
    line-height: var(--tso-font-line-height-heading);
    font-family: var(--font-heading);
    color: var(--tso-color-text-primary);
}

.site-title a,
.site-description {
    color: var(--header-text-color);
}

.site-description,
.entry-meta,
.entry-footer,
.widget p,
.site-info {
    color: var(--tso-color-text-secondary);
}

.site-footer .site-footer-bottom {
    background-color: var(--tso-color-surface-elevated);
}

.tso-color-mode-toggle,
.tso-header-utility-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: var(--tso-border-width) solid var(--tso-color-border);
    background: var(--tso-color-surface);
    color: var(--tso-color-text-primary);
    border-radius: var(--tso-radius-md);
    padding: var(--tso-space-2) var(--tso-space-3);
    text-decoration: none;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background-color var(--tso-transition-fast), color var(--tso-transition-fast), border-color var(--tso-transition-fast);
}

.tso-color-mode-toggle:hover,
.tso-color-mode-toggle:focus-visible,
.tso-header-utility-button:hover,
.tso-header-utility-button:focus-visible {
    border-color: var(--tso-color-primary);
}

.tso_news-wrapper {
    padding-inline: var(--tso-layout-gutter);
}

.site-main article {
    padding: var(--tso-space-5);
}

.entry-content,
.entry-summary {
    max-width: var(--tso-layout-content-max-width);
}

header.site-header .top-header {
    background-color: var(--tso-color-topbar-bg);
    color: var(--tso-color-topbar-fg);
}

header.site-header .top-header .top-header-wrapper {
    gap: var(--tso-space-3);
}

header.site-header .top-header .top-header-wrapper .top-header-left,
header.site-header .top-header .top-header-wrapper .top-header-right {
    min-width: 0;
}

header.site-header .top-header .top-header-wrapper .top-header-left {
    flex-wrap: wrap;
}

header.site-header .top-header .top-header-wrapper .top-header-left .date-wrap time {
    display: inline-flex;
    align-items: center;
    gap: var(--tso-space-1);
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--tso-color-topbar-badge-bg);
    color: var(--tso-color-topbar-fg);
}

header.site-header .top-header .top-header-wrapper .top-header-left .top-header-menu ul {
    row-gap: var(--tso-space-1);
}

header.site-header .top-header .top-header-wrapper .top-header-left .top-header-menu ul a,
header.site-header .top-header .top-header-wrapper .social-icons li a {
    color: var(--tso-color-topbar-fg);
}

header.site-header .top-header .top-header-wrapper .top-header-left .top-header-menu ul a:focus-visible,
header.site-header .top-header .top-header-wrapper .social-icons li a:focus-visible {
    outline: var(--tso-focus-outline);
    outline-offset: 2px;
}

header.site-header .middle-header-part .middle-header-wrapper {
    align-items: center;
}

.header-widget-area {
    border-top: var(--tso-border-width) solid var(--tso-color-border);
    border-bottom: var(--tso-border-width) solid var(--tso-color-border);
    background-color: var(--tso-color-surface-elevated);
}

.header-widget-area .header-widget-area-inner {
    display: grid;
    gap: var(--tso-space-3);
    padding-block: var(--tso-space-3);
}

.tso-header-advertisement {
    border: var(--tso-border-width) solid var(--tso-color-border);
    border-radius: var(--tso-radius-sm);
    background-color: var(--tso-color-surface-elevated);
    padding: var(--tso-space-2);
}

.tso-header-advertisement img {
    display: block;
    max-width: 100%;
    height: auto;
}

.bottom-header-part-outer.tso-header-is-sticky .bottom-header-part {
    position: sticky;
    top: 0;
    z-index: 40;
    box-shadow: var(--tso-shadow-1);
}

body.admin-bar .bottom-header-part-outer.tso-header-is-sticky .bottom-header-part {
    top: 32px;
}

.flash-news-ticker .flash-news-ticker-wrapper .flash-news-part {
    min-width: 0;
    overflow: hidden;
}

.flash-news-ticker,
.flash-news-ticker .flash-news-ticker-wrapper {
    overflow-x: hidden;
}

.flash-news-ticker .flash-news-ticker-wrapper .flash-news-part .marquee {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.25;
}

.flash-news-ticker .flash-news-ticker-wrapper .flash-news-part .marquee .js-marquee-wrapper,
.flash-news-ticker .flash-news-ticker-wrapper .flash-news-part .marquee .js-marquee {
    display: inline-flex !important;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.flash-news-ticker .flash-news-ticker-wrapper .flash-news-part .mag-post-title-wrapper {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.flash-news-ticker .flash-news-ticker-wrapper .flash-news-part .mag-post-title-wrap {
    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.flash-news-ticker .flash-news-ticker-wrapper .flash-news-part .mag-post-title-wrap .flash-title,
.flash-news-ticker .flash-news-ticker-wrapper .flash-news-part .mag-post-title-wrap .flash-title a {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}

[data-tso-color-mode="dark"] {
    --tso-color-page-bg: #0d1623;
    --tso-color-surface: #131f30;
    --tso-color-surface-elevated: #1b2a40;
    --tso-color-text-primary: #ebf2ff;
    --tso-color-text-secondary: #c0cddd;
    --tso-color-text-muted: #99abc1;
    --tso-color-border: #2e425f;
    --tso-color-link: #8fc2ff;
    --tso-color-focus: #ff8b6f;
    --tso-color-success: #4ed28d;
    --tso-color-warning: #ffca66;
    --tso-color-error: #ff8e90;
    --tso-color-topbar-bg: #101b2b;
    --tso-color-topbar-fg: #ebf2ff;
    --tso-color-topbar-badge-bg: rgba(235, 242, 255, 0.18);
    --tso-shadow-1: 0 10px 26px rgba(0, 0, 0, 0.45);

    --body-bg: var(--tso-color-page-bg);
    --clr-background: var(--tso-color-surface);
    --clr-sub-background: var(--tso-color-surface-elevated);
    --clr-foreground: var(--tso-color-text-primary);
    --clr-sub-border: var(--tso-color-border);
    --text-color-normal: var(--tso-color-text-primary);
    --light-bg-color: var(--tso-color-surface-elevated);
    --background-color-white: var(--tso-color-surface);
}

.tso-post-carousel-section .tso-post-carousel-arrows button {
    border: var(--tso-border-width) solid var(--tso-color-border);
    background-color: var(--tso-color-surface);
    color: var(--tso-color-text-primary);
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    margin-inline-start: var(--tso-space-2);
}

.tso-post-carousel-section .tso-post-carousel-arrows button:hover,
.tso-post-carousel-section .tso-post-carousel-arrows button:focus-visible {
    border-color: var(--tso-color-primary);
}

.tso-video-section .tso-video-section-wrapper {
    display: grid;
    gap: var(--tso-space-4);
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 992px) {
    .tso-video-section .tso-video-section-wrapper {
        grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    }
}

.tso-video-section .tso-video-player-shell {
    position: relative;
    overflow: hidden;
    border-radius: var(--tso-radius-md);
    border: var(--tso-border-width) solid var(--tso-color-border);
    background: var(--tso-color-surface-elevated);
    aspect-ratio: 16 / 9;
}

.tso-video-section .tso-video-player-shell iframe,
.tso-video-section .tso-video-player-shell .tso-video-activate {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.tso-video-section .tso-video-activate {
    position: relative;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.tso-video-section .tso-video-activate:focus-visible {
    outline: var(--tso-focus-outline);
    outline-offset: 2px;
}

.tso-video-section .tso-video-activate img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tso-video-section .tso-video-play-badge {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 3rem;
    height: 3rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    color: #ffffff;
    font-size: 1.35rem;
}

.tso-video-section .tso-video-detail {
    padding: var(--tso-space-3);
}

.tso-video-section .tso-video-meta {
    display: flex;
    gap: var(--tso-space-2);
    align-items: center;
    flex-wrap: wrap;
    margin: 0 0 var(--tso-space-2);
}

.tso-video-section .tso-video-meta-category {
    font-size: var(--tso-font-size-xs);
    color: var(--tso-color-primary);
    font-weight: 600;
}

.tso-video-section .tso-video-meta-date {
    font-size: var(--tso-font-size-xs);
    color: var(--tso-color-text-muted);
}

.tso-video-section .tso-video-title {
    margin: 0 0 var(--tso-space-2);
}

.tso-video-section .tso-video-description {
    margin: 0 0 var(--tso-space-3);
}

.tso-category-profile {
    margin-block: var(--tso-space-5);
}

.tso-category-landing-identity {
    margin-bottom: var(--tso-space-4);
}

.tso-category-landing-identity__label {
    margin: 0;
    font-size: var(--tso-font-size-xs);
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--tso-color-text-muted);
}

.tso-category-landing-identity__title {
    margin: var(--tso-space-1) 0 0;
}

.tso-category-profile--general {}

.tso-category-profile--technology {}

.tso-category-profile--health-lifestyle {}

.tso-category-profile--climate-data {}

.tso-category-profile--environment-investigative {}

.tso-category-profile--nature-visual {}

.tso-category-profile--surf-outdoor {}

.tso-category-profile .magazine-section-body {
    border: var(--tso-border-width) solid var(--tso-color-border);
    border-radius: var(--tso-radius-md);
    background: var(--tso-color-surface);
    padding: var(--tso-space-4);
}

.tso-header-utilities {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--tso-space-2);
    margin-right: 0;
}

.tso-header-utility-button {
    font-size: var(--tso-font-size-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--tso-color-text-primary);
}

header.site-header .bottom-header-part .bottom-header-wrapper .header-search .header-search-wrap .header-search-icon.tso-header-utility-button {
    width: auto;
    height: auto;
    min-width: 86px;
    max-width: none;
    overflow: visible;
    text-overflow: clip;
    font-size: var(--tso-font-size-xs);
    color: var(--tso-color-text-primary);
}

.tso-header-search-button {
    min-width: 86px;
    width: auto;
    white-space: nowrap;
}

.bottom-header-wrapper .bottom-header-end {
    min-width: 0;
}

header.site-header .bottom-header-part .bottom-header-wrapper .header-search {
    width: auto !important;
    min-width: 0;
    display: inline-flex !important;
    align-items: center;
}

header.site-header .bottom-header-part .bottom-header-wrapper .header-search .header-search-wrap {
    display: inline-flex !important;
    align-items: center;
}

.tso-header-utility-button:focus-visible {
    outline: var(--tso-focus-outline);
    outline-offset: 2px;
}

.tso-category-profile__conditions-slot {
    margin-top: var(--tso-space-4);
    margin-bottom: var(--tso-space-4);
    border: var(--tso-border-width) dashed var(--tso-color-border);
    border-radius: var(--tso-radius-md);
    padding: var(--tso-space-3);
    color: var(--tso-color-text-muted);
    background: var(--tso-color-surface-elevated);
}

.tso-category-profile--technology .section-title,
.tso-category-profile--surf-outdoor .section-title {
    letter-spacing: 0.02em;
}

.tso-category-profile--health-lifestyle .mag-post-category.with-background,
.tso-category-profile--nature-visual .mag-post-category.with-background,
.tso-category-profile--surf-outdoor .mag-post-category.with-background {
    border-radius: 999px;
}

.tso-category-profile--climate-data .mag-post-single,
.tso-category-profile--environment-investigative .mag-post-single {
    border-bottom: var(--tso-border-width) solid var(--tso-color-border);
    padding-bottom: var(--tso-space-3);
}

.tso-category-profile__continuation {
    margin-top: var(--tso-space-5);
}

[data-tso-color-mode="system"] {
    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    [data-tso-color-mode="system"] {
        --tso-color-page-bg: #0d1623;
        --tso-color-surface: #131f30;
        --tso-color-surface-elevated: #1b2a40;
        --tso-color-text-primary: #ebf2ff;
        --tso-color-text-secondary: #c0cddd;
        --tso-color-text-muted: #99abc1;
        --tso-color-border: #2e425f;
        --tso-color-link: #8fc2ff;
        --tso-color-focus: #ff8b6f;
        --tso-color-success: #4ed28d;
        --tso-color-warning: #ffca66;
        --tso-color-error: #ff8e90;
        --tso-color-topbar-bg: #101b2b;
        --tso-color-topbar-fg: #ebf2ff;
        --tso-color-topbar-badge-bg: rgba(235, 242, 255, 0.18);
        --tso-shadow-1: 0 10px 26px rgba(0, 0, 0, 0.45);
    }
}

@media (max-width: 991px) {
    :root {
        --tso-layout-gutter: 16px;
        --tso-layout-section-spacing: 24px;
    }

    .site-main article {
        padding: var(--tso-space-4);
    }

    .tso-header-utilities {
        gap: var(--tso-space-2);
        margin-right: var(--tso-space-2);
    }

    #site-navigation .main-navigation-links {
        inset-inline-end: 0;
        inset-inline-start: auto;
        transform: translateX(112%);
        transition: transform 400ms ease, opacity 400ms ease, visibility 400ms ease;
    }

    #site-navigation.toggled .main-navigation-links {
        transform: translateX(0);
    }
}

@media (max-width: 600px) {
    :root {
        --tso-layout-gutter: 12px;
        --tso-layout-section-spacing: 20px;
    }

    .site-main article {
        padding: var(--tso-space-3);
    }

    .tso-color-mode-toggle,
    .tso-header-utility-button {
        max-width: 132px;
        min-height: 34px;
        padding: var(--tso-space-2);
    }

    .tso-header-search-button {
        max-width: none;
        min-width: 74px;
    }

    header.site-header .bottom-header-part .bottom-header-wrapper {
        min-height: auto;
        flex-wrap: wrap !important;
        row-gap: var(--tso-space-2);
        padding-block: var(--tso-space-2);
    }

    header.site-header .bottom-header-part .bottom-header-wrapper .navigation-part {
        width: 100%;
    }

    header.site-header .bottom-header-part .bottom-header-wrapper .bottom-header-end {
        width: 100%;
        justify-content: flex-end !important;
    }

    header.site-header .bottom-header-part .bottom-header-wrapper .tso-header-utilities {
        width: 100%;
        justify-content: flex-end;
        margin-right: 0;
    }

    /* Match the upstream footer rule: its -15px margins exceed the mobile gutter. */
    .site-footer .site-footer-top .footer-widgets-wrapper {
        margin-inline: 0;
        overflow-x: clip;
    }

    .site-footer .footer-widget-single {
        margin-inline: 0;
    }
}

.tso-location-selector-page {
    border: var(--tso-border-width) solid var(--tso-color-border);
    border-radius: var(--tso-radius-md);
    background: var(--tso-color-surface);
    padding: var(--tso-space-4);
    width: 100%;
}

.tso-location-selector-title {
    margin-bottom: var(--tso-space-3);
}

.tso-location-selector-form {
    display: grid;
    gap: var(--tso-space-3);
}

.tso-location-selector-toolbar,
.tso-location-selector-actions {
    display: flex;
    align-items: center;
    gap: var(--tso-space-2);
    flex-wrap: wrap;
}

.tso-location-selector-grid {
    display: grid;
    gap: var(--tso-space-2);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tso-location-selector-field {
    display: grid;
    gap: var(--tso-space-1);
    min-width: 0;
}

.tso-location-selector-field select,
.tso-location-selector-search,
.tso-location-selector-search-results,
.tso-location-selector-all,
.tso-location-selector-submit {
    border: var(--tso-border-width) solid var(--tso-color-border);
    border-radius: var(--tso-radius-md);
    background: var(--tso-color-surface);
    color: var(--tso-color-text-primary);
    min-height: 38px;
    padding: var(--tso-space-2) var(--tso-space-3);
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tso-location-selector-search {
    flex: 1 1 100%;
}

.tso-location-selector-search-results {
    flex: 1 1 100%;
}

.tso-location-selector-message {
    margin: 0;
    padding: var(--tso-space-2) var(--tso-space-3);
    border-radius: var(--tso-radius-md);
    border: var(--tso-border-width) solid var(--tso-color-warning);
    background: var(--tso-color-surface-elevated);
    color: var(--tso-color-text-primary);
}

.tso-location-selector-all,
.tso-location-selector-submit {
    cursor: pointer;
    font-weight: 600;
}

.tso-location-selector-field select:focus-visible,
.tso-location-selector-search:focus-visible,
.tso-location-selector-search-results:focus-visible,
.tso-location-selector-all:focus-visible,
.tso-location-selector-submit:focus-visible {
    outline: var(--tso-focus-outline);
    outline-offset: 2px;
}

@media (max-width: 820px) {
    .tso-location-selector-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 782px) {
    body.admin-bar .bottom-header-part-outer.tso-header-is-sticky .bottom-header-part {
        top: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Keep footer social links inside their existing responsive grid cells. */
.footer-widget-single .widget_tso_news_social_icons ul.social-links li a { width:100%; min-width:0; max-width:100%; }
