/* =========================================================================
 * WSSF · Layout & site chrome (header / footer / containers)
 *
 * Reemplaza los widgets de Elementor para header/footer. HTML/CSS puro.
 * ========================================================================= */

/* Skip-link para accesibilidad */
.wssf-skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 999;
}
.wssf-skip-link:focus {
    position: fixed;
    top: 12px;
    left: 12px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    background: #1A1A1A;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
}

/* ===== Header ===== */
.wssf-site-header {
    background: #FFFFFF;
    border-bottom: 1px solid #E5E5E5;
    position: sticky;
    top: 0;
    z-index: 100;
}

.wssf-header-inner {
    max-width: var(--sf-max-width, 1280px);
    margin: 0 auto;
    padding: 16px var(--sf-space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sf-space-4);
}

.wssf-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #1A1A1A;
    flex-shrink: 0;
    margin-left: 30px; /* despegar del borde izquierdo · feedback owner */
}
@media (max-width: 880px) {
    .wssf-logo { margin-left: 0; }
}
.wssf-logo img,
.wssf-logo .custom-logo {
    height: 83px;
    width: auto;
    display: block;
}
@media (max-width: 880px) {
    .wssf-logo img,
    .wssf-logo .custom-logo { height: 64px; }
}
.wssf-logo-text {
    font-family: var(--sf-font-sans);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #1A1A1A;
}
.wssf-logo-text em {
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: #595959;
    margin-left: 4px;
}

/* ===== Nav menu ===== */
.wssf-nav {
    display: flex;
    align-items: center;
}

.wssf-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wssf-nav-menu .menu-item > a {
    display: inline-flex;
    align-items: center;
    padding: 10px 16px;
    color: #1A1A1A;
    text-decoration: none;
    font-size: var(--sf-text-sm);
    font-weight: var(--sf-fw-semibold);
    line-height: 1.2;
    border: 1px solid transparent;
    border-radius: var(--sf-radius-sm);
    transition: all var(--sf-duration-fast) var(--sf-ease);
}
.wssf-nav-menu .menu-item > a:hover {
    background: #F5F5F5;
    border-color: #E5E5E5;
    color: #000;
}
.wssf-nav-menu .menu-item.current-menu-item > a,
.wssf-nav-menu .menu-item.current_page_item > a {
    background: #1A1A1A;
    color: #fff;
    border-color: #1A1A1A;
}

/* Submenús */
.wssf-nav-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 6px;
    position: absolute;
    background: #fff;
    border: 1px solid #E5E5E5;
    border-radius: var(--sf-radius-sm);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    min-width: 220px;
    display: none;
    z-index: 200;
}
.wssf-nav-menu .menu-item-has-children { position: relative; }
.wssf-nav-menu .menu-item-has-children:hover > .sub-menu,
.wssf-nav-menu .menu-item-has-children:focus-within > .sub-menu { display: block; }
.wssf-nav-menu .sub-menu .menu-item > a {
    display: block;
    padding: 8px 12px;
    border: 0;
    border-radius: 4px;
}

/* ===== Language switcher pill ===== */
.wssf-lang-switcher {
    display: inline-flex;
    align-items: center;
    margin-left: 12px;
    padding: 3px;
    background: #F5F5F5;
    border: 1px solid #E5E5E5;
    border-radius: 999px;
    line-height: 1;
}
.wssf-lang-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #595959;
    text-decoration: none;
    border-radius: 999px;
    transition: all var(--sf-duration-fast, 150ms) var(--sf-ease, ease);
}
.wssf-lang-btn:hover { color: #1A1A1A; }
.wssf-lang-btn.is-active {
    background: #1A1A1A;
    color: #fff;
}

@media (max-width: 880px) {
    .wssf-lang-switcher {
        margin-left: 8px;
        order: -1; /* aparecer antes del burger toggle */
    }
}

/* ===== Mobile nav toggle ===== */
.wssf-nav-toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid #E5E5E5;
    background: #fff;
    border-radius: var(--sf-radius-sm);
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}
.wssf-nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #1A1A1A;
    border-radius: 2px;
}

