/*
Theme Name: TSO Blog
Author: deadko
Author URI: https://tusoporteonline.es
Description: Classic blog theme with an orange frame and a white content area. Includes a two-column home grid with Load more, live search, a day/night color mode, Customizer options for colors, typography and logo, announcement bars, ready-made page templates (portfolio, pricing, team, FAQ, contact and more) and optional Google Fonts.
Version: 1.0.8
Requires at least: 6.1
Tested up to: 7.1
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tso-blog
Domain Path: /languages
Tags: blog, two-columns, right-sidebar, custom-colors, custom-header, custom-background, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, sticky-post, theme-options, threaded-comments, translation-ready, wide-blocks, block-styles
*/

/* ============================================================
   THEME CSS VARIABLES (overridden via Customizer inline CSS)
   ============================================================ */
:root {
    --tso-color-accent: #d6993a;
    --tso-color-primary: #1e73be;
    --tso-color-body-bg: #d6993a;
    --tso-color-accent-hover: #b5782e;
    --tso-color-nav-bg: #000000;
    --tso-color-nav-text: #ffffff;
    --tso-color-nav-hover: #d6993a;
    --tso-color-nav-submenu: #222222;
    --tso-color-footer-bg: #222222;
    --tso-color-footer-heading: #ffffff;
    --tso-color-footer-text: #cccccc;
    --tso-color-footer-muted: #aaaaaa;
    --tso-color-footer-border: #444444;
    --tso-color-announce-bg: #d6993a;
    --tso-color-announce-text: #ffffff;
    --tso-color-text: #333333;
    --tso-color-heading: #111111;
    --tso-color-text-muted: #666666;
    --tso-color-white: #ffffff;
    --tso-color-border: #e0e0e0;
    --tso-color-surface: #ffffff;
    --tso-font-body: Arial, Helvetica, sans-serif;
    --tso-font-heading: Arial, Helvetica, sans-serif;
    --tso-font-announce: Arial, Helvetica, sans-serif;
    --tso-font-nav: Arial, Helvetica, sans-serif;
    --tso-font-body-size: 15px;
    --tso-font-body-line: 1.6;
    --tso-font-heading-weight: 700;
    --tso-font-h1-size: 24px;
    --tso-font-h1-transform: none;
    --tso-font-widget-title-size: 14px;
    --tso-font-widget-text-size: 14px;
    --tso-logo-width: 300px;
    --tso-logo-width-mobile: 180px;
    --tso-layout-max: 1060px;
    --tso-sidebar-width: 300px;
    --tso-sidebar-gap: 30px;
    --tso-sidebar-radius: 6px;
    --tso-sidebar-bg: #f1f1f1;
    --tso-sidebar-widget-bg: #ffffff;
    --tso-sidebar-title-bg: #1e73be;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--tso-font-body, Arial, Helvetica, sans-serif);
    font-size: var(--tso-font-body-size, 15px);
    line-height: var(--tso-font-body-line, 1.6);
    color: var(--tso-color-text);
    /* background-color: var(--tso-color-body-bg) — set via inline CSS from Customizer */
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--tso-font-heading, Arial, Helvetica, sans-serif);
    font-weight: var(--tso-font-heading-weight, 700);
    color: var(--tso-color-heading, #111111);
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--tso-color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--tso-color-accent-hover);
    text-decoration: underline;
}

/* ============================================================
   ACCESIBILIDAD — SKIP TO CONTENT
   Hidden with clip (not top:-100px) so it never peeks as a blue bar.
   Visible only on keyboard focus (:focus-visible).
   ============================================================ */
.skip-to-content {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    word-wrap: normal !important;
    z-index: 100000;
    background: transparent;
    color: transparent;
    text-decoration: none;
}

.skip-to-content:focus,
.skip-to-content:focus-visible {
    clip: auto !important;
    -webkit-clip-path: none;
    clip-path: none;
    height: auto;
    width: auto;
    margin: 0;
    padding: 10px 20px;
    overflow: visible;
    background: var(--tso-color-primary);
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    line-height: normal;
    border-radius: 0 0 4px 0;
    outline: 3px solid var(--tso-color-accent);
    outline-offset: 0;
    top: 0;
    left: 0;
    z-index: 100000;
}

/* Keep skip link below the WordPress admin bar when focused */
body.admin-bar .skip-to-content:focus,
body.admin-bar .skip-to-content:focus-visible {
    top: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar .skip-to-content:focus,
    body.admin-bar .skip-to-content:focus-visible {
        top: 46px;
    }
}

/* WordPress core — screen reader text (Codex pattern) */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: #f1f1f1;
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* WordPress core — captions & galleries */
.wp-caption {
    max-width: 100%;
    margin-bottom: 1em;
}

.wp-caption img {
    display: block;
    margin: 0 auto;
    height: auto;
}

.wp-caption-text,
.gallery-caption {
    font-size: 0.875em;
    color: #666;
    text-align: center;
    margin: 0.5em 0 0;
    line-height: 1.5;
}

/* Classic [gallery] — html5 gallery support needs theme CSS */
.gallery {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 1em;
    margin: 0 0 1.5em;
    padding: 0;
    clear: both;
}

.gallery-item {
    margin: 0;
    padding: 0;
    text-align: center;
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    box-sizing: border-box;
}

.gallery-item img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border: none;
}

.gallery-columns-1 .gallery-item { width: 100%; }
.gallery-columns-2 .gallery-item { width: calc(50% - 0.5em); }
.gallery-columns-3 .gallery-item { width: calc(33.333% - 0.67em); }
.gallery-columns-4 .gallery-item { width: calc(25% - 0.75em); }
.gallery-columns-5 .gallery-item { width: calc(20% - 0.8em); }
.gallery-columns-6 .gallery-item { width: calc(16.666% - 0.84em); }
.gallery-columns-7 .gallery-item { width: calc(14.285% - 0.86em); }
.gallery-columns-8 .gallery-item { width: calc(12.5% - 0.875em); }
.gallery-columns-9 .gallery-item { width: calc(11.111% - 0.89em); }

.gallery-item a {
    display: inline-block;
    line-height: 0;
}

/* Block styles (register_block_style) */
.is-style-tso-accent .wp-block-button__link,
.wp-block-button.is-style-tso-accent .wp-block-button__link {
    background-color: var(--tso-color-accent);
    color: #fff;
}

.is-style-tso-sidebar-quote,
.wp-block-quote.is-style-tso-sidebar-quote {
    border-left: 4px solid var(--tso-color-accent);
    padding-left: 1em;
    margin-left: 0;
}

.is-style-tso-short.wp-block-separator,
.wp-block-separator.is-style-tso-short {
    width: 80px;
    margin-left: auto;
    margin-right: auto;
    border-bottom-width: 3px;
    border-color: var(--tso-color-accent);
}

.is-style-tso-shadow img,
.wp-block-image.is-style-tso-shadow img {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* Align wide / full inside page wrapper */
.entry-content .alignwide {
    max-width: 100%;
}

.entry-content .alignfull {
    width: calc(100% + 80px);
    max-width: calc(100% + 80px);
    margin-left: -40px;
    margin-right: -40px;
}

@media screen and (max-width: 768px) {
    .entry-content .alignfull {
        width: calc(100% + 30px);
        max-width: calc(100% + 30px);
        margin-left: -15px;
        margin-right: -15px;
    }
}

/* WordPress core — sticky posts */
.sticky.home-post-card {
    border-left: 4px solid var(--tso-color-accent);
}

/* WordPress core — comment by post author */
.comment.bypostauthor {
    border-left: 3px solid var(--tso-color-primary);
    padding-left: 12px;
}

/* ============================================================
   CONTENEDOR PRINCIPAL
   ============================================================ */
#page-wrapper {
    background: var(--tso-color-surface);
    max-width: var(--tso-layout-max);
    width: 100%;
    margin: 30px auto;
    padding: 20px 40px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
    min-height: 100vh;
    box-sizing: border-box;
}

body.tso-layout-full #page-wrapper {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background-color: var(--tso-color-header-bg);
    border-bottom: 1px solid var(--tso-color-border, #eee);
    margin: -20px -40px 0;
    padding: 0 40px;
}

.header-main {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 20px 0;
    gap: 20px;
}

.logo a {
    display: block;
    line-height: 0;
}

.logo img,
.custom-logo {
    width: var(--tso-logo-width, 300px);
    max-width: 100%;
    height: auto;
    display: block;
}

/* Custom header image (Customize → Header Image), recommended 1060×200 */
.header-image {
    margin: 0 0 12px;
    line-height: 0;
    text-align: center;
}

.header-image a {
    display: block;
}

.header-image img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

/* Columna derecha del header */
.header-right {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: end;
    -ms-flex-align: end;
    align-items: flex-end;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    gap: 8px;
}

/* Iconos sociales — el tamaño se fija con style="" inline en PHP (FOUC-proof) */
.header-social-icons {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
}
/* Fallback gap para Safari iOS < 14 */
.header-social-icons .social-icon + .social-icon {
    margin-left: 6px;
}

.social-icon {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    border-radius: 50%;
    background-color: var(--tso-color-primary);
    overflow: hidden;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    text-decoration: none;
    -webkit-transition: background-color 0.2s;
    transition: background-color 0.2s;
    /* Tamaño fijado via style="" inline para ser FOUC-proof */
}

.social-icon svg {
    fill: #fff;
    display: block;
    pointer-events: none;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.social-icon:hover              { background-color: var(--tso-color-accent); text-decoration: none; }
.social-icon--youtube:hover     { background-color: #ff0000; }
.social-icon--linkedin:hover    { background-color: #0077b5; }
.social-icon--facebook:hover    { background-color: #1877f2; }
.social-icon--twitter:hover     { background-color: #000; }
.social-icon--tiktok:hover      { background-color: #000; }
.social-icon--telegram:hover    { background-color: #229ed9; }
.social-icon--whatsapp:hover    { background-color: #25d366; }
.social-icon--pinterest:hover   { background-color: #e60023; }
.social-icon--threads:hover     { background-color: #000; }
.social-icon--github:hover      { background-color: #333; }
.social-icon--instagram:hover   {
    background: -webkit-linear-gradient(315deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);
    background: linear-gradient(135deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888);
}

/* ============================================================
   BUSCADOR EN EL HEADER
   ============================================================ */
.header-search {
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.tso-search-wrapper {
    position: relative;
}

#searchform,
.searchform {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    border: 2px solid #ccc;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

#searchform div,
.searchform div {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    width: 100%;
}

#searchform input[type="text"],
#searchform input[type="search"],
.searchform input[type="text"],
.searchform input[type="search"] {
    border: none;
    outline: none;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    width: 220px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

#searchform button[type="submit"],
.searchform button[type="submit"] {
    background: var(--tso-color-header-bg);
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    color: var(--tso-color-header-contrast, #fff);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    -webkit-transition: background-color 0.2s;
    transition: background-color 0.2s;
}

#searchform button[type="submit"]:hover,
.searchform button[type="submit"]:hover {
    background: var(--tso-color-header-bg-hover);
}

/* Dropdown de resultados del buscador */
#tso-search-results,
.tso-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    width: 100%;
    min-width: 280px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    -webkit-box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 9999;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 360px;
    overflow-y: auto;
}

#tso-search-results li,
.tso-search-results li {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f2f2f2;
}

#tso-search-results li:last-child,
.tso-search-results li:last-child {
    border-bottom: none;
}

#tso-search-results li a,
.tso-search-results li a {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    padding: 9px 13px;
    text-decoration: none;
    color: #222;
    -webkit-transition: background 0.12s;
    transition: background 0.12s;
}

#tso-search-results li a:hover,
#tso-search-results li.is-active a,
.tso-search-results li a:hover,
.tso-search-results li.is-active a {
    background: #fdf5e8;
    text-decoration: none;
}

#tso-search-results .tso-sr-title,
.tso-search-results .tso-sr-title {
    font-size: 13px;
    font-weight: 600;
    color: #222;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

#tso-search-results li a:hover .tso-sr-title,
#tso-search-results li.is-active a .tso-sr-title,
.tso-search-results li a:hover .tso-sr-title,
.tso-search-results li.is-active a .tso-sr-title {
    color: var(--tso-color-accent);
}

#tso-search-results .tso-sr-mark,
.tso-search-results .tso-sr-mark {
    background: rgba(214, 153, 58, 0.35);
    color: inherit;
    font-weight: 700;
    padding: 0;
}

#tso-search-results .tso-sr-date,
.tso-search-results .tso-sr-date {
    font-size: 11px;
    color: #aaa;
    margin-top: 3px;
    display: block;
}

#tso-search-results .tso-sr-msg,
.tso-search-results .tso-sr-msg {
    padding: 11px 13px;
    font-size: 13px;
    color: #999;
    text-align: center;
    display: block;
}

/* ============================================================
   ANUNCIO / NOVEDADES (entre cabecera y menú)
   ============================================================ */
#tsothm-announcement-root,
#tsothm-social-root,
#tsothm-color-mode-root,
#tsothm-header-image-root,
#tsothm-footer-texts-root {
    position: relative;
}

/* Hit area for Customizer pencil when the bar is off / empty. */
body.customize-partial-edit-shortcuts-shown #tsothm-announcement-root.tsothm-announcement-root--empty {
    min-height: 28px;
    margin: 8px -40px 0;
}

body.customize-partial-edit-shortcuts-shown #tsothm-social-root.tsothm-social-root--empty,
body.customize-partial-edit-shortcuts-shown #tsothm-color-mode-root.tsothm-color-mode-root--empty,
body.customize-partial-edit-shortcuts-shown #tsothm-header-image-root.tsothm-header-image-root--empty {
    min-height: 28px;
    min-width: 28px;
}

.tsothm-announcement {
    position: relative;
    margin: 12px -40px 0;
    padding: 14px 40px;
    background-color: var(--tso-color-announce-bg, #d6993a);
    color: var(--tso-color-announce-text, #fff);
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.tsothm-announcement-viewport {
    position: relative;
    overflow: hidden;
    min-height: 1.7em;
}

.tsothm-announcement-slide {
    display: none;
    width: 100%;
    margin: 0;
    font-family: var(--tso-font-announce, var(--tso-font-body, Arial, Helvetica, sans-serif));
    font-size: var(--tso-font-announce-size, 16px);
    font-weight: var(--tso-font-announce-weight, 800);
    line-height: 1.35;
    letter-spacing: var(--tso-font-announce-tracking, 0.03em);
    text-transform: var(--tso-font-announce-transform, uppercase);
    opacity: 0;
    will-change: transform, opacity;
}

.tsothm-announcement-slide.is-active,
.tsothm-announcement-slide.is-entering,
.tsothm-announcement-slide.is-leaving {
    display: block;
}

.tsothm-announcement-slide.is-leaving {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    pointer-events: none;
}

/* Effect: slide (from the right → center → left) */
.tsothm-announcement--slide .tsothm-announcement-slide,
.tsothm-announcement--slide .tsothm-announcement-slide.is-entering {
    -webkit-transform: translateX(100%);
    transform: translateX(100%);
}

.tsothm-announcement--slide .tsothm-announcement-slide.is-active {
    -webkit-transform: translateX(0);
    transform: translateX(0);
    opacity: 1;
    -webkit-transition: -webkit-transform 1.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease-out;
    transition: transform 1.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease-out;
}

.tsothm-announcement--slide .tsothm-announcement-slide.is-leaving {
    -webkit-transform: translateX(-100%);
    transform: translateX(-100%);
    opacity: 0;
    -webkit-transition: -webkit-transform 1.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.95s ease-in;
    transition: transform 1.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.95s ease-in;
}

/* Effect: fade */
.tsothm-announcement--fade .tsothm-announcement-slide,
.tsothm-announcement--fade .tsothm-announcement-slide.is-entering {
    -webkit-transform: none;
    transform: none;
    opacity: 0;
}

.tsothm-announcement--fade .tsothm-announcement-slide.is-active {
    -webkit-transform: none;
    transform: none;
    opacity: 1;
    -webkit-transition: opacity 1.4s ease-in-out;
    transition: opacity 1.4s ease-in-out;
}

.tsothm-announcement--fade .tsothm-announcement-slide.is-leaving {
    -webkit-transform: none;
    transform: none;
    opacity: 0;
    -webkit-transition: opacity 1.2s ease-in-out;
    transition: opacity 1.2s ease-in-out;
}

/* Effect: rise (from below → center → up) */
.tsothm-announcement--rise .tsothm-announcement-slide,
.tsothm-announcement--rise .tsothm-announcement-slide.is-entering {
    -webkit-transform: translateY(120%);
    transform: translateY(120%);
    opacity: 0;
}

.tsothm-announcement--rise .tsothm-announcement-slide.is-active {
    -webkit-transform: translateY(0);
    transform: translateY(0);
    opacity: 1;
    -webkit-transition: -webkit-transform 1.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease-out;
    transition: transform 1.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 1s ease-out;
}

.tsothm-announcement--rise .tsothm-announcement-slide.is-leaving {
    -webkit-transform: translateY(-110%);
    transform: translateY(-110%);
    opacity: 0;
    -webkit-transition: -webkit-transform 1.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.95s ease-in;
    transition: transform 1.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.95s ease-in;
}

.tsothm-announcement-text {
    color: inherit;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.tsothm-announcement-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
    -webkit-transition: opacity 0.2s, -webkit-transform 0.2s;
    transition: opacity 0.2s, transform 0.2s;
}

.tsothm-announcement-link:hover,
.tsothm-announcement-link:focus {
    color: inherit;
    text-decoration: underline;
    opacity: 0.95;
}

.tsothm-announcement-link:focus-visible {
    outline: 2px solid var(--tso-color-announce-text, #fff);
    outline-offset: 3px;
}

body.tsothm-has-announcement .main-navigation {
    margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
    .tsothm-announcement-slide,
    .tsothm-announcement-slide.is-active,
    .tsothm-announcement-slide.is-entering,
    .tsothm-announcement-slide.is-leaving,
    .tsothm-announcement--slide .tsothm-announcement-slide,
    .tsothm-announcement--fade .tsothm-announcement-slide,
    .tsothm-announcement--rise .tsothm-announcement-slide {
        -webkit-transition: none !important;
        transition: none !important;
        -webkit-transform: none !important;
        transform: none !important;
        opacity: 1;
    }

    .tsothm-announcement-slide.is-leaving {
        display: none;
        opacity: 0;
    }
}

/* ============================================================
   NAVEGACIÓN PRINCIPAL
   Styles: body.tsothm-nav-style-{raised|carved|pill|underline|flat} (Customizer)
   ============================================================ */
.main-navigation {
    background-color: var(--tso-color-nav-bg);
    margin: 20px -40px 0;
    padding: 10px 40px;
}

body.tsothm-nav-style-raised .main-navigation,
body.tsothm-nav-style-carved .main-navigation {
    background-image: -webkit-linear-gradient(
        top,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 45%,
        rgba(0, 0, 0, 0.28) 100%
    );
    background-image: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(255, 255, 255, 0) 45%,
        rgba(0, 0, 0, 0.28) 100%
    );
    -webkit-box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.18);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 2px 6px rgba(0, 0, 0, 0.18);
    padding: 12px 40px;
}

.main-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Només el primer nivell és flex centrat */
.main-navigation > ul,
#primary-menu {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 0;
}

body.tsothm-nav-style-raised .main-navigation > ul,
body.tsothm-nav-style-raised #primary-menu,
body.tsothm-nav-style-carved .main-navigation > ul,
body.tsothm-nav-style-carved #primary-menu {
    gap: 10px;
}

.main-navigation li {
    position: relative;
}

/* ── Submenús desplegables (GTranslate i altres) ── */
.main-navigation ul ul,
.main-navigation .sub-menu,
.main-navigation .dropdown-menu {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    min-width: 180px;
    background-color: var(--tso-color-nav-submenu);
    padding: 6px 0;
    border-radius: 0 0 4px 4px;
    -webkit-box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-wrap: nowrap;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.main-navigation li:hover > ul,
.main-navigation li:hover > .sub-menu,
.main-navigation li:hover > .dropdown-menu,
.main-navigation li:focus-within > ul,
.main-navigation li:focus-within > .sub-menu {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
}

.main-navigation ul ul li,
.main-navigation .sub-menu li {
    width: 100%;
    float: none;
}

.main-navigation ul ul li a,
.main-navigation .sub-menu li a {
    padding: 8px 16px;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.main-navigation ul ul li a:hover,
.main-navigation .sub-menu li a:hover {
    background-color: var(--tso-color-nav-bg);
    color: var(--tso-color-nav-hover);
}

.main-navigation .gt-current-lang a {
    background-color: var(--tso-color-nav-bg);
}

.main-navigation li a {
    display: block;
    color: var(--tso-color-nav-text);
    padding: 8px 16px;
    font-family: var(--tso-font-nav, var(--tso-font-body, Arial, Helvetica, sans-serif));
    font-size: var(--tso-font-nav-size, 15px);
    font-weight: var(--tso-font-nav-weight, 700);
    text-decoration: none;
    text-transform: var(--tso-font-nav-transform, uppercase);
    letter-spacing: var(--tso-font-nav-tracking, 0.5px);
    -webkit-transition: color 0.2s;
    transition: color 0.2s;
}

.main-navigation li a:hover,
.main-navigation li.current-menu-item > a:hover,
.main-navigation li.current-menu-ancestor > a:hover {
    color: var(--tso-color-nav-hover);
    text-decoration: none;
}

/* Current item keeps nav text color; each button style adds its own pressed look. */
.main-navigation li.current-menu-item > a,
.main-navigation li.current-menu-ancestor > a {
    color: var(--tso-color-nav-text);
    text-decoration: none;
}

/* —— Raised (classic emboss) —— */
body.tsothm-nav-style-raised .main-navigation > ul > li > a,
body.tsothm-nav-style-raised #primary-menu > li > a {
    padding: 9px 18px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background-color: rgba(255, 255, 255, 0.06);
    background-image: -webkit-linear-gradient(
        top,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.04) 48%,
        rgba(0, 0, 0, 0.22) 100%
    );
    background-image: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.04) 48%,
        rgba(0, 0, 0, 0.22) 100%
    );
    -webkit-box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 2px 3px rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 -1px 0 rgba(0, 0, 0, 0.35),
        0 2px 3px rgba(0, 0, 0, 0.35);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
    -webkit-transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        -webkit-box-shadow 0.2s ease,
        -webkit-transform 0.2s ease;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

body.tsothm-nav-style-raised .main-navigation > ul > li > a:hover,
body.tsothm-nav-style-raised .main-navigation > ul > li.current-menu-item > a:hover,
body.tsothm-nav-style-raised .main-navigation > ul > li.current-menu-ancestor > a:hover,
body.tsothm-nav-style-raised #primary-menu > li > a:hover,
body.tsothm-nav-style-raised #primary-menu > li.current-menu-item > a:hover,
body.tsothm-nav-style-raised #primary-menu > li.current-menu-ancestor > a:hover {
    color: var(--tso-color-nav-hover);
    border-color: rgba(255, 255, 255, 0.28);
    background-color: rgba(255, 255, 255, 0.12);
    -webkit-box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 3px 6px rgba(0, 0, 0, 0.4);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3),
        0 3px 6px rgba(0, 0, 0, 0.4);
    -webkit-transform: translateY(-1px);
    transform: translateY(-1px);
}

/* Raised: current looks the same as siblings (hover still accents). */

/* —— Carved (inset / chiseled) —— */
body.tsothm-nav-style-carved .main-navigation > ul > li > a,
body.tsothm-nav-style-carved #primary-menu > li > a {
    padding: 9px 18px;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.55);
    background-color: rgba(0, 0, 0, 0.2);
    background-image: -webkit-linear-gradient(
        top,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(255, 255, 255, 0.07) 100%
    );
    background-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.35) 0%,
        rgba(255, 255, 255, 0.07) 100%
    );
    -webkit-box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.55),
        inset 0 -1px 0 rgba(255, 255, 255, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    box-shadow:
        inset 0 2px 5px rgba(0, 0, 0, 0.55),
        inset 0 -1px 0 rgba(255, 255, 255, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.08);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
    letter-spacing: 0.8px;
    -webkit-transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        -webkit-box-shadow 0.2s ease;
    transition:
        color 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

body.tsothm-nav-style-carved .main-navigation > ul > li > a:hover,
body.tsothm-nav-style-carved .main-navigation > ul > li.current-menu-item > a:hover,
body.tsothm-nav-style-carved .main-navigation > ul > li.current-menu-ancestor > a:hover,
body.tsothm-nav-style-carved #primary-menu > li > a:hover,
body.tsothm-nav-style-carved #primary-menu > li.current-menu-item > a:hover,
body.tsothm-nav-style-carved #primary-menu > li.current-menu-ancestor > a:hover {
    color: var(--tso-color-nav-hover);
    border-color: rgba(0, 0, 0, 0.4);
    background-color: rgba(255, 255, 255, 0.08);
    background-image: -webkit-linear-gradient(
        top,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(255, 255, 255, 0.12) 100%
    );
    background-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.2) 0%,
        rgba(255, 255, 255, 0.12) 100%
    );
    -webkit-box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.14);
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.14);
}

/* Carved: current looks the same as siblings (hover still accents). */

/* —— Pill (rounded outline buttons; hover uses accent, current stays homogeneous) —— */
body.tsothm-nav-style-pill .main-navigation > ul,
body.tsothm-nav-style-pill #primary-menu {
    gap: 8px;
}

body.tsothm-nav-style-pill .main-navigation > ul > li > a,
body.tsothm-nav-style-pill #primary-menu > li > a {
    padding: 8px 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: transparent;
    letter-spacing: 0.6px;
    -webkit-transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

body.tsothm-nav-style-pill .main-navigation > ul > li > a:hover,
body.tsothm-nav-style-pill .main-navigation > ul > li > a:focus-visible,
body.tsothm-nav-style-pill .main-navigation > ul > li.current-menu-item > a:hover,
body.tsothm-nav-style-pill .main-navigation > ul > li.current-menu-item > a:focus-visible,
body.tsothm-nav-style-pill .main-navigation > ul > li.current-menu-ancestor > a:hover,
body.tsothm-nav-style-pill .main-navigation > ul > li.current-menu-ancestor > a:focus-visible,
body.tsothm-nav-style-pill #primary-menu > li > a:hover,
body.tsothm-nav-style-pill #primary-menu > li > a:focus-visible,
body.tsothm-nav-style-pill #primary-menu > li.current-menu-item > a:hover,
body.tsothm-nav-style-pill #primary-menu > li.current-menu-item > a:focus-visible,
body.tsothm-nav-style-pill #primary-menu > li.current-menu-ancestor > a:hover,
body.tsothm-nav-style-pill #primary-menu > li.current-menu-ancestor > a:focus-visible {
    color: var(--tso-color-nav-hover);
    border-color: var(--tso-color-nav-hover);
    background-color: rgba(255, 255, 255, 0.08);
}

/* Pill: current looks the same as siblings (hover still accents). */