@media (max-width: 880px) {
    .wssf-nav-toggle { display: inline-flex; }
    .wssf-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid #E5E5E5;
        padding: var(--sf-space-3) var(--sf-space-4);
    }
    .wssf-nav.is-open { display: block; }
    .wssf-nav-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
    }
    .wssf-nav-menu .menu-item > a {
        justify-content: flex-start;
        width: 100%;
    }
}

/* ===== Main area ===== */
.wssf-main {
    min-height: 50vh;
    background: var(--sf-bg, #FAFAFA);
}

.wssf-container {
    max-width: var(--sf-max-width, 1280px);
    margin: 0 auto;
    padding: var(--sf-space-6) var(--sf-space-4);
}

/* Hero container · mismo max-width pero sin padding-bottom (la siguiente
 * página content ya tiene su propio padding-top en wssf-container). */
.wssf-hero-container {
    padding-top: var(--sf-space-4);
    padding-bottom: 0;
}

/* =========================================================================
 * Hero Band · Diseño minimalista profesional (rediseño 2026-04-30)
 *
 * Una sola línea horizontal con saludo + status pedido o fecha.
 * Tipografía Inter, alto contraste, sin animaciones distrayentes.
 * Inspirado en command bars de Linear / Vercel / Stripe dashboards.
 * ========================================================================= */

.wssf-hero-band {
    margin: 0 0 var(--sf-space-4, 16px);
}

.wssf-hero-inner {
    display: flex;
    align-items: center;
    gap: var(--sf-space-3, 12px);
    padding: 10px 16px;
    background: #FAFAFA;
    border: 1px solid #E5E5E5;
    border-radius: 10px;
    font-size: var(--sf-text-sm, 14px);
    line-height: 1.4;
    transition: border-color 200ms ease;
    position: relative;
    overflow: hidden;
}
.wssf-hero-inner:hover {
    border-color: #D4D4D4;
}

/* Saludo + nombre — flex grow para empujar el status/fecha al lado derecho */
.wssf-hero-greet {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sf-text-muted, #595959);
    flex: 1 1 auto;
    min-width: 0;
    margin-right: auto;
}
.wssf-hero-greet-text {
    font-weight: 500;
}
.wssf-hero-greet-sep {
    color: #D4D4D4;
    font-weight: 300;
}
.wssf-hero-greet-name {
    color: #1A1A1A;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Lado derecho: status pill (link) o fecha (texto plano) */
.wssf-hero-date {
    color: var(--sf-text-muted, #595959);
    font-size: 13px;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

.wssf-hero-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: #FFFFFF;
    border: 1px solid #E5E5E5;
    border-radius: 999px;
    color: #1A1A1A;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 150ms ease;
    max-width: 100%;
}
.wssf-hero-status:hover {
    background: #1A1A1A;
    border-color: #1A1A1A;
    color: #FFFFFF;
}

.wssf-hero-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.wssf-hero-status-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 320px;
}

.wssf-hero-status-arrow {
    font-size: 14px;
    line-height: 1;
    transition: transform 150ms ease;
}
.wssf-hero-status:hover .wssf-hero-status-arrow {
    transform: translateX(2px);
}

/* Variantes de status según tipo */
.wssf-hero-status--warn { color: #854d0e; border-color: #fef3c7; background: #fffbeb; }
.wssf-hero-status--warn:hover { background: #854d0e; border-color: #854d0e; color: #fff; }

.wssf-hero-status--info { color: #1e3a8a; border-color: #dbeafe; background: #eff6ff; }
.wssf-hero-status--info:hover { background: #1e3a8a; border-color: #1e3a8a; color: #fff; }

.wssf-hero-status--success { color: #14532d; border-color: #dcfce7; background: #f0fdf4; }
.wssf-hero-status--success:hover { background: #14532d; border-color: #14532d; color: #fff; }

/* Mobile: stack vertical */
@media (max-width: 600px) {
    .wssf-hero-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 10px 14px;
    }
    .wssf-hero-greet { width: 100%; }
    .wssf-hero-status-label { max-width: none; }
}

.wssf-page-header {
    margin-bottom: var(--sf-space-6);
}
.wssf-page-title {
    font-size: var(--sf-text-3xl, 32px);
    font-weight: var(--sf-fw-bold);
    color: #1A1A1A;
    letter-spacing: -0.02em;
    margin: 0;
}

.wssf-page-content :is(h2, h3) {
    margin-top: var(--sf-space-8);
    margin-bottom: var(--sf-space-3);
    color: #1A1A1A;
    font-weight: var(--sf-fw-bold);
    letter-spacing: -0.01em;
}
.wssf-page-content h2 { font-size: var(--sf-text-2xl, 26px); }
.wssf-page-content h3 { font-size: var(--sf-text-xl, 22px); }
.wssf-page-content p {
    margin: 0 0 var(--sf-space-3);
    line-height: var(--sf-lh-relaxed, 1.6);
    color: var(--sf-text, #1A1A1A);
}

/* ===== Footer ===== */
.wssf-site-footer {
    background: #FFFFFF;
    border-top: 1px solid #E5E5E5;
    margin-top: var(--sf-space-8);
}

.wssf-footer-inner {
    max-width: var(--sf-max-width, 1280px);
    margin: 0 auto;
    padding: var(--sf-space-8) var(--sf-space-4);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sf-space-4);
    text-align: center;
}

.wssf-footer-brand .wssf-logo-text,
.wssf-footer-brand img {
    margin-bottom: var(--sf-space-2);
}
.wssf-footer-brand img,
.wssf-footer-brand .custom-logo {
    height: 115px;
    width: auto;
}

.wssf-footer-tagline {
    color: var(--sf-text-muted, #595959);
    font-size: var(--sf-text-sm);
    margin: 0;
}

.wssf-footer-social {
    display: flex;
    gap: var(--sf-space-2);
}
.wssf-footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #F5F5F5;
    color: #1A1A1A;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--sf-duration-fast) var(--sf-ease);
}
.wssf-footer-social a:hover {
    background: #1A1A1A;
    color: #fff;
}

.wssf-footer-meta {
    color: var(--sf-text-muted, #595959);
    font-size: var(--sf-text-sm);
}
.wssf-footer-meta p { margin: 0; }
.wssf-footer-tiny { font-size: 12px; opacity: 0.7; margin-top: 4px; }

/* Padding inferior para no chocar con footer fixed del bulk-list */
body.page-template-front-page .wssf-main,
body.wssf-front .wssf-main { padding-bottom: 120px; }

/* Util: visualmente oculto */
.wssf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ===== Download Monitor · Grid Opción C (per-section) =====
 * /resources/ tiene 4 secciones, cada una con aspect ratio distinto:
 *   Logo     → 1 item, card grande
 *   Photos   → landscape 4:5 → 3 cols
 *   Sliders  → vertical 9:16 → 4 cols, alto
 *   Banners  → landscape 16:9 → 3 cols
 * Usamos .wssf-res-section--<slug> que el filtro PHP envuelve.
 *
 * Reset: .download-box default styling consistente para todas las secciones.
 */

.wssf-page-content .download-box {
    background: var(--sf-card, #fff);
    border: 1px solid var(--sf-border, #E5E5E5);
    border-radius: var(--sf-radius-sm, 6px);
    overflow: hidden;
    box-sizing: border-box;
    transition: box-shadow var(--sf-duration-fast, 150ms) var(--sf-ease, ease);
    display: flex;
    flex-direction: column;
    position: relative;   /* contiene el download-count absoluto del plugin */
}
.wssf-page-content .download-box:hover {
    box-shadow: var(--sf-shadow-md, 0 4px 12px rgba(0,0,0,0.08));
}
.wssf-page-content .download-box img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    object-fit: cover;
    flex-shrink: 0;
}
.wssf-page-content .download-count { display: none !important; }
.wssf-page-content .download-box-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}
.wssf-page-content .download-box-content :is(h1,h2,h3,h4) {
    font-size: 13px;
    font-weight: var(--sf-fw-semibold, 600);
    margin: 0 !important;
    color: var(--sf-text);
    line-height: 1.3;
}
.wssf-page-content .download-link.download-button {
    display: block;
    margin-top: auto;
    padding: 7px 12px;
    background: transparent;
    color: var(--sf-text, #1A1A1A);
    border: 1px solid var(--sf-border, #E5E5E5);
    border-radius: var(--sf-radius-sm, 6px);
    font-size: 12px;
    font-weight: var(--sf-fw-semibold, 600);
    text-align: center;
    text-decoration: none;
    transition: background var(--sf-duration-fast, 150ms), border-color var(--sf-duration-fast, 150ms);
    cursor: pointer;
}
.wssf-page-content .download-link.download-button:hover {
    background: var(--sf-bg-alt, #F5F5F5);
    border-color: var(--sf-text-muted, #595959);
    color: var(--sf-text, #1A1A1A);
}
.wssf-page-content .download-link.download-button small {
    display: block;
    font-size: 10px;
    font-weight: 400;
    color: var(--sf-text-muted, #595959);
    margin-top: 2px;
}

/* ----- Sección wrapper · grid base ----- */
.wssf-res-section > p:empty { display: none; }   /* wpautop genera <p></p> que ocupa celda del grid */
.wssf-res-section {
    display: grid;
    gap: var(--sf-space-3, 12px);
    margin: var(--sf-space-3) 0 var(--sf-space-6);
}

/* ----- LOGO · 1 col, max ancho 320px (centrado a la izq) ----- */
.wssf-res-section--logo {
    grid-template-columns: minmax(0, 320px);
}
.wssf-res-section--logo .download-box img {
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: #FAFAFA;
}

/* ----- PHOTOS · 3 cols, aspect 4:5 ----- */
.wssf-res-section--photos {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wssf-res-section--photos .download-box img {
    aspect-ratio: 4 / 5;
}

/* ----- SLIDERS · 3 cols, altura fija — mix panorámico/landscape/portrait ----- */
.wssf-res-section--sliders {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wssf-res-section--sliders .download-box img {
    height: 140px;
    width: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center center;
    padding: 0;
    border-bottom: 1px solid var(--sf-border, #E5E5E5);
}

/* ----- BANNERS · 3 cols, aspect 16:9 ----- */
.wssf-res-section--banners {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.wssf-res-section--banners .download-box img {
    aspect-ratio: 16 / 9;
}

/* ----- FICHAS técnicas · 4 cols, portrait PDF-style ----- */
.wssf-res-section--fichas {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.wssf-res-section--fichas .download-box img {
    aspect-ratio: 3 / 4;
    object-fit: contain;
    background: var(--sf-bg-alt, #F5F5F5);
    padding: 12px;
}
/* Placeholder cuando la sección no tiene downloads aún */
.wssf-res-coming-soon {
    grid-column: 1 / -1;
    padding: 32px;
    background: var(--sf-bg-alt, #F5F5F5);
    border: 1px dashed var(--sf-border, #E5E5E5);
    border-radius: var(--sf-radius-sm, 6px);
    text-align: center;
    color: var(--sf-text-muted, #595959);
    font-size: 14px;
}

/* ----- Responsive breakpoints ----- */
@media (max-width: 1024px) {
    .wssf-res-section--sliders,
    .wssf-res-section--fichas { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .wssf-res-section--photos,
    .wssf-res-section--banners,
    .wssf-res-section--sliders,
    .wssf-res-section--fichas { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .wssf-res-section { grid-template-columns: 1fr !important; }
    .wssf-res-section--logo { grid-template-columns: 1fr; }
}

/* Íconos SVG inline: respetan el tamaño del contenedor. */
.wssf-nav-icon { display: inline-flex; width: 18px; height: 18px; flex-shrink: 0; overflow: hidden; }
.wssf-nav-icon svg { display: block; width: 18px; height: 18px; }
.wssf-dash-stat-icon svg,
.wssf-dash-action-icon svg { display: block; width: 16px; height: 16px; }