/* —— Underline (sin cajas; barra que crece desde el centro) —— */
body.tsothm-nav-style-underline .main-navigation > ul,
body.tsothm-nav-style-underline #primary-menu {
    gap: 6px;
}

body.tsothm-nav-style-underline .main-navigation > ul > li > a,
body.tsothm-nav-style-underline #primary-menu > li > a {
    position: relative;
    padding: 10px 16px;
    letter-spacing: 0.8px;
}

body.tsothm-nav-style-underline .main-navigation > ul > li > a::after,
body.tsothm-nav-style-underline #primary-menu > li > a::after {
    content: "";
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 3px;
    height: 3px;
    border-radius: 2px;
    background-color: var(--tso-color-nav-text);
    -webkit-transform: scaleX(0);
    transform: scaleX(0);
    -webkit-transform-origin: center;
    transform-origin: center;
    -webkit-transition: -webkit-transform 0.25s ease, background-color 0.2s ease;
    transition: transform 0.25s ease, background-color 0.2s ease;
}

body.tsothm-nav-style-underline .main-navigation > ul > li > a:hover::after,
body.tsothm-nav-style-underline .main-navigation > ul > li > a:focus-visible::after,
body.tsothm-nav-style-underline .main-navigation > ul > li.current-menu-item > a:hover::after,
body.tsothm-nav-style-underline .main-navigation > ul > li.current-menu-item > a:focus-visible::after,
body.tsothm-nav-style-underline .main-navigation > ul > li.current-menu-ancestor > a:hover::after,
body.tsothm-nav-style-underline .main-navigation > ul > li.current-menu-ancestor > a:focus-visible::after,
body.tsothm-nav-style-underline #primary-menu > li > a:hover::after,
body.tsothm-nav-style-underline #primary-menu > li > a:focus-visible::after,
body.tsothm-nav-style-underline #primary-menu > li.current-menu-item > a:hover::after,
body.tsothm-nav-style-underline #primary-menu > li.current-menu-item > a:focus-visible::after,
body.tsothm-nav-style-underline #primary-menu > li.current-menu-ancestor > a:hover::after,
body.tsothm-nav-style-underline #primary-menu > li.current-menu-ancestor > a:focus-visible::after {
    background-color: var(--tso-color-nav-hover);
    -webkit-transform: scaleX(1);
    transform: scaleX(1);
}

/* Underline: no permanent mark on current; bar only on hover/focus. */

@media (prefers-reduced-motion: reduce) {
    body.tsothm-nav-style-underline .main-navigation > ul > li > a::after,
    body.tsothm-nav-style-underline #primary-menu > li > a::after {
        -webkit-transition: none;
        transition: none;
    }

    body.tsothm-nav-style-raised .main-navigation > ul > li > a,
    body.tsothm-nav-style-raised #primary-menu > li > a {
        -webkit-transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
        transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
        -webkit-transform: none !important;
        transform: none !important;
    }
}

/* ============================================================
   ÁREA DE CONTENIDO
   ============================================================ */
#content {
    padding-top: 10px;
}

/* ============================================================
   HOME — GRID DE 2 COLUMNAS (estilo original)
   ============================================================ */

/* Botón cargar más */
.btn-load-more {
    display: inline-block;
    padding: 10px 28px;
    background: var(--tso-color-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    -webkit-transition: background-color 0.2s;
    transition: background-color 0.2s;
    font-family: inherit;
}

.btn-load-more:hover {
    background: var(--tso-color-accent);
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================================
   SINGLE — ARTÍCULO INDIVIDUAL
   ============================================================ */
.single-layout {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: var(--tso-sidebar-gap, 30px);
    padding: 25px 0;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
}

.single-content-area {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
}

/* Breadcrumb */
.single-breadcrumb {
    padding: 12px 0 8px;
    font-size: 13px;
    color: #777;
    border-bottom: 1px solid #eee;
    margin-bottom: 0;
}

.single-breadcrumb a {
    color: var(--tso-color-accent);
    text-decoration: none;
}

.single-breadcrumb a:hover {
    color: var(--tso-color-accent-hover);
    text-decoration: underline;
}

.breadcrumb-cat {
    font-style: italic;
}

/* Header artículo */
.single-article-header {
    margin-bottom: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

/* Badge categoría */
.single-category-badge {
    display: inline-block;
    margin-bottom: 10px;
}

.single-category-badge a {
    background-color: var(--tso-color-accent);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 9px;
    border-radius: 3px;
    text-decoration: none;
}

.single-category-badge a:hover {
    background-color: var(--tso-color-accent-hover);
    text-decoration: none;
}

/* Título artículo */
.single-title {
    font-size: var(--tso-font-h1-size, 24px);
    line-height: 1.3;
    margin: 0 0 10px;
    color: var(--tso-color-heading, var(--tso-color-primary));
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* Contenido artículo */
.entry-content {
    font-size: var(--tso-font-body-size, 15px);
    line-height: var(--tso-font-body-line, 1.7);
    color: var(--tso-color-text, #333);
}

.entry-content p {
    margin: 0 0 1em;
}

.entry-content a {
    color: var(--tso-color-accent);
    text-decoration: underline;
}

.entry-content a:hover {
    color: var(--tso-color-accent-hover);
}

.entry-content img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    line-height: 1.3;
    color: #222;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.entry-content::after {
    content: '';
    display: table;
    clear: both;
}

/* Alineaciones Gutenberg y editor clásico */
.entry-content .aligncenter,
.entry-content figure.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.entry-content .alignright,
.entry-content figure.alignright {
    float: right;
    margin: 0 0 15px 20px;
}

.entry-content .alignleft,
.entry-content figure.alignleft {
    float: left;
    margin: 0 20px 15px 0;
}

.entry-content .wp-block-image img {
    max-width: 100%;
    height: auto;
}

.entry-content .wp-block-columns {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 20px;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
}

.entry-content .wp-block-column {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
}

/* Tags */
.single-tags {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 6px;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    font-size: 13px;
}

.single-tags .tags-label {
    color: #666;
    font-weight: bold;
    margin-right: 4px;
}

.single-tags a {
    background: #f2f2f2;
    color: #444;
    padding: 3px 9px;
    border-radius: 3px;
    font-size: 12px;
    text-decoration: none;
    border: 1px solid #ddd;
    -webkit-transition: background 0.2s, color 0.2s;
    transition: background 0.2s, color 0.2s;
}

.single-tags a:hover {
    background: var(--tso-color-accent);
    color: #fff;
    border-color: var(--tso-color-accent);
    text-decoration: none;
}

/* ============================================================
   POSTS RELACIONADOS
   ============================================================ */
.related-posts-box {
    margin-top: 35px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

.related-posts-title {
    font-size: calc(var(--tso-font-widget-title-size, 14px) + 3px);
    font-weight: bold;
    color: #fff;
    background: var(--tso-color-accent);
    margin: -20px -20px 18px;
    padding: 10px 20px;
    border-radius: 6px 6px 0 0;
}

.related-posts-grid {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 16px;
}

.related-post-card {
    /* Màxim 3 columnes — la targeta solitària no s'estira a tota l'amplada */
    -webkit-box-flex: 0;
    -ms-flex: 0 1 calc(33.333% - 11px);
    flex: 0 1 calc(33.333% - 11px);
    min-width: 160px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.related-thumb-link {
    display: block;
    line-height: 0;
    background-color: #f0f0f0;
}

.related-post-card img {
    width: 100%;
    height: 120px;
    -o-object-fit: cover;
    object-fit: cover;
    /* top center: mostra la part superior (on sol ser el subjecte) */
    -o-object-position: top center;
    object-position: top center;
    display: block;
}

.related-post-info {
    padding: 10px 12px;
}

.related-post-title {
    font-size: 13px;
    font-weight: bold;
    margin: 0 0 5px;
    line-height: 1.3;
}

.related-post-title a {
    color: #222;
    text-decoration: none;
}

.related-post-title a:hover {
    color: var(--tso-color-accent);
    text-decoration: none;
}

.related-post-date {
    font-size: 11px;
    color: #999;
    display: block;
}

/* ============================================================
   COMENTARIOS
   ============================================================ */
.comments-area {
    margin-top: 35px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}

.comments-title,
.comment-reply-title {
    font-size: 17px;
    font-weight: bold;
    color: #fff;
    background: var(--tso-color-accent);
    margin: -20px -20px 18px;
    padding: 10px 20px;
    border-radius: 6px 6px 0 0;
}

.comment-reply-title small {
    font-size: 13px;
    font-weight: normal;
    margin-left: 10px;
}

/* Quan #respond està fora de .comments-area (Jetpack Comments),
   el marge negatiu no funciona — el corregim */
#respond {
    margin-top: 35px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
}

#respond .comment-reply-title {
    margin: 0 0 18px;
    border-radius: 6px 6px 0 0;
}

#respond .comment-form {
    padding: 0 20px 20px;
}

/* Formulario dentro de .comments-area (caso normal): el contenedor ya es la
   caja, así que #respond no dibuja una segunda caja anidada. */
.comments-area #respond {
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.comments-area #respond .comment-form {
    padding: 0;
}

/* Sin comentarios previos: la barra de título ocupa el borde superior de la caja. */
.comments-area > #respond:first-child .comment-reply-title {
    margin: -20px -20px 18px;
}

/* Con comentarios previos: barra a todo el ancho de la caja, separada de la lista. */
.comments-area > #respond:not(:first-child) {
    margin-top: 28px;
}

.comments-area > #respond:not(:first-child) .comment-reply-title {
    margin: 0 -20px 18px;
    border-radius: 0;
}

ol.comment-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

ol.comment-list .comment {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 12px;
}

ol.comment-list .children {
    list-style: none;
    margin-left: 30px;
    padding: 0;
}

.comment-author {
    font-weight: bold;
    font-size: 14px;
    color: #222;
}

.comment-author .url {
    color: var(--tso-color-primary);
}

.comment-metadata {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.comment-metadata a {
    color: #bbb;
    text-decoration: none;
}

.comment-content {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    margin: 10px 0;
}

.comment-reply {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.comment-reply-link {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    background-color: var(--tso-color-accent);
    color: #fff;
    border: 2px solid var(--tso-color-accent);
    -webkit-transition: background 0.2s;
    transition: background 0.2s;
}

.comment-reply-link:hover {
    background-color: var(--tso-color-accent-hover);
    border-color: var(--tso-color-accent-hover);
    color: #fff;
    text-decoration: none;
}

.comment-awaiting-moderation {
    background: #fff8e1;
    border-left: 3px solid #f9a825;
    padding: 6px 10px;
    font-size: 12px;
    color: #7a6000;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Formulario de comentarios */
.comment-notes {
    font-size: 13px;
    color: #777;
    margin-bottom: 15px;
}

.comment-form label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 4px;
    color: #444;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    -webkit-appearance: none;
    appearance: none;
    -webkit-transition: border-color 0.2s;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--tso-color-primary);
    outline: none;
    -webkit-box-shadow: 0 0 0 2px rgba(30,115,190,0.15);
    box-shadow: 0 0 0 2px rgba(30,115,190,0.15);
}

.comment-form textarea {
    height: 120px;
    resize: vertical;
}

.comment-form p {
    margin-bottom: 14px;
}

.comment-form input[type="submit"] {
    background: var(--tso-color-accent);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    -webkit-transition: background 0.2s;
    transition: background 0.2s;
}

.comment-form input[type="submit"]:hover {
    background: var(--tso-color-accent-hover);
}

#cancel-comment-reply-link {
    font-size: 12px;
    color: #999;
    text-decoration: none;
    margin-left: 8px;
}

#cancel-comment-reply-link:hover {
    color: var(--tso-color-accent);
    text-decoration: underline;
}

/* ============================================================
   ARCHIVE — CATEGORÍAS / ETIQUETAS / AUTOR
   ============================================================ */
.archive-layout {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: var(--tso-sidebar-gap, 30px);
    padding: 25px 0;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
}

.archive-layout .main-content {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
}

.archive-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--tso-color-accent);
}

.archive-title {
    font-size: var(--tso-font-h1-size, 22px);
    color: var(--tso-color-heading, #111);
    margin: 0 0 6px;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.archive-description {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Paginación */
.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination .nav-links {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    gap: 4px;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    color: #444;
    text-decoration: none;
    font-size: 14px;
    -webkit-transition: background 0.2s, color 0.2s;
    transition: background 0.2s, color 0.2s;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--tso-color-accent);
    color: #fff;
    border-color: var(--tso-color-accent);
    text-decoration: none;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.widget-area {
    /* --tso-sidebar-width = useful widget content width (not including this padding).
       With border-box, outer column = content + horizontal padding (16px × 2). */
    --tso-sidebar-pad-x: 16px;
    width: calc(var(--tso-sidebar-width, 300px) + (2 * var(--tso-sidebar-pad-x)));
    -webkit-box-flex: 0;
    -ms-flex: 0 0 calc(var(--tso-sidebar-width, 300px) + (2 * var(--tso-sidebar-pad-x)));
    flex: 0 0 calc(var(--tso-sidebar-width, 300px) + (2 * var(--tso-sidebar-pad-x)));
    max-width: 100%;
    box-sizing: border-box;
    background-color: var(--tso-sidebar-bg, #f1f1f1);
    border-radius: var(--tso-sidebar-radius, 6px);
    padding: 18px var(--tso-sidebar-pad-x);
    -ms-flex-item-align: stretch;
    align-self: stretch;
    /* Base pròpia: no heretar la mida del cos (Customizer Tipografía) */
    font-size: var(--tso-font-widget-text-size, 14px);
    line-height: 1.45;
    color: var(--tso-color-text, #444);
}

body.tso-sidebar-left .single-layout,
body.tso-sidebar-left .archive-layout,
body.tso-sidebar-left .main-container {
    -webkit-box-orient: horizontal;
    -webkit-box-direction: reverse;
    -ms-flex-direction: row-reverse;
    flex-direction: row-reverse;
}

body.tso-sidebar-sticky .widget-area {
    position: -webkit-sticky;
    position: sticky;
    top: 16px;
    -ms-flex-item-align: start;
    align-self: flex-start;
    max-height: calc(100vh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.admin-bar.tso-sidebar-sticky .widget-area {
    top: 48px;
    max-height: calc(100vh - 64px);
}

@media screen and (max-width: 782px) {
    body.admin-bar.tso-sidebar-sticky .widget-area {
        top: 62px;
    }
}

body.tso-sidebar-border .widget-area {
    border: 1px solid var(--tso-color-border, #e0e0e0);
}

body.tso-sidebar-shadow .widget-area {
    -webkit-box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
}

.widget-area .widget {
    background: var(--tso-sidebar-widget-bg, #fff);
    margin-bottom: 20px;
    border-radius: 6px;
    overflow: hidden;
    font-size: var(--tso-font-widget-text-size, 14px);
    line-height: 1.45;
}

/* Customizer pencil shortcuts sit outside the card (left: -30px); do not clip them. */
body.customize-partial-edit-shortcuts-shown .widget-area .widget {
    overflow: visible;
}
body.customize-partial-edit-shortcuts-shown.tso-sidebar-sticky .widget-area {
    overflow: visible;
}

.widget-area .widget:last-child {
    margin-bottom: 0;
}

/* Barra blava TSO: qualsevol nivell (H1–H6) o .widget-title al sidebar.
   Especificitat alta per guanyar global-styles / tipografia inline. */
.widget-area .widget-title,
.widget-area .widget .widget-title,
.widget-area .wp-block-heading,
.widget-area .widget .wp-block-heading,
.widget-area .widget h1,
.widget-area .widget h2,
.widget-area .widget h3,
.widget-area .widget h4,
.widget-area .widget h5,
.widget-area .widget h6,
.widget-area h1,
.widget-area h2,
.widget-area h3,
.widget-area h4,
.widget-area h5,
.widget-area h6 {
    font-size: var(--tso-font-widget-title-size, 14px) !important;
    font-weight: bold;
    color: #fff !important;
    background: var(--tso-sidebar-title-bg, var(--tso-color-primary)) !important;
    margin: 0 0 14px;
    padding: 8px 16px;
    border: none;
    border-radius: 0;
    text-transform: none !important;
    line-height: 1.3;
}

/* Footer: no usar las “tarjetas blancas” del sidebar.
   Important: do not style bare .widget — WordPress admin widgets.php and
   legacy-widget preview iframes also use that class. */
.site-footer .widget,
.site-footer .footer-column .widget {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    margin-bottom: 20px;
    padding: 0;
    box-shadow: none;
    border: none;
    color: var(--tso-color-footer-text);
}

.site-footer .widget:last-child,
.site-footer .footer-column .widget:last-child {
    margin-bottom: 0;
}

/* Footer: títulos claros sobre fondo oscuro (anulan el azul del sidebar) */
.site-footer .widget .widget-title,
.site-footer .widget h3.widget-title,
.site-footer .footer-column .widget-title,
.site-footer .footer-column h3.widget-title,
.site-footer .wp-block-heading,
.site-footer h2,
.site-footer h3 {
    color: var(--tso-color-footer-heading);
    background: none;
    padding: 0 0 8px;
    margin: 0 0 14px;
    border-bottom: 2px solid var(--tso-color-accent);
    border-radius: 0;
}

/* Imágenes en footer:
   - Columnas a ancho igual + gap fijo (espaciado uniforme entre widgets)
   - Imagen completa (sin recorte), ancho de columna
   - Si se redimensiona en el editor, se respeta y se centra */
.site-footer .footer-column .wp-block-image,
.site-footer .footer-column .widget > img,
.site-footer .footer-column .wp-block-image figure {
    margin: 0;
    max-width: 100%;
    width: 100%;
}

.site-footer .footer-column img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    object-position: center;
    vertical-align: top;
}

/* Escudos / logos pequeños dentro de widgets de tabla (p. ej. TSO-Tabla-Liga) */
.site-footer .footer-column .tso-clas-table img,
.site-footer .footer-column .tso-clas-wrap img {
    width: 14px !important;
    max-width: 14px !important;
    height: 14px !important;
    display: inline !important;
    vertical-align: middle !important;
    margin: 0 5px 0 0 !important;
    object-fit: contain !important;
}

/* Redimensionada en el editor: tamaño manual, centrada en la columna */
.footer-layout--cols-2 .footer-column .wp-block-image.is-resized,
.footer-layout--cols-3 .footer-column .wp-block-image.is-resized {
    width: auto;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.footer-layout--cols-2 .footer-column .wp-block-image.is-resized img,
.footer-layout--cols-3 .footer-column .wp-block-image.is-resized img {
    width: auto !important;
    max-width: 100%;
    height: auto !important;
}

/* Menú / Navigation block en footer */
.site-footer .wp-block-navigation,
.site-footer .wp-block-navigation__container,
.site-footer .wp-block-page-list {
    background: transparent !important;
    gap: 0;
}

.site-footer .wp-block-navigation a,
.site-footer .wp-block-navigation-item__content,
.site-footer .wp-block-page-list a,
.site-footer .menu a,
.site-footer .widget_nav_menu a {
    background: transparent !important;
    color: var(--tso-color-footer-text) !important;
    padding: 6px 0 !important;
    border: none !important;
    box-shadow: none !important;
    text-decoration: none;
}

.site-footer .wp-block-navigation a:hover,
.site-footer .wp-block-navigation-item__content:hover,
.site-footer .wp-block-page-list a:hover,
.site-footer .menu a:hover,
.site-footer .widget_nav_menu a:hover {
    color: var(--tso-color-footer-heading) !important;
    background: transparent !important;
    text-decoration: underline;
}

.site-footer .wp-block-navigation-item,
.site-footer .wp-block-page-list li,
.site-footer .widget_nav_menu li {
    background: transparent !important;
    border-bottom: 1px solid var(--tso-color-footer-border);
}

.site-footer .wp-block-navigation-item:last-child,
.site-footer .wp-block-page-list li:last-child,
.site-footer .widget_nav_menu li:last-child {
    border-bottom: none;
}

.site-footer .wp-block-navigation.is-vertical .wp-block-navigation__container {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
}

/* Dentro de .widget-area el títol és blau per la regla anterior */
.widget-area .widget .widget-title,
.widget-area .widget h1.widget-title,
.widget-area .widget h2.widget-title,
.widget-area .widget h3.widget-title,
.widget-area .widget h4.widget-title,
.widget-area .widget h5.widget-title,
.widget-area .widget h6.widget-title {
    background: var(--tso-color-primary);
}

.widget-area a {
    color: var(--tso-color-primary);
    text-decoration: none;
    font-size: inherit;
}

.widget-area a:hover {
    color: var(--tso-color-accent);
    text-decoration: underline;
}

.widget-area p,
.widget-area li,
.widget-area .wp-block-latest-posts,
.widget-area .wp-block-latest-posts a,
.widget-area .wp-block-latest-comments,
.widget-area .wp-block-latest-comments a,
.widget-area .wp-block-latest-comments__comment,
.widget-area .wp-block-latest-comments__comment-meta,
.widget-area .wp-block-latest-comments__comment-excerpt,
.widget-area .wp-block-latest-comments__comment-excerpt p,
.widget-area .wp-block-categories,
.widget-area .wp-block-archives,
.widget-area .wp-block-page-list,
.widget-area .wp-block-navigation,
.widget-area .wp-block-navigation a {
    font-size: var(--tso-font-widget-text-size, 14px) !important;
    line-height: 1.45;
    color: #444;
}

.widget-area .wp-block-latest-posts a,
.widget-area .wp-block-latest-comments a,
.widget-area .wp-block-categories a,
.widget-area .wp-block-archives a,
.widget-area .wp-block-page-list a {
    color: var(--tso-color-primary);
}

.widget-area ul,
.widget-area ol,
.widget-area .wp-block-latest-posts,
.widget-area .wp-block-latest-comments {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget-area ul li,
.widget-area ol li,
.widget-area .wp-block-latest-posts > li,
.widget-area .wp-block-latest-comments__comment {
    border-bottom: 1px solid #ddd;
    padding: 6px 0;
    margin: 0;
}

.widget-area ul li:last-child,
.widget-area ol li:last-child,
.widget-area .wp-block-latest-posts > li:last-child,
.widget-area .wp-block-latest-comments__comment:last-child {
    border-bottom: none;
}

/* ============================================================
   PAGE — PÁGINAS ESTÁTICAS
   ============================================================ */
.main-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: var(--tso-sidebar-gap, 30px);
    padding: 25px 0;
}

.main-container > main,
.main-container > .tso-contact-page,
.main-container > .main-content-area {
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    min-width: 0;
}

.page-title {
    font-size: var(--tso-font-h1-size, 24px);
    color: var(--tso-color-heading, var(--tso-color-primary));
    margin: 0 0 20px;
    border-bottom: 2px solid var(--tso-color-accent);
    padding-bottom: 12px;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background-color: var(--tso-color-footer-bg);
    color: var(--tso-color-footer-text);
    margin: 30px -40px -20px;
    padding: 28px 40px 12px;
}

/* Footer tables inside widgets (stats, etc.) */
.site-footer .footer-column table {
    max-width: 100% !important;
    width: 100% !important;
}

/* Columnas siempre iguales (1 / 2 / 3) */
.footer-layout {
    display: grid;
    width: 100%;
    max-width: 100%;
    gap: 20px;
    margin: 0 0 16px;
    padding: 0;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: start;
    -webkit-box-pack: stretch;
    -ms-flex-pack: stretch;
    justify-items: stretch;
    box-sizing: border-box;
}

.footer-layout--cols-1 {
    grid-template-columns: minmax(0, 1fr);
}

.footer-layout--cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.footer-layout--cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.footer-layout-cell {
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}

.footer-column {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.site-footer .footer-column .widget {
    margin-bottom: 0;
    padding: 0;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
}

/* Customizer pencil shortcuts sit outside the widget card. */
body.customize-partial-edit-shortcuts-shown .site-footer .footer-column .widget {
    overflow: visible;
}

/* CurrencyRate embeds use floats + fixed white cards.
   Contain Custom HTML hosts; do not blanket every .widget_block > div. */
.site-footer .textwidget,
.site-footer .custom-html-widget,
.site-footer .widget_custom_html {
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    box-sizing: border-box;
}

.site-footer .textwidget::after,
.site-footer .custom-html-widget::after {
    content: "";
    display: table;
    clear: both;
}

.site-footer .textwidget > div,
.site-footer .custom-html-widget > div {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Attribution + card from CurrencyRate inside any footer widget. */
.site-footer .widget .crcpw-attribution,
.site-footer .widget [class*="crcpw"] {
    max-width: 100%;
    box-sizing: border-box;
}

/* Legacy table markup (por si queda en caché) */
table.footer-layout-table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    border-spacing: 0 !important;
    margin-bottom: 16px !important;
    display: table !important;
}

table.footer-layout-table > tr,
table.footer-layout-table > tbody > tr {
    display: table-row !important;
}

table.footer-layout-table td.footer-layout-cell {
    display: table-cell !important;
    width: 33.33% !important;
    max-width: 0 !important; /* with table-layout:fixed, force cells to respect column width */
    vertical-align: top !important;
    padding: 0 12px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

table.footer-layout-table.footer-layout--cols-1 td.footer-layout-cell {
    width: 100% !important;
}

table.footer-layout-table.footer-layout--cols-2 td.footer-layout-cell {
    width: 50% !important;
}

/* Una sola columna activa: menú / enlaces en fila (Contacto, Legal…) */
.footer-layout--horizontal .footer-column {
    text-align: center;
}

.footer-layout--horizontal .footer-column .widget {
    margin-bottom: 12px;
    background: transparent;
}

/* Currency widgets are designed for ~300px columns; full-bleed looks broken. */
.footer-layout--horizontal .widget_custom_html,
.footer-layout--horizontal .widget_text {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
}

.footer-layout--horizontal .footer-column .widget:last-child {
    margin-bottom: 0;
}

.footer-layout--horizontal .footer-column .widget-title {
    border-bottom: none;
    margin-bottom: 10px;
    padding-bottom: 0;
    background: none;
}

.footer-layout--horizontal .footer-column ul,
.footer-layout--horizontal .footer-column .menu,
.footer-layout--horizontal .footer-column .wp-block-navigation__container,
.footer-layout--horizontal .footer-column .wp-block-page-list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
}

.footer-layout--horizontal .footer-column ul li,
.footer-layout--horizontal .footer-column .menu li,
.footer-layout--horizontal .footer-column .wp-block-navigation-item,
.footer-layout--horizontal .footer-column .wp-block-page-list li {
    border-bottom: none;
    padding: 4px 0;
    margin: 0;
    background: transparent !important;
}

.footer-layout--horizontal .footer-column ul li + li,
.footer-layout--horizontal .footer-column .menu li + li,
.footer-layout--horizontal .footer-column .wp-block-navigation-item + .wp-block-navigation-item,
.footer-layout--horizontal .footer-column .wp-block-page-list li + li {
    border-left: 1px solid var(--tso-color-footer-border);
    padding-left: 16px;
    margin-left: 16px;
}

.footer-column h3,
.footer-column .widget-title {
    color: var(--tso-color-footer-heading);
    font-size: var(--tso-font-widget-title-size, 14px);
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--tso-color-accent);
    background: none;
}

.footer-column a {
    color: var(--tso-color-footer-text);
    text-decoration: none;
}

.footer-column a:hover {
    color: var(--tso-color-footer-heading);
    text-decoration: underline;
}

.footer-column p,
.footer-column li,
.footer-column .recentcomments {
    color: var(--tso-color-footer-text);
    font-size: var(--tso-font-widget-text-size, 14px);
    line-height: 1.5;
}

.footer-column ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-column ul li {
    border-bottom: 1px solid var(--tso-color-footer-border);
    padding: 5px 0;
}

.footer-column ul li:last-child {
    border-bottom: none;
}

/* Widget comentarios en el footer */
.footer-column .recentcomments {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--tso-color-footer-border);
}

.footer-column .recentcomments:last-child {
    border-bottom: none;
}

.footer-column .recentcomments a {
    color: var(--tso-color-primary);
    font-weight: bold;
}

.footer-column .recentcomments a:hover {
    color: var(--tso-color-footer-heading);
}

/* Tablas dentro del footer (widget de estadísticas, etc.) */
.footer-column table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: var(--tso-color-footer-text);
}

.footer-column table td,
.footer-column table th {
    padding: 4px 6px;
    vertical-align: top;
    word-break: break-word;
}

/* Footer bottom */
.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--tso-color-footer-border);
    padding: 10px 0 0;
    margin: 0;
    line-height: 1.3;
}

.footer-bottom p {
    margin: 0;
    padding: 0;
    color: var(--tso-color-footer-muted);
    font-size: var(--tso-font-footer-text-size, 12px);
    line-height: 1.3;
}

.footer-legal {
    margin-top: 4px;
    font-size: var(--tso-font-footer-text-size, 12px);
    line-height: 1.3;
    color: var(--tso-color-footer-muted);
    text-align: center;
}

.footer-legal a {
    color: var(--tso-color-footer-text);
    text-decoration: none;
    margin: 0 6px;
}

.footer-legal a:hover {
    color: var(--tso-color-footer-heading);
    text-decoration: underline;
}

/* ============================================================
   FOCUS VISIBLE — ACCESIBILIDAD
   ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--tso-color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Narrow desktop: keep 300px sidebar; tighten gap so the main column keeps room
   when Content width is 960–1060 or the viewport is just above the mobile breakpoint. */
@media screen and (max-width: 1100px) and (min-width: 769px) {
    :root {
        --tso-sidebar-gap: 20px;
    }
}

/* ============================================================
   RESPONSIVE — TABLET / MÓVIL (≤ 768px)
   ============================================================ */
@media screen and (max-width: 768px) {

    /* Página */
    #page-wrapper {
        margin: 0;
        padding: 10px 15px;
        max-width: 100%;
        box-shadow: none;
    }

    .site-header {
        margin: -10px -15px 0;
        padding: 0 15px;
    }

    /* Header */
    .header-main {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        gap: 12px;
    }

    .logo img,
    .custom-logo {
        width: var(--tso-logo-width-mobile, 180px);
        max-width: 100%;
    }

    .header-right {
        width: 100%;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
    }

    .header-social-icons {
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
        gap: 10px;
    }

    .header-social-icons .social-icon + .social-icon {
        margin-left: 10px;
    }

    .header-search {
        width: 100%;
    }

    #searchform input[type="text"],
    #searchform input[type="search"],
    .searchform input[type="text"],
    .searchform input[type="search"] {
        width: 100%;
        -webkit-box-flex: 1;
        -ms-flex: 1;
        flex: 1;
    }

    #searchform div,
    .searchform div {
        width: 100%;
    }

    /* Anuncio */
    .tsothm-announcement {
        margin: 12px -15px 0;
        padding: 12px 15px;
    }

    .tsothm-announcement-slide {
        font-size: 14px;
    }

    /* Menú — horitzontal amb scroll al mòbil */
    .main-navigation {
        margin: 10px -15px 0;
        padding: 10px 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body.customize-partial-edit-shortcuts-shown .main-navigation {
        overflow: visible;
    }

    .main-navigation::-webkit-scrollbar {
        display: none;
    }

    .main-navigation ul {
        -webkit-box-orient: horizontal;
        -webkit-box-direction: normal;
        -ms-flex-direction: row;
        flex-direction: row;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;
        -ms-flex-wrap: nowrap;
        flex-wrap: nowrap;
        -webkit-box-pack: start;
        -ms-flex-pack: start;
        justify-content: flex-start;
        padding: 0 15px;
        width: -webkit-max-content;
        width: max-content;
        min-width: 100%;
    }

    body.tsothm-nav-style-raised .main-navigation ul,
    body.tsothm-nav-style-carved .main-navigation ul {
        gap: 8px;
    }

    .main-navigation li a {
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }

    body.tsothm-nav-style-raised .main-navigation > ul > li > a,
    body.tsothm-nav-style-raised #primary-menu > li > a,
    body.tsothm-nav-style-carved .main-navigation > ul > li > a,
    body.tsothm-nav-style-carved #primary-menu > li > a {
        padding: 8px 12px;
        font-size: 13px;
    }

    body.tsothm-nav-style-pill .main-navigation ul,
    body.tsothm-nav-style-underline .main-navigation ul {
        gap: 6px;
    }

    body.tsothm-nav-style-pill .main-navigation > ul > li > a,
    body.tsothm-nav-style-pill #primary-menu > li > a {
        padding: 7px 14px;
        font-size: 13px;
    }

    body.tsothm-nav-style-underline .main-navigation > ul > li > a,
    body.tsothm-nav-style-underline #primary-menu > li > a {
        padding: 10px 10px;
    }

    body.tsothm-nav-style-underline .main-navigation > ul > li > a::after,
    body.tsothm-nav-style-underline #primary-menu > li > a::after {
        left: 10px;
        right: 10px;
    }

    body.tsothm-nav-style-flat .main-navigation {
        padding: 0;
    }

    /* Single */
    .single-layout {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        gap: 0;
    }

    .single-title {
        font-size: 20px;
    }

    .single-breadcrumb {
        font-size: 12px;
    }

    /* Archive */
    .archive-layout {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
    }

    /* Sidebar: oculto en móvil excepto en single */
    .archive-layout .widget-area,
    .main-container .widget-area {
        display: none;
    }

    /* Widget area en single: ocultar también */
    .single-layout .widget-area {
        display: none;
    }

    /* Related posts: una columna */
    .related-posts-grid {
        display: block;
    }

    .related-post-card {
        margin-bottom: 12px;
    }

    /* Comentarios */
    .comments-area {
        padding: 14px;
    }

    .comments-title,
    .comment-reply-title {
        margin: -14px -14px 14px;
        border-radius: 4px 4px 0 0;
    }

    .comments-area > #respond:first-child .comment-reply-title {
        margin: -14px -14px 14px;
    }

    .comments-area > #respond:not(:first-child) .comment-reply-title {
        margin: 0 -14px 14px;
    }

    ol.comment-list .children {
        margin-left: 15px;
    }

    .comment-form input[type="text"],
    .comment-form input[type="email"],
    .comment-form input[type="url"],
    .comment-form textarea {
        font-size: 16px; /* Evita zoom automático en iOS */
    }

    /* Footer móvil */
    .site-footer {
        margin: 20px -15px -10px;
        padding: 20px 15px 10px;
    }

    .footer-layout,
    .footer-layout--cols-2,
    .footer-layout--cols-3 {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        margin-bottom: 12px;
    }

    /* Legacy table markup */
    table.footer-layout-table,
    table.footer-layout-table > tr,
    table.footer-layout-table > tbody,
    table.footer-layout-table > tbody > tr {
        display: block !important;
        width: 100% !important;
    }

    table.footer-layout-table td.footer-layout-cell {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 0 20px 0 !important;
        box-sizing: border-box !important;
    }

    table.footer-layout-table td.footer-layout-cell:last-child {
        padding-bottom: 0 !important;
    }

    .footer-bottom {
        padding-top: 8px;
    }

    /* En móvil, la franja horizontal sigue en fila (con wrap) */
    .footer-layout--horizontal .footer-column ul,
    .footer-layout--horizontal .footer-column .menu {
        -webkit-box-pack: center;
        -ms-flex-pack: center;
        justify-content: center;
    }

    /* Page */
    .main-container {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
    }

}

/* ============================================================
   HOME — GRID DE 2 COLUMNAS (estilo original)
   ============================================================ */
.posts-grid-container {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 20px -10px 0;
}

.home-post-card {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 calc(50% - 20px);
    flex: 0 0 calc(50% - 20px);
    width: calc(50% - 20px);
    margin: 0 10px 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    -webkit-box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    box-shadow: 0 2px 6px rgba(0,0,0,0.07);
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-transition: -webkit-box-shadow 0.2s;
    transition: box-shadow 0.2s;
}

.home-post-card:hover {
    -webkit-box-shadow: 0 4px 14px rgba(0,0,0,0.13);
    box-shadow: 0 4px 14px rgba(0,0,0,0.13);
}

.post-card-image {
    line-height: 0;
    overflow: hidden;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.post-card-image img {
    width: 100%;
    height: 220px;
    -o-object-fit: cover;
    object-fit: cover;
    -o-object-position: center center;
    object-position: center center;
    display: block;
    margin: 0 auto;
    -webkit-transition: -webkit-transform 0.3s ease;
    transition: transform 0.3s ease;
}

.home-post-card:hover .post-card-image img {
    -webkit-transform: scale(1.03);
    transform: scale(1.03);
}

.post-card-body {
    padding: 14px 16px;
    -webkit-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
}

.post-card-title {
    font-size: var(--tso-font-card-title-size, 16px);
    font-weight: bold;
    line-height: 1.35;
    margin: 0 0 10px;
    color: var(--tso-color-primary);
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.post-card-title a {
    color: var(--tso-color-primary);
    text-decoration: none;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
}

.post-card-title a:hover {
    color: var(--tso-color-accent);
    text-decoration: none;
}

.post-card-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.55;
    margin-top: auto;
}

/* Lista: imagen a la izquierda */
.posts-layout-list .home-post-card {
    -ms-flex: 0 0 calc(100% - 20px);
    flex: 0 0 calc(100% - 20px);
    width: calc(100% - 20px);
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
}

.posts-layout-list .post-card-image {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 280px;
    flex: 0 0 280px;
    width: 280px;
    max-width: 40%;
}

.posts-layout-list .post-card-image img {
    height: 100%;
    min-height: 160px;
}

.posts-layout-list .post-card-body {
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.posts-layout-list .post-card-title {
    font-size: calc(var(--tso-font-card-title-size, 16px) + 2px);
}

/* Magazine: primer post destacado a ancho completo */
.posts-layout-magazine .home-post-card.is-featured {
    -ms-flex: 0 0 calc(100% - 20px);
    flex: 0 0 calc(100% - 20px);
    width: calc(100% - 20px);
    -webkit-box-orient: horizontal;
    -webkit-box-direction: normal;
    -ms-flex-direction: row;
    flex-direction: row;
}

.posts-layout-magazine .home-post-card.is-featured .post-card-image {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 54%;
    flex: 0 0 54%;
    width: 54%;
}

.posts-layout-magazine .home-post-card.is-featured .post-card-image img {
    height: 300px;
}

.posts-layout-magazine .home-post-card.is-featured .post-card-title {
    font-size: calc(var(--tso-font-card-title-size, 16px) + 6px);
    line-height: 1.3;
}

.post-card-kicker {
    margin: 0 0 8px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tso-color-accent);
}

/* Móvil: una sola columna */
@media screen and (max-width: 768px) {
    .posts-grid-container {
        margin: 10px 0 0;
    }

    .home-post-card {
        -ms-flex: 0 0 100%;
        flex: 0 0 100%;
        width: 100%;
        margin: 0 0 16px;
    }

    .posts-layout-list .home-post-card,
    .posts-layout-magazine .home-post-card.is-featured {
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
    }

    .posts-layout-list .post-card-image,
    .posts-layout-magazine .home-post-card.is-featured .post-card-image {
        -ms-flex: 0 0 auto;
        flex: 0 0 auto;
        width: 100%;
        max-width: none;
    }

    .post-card-image img,
    .posts-layout-magazine .home-post-card.is-featured .post-card-image img {
        height: 220px;
    }
}

/* ============================================================
   SEARCH RESULTS
   ============================================================ */
.search-header {
    margin: 10px 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--tso-color-accent);
}

.search-title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    color: var(--tso-color-primary);
    line-height: 1.3;
}

.search-title .search-query {
    color: var(--tso-color-accent);
}

.search-results-count {
    margin: 0;
    color: var(--tso-color-text-muted);
    font-size: 0.95rem;
}

.search-no-results {
    padding: 30px 10px;
    text-align: center;
}

.search-no-results p {
    margin-bottom: 20px;
    color: var(--tso-color-text-muted);
}

.posts-pagination {
    text-align: center;
    margin: 40px 0;
}

.posts-empty {
    padding: 40px 10px;
    text-align: center;
    color: var(--tso-color-text-muted);
}

.site-title-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--tso-color-primary);
    text-decoration: none;
}

.logo a .site-title-text:hover {
    color: var(--tso-color-accent);
}

.posts-pagination .nav-links {
    display: inline-flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.posts-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--tso-color-border);
    border-radius: 4px;
    color: var(--tso-color-primary);
    text-decoration: none;
}

.posts-pagination .page-numbers.current,
.posts-pagination .page-numbers:hover {
    background: var(--tso-color-primary);
    border-color: var(--tso-color-primary);
    color: var(--tso-color-white);
}

/* ============================================================
   404
   ============================================================ */
.error-404 {
    padding: 40px 20px 60px;
}

.error-404-inner {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
}

.error-404-code {
    margin: 0 0 8px;
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    color: var(--tso-color-accent);
    letter-spacing: -0.02em;
}

.error-404-title {
    margin: 0 0 12px;
    font-size: 26px;
    color: var(--tso-color-primary);
}

.error-404-text {
    margin: 0 0 28px;
    font-size: 15px;
    line-height: 1.55;
    color: var(--tso-color-text-muted);
}

.error-404-search {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    margin-bottom: 24px;
}

.error-404-search .tso-search-wrapper {
    width: 100%;
    max-width: 360px;
}

.error-404-search #searchform input[type="text"],
.error-404-search #searchform input[type="search"],
.error-404-search .searchform input[type="text"],
.error-404-search .searchform input[type="search"] {
    width: 100%;
}

.error-404-home {
    margin: 0;
}

.error-404-home-link {
    display: inline-block;
    padding: 10px 18px;
    background: var(--tso-color-accent);
    color: var(--tso-color-white);
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    -webkit-transition: background-color 0.2s;
    transition: background-color 0.2s;
}

.error-404-home-link:hover {
    background: var(--tso-color-accent-hover);
    color: var(--tso-color-white);
    text-decoration: none;
}

.load-more-wrapper {
    text-align: center;
    margin: 40px 0;
}

/* ============================================================
   PORTFOLIO / WALLPAPER GALLERY
   ============================================================ */
.tso-portfolio-layout {
    display: block;
}

.tso-portfolio-main {
    width: 100%;
    max-width: 100%;
}

.tso-portfolio-intro {
    margin-bottom: 28px;
}

.tso-portfolio-empty {
    padding: 24px;
    background: #f7f7f7;
    border-left: 4px solid var(--tso-color-accent);
    color: var(--tso-color-text-muted);
}

.tso-portfolio-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 18px;
    margin: 0 0 40px;
    -webkit-box-align: stretch;
    -ms-flex-align: stretch;
    align-items: stretch;
}

.tso-portfolio-item {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    height: 100%;
    margin: 0;
    padding: 0;
    background: var(--tso-color-surface, #fff);
    min-width: 0;
}

.tso-portfolio-thumb {
    position: relative;
    display: block;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    width: 100%;
    /* Fallback for browsers without aspect-ratio */
    height: 0;
    padding-bottom: 62.5%; /* 16:10 */
    overflow: hidden;
    background: #111;
    line-height: 0;
}

@supports (aspect-ratio: 1 / 1) {
    .tso-portfolio-thumb {
        height: auto;
        padding-bottom: 0;
        aspect-ratio: 16 / 10;
    }
}

.tso-portfolio-image {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    object-position: center;
    -webkit-transition: opacity 0.2s;
    transition: opacity 0.2s;
}

.tso-portfolio-thumb:hover .tso-portfolio-image {
    opacity: 0.92;
}

.tso-portfolio-caption {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    padding: 12px 4px 0;
    min-height: 0;
}

.tso-portfolio-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--tso-color-heading, #111);
    margin: 0 0 8px;
    min-height: 2.7em;
    max-height: 2.7em;
}

.tso-portfolio-downloads {
    margin-top: auto;
    padding-top: 4px;
}

.tso-portfolio-downloads-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--tso-color-text-muted, #666);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tso-portfolio-download-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    gap: 6px;
    min-height: 4.6em;
}

.tso-portfolio-download-list li {
    margin: 0;
    padding: 0;
    border: none;
    position: relative;
}

.tso-portfolio-download {
    display: inline-block;
    padding: 5px 8px;
    font-size: 11px;
    line-height: 1.3;
    color: var(--tso-color-primary);
    background: #f0f4f8;
    text-decoration: none;
    border-radius: 3px;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.tso-portfolio-download:hover {
    background: var(--tso-color-accent);
    color: #fff;
    text-decoration: none;
}

.tso-portfolio-download.is-disabled {
    color: #999;
    background: #ececec;
    cursor: help;
    text-decoration: line-through;
}

.tso-portfolio-download.is-disabled:hover {
    background: #ececec;
    color: #999;
}

.tso-portfolio-original {
    position: relative;
    display: inline-block;
}

.tso-portfolio-original > summary {
    list-style: none;
}

.tso-portfolio-original > summary::-webkit-details-marker {
    display: none;
}

.tso-portfolio-original-pop {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    z-index: 20;
    min-width: 180px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--tso-color-border, #e0e0e0);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.tso-portfolio-original-pop::after {
    content: '';
    position: absolute;
    left: 16px;
    top: 100%;
    border: 6px solid transparent;
    border-top-color: #fff;
    filter: drop-shadow(0 1px 0 #e0e0e0);
}

.tso-portfolio-original-dims {
    margin: 0 0 10px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--tso-color-text, #333);
}

.tso-portfolio-download--go {
    display: block;
    text-align: center;
    background: var(--tso-color-primary);
    color: #fff;
}

.tso-portfolio-download--go:hover {
    background: var(--tso-color-accent);
    color: #fff;
}

@media screen and (max-width: 900px) {
    .tso-portfolio-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (max-width: 560px) {
    .tso-portfolio-gallery {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .tso-portfolio-download-list {
        min-height: 0;
    }
}

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.tso-contact-page {
    margin: 0 0 40px;
}

.tso-contact-hero {
    position: relative;
    margin: 0 0 0;
    padding: 72px 24px 96px;
    text-align: center;
    color: #fff;
    background-color: #1a1a1a;
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.7) 100%),
        var(--tso-contact-hero-image, none);
    background-size: cover;
    background-position: center;
}

.tso-contact-hero-title {
    margin: 0 0 12px;
    font-size: 40px;
    line-height: 1.15;
    color: #fff;
    font-weight: 700;
}

.tso-contact-hero-subtitle {
    margin: 0 auto;
    max-width: 560px;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.tso-contact-wrap {
    max-width: 1000px;
    margin: -48px auto 0;
    padding: 0 16px;
    position: relative;
    z-index: 2;
}

.tso-contact-card {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 0;
    background: #fff;
    border: 1px solid var(--tso-color-border, #e0e0e0);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.tso-contact-info,
.tso-contact-form-col {
    padding: 36px 32px;
}

.tso-contact-info {
    background: #fafafa;
    border-right: 1px solid var(--tso-color-border, #e0e0e0);
}

.tso-contact-card-title {
    margin: 0 0 14px;
    font-size: 22px;
    color: var(--tso-color-heading, #111);
}

.tso-contact-intro {
    margin: 0 0 24px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--tso-color-text-muted, #666);
}

.tso-contact-details {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tso-contact-detail {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 14px;
    margin: 0 0 22px;
    padding: 0;
    border: none;
}

.tso-contact-detail:last-child {
    margin-bottom: 0;
}

.tso-contact-detail-icon {
    -ms-flex-negative: 0;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tso-color-primary);
    color: #fff;
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.tso-contact-detail strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--tso-color-heading, #111);
}

.tso-contact-detail p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--tso-color-text, #333);
}

.tso-contact-detail a {
    color: var(--tso-color-primary);
    text-decoration: none;
}

.tso-contact-detail a:hover {
    color: var(--tso-color-accent);
    text-decoration: underline;
}

.tso-contact-social {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--tso-color-border, #e0e0e0);
}

.tso-contact-social-title {
    display: block;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--tso-color-heading, #111);
}

.tso-contact-form-hint {
    margin: 0;
    padding: 16px;
    background: #f7f7f7;
    border-left: 4px solid var(--tso-color-accent);
    font-size: 14px;
    color: var(--tso-color-text-muted, #666);
}

.tso-contact-form .wpcf7-form label,
.tso-contact-form label {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tso-color-heading, #111);
}

.tso-contact-form input[type="text"],
.tso-contact-form input[type="email"],
.tso-contact-form input[type="tel"],
.tso-contact-form input[type="url"],
.tso-contact-form textarea,
.tso-contact-form select {
    width: 100%;
    max-width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid #cfcfcf;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
    background: #fff;
}

.tso-contact-form textarea {
    min-height: 120px;
    resize: vertical;
}

.tso-contact-form input[type="submit"],
.tso-contact-form button[type="submit"],
.tso-contact-form .wpcf7-submit {
    display: inline-block;
    width: 100%;
    margin-top: 8px;
    padding: 12px 18px;
    border: none;
    border-radius: 3px;
    background: var(--tso-color-primary);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.tso-contact-form input[type="submit"]:hover,
.tso-contact-form button[type="submit"]:hover,
.tso-contact-form .wpcf7-submit:hover {
    background: var(--tso-color-accent);
}

.tso-contact-map {
    margin-top: 28px;
    overflow: hidden;
    border: 1px solid var(--tso-color-border, #e0e0e0);
    background: #e8e8e8;
}

.tso-contact-map-frame {
    display: block;
    width: 100%;
    max-width: 100%;
    vertical-align: top;
    border: 0;
}

@media screen and (max-width: 800px) {
    .tso-contact-hero {
        padding: 48px 16px 72px;
    }

    .tso-contact-hero-title {
        font-size: 30px;
    }

    .tso-contact-card {
        grid-template-columns: 1fr;
    }

    .tso-contact-info {
        border-right: none;
        border-bottom: 1px solid var(--tso-color-border, #e0e0e0);
    }

    .tso-contact-info,
    .tso-contact-form-col {
        padding: 28px 20px;
    }
}

/* ============================================================
   LEGACY WIDGET PREVIEW IFRAMES (widgets.php / Customizer)
   Core also adds body.wp-embed-responsive on the real frontend — never
   force white there or the orange outer frame disappears.
   ============================================================ */
body.tsothm-legacy-widget-preview {
    background-color: #ffffff !important;
}

/* ============================================================
   PLANTILLAS NUEVAS — ANCHO COMPLETO Y LANDING
   ============================================================ */
body.tso-tpl-full-width #page-wrapper {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
}

.tso-landing-hero {
    position: relative;
    background-color: var(--tso-color-heading);
    background-image: var(--tso-landing-hero-image, none);
    background-size: cover;
    background-position: center;
    padding: 70px 30px;
    text-align: center;
    border-radius: 6px;
    overflow: hidden;
}

.tso-landing-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.tso-landing-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.tso-landing-hero-title {
    color: var(--tso-color-white);
    margin: 0 0 10px;
}

.tso-landing-hero-subtitle {
    color: var(--tso-color-white);
    font-size: 1.1em;
    margin: 0;
}

.tso-landing-content {
    padding-top: 30px;
}

/* ============================================================
   PLANTILLAS NUEVAS — EQUIPO / SERVICIOS
   ============================================================ */
.tso-team-grid,
.tso-service-grid {
    gap: 30px;
    margin: 30px 0;
}

.tso-team-member {
    text-align: center;
}

.tso-team-member img {
    border-radius: 999px;
}

.tso-service-card {
    padding: 20px;
    border: 1px solid var(--tso-color-border);
    border-radius: 8px;
    background: var(--tso-color-surface);
}

/* ============================================================
   PLANTILLAS NUEVAS — PRECIOS
   ============================================================ */
.tso-pricing-grid {
    gap: 24px;
    margin: 30px 0;
    align-items: stretch;
}

.tso-pricing-card {
    padding: 24px;
    border: 1px solid var(--tso-color-border);
    border-radius: 8px;
    background: var(--tso-color-surface);
    text-align: center;
}

.tso-pricing-card--featured {
    border-color: var(--tso-color-accent);
    border-width: 2px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.tso-pricing-price {
    font-size: 2em;
    font-weight: var(--tso-font-heading-weight, 700);
    color: var(--tso-color-heading);
    margin: 10px 0;
}

.tso-pricing-price span {
    font-size: 0.4em;
    font-weight: 400;
    color: var(--tso-color-text-muted);
}

.tso-pricing-card ul {
    text-align: left;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.tso-pricing-card li {
    padding: 6px 0;
    border-bottom: 1px solid var(--tso-color-border);
}

/* ============================================================
   PLANTILLAS NUEVAS — TESTIMONIOS
   ============================================================ */
.tso-testimonial-grid {
    gap: 24px;
    margin: 30px 0;
}

.tso-testimonial-card blockquote {
    margin: 0;
    padding: 20px;
    border-left: 4px solid var(--tso-color-accent);
    background: var(--tso-color-surface);
    font-style: italic;
}

.tso-testimonial-card cite {
    display: block;
    margin-top: 10px;
    font-style: normal;
    font-weight: 700;
    color: var(--tso-color-heading);
}

/* ============================================================
   PLANTILLAS NUEVAS — PREGUNTAS FRECUENTES (FAQ)
   ============================================================ */
.tso-faq-list {
    margin: 20px 0;
}

.tso-faq-item {
    border-bottom: 1px solid var(--tso-color-border);
    padding: 14px 0;
}

.tso-faq-question {
    cursor: pointer;
    font-weight: var(--tso-font-heading-weight, 700);
    color: var(--tso-color-heading);
    list-style: none;
    position: relative;
    padding-right: 30px;
}

.tso-faq-question::-webkit-details-marker {
    display: none;
}

.tso-faq-question::after {
    content: "+";
    position: absolute;
    right: 0;
    top: 0;
    font-size: 1.2em;
    color: var(--tso-color-accent);
}

.tso-faq-item[open] .tso-faq-question::after {
    content: "\2212";
}

.tso-faq-answer {
    padding-top: 10px;
    color: var(--tso-color-text);
}

/* ============================================================
   PLANTILLAS NUEVAS — RECURSOS / DESCARGAS
   ============================================================ */
.tso-resources-list {
    list-style: none;
    margin: 20px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tso-resource-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid var(--tso-color-border);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    background: var(--tso-color-surface);
    transition: border-color 0.15s ease;
}

.tso-resource-link:hover,
.tso-resource-link:focus {
    border-color: var(--tso-color-accent);
}

.tso-resource-icon {
    flex-shrink: 0;
    color: var(--tso-color-accent);
    line-height: 0;
}

.tso-resource-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tso-resource-name {
    font-weight: 700;
    color: var(--tso-color-heading);
}

.tso-resource-meta {
    font-size: 0.85em;
    color: var(--tso-color-text-muted);
}

/* ============================================================
   PLANTILLAS NUEVAS — LEGAL / DOCUMENTO LARGO
   ============================================================ */
.tso-legal-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.tso-legal-toc {
    flex: 0 0 240px;
    position: sticky;
    top: 20px;
    padding: 16px;
    border: 1px solid var(--tso-color-border);
    border-radius: 8px;
    background: var(--tso-color-surface);
    font-size: 0.9em;
}

.tso-legal-toc-title {
    display: block;
    margin-bottom: 8px;
    color: var(--tso-color-heading);
}

.tso-legal-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tso-legal-toc-item {
    margin: 4px 0;
}

.tso-legal-toc-level-3 {
    padding-left: 14px;
}

.tso-legal-content {
    flex: 1;
    min-width: 0;
}

@media (max-width: 782px) {
    .tso-legal-layout {
        flex-direction: column;
    }
    .tso-legal-toc {
        position: static;
        width: 100%;
    }
}

/* ============================================================
   PLANTILLAS NUEVAS — CRONOLOGÍA / HISTORIA
   ============================================================ */
.tso-timeline {
    position: relative;
    margin: 30px 0;
    padding-left: 30px;
}

.tso-timeline::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background: var(--tso-color-border);
}

.tso-timeline-item {
    position: relative;
    padding-bottom: 30px;
}

.tso-timeline-item:last-child {
    padding-bottom: 0;
}

.tso-timeline-item::before {
    content: "";
    position: absolute;
    left: -30px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--tso-color-accent);
    border: 3px solid var(--tso-color-surface);
    box-shadow: 0 0 0 1px var(--tso-color-border);
}

.tso-timeline-date {
    font-weight: 700;
    color: var(--tso-color-accent);
    margin: 0 0 4px;
}

/* ============================================================
   PLANTILLAS NUEVAS — ENLACES (LINK IN BIO)
   ============================================================ */
.tso-links-page .main-container {
    justify-content: center;
}

.tso-links-page article {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}

.tso-links-avatar {
    width: 120px;
    height: 120px;
    border-radius: 999px;
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
}

.tso-links-page .wp-block-buttons {
    flex-direction: column;
}

.tso-links-page .wp-block-button {
    width: 100%;
}

.tso-links-page .wp-block-button__link {
    width: 100%;
    border-radius: 999px;
}

/* ============================================================
   PLANTILLAS NUEVAS — SOBRE MÍ
   ============================================================ */
.tso-about-hero {
    text-align: center;
    margin-bottom: 20px;
}

.tso-about-avatar {
    width: 160px;
    height: 160px;
    border-radius: 999px;
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
}

.tso-about-contact-card {
    margin-top: 40px;
    padding: 24px;
    border: 1px solid var(--tso-color-border);
    border-radius: 8px;
    background: var(--tso-color-surface);
}

.tso-about-contact-title {
    margin-top: 0;
}

.tso-about-contact-direct a {
    color: var(--tso-color-primary);
}

.tso-about-contact-hint {
    color: var(--tso-color-text-muted);
    font-style: italic;
}

/* ============================================================
   CUSTOMIZER — EQUIPO (repetidor dinámico)
   ============================================================ */
.tso-team-grid--dynamic {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin: 30px 0;
}

.tso-team-grid--dynamic .tso-team-member {
    flex: 1 1 180px;
    max-width: 220px;
}

.tso-team-photo {
    width: 130px;
    height: 130px;
    border-radius: 999px;
    object-fit: cover;
    margin: 0 auto 14px;
    display: block;
    border: 3px solid var(--tso-color-surface);
    box-shadow: 0 0 0 3px var(--tso-color-border);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.tso-team-member:hover .tso-team-photo {
    box-shadow: 0 0 0 3px var(--tso-color-accent);
    transform: translateY(-3px);
}

.tso-team-photo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tso-color-accent);
    color: var(--tso-color-white);
    font-size: 2.2em;
    font-weight: 700;
}

.tso-team-name {
    margin: 0 0 2px;
    font-size: 1.05em;
}

.tso-team-name a {
    color: inherit;
    text-decoration: none;
}

.tso-team-name a:hover {
    color: var(--tso-color-accent);
}

.tso-team-role {
    margin: 0;
    color: var(--tso-color-text-muted);
    font-size: 0.9em;
}

/* ============================================================
   CUSTOMIZER — PRECIOS (repetidor dinámico)
   ============================================================ */
.tso-pricing-grid--dynamic {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin: 30px 0;
    align-items: stretch;
}

.tso-pricing-grid--dynamic .tso-pricing-card {
    flex: 1 1 220px;
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tso-pricing-grid--dynamic .tso-pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.tso-pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tso-color-accent);
    color: var(--tso-color-white);
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 14px;
    border-radius: 999px;
    white-space: nowrap;
}

.tso-pricing-title {
    margin: 6px 0 0;
}

.tso-pricing-features {
    text-align: left;
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    flex: 1;
}

.tso-pricing-features li {
    padding: 6px 0;
    border-bottom: 1px solid var(--tso-color-border);
}

.tso-pricing-button {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 999px;
    background: var(--tso-color-accent);
    color: var(--tso-color-white);
    text-decoration: none;
    font-weight: 700;
    transition: background-color 0.15s ease;
}

.tso-pricing-button:hover {
    background: var(--tso-color-accent-hover);
    color: var(--tso-color-white);
}

.tso-pricing-card--featured .tso-pricing-button {
    background: var(--tso-color-primary);
}

/* ============================================================
   CUSTOMIZER — LANDING (eyebrow, botones, destacados)
   ============================================================ */
.tso-landing-hero-eyebrow {
    position: relative;
    display: inline-block;
    color: var(--tso-color-white);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8em;
    font-weight: 700;
    margin: 0 0 12px;
    padding-bottom: 8px;
}

.tso-landing-hero-eyebrow::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--tso-color-accent);
    border-radius: 999px;
}

.tso-landing-hero-buttons {
    margin-top: 24px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.tso-landing-btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.tso-landing-btn:hover {
    transform: translateY(-2px);
}

.tso-landing-btn--primary {
    background: var(--tso-color-accent);
    color: var(--tso-color-white);
}

.tso-landing-btn--primary:hover {
    background: var(--tso-color-accent-hover);
    color: var(--tso-color-white);
}

.tso-landing-btn--secondary {
    background: transparent;
    color: var(--tso-color-white);
    border: 2px solid var(--tso-color-white);
}

.tso-landing-btn--secondary:hover {
    background: var(--tso-color-white);
    color: var(--tso-color-heading);
}

.tso-landing-highlights {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    max-width: 900px;
    margin: -34px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.tso-landing-highlight {
    flex: 1 1 200px;
    max-width: 260px;
    background: var(--tso-color-surface);
    border-radius: 10px;
    padding: 24px 18px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.tso-landing-highlight-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin: 0 auto 12px;
    border-radius: 999px;
    background: rgba(214, 153, 58, 0.15);
    font-size: 1.5em;
}

.tso-landing-highlight-title {
    margin: 0 0 6px;
    font-size: 1em;
}

.tso-landing-highlight-text {
    margin: 0;
    color: var(--tso-color-text-muted);
    font-size: 0.9em;
}

@media (max-width: 600px) {
    .tso-landing-highlights {
        margin-top: 20px;
    }
}

/* ============================================================
   MODE NIT — tokens nous i selector flotant dia / nit / auto
   (el mode dia no es toca; només s'hi afegeixen variables noves
   amb el mateix valor que ja es feia servir de fet)
   ============================================================ */
:root {
    --tso-color-surface-alt: #f1f1f1;
    --tso-color-surface-sunken: #eaeaea;
    --tso-shadow-color: rgba(0, 0, 0, 0.12);
}

html[data-theme="light"] {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --tso-color-body-bg: #0b0c0e;
    --tso-color-primary: #4d9fff;
    --tso-color-accent: #e8ac55;
    --tso-color-accent-contrast: #1a1205;
    --tso-color-link-soft: #8ab4f8;
    --tso-color-link-soft-contrast: #0b1220;
    --tso-color-accent-hover: #f5c076;
    --tso-color-nav-bg: #000000;
    --tso-color-nav-text: #ffffff;
    --tso-color-nav-hover: #e8ac55;
    --tso-color-nav-submenu: #141417;
    --tso-color-footer-bg: #111113;
    --tso-color-footer-heading: #ffffff;
    --tso-color-footer-text: #c7c7cc;
    --tso-color-footer-muted: #8a8a90;
    --tso-color-footer-border: #2c2d33;
    --tso-color-announce-bg: #8a5a20;
    --tso-color-announce-text: #ffffff;
    --tso-color-text: #d6d6da;
    --tso-color-heading: #f5f5f7;
    --tso-color-text-muted: #98999e;
    --tso-color-white: #ffffff;
    --tso-color-border: #2c2d33;
    --tso-color-surface: #17181c;
    --tso-color-surface-alt: #1f2024;
    --tso-color-surface-sunken: #101114;
    --tso-shadow-color: rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] body {
    background-color: var(--tso-color-body-bg);
}

/* Atenua la imagen de fondo personalizada en modo noche para que no desentone con la paleta oscura */
html[data-theme="dark"] body.custom-background::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 0;
}

html[data-theme="dark"] #page-wrapper {
    position: relative;
    z-index: 1;
}

/* Comentaris de Jetpack: l'iframe es pinta des del domini de Jetpack i el
   seu esquema de color va signat, així que no es pot canviar per JS.
   En mode nit s'inverteix l'iframe (mantenint els tons) per fer-lo fosc. */
html[data-theme="dark"] #jetpack_remote_comment {
    filter: invert(1) hue-rotate(180deg);
    border-radius: 4px;
}

/* Mode nit: les barres de títol (naranja / blau) i els botons "Responder"
   portaven text blanc amb un contrast massa baix (2:1 i 2,7:1).
   Es manté l'orange de marca amb text fosc (9:1) i el blau passa a un to
   més suau (8:1); els enllaços del sidebar també, per no cansar la vista. */
html[data-theme="dark"] .related-posts-title,
html[data-theme="dark"] .comment-reply-title,
html[data-theme="dark"] .comments-title,
html[data-theme="dark"] .comment-reply-link,
html[data-theme="dark"] .comment-reply,
html[data-theme="dark"] .comment-form input[type="submit"] {
    background: var(--tso-color-accent) !important;
    color: var(--tso-color-accent-contrast) !important;
}

html[data-theme="dark"] .widget-area .widget-title,
html[data-theme="dark"] .widget-area .wp-block-heading {
    background: var(--tso-color-link-soft) !important;
    color: var(--tso-color-link-soft-contrast) !important;
}

html[data-theme="dark"] .widget-area a {
    color: var(--tso-color-link-soft) !important;
}

/* Mode nit — text i camps dels widgets del sidebar. La regla base posa
   color #444 a p/li/blocs (il·legible sobre fons fosc): és el que feia que el
   text del widget de subscripció (Jetpack) i altres widgets gairebé no es veiés. */
html[data-theme="dark"] .widget-area p,
html[data-theme="dark"] .widget-area li,
html[data-theme="dark"] .widget-area .wp-block-latest-posts,
html[data-theme="dark"] .widget-area .wp-block-latest-comments,
html[data-theme="dark"] .widget-area .wp-block-latest-comments__comment,
html[data-theme="dark"] .widget-area .wp-block-latest-comments__comment-meta,
html[data-theme="dark"] .widget-area .wp-block-latest-comments__comment-excerpt,
html[data-theme="dark"] .widget-area .wp-block-latest-comments__comment-excerpt p,
html[data-theme="dark"] .widget-area .wp-block-categories,
html[data-theme="dark"] .widget-area .wp-block-archives,
html[data-theme="dark"] .widget-area .wp-block-page-list,
html[data-theme="dark"] .widget-area .wp-block-navigation {
    color: var(--tso-color-text);
}

html[data-theme="dark"] .widget-area input[type="text"],
html[data-theme="dark"] .widget-area input[type="email"],
html[data-theme="dark"] .widget-area input[type="search"],
html[data-theme="dark"] .widget-area input[type="url"],
html[data-theme="dark"] .widget-area textarea,
html[data-theme="dark"] .widget-area select {
    background: var(--tso-color-surface-sunken);
    border: 1px solid var(--tso-color-border);
    border-radius: 4px;
    color: var(--tso-color-text);
}

html[data-theme="dark"] .widget-area input::placeholder,
html[data-theme="dark"] .widget-area textarea::placeholder {
    color: var(--tso-color-text-muted);
    opacity: 1;
}

/* Mode nit — widgets de plugins/HTML propi del peu (fons blanc al mode nit).
   - WP Tab Widget (Comentarios / Reciente): té classes pròpies, es tematitza.
   - Widget HTML personalitzat (cotitzacions cripto, id custom_html-5): el
     marcatge és de tercers amb colors en línia, així que s'inverteix el
     bloc i es reverteix la inversió a les imatges (logos). Si es torna a
     crear el widget i canvia d'ID, cal actualitzar aquest selector. */
html[data-theme="dark"] .widget_wpt .wpt_widget_content,
html[data-theme="dark"] .widget_wpt .inside {
    background: var(--tso-color-surface);
    border-color: var(--tso-color-border);
}

html[data-theme="dark"] .widget_wpt .wpt-tabs {
    background: var(--tso-color-surface-sunken);
    border-bottom-color: var(--tso-color-link-soft);
}

html[data-theme="dark"] .widget_wpt .tab_title a {
    background: var(--tso-color-surface-sunken);
    border-color: var(--tso-color-border);
    color: var(--tso-color-text-muted);
}

html[data-theme="dark"] .widget_wpt .tab_title.selected a {
    background: var(--tso-color-surface);
    color: var(--tso-color-link-soft);
}

html[data-theme="dark"] .widget_wpt li {
    border-bottom-color: var(--tso-color-border);
}

html[data-theme="dark"] .widget_wpt a,
html[data-theme="dark"] .widget_wpt .wpt_comment_author,
html[data-theme="dark"] .widget_wpt .wpt_comment_post {
    color: var(--tso-color-link-soft);
}

html[data-theme="dark"] .widget_wpt .wpt_comment_content,
html[data-theme="dark"] .widget_wpt .wpt_comment_content p {
    color: var(--tso-color-text-muted);
}

html[data-theme="dark"] .widget_wpt a.next {
    border-color: var(--tso-color-border);
    color: var(--tso-color-link-soft);
}

html[data-theme="dark"] #custom_html-5 .textwidget {
    filter: invert(0.9) hue-rotate(180deg);
    border-radius: 4px;
}

html[data-theme="dark"] #custom_html-5 .textwidget img {
    filter: invert(1) hue-rotate(180deg);
}

html[data-theme="dark"] .entry-content img,
html[data-theme="dark"] .wp-block-image img,
html[data-theme="dark"] .related-thumb-link img,
html[data-theme="dark"] .home-post-card img {
    filter: brightness(0.92) contrast(1.02);
}

html[data-theme="dark"] ::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
html[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--tso-color-surface-sunken);
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3a3b42;
    border-radius: 6px;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4a4b54;
}

/* Fons i vores en blanc/gris clar fixos -> tokens del mode nit */
html[data-theme="dark"] .searchform,
html[data-theme="dark"] .tso-search-results,
html[data-theme="dark"] .related-post-card,
html[data-theme="dark"] .home-post-card,
html[data-theme="dark"] ol.comment-list .comment,
html[data-theme="dark"] .widget-area .widget,
html[data-theme="dark"] .site-footer .widget,
html[data-theme="dark"] .tso-portfolio-original-pop,
html[data-theme="dark"] .tso-contact-card {
    background: var(--tso-color-surface);
    border-color: var(--tso-color-border);
}

html[data-theme="dark"] .tso-search-results {
    box-shadow: 0 8px 24px var(--tso-shadow-color);
}

html[data-theme="dark"] .related-posts-box,
html[data-theme="dark"] .comments-area,
html[data-theme="dark"] #respond,
html[data-theme="dark"] .tso-portfolio-empty,
html[data-theme="dark"] .tso-contact-info,
html[data-theme="dark"] .tso-contact-form-hint,
html[data-theme="dark"] .single-tags a,
html[data-theme="dark"] .screen-reader-text:focus {
    background: var(--tso-color-surface-alt);
    background-color: var(--tso-color-surface-alt);
    border-color: var(--tso-color-border);
}

/* Sidebar column bg comes from --tso-sidebar-bg (day + night override in inline CSS) */
html[data-theme="dark"] body:not(.tso-sidebar-no-bg) .widget-area {
    border-color: var(--tso-color-border);
}
html[data-theme="dark"] body.tso-sidebar-no-bg .widget-area,
body.tso-sidebar-no-bg .widget-area {
    background: transparent;
    background-color: transparent;
}
html[data-theme="dark"] body.tso-sidebar-border .widget-area {
    border-color: var(--tso-color-border);
}
html[data-theme="dark"] body.tso-sidebar-shadow .widget-area {
    -webkit-box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .related-thumb-link,
html[data-theme="dark"] .tso-contact-map,
html[data-theme="dark"] .tso-portfolio-thumb,
html[data-theme="dark"] .tso-portfolio-download.is-disabled,
html[data-theme="dark"] .tso-portfolio-download.is-disabled:hover {
    background: var(--tso-color-surface-sunken);
}

html[data-theme="dark"] .comment-form input[type="text"],
html[data-theme="dark"] .comment-form input[type="email"],
html[data-theme="dark"] .comment-form input[type="url"],
html[data-theme="dark"] .comment-form textarea,
html[data-theme="dark"] .tso-contact-form input[type="text"],
html[data-theme="dark"] .tso-contact-form input[type="email"],
html[data-theme="dark"] .tso-contact-form input[type="tel"],
html[data-theme="dark"] .tso-contact-form input[type="url"],
html[data-theme="dark"] .tso-contact-form textarea,
html[data-theme="dark"] .tso-contact-form select {
    background: var(--tso-color-surface-sunken);
    border-color: var(--tso-color-border);
    color: var(--tso-color-text);
}

html[data-theme="dark"] .pagination .page-numbers {
    border-color: var(--tso-color-border);
    color: var(--tso-color-text);
}

/* Vores fixes -> vora del mode nit */
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .single-article-header,
html[data-theme="dark"] .comment-reply,
html[data-theme="dark"] .widget-area .wp-block-latest-comments__comment {
    border-color: var(--tso-color-border);
}
html[data-theme="dark"] .single-tags {
    border-top-color: var(--tso-color-border);
}
html[data-theme="dark"] .single-breadcrumb {
    border-bottom-color: var(--tso-color-border);
}

/* Textos foscos fixos -> escala de grisos del mode nit */
html[data-theme="dark"] .tso-search-results li a,
html[data-theme="dark"] .tso-search-results .tso-sr-title,
html[data-theme="dark"] .entry-content h4,
html[data-theme="dark"] .related-post-title a,
html[data-theme="dark"] .comment-author,
html[data-theme="dark"] .comment-form label {
    color: var(--tso-color-heading);
}
html[data-theme="dark"] .tso-search-results .tso-sr-msg,
html[data-theme="dark"] .single-breadcrumb,
html[data-theme="dark"] .single-tags .tags-label,
html[data-theme="dark"] .related-post-date,
html[data-theme="dark"] .comment-metadata,
html[data-theme="dark"] .comment-metadata a,
html[data-theme="dark"] .comment-notes,
html[data-theme="dark"] #cancel-comment-reply-link,
html[data-theme="dark"] .archive-description,
html[data-theme="dark"] .post-card-excerpt,
html[data-theme="dark"] .tso-portfolio-download.is-disabled,
html[data-theme="dark"] .tso-portfolio-download.is-disabled:hover {
    color: var(--tso-color-text-muted);
}
html[data-theme="dark"] .single-tags a,
html[data-theme="dark"] .comment-content,
html[data-theme="dark"] .comment-form textarea,
html[data-theme="dark"] .widget-area,
html[data-theme="dark"] .widget-area .wp-block-navigation a {
    color: var(--tso-color-text);
}

html[data-theme="dark"] .tso-portfolio-original-pop::after {
    border-top-color: var(--tso-color-surface);
    filter: drop-shadow(0 1px 0 var(--tso-color-border));
}

html[data-theme="dark"] .social-icon--twitter:hover,
html[data-theme="dark"] .social-icon--tiktok:hover,
html[data-theme="dark"] .social-icon--threads:hover {
    background-color: #2b2b30;
}
html[data-theme="dark"] .social-icon--github:hover {
    background-color: #3a3a40;
}

/* ============================================================
   SELECTOR DIA / NIT / AUTOMÀTIC — a la capçalera
   ============================================================ */
.tso-theme-switch {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    gap: 4px;
    background: var(--tso-color-surface, #fff);
    border: 1px solid var(--tso-color-border, #e0e0e0);
    border-radius: 999px;
    padding: 3px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    -webkit-box-shadow: 0 2px 8px var(--tso-shadow-color, rgba(0, 0, 0, 0.08));
    box-shadow: 0 2px 8px var(--tso-shadow-color, rgba(0, 0, 0, 0.08));
}
.tso-theme-switch-btn {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--tso-color-text-muted, #666);
    cursor: pointer;
    padding: 0;
    -webkit-transition: background 0.2s, color 0.2s, -webkit-transform 0.2s;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}
.tso-theme-switch-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.tso-theme-switch-btn:hover {
    color: var(--tso-color-accent, #d6993a);
    -webkit-transform: scale(1.08);
    transform: scale(1.08);
}
/* Accent (no el fons de la capçalera): en mode nit la capçalera és del mateix
   color que el selector i el botó actiu / en hover quedaven invisibles. */
.tso-theme-switch-btn.is-active {
    background: var(--tso-color-accent, #d6993a);
    color: var(--tso-color-accent-contrast, #fff);
}
.tso-theme-switch-btn:focus-visible {
    outline: 2px solid var(--tso-color-primary, #1e73be);
    outline-offset: 2px;
}
@media (max-width: 600px) {
    .tso-theme-switch-btn {
        width: 28px;
        height: 28px;
    }
}


/* ==========================================================
   Modo noche: plantillas y botones de acento/primario.
   En noche accent/primary son tonos claros, por lo que el texto
   blanco pierde contraste: se usa el color de contraste.
   ========================================================== */
html[data-theme="dark"] .skip-to-content:focus,
html[data-theme="dark"] .skip-to-content:focus-visible,
html[data-theme="dark"] .btn-load-more,
html[data-theme="dark"] .single-category-badge a,
html[data-theme="dark"] .single-tags a:hover,
html[data-theme="dark"] .pagination .page-numbers:hover,
html[data-theme="dark"] .pagination .page-numbers.current,
html[data-theme="dark"] .posts-pagination .page-numbers.current,
html[data-theme="dark"] .posts-pagination .page-numbers:hover,
html[data-theme="dark"] .error-404-home-link,
html[data-theme="dark"] .tso-portfolio-download:hover,
html[data-theme="dark"] .tso-portfolio-download--go:hover,
html[data-theme="dark"] .tso-team-photo--placeholder,
html[data-theme="dark"] .tso-pricing-badge,
html[data-theme="dark"] .tso-pricing-button,
html[data-theme="dark"] .tso-landing-btn--primary,
html[data-theme="dark"] .is-style-tso-accent .wp-block-button__link,
html[data-theme="dark"] .wp-block-button.is-style-tso-accent .wp-block-button__link {
    background: var(--tso-color-accent);
    color: var(--tso-color-accent-contrast);
}

html[data-theme="dark"] .comment-reply-link:hover,
html[data-theme="dark"] .error-404-home-link:hover,
html[data-theme="dark"] .tso-pricing-button:hover,
html[data-theme="dark"] .tso-landing-btn--primary:hover {
    background: var(--tso-color-accent);
    color: var(--tso-color-accent-contrast);
    filter: brightness(1.08);
}

html[data-theme="dark"] .tso-contact-detail-icon,
html[data-theme="dark"] .tso-contact-form input[type="submit"],
html[data-theme="dark"] .tso-contact-form button[type="submit"],
html[data-theme="dark"] .tso-portfolio-download--go {
    background: var(--tso-color-link-soft);
    color: var(--tso-color-link-soft-contrast);
}

/* Portfolio: pastillas de descarga */
html[data-theme="dark"] .tso-portfolio-download {
    background: var(--tso-color-surface-alt);
    color: var(--tso-color-link-soft);
    border: 1px solid var(--tso-color-border);
}
html[data-theme="dark"] .tso-portfolio-download:hover {
    border-color: var(--tso-color-accent);
}
html[data-theme="dark"] .tso-portfolio-download.is-disabled {
    background: var(--tso-color-surface-sunken);
    color: var(--tso-color-text-muted);
    border-color: var(--tso-color-border);
}

/* Botón secundario de landing y comentario en moderación */
html[data-theme="dark"] .tso-landing-btn--secondary:hover {
    background: var(--tso-color-text);
    color: var(--tso-color-surface);
}
html[data-theme="dark"] .comment-awaiting-moderation {
    background: rgba(232, 172, 85, 0.12);
    color: var(--tso-color-text);
    border-color: var(--tso-color-accent);
}


/* Accessibility: sufficient contrast in footer/sidebar widget tabs and small text (PageSpeed). */
html:not([data-theme="dark"]) .widget-area .widget [data-tab-id],
html:not([data-theme="dark"]) .site-footer .widget [data-tab-id] { color: #595959; }
.widget-area .textwidget > div > div > span,
.site-footer .textwidget > div > div > span { color: #565c62; }
/* The currency widget sets these colours inline (#777 / #6c757d), so !important is needed. */
.widget-area .textwidget a[data-tab-id][style*="119, 119, 119"],
.widget-area .textwidget a[data-tab-id][style*="#777"],
.site-footer .textwidget a[data-tab-id][style*="119, 119, 119"],
.site-footer .textwidget a[data-tab-id][style*="#777"] { color: #595959 !important; }
.widget-area .textwidget span[style*="108, 117, 125"],
.widget-area .textwidget span[style*="6c757d"],
.site-footer .textwidget span[style*="108, 117, 125"],
.site-footer .textwidget span[style*="6c757d"] { color: #565c62 !important; }
/* Light mode: footer widgets that sit on white cards must not inherit the light footer text colour. */
html[data-theme="light"] .footer-layout .tso-clas-legend { color: #555; }
html[data-theme="light"] .footer-layout .wpt_widget_content .wpt_comment_content p { color: #444; }
                                                                                                                                                                                                                                                                                                                                                                            