/*
Theme Name: WindowsBlogItalia Fluent
Description: Tema editoriale responsive per WindowsBlogItalia, ispirato a Windows 11.
Version: 1.4.4
Requires at least: 6.6
Requires PHP: 7.4
Text Domain: wbi-fluent
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
    color-scheme: light;
    --brand: #238e9a;
    --ink: #1f252b;
    --muted: #505a5e;
    --accent: #1a6b74;
    --accent-soft: #dceff0;
    --paper: #f9f9f9;
    --base: #e5e5e5;
    --wash: #e4edee;
    --border: #cbcbcb;
    --focus: #1a6b74;
    --card-hover: #edf4f4;
    --card-hover-border: #98acaf;
    --shadow: 0 2px 4px #00000010, 0 8px 25px #00000009;
    --radius: 12px;
    --font: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --ink: #f5f7f7;
        --muted: #c4cecf;
        --accent: #8cdee5;
        --accent-soft: #23474b;
        --paper: #1a1a1a;
        --base: #111;
        --wash: #182628;
        --border: #3b4344;
        --focus: #8cdee5;
        --card-hover: #252e2f;
        --card-hover-border: #708284;
        --shadow: 0 3px 16px #0003;
    }
}

*, *::before, *::after { box-sizing: border-box; }
body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(123deg, var(--base) 36%, var(--wash) 100%);
    min-height: 100vh;
    font: 16px/1.55 var(--font);
    overflow-wrap: anywhere;
}
body, button, input, textarea, select { font-family: var(--font); }
a { color: var(--accent); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .13em; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}
img, video, iframe { max-width: 100%; }
img, video { height: auto; }
h1, h2, h3, h4 { line-height: 1.15; }
.wrap { width: min(100% - 64px, 1360px); margin-inline: auto; }
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.screen-reader-text:focus {
    z-index: 10;
    width: auto;
    height: auto;
    margin: 8px;
    padding: 12px 18px;
    clip: auto;
    clip-path: none;
    color: var(--accent);
    background: var(--paper);
}

.site-header {
    background: var(--brand);
    border-bottom: 1px solid var(--border);
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    min-height: 78px;
}
.site-brand { min-width: 0; }
.wordmark {
    display: block;
    width: fit-content;
    max-width: 100%;
    border-radius: 4px;
}
.wordmark:focus-visible { outline-color: #fff; }
.legacy-logo { display: block; width: clamp(230px, 27vw, 340px); }
.custom-logo { display: block; width: auto; max-width: 100%; max-height: 46px; object-fit: contain; }
.header-search { flex: 0 1 330px; min-width: 0; }
.sidebar-toggle { display: none; }
.sidebar-backdrop, .sidebar-drawer-header { display: none; }
.sidebar-toggle label {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid #ffffff66;
    border-radius: 7px;
    color: #fff;
    cursor: pointer;
}
.sidebar-toggle label:hover, .sidebar-toggle input:checked + label { background: #0003; }
.sidebar-toggle input:focus-visible + label { outline: 2px solid #fff; outline-offset: 3px; }
.sidebar-toggle-icon, .sidebar-toggle-icon::before, .sidebar-toggle-icon::after {
    display: block;
    width: 19px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
}
.sidebar-toggle-icon { position: relative; }
.sidebar-toggle-icon::before, .sidebar-toggle-icon::after { content: ""; position: absolute; }
.sidebar-toggle-icon::before { top: -6px; }
.sidebar-toggle-icon::after { top: 6px; }
.sidebar-toggle input:checked + label .sidebar-toggle-icon { background: transparent; }
.sidebar-toggle input:checked + label .sidebar-toggle-icon::before { top: 0; transform: rotate(45deg); }
.sidebar-toggle input:checked + label .sidebar-toggle-icon::after { top: 0; transform: rotate(-45deg); }
.search-form {
    display: flex;
    align-items: stretch;
    max-width: 440px;
    min-width: 0;
    min-height: 42px;
    background: var(--base);
    border: 1px solid var(--border);
    border-radius: 7px;
}
.search-field { flex: 1; min-width: 0; display: flex; }
.search-form input {
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 6px;
    color: var(--ink);
    background: transparent;
    font-size: 1rem;
}
.search-form input::placeholder { color: var(--muted); opacity: 1; }
.search-form button {
    display: grid;
    place-items: center;
    flex: 0 0 43px;
    color: var(--accent);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}
.search-form button:hover { background: var(--accent-soft); }
.header-nav { background: var(--paper); border-top: 1px solid var(--border); }
.nav-list, .footer-menu, .tile-grid, .updates-panel ul { margin: 0; padding: 0; list-style: none; }
.nav-list { display: flex; flex-wrap: wrap; gap: 3px 5px; padding-block: 5px; }
.nav-list li { position: relative; }
.nav-list a {
    display: flex;
    align-items: center;
    min-height: 43px;
    padding: 5px 13px;
    border-radius: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: .91rem;
    font-weight: 650;
}
.nav-list a:hover, .nav-list .current-menu-item > a, .nav-list a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-list .sub-menu {
    display: none;
    position: absolute;
    z-index: 4;
    top: 100%;
    left: 0;
    width: max-content;
    max-width: 300px;
    margin: 0;
    padding: 5px;
    list-style: none;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}
.nav-list li:hover > .sub-menu, .nav-list li:focus-within > .sub-menu { display: block; }
.nav-list .sub-menu .sub-menu { position: static; width: auto; box-shadow: none; margin-left: 9px; }

.main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    align-items: start;
    gap: 26px;
    padding-block: 33px 60px;
    position: relative;
}
.main-column, .editorial-sidebar { min-width: 0; }
.section-heading { margin: 0 0 17px; }
.section-heading h1, .section-heading h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.18rem);
    letter-spacing: -.045em;
    font-weight: 750;
}
.archive-description { margin-top: 12px; color: var(--muted); }
.layout-heading { grid-column: 1 / -1; margin-bottom: -9px; }
.lead-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.68fr) minmax(0, 1fr);
    gap: 15px;
}
.lead-grid:has(> :only-child) { grid-template-columns: 1fr; }
.lead-secondary { display: grid; gap: 15px; }
.story-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.latest { margin-top: 32px; }
.panel, .story-card {
    min-width: 0;
    background: var(--paper);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.story-card { position: relative; isolation: isolate; overflow: hidden; }
.story-card, .update-card, .related-tile { transition: background-color .15s, border-color .15s; }
.story-card:focus-within { outline: 2px solid var(--focus); outline-offset: 3px; }
.story-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--wash); }
.story-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.story-copy { padding: 15px 16px 18px; }
.story-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px 9px;
    color: var(--muted);
    font-size: .77rem;
    line-height: 1.35;
}
.story-category {
    position: relative;
    z-index: 2;
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
}
.story-category:hover { color: var(--ink); }
.story-title { margin: 8px 0 0; font-size: 1.14rem; letter-spacing: -.02em; }
.story-title a { color: inherit; text-decoration: none; }
.story-title a::after { content: ""; position: absolute; z-index: 1; inset: 0; }
.featured-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 9px;
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .72rem;
    font-weight: 750;
}
.story-excerpt { margin: 8px 0 0; color: var(--muted); font-size: .89rem; }
.story-lead { display: flex; flex-direction: column; justify-content: end; min-height: 385px; color: #fff; background: #123337; }
.story-lead .story-media, .story-lead::before { position: absolute; inset: 0; aspect-ratio: auto; }
.story-lead .story-media { z-index: -2; }
.story-lead::before { content: ""; z-index: -1; background: linear-gradient(180deg, #09183110 20%, #091831dd 72%, #091831 100%); }
.story-lead .story-copy { padding: 25px; }
.story-lead .featured-label { background: #f3fafa; color: #1a6b74; }
.story-lead .story-title { font-size: clamp(1.55rem, 2.5vw, 2.28rem); line-height: 1.12; letter-spacing: -.035em; }
.story-lead .story-meta, .story-lead .story-category { color: #f1f6ff; }
.story-lead .story-category { background: #1a6b74; border-radius: 4px; padding: 3px 7px; }
.story-lead .story-category:hover { background: #25565b; }
.story-lead a:focus-visible { outline-color: #fff; }
.story-secondary { display: grid; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); }
.story-secondary:not(:has(.story-media)) { grid-template-columns: 1fr; }
.story-secondary .story-media { position: relative; align-self: stretch; aspect-ratio: auto; min-height: 105px; }
.story-secondary .story-media img { position: absolute; inset: 0; }
.story-secondary .story-copy { padding: 12px; }
.story-secondary .story-title { font-size: 1.04rem; }

.editorial-sidebar { display: grid; gap: 15px; }
.updates-panel, .widget { padding: 17px; }
.section-tiles h2, .updates-panel h2, .widget-title { margin: 0 0 13px; font-size: 1.19rem; letter-spacing: -.025em; }
.tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.tile-wide { grid-column: 1 / -1; }
.section-tile {
    display: flex;
    position: relative;
    isolation: isolate;
    align-items: end;
    aspect-ratio: 1;
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--brand);
    color: #fff;
    text-decoration: none;
    box-shadow: var(--shadow);
}
.tile-wide .section-tile { aspect-ratio: 2; }
.section-tile span { position: relative; z-index: 1; padding: 8px 10px; color: #fff; font-size: .84rem; font-weight: 700; line-height: 1.25; text-shadow: 0 1px 3px #000; }
.section-tile::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(transparent 43%, #000a); }
.tile-art { position: absolute; inset: 0; overflow: hidden; }
.tile-art > img, .tile-art > amp-img { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile-art img { object-fit: contain; }
.tile-xbox .tile-art > :first-child, .tile-xbox .tile-art > :first-child img, .tile-recruit .tile-art img { object-fit: cover; }
.tile-art .xbox-mark { inset: 5px 5px auto auto; width: 29px; height: 29px; }
.tile-windows, .tile-download { background: #00aeef; }
.tile-edge { background: #173a73; }
.tile-office, .tile-onedrive { background: #404040; }
.tile-xbox { background: #107c10; }
.tile-recruit { background: #fc5238; }
.sidebar-banner { display: grid; justify-items: center; padding: 9px 0; }
.sidebar-ad-unit { display: inline-block; width: 300px; height: 250px; }
.article-ad { display: grid; justify-items: stretch; margin-block: 24px; clear: both; }
.article-ad-unit { display: block; width: 100%; min-height: 90px; }
.article-ad .banner-preview, .article-ad amp-ad { margin-inline: auto; }
@media (max-width: 370px) {
    .article-ad amp-ad { display: none; }
}
.banner-preview { display: grid; place-items: center; width: min(100%, 300px); height: 250px; border: 1px dashed var(--border); background: var(--base); color: var(--muted); font-size: .82rem; }
.updates-panel li + li { border-top: 1px solid var(--border); }
.updates-panel li { padding-block: 4px; line-height: 1.35; }
.updates-panel li:first-child { padding-top: 0; }
.update-card { display: flex; align-items: center; gap: 9px; padding: 6px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); font-size: .9rem; font-weight: 650; text-decoration: none; }
.update-image { flex: 0 0 52px; height: 52px; overflow: hidden; border-radius: 5px; background: var(--brand); }
.update-image img, .update-image amp-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.update-copy { min-width: 0; }
.updates-panel time { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; }
.all-updates { display: inline-block; margin-top: 5px; font-size: .87rem; font-weight: 700; }

.auxiliary-layout .article-panel { max-width: 960px; }
.article-panel, .discussion, .empty-state { padding: clamp(17px, 4vw, 44px); }
.article-header h1 { margin: 10px 0 12px; font-size: clamp(1.95rem, 4vw, 3.3rem); letter-spacing: -.047em; }
.byline { margin: 0; color: var(--muted); }
.article-header { margin-bottom: 24px; }
.entry-content { min-width: 0; font-size: clamp(1rem, 1.6vw, 1.11rem); line-height: 1.72; }
.entry-content > :first-child { margin-top: 0; }
.entry-content img { max-width: 100%; }
.entry-content figure { max-width: 100%; margin-inline: 0; }
.related-tile {
    display: flex;
    align-items: stretch;
    width: min(100%, 720px);
    margin: clamp(24px, 4vw, 32px) auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    text-decoration: none;
}
.related-tile-image { display: grid; flex: 0 0 34%; aspect-ratio: 16 / 9; }
.related-tile-image > img, .related-tile-image > amp-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.related-tile-copy {
    display: grid;
    align-content: center;
    gap: 6px;
    min-width: 0;
    padding: clamp(10px, 2vw, 20px);
    line-height: 1.35;
}
.related-tile time { color: var(--muted); font-size: .8rem; }
.entry-content :is(.wp-block-video, .wp-block-embed-youtube, .wp-block-embed-vimeo, .wp-block-embed-dailymotion, .wp-block-embed-videopress, .wp-block-embed-wordpress-tv, .wp-video, .jetpack-video-wrapper, amp-youtube, amp-vimeo, amp-dailymotion, amp-video, amp-video-iframe) {
    float: none;
    clear: both;
    width: 100% !important;
    max-width: 100%;
    margin-inline: auto;
}
.entry-content :is(video, .wbif-video-embed, .wp-video iframe) {
    display: block;
    width: 100% !important;
    height: auto !important;
    margin-inline: auto;
}
.entry-content :is(.wbif-video-embed, .wp-video iframe) { aspect-ratio: var(--wbif-video-ratio, 16 / 9); }
.entry-content .wp-embed-aspect-9-16 .wbif-video-embed { aspect-ratio: 9 / 16; }
.entry-content .wp-has-aspect-ratio .wp-block-embed__wrapper .wbif-video-embed { height: 100% !important; }
.entry-content figcaption, .wp-caption-text { color: var(--muted); font-size: .88em; }
.entry-content pre, .entry-content .wp-block-table { overflow: auto; }
.entry-content pre { padding: 15px; background: var(--base); }
.entry-content table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 7px; }
.entry-content blockquote { margin-inline: 0; padding-inline: 16px; border-inline-start: 3px solid var(--accent); }
.entry-content .aligncenter { display: block; margin-inline: auto; }
.entry-content .alignleft { float: left; margin: 0 15px 12px 0; }
.entry-content .alignright { float: right; margin: 0 0 12px 15px; }
.entry-content::after { content: ""; display: block; clear: both; }
.article-tags { margin-top: 20px; display: flex; gap: 7px; flex-wrap: wrap; }
.article-tags a, .nav-links .page-numbers {
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--paper);
    text-decoration: none;
}
.article-tags a:hover, .nav-links a:hover { text-decoration: underline; }
.discussion, .article-layout .main-column > .widget { margin-top: 18px; }
.discussion h2 { margin-top: 0; }
.discussion-status:empty { display: none; }
.action {
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1rem;
    font-weight: 650;
    cursor: pointer;
}
.navigation { margin-top: 22px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 7px; }
.nav-links .current { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.post-navigation .nav-links > div { flex: 1 1 235px; }
.post-navigation a { display: block; height: 100%; padding: 12px; border: 1px solid var(--border); background: var(--paper); border-radius: 8px; text-decoration: none; font-weight: 650; }
.post-navigation small { display: block; margin-bottom: 4px; color: var(--muted); font-weight: 500; }
.empty-state h1 { margin-top: 0; }

.site-footer { padding-block: 27px; background: var(--paper); border-top: 1px solid var(--border); }
.footer-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.footer-row p { margin: 3px 0 0; color: var(--muted); font-size: .87rem; }
.footer-brand { color: var(--ink); font-weight: 750; text-decoration: none; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 7px 14px; }
.footer-menu a { color: var(--muted); font-size: .87rem; }
.footer-widgets { display: grid; gap: 12px; margin-bottom: 20px; }
.grecaptcha-badge { visibility: hidden; }
.recaptcha-notice { margin: 18px 0 0; color: var(--muted); font-size: .8rem; }

@media (hover: hover) {
    .story-card:hover, .update-card:hover, .related-tile:hover { background: var(--card-hover); border-color: var(--card-hover-border); }
    .story-lead:hover { background: #194548; }
    .story-lead:hover::before { background: linear-gradient(180deg, #28525522 20%, #091831c9 72%, #091831 100%); }
    .section-tile:hover::after {
        border-radius: inherit;
        box-shadow: inset 0 0 0 1px var(--card-hover-border);
        background: linear-gradient(#ffffff16, #ffffff0d 43%, #000a);
    }
}
@media (max-width: 1180px) {
    .story-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lead-grid { grid-template-columns: minmax(0, 1.37fr) minmax(0, 1fr); }
    .main-layout { gap: 18px; }
    .layout-heading { margin-bottom: -4px; }
}
@media (max-width: 1024px) {
    .main-layout { grid-template-columns: minmax(0, 1fr); }
    .header-top { gap: 12px; }
    .header-search { margin-inline-start: auto; }
    .sidebar-toggle { display: block; }
    .sidebar-backdrop {
        display: block;
        position: fixed;
        z-index: 20;
        inset: 0;
        background: #0006;
        opacity: 0;
        visibility: hidden;
        transition: opacity .22s, visibility .22s;
    }
    .editorial-sidebar {
        position: fixed;
        z-index: 21;
        inset: var(--wp-admin--admin-bar--height, 0px) 0 0 auto;
        width: min(420px, 100%);
        max-height: 100dvh;
        align-content: start;
        overflow: auto;
        overscroll-behavior: contain;
        padding: 0 12px 16px;
        border-inline-start: 1px solid var(--border);
        background: var(--paper);
        box-shadow: var(--shadow), 0 10px 28px #0003;
        transform: translateX(100%);
        visibility: hidden;
        transition: transform .22s ease, visibility .22s;
    }
    body:has(#wbif-sidebar-toggle:checked) { overflow: hidden; }
    body:has(#wbif-sidebar-toggle:checked) .sidebar-backdrop { opacity: 1; visibility: visible; }
    body:has(#wbif-sidebar-toggle:checked) .editorial-sidebar { transform: translateX(0); visibility: visible; }
    .sidebar-drawer-header {
        display: flex;
        position: sticky;
        z-index: 2;
        top: 0;
        justify-content: flex-end;
        align-items: center;
        padding-block: 8px;
        border-bottom: 1px solid var(--border);
        background: var(--paper);
    }
    .sidebar-close {
        position: relative;
        display: block;
        width: 44px;
        height: 44px;
        border: 1px solid var(--border);
        border-radius: 7px;
        background: var(--base);
        color: var(--ink);
        padding: 0;
        cursor: pointer;
    }
    .sidebar-close::before, .sidebar-close::after {
        content: "";
        position: absolute;
        top: 50%;
        left: 50%;
        width: 16px;
        height: 2px;
        border-radius: 1px;
        background: currentColor;
        transform: translate(-50%, -50%) rotate(45deg);
    }
    .sidebar-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
    .sidebar-close:hover { background: var(--accent-soft); }
}
@media (max-width: 680px) {
    .wrap { width: calc(100% - 30px); }
    .header-top { min-height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px; padding-block: 13px; }
    .header-search { grid-area: 2 / 1 / 3 / -1; width: 100%; }
    .sidebar-toggle { grid-area: 1 / 2; }
    .editorial-sidebar { width: 100%; border: 0; padding-inline: max(8px, env(safe-area-inset-right)); }
    .header-search .search-form { max-width: none; }
    .nav-list { gap: 2px 5px; padding-block: 4px; }
    .nav-list a { min-height: 40px; padding-inline: 9px; font-size: .83rem; }
    .nav-list .sub-menu { position: static; width: auto; max-width: none; display: block; border: 0; box-shadow: none; padding: 0 0 0 9px; }
    .main-layout { padding-block: 22px 36px; }
    .section-heading { margin-bottom: 12px; }
    .layout-heading { margin-bottom: -6px; }
    .lead-grid { grid-template-columns: minmax(0, 1fr); }
    .story-lead { min-height: 300px; }
    .story-lead .story-copy { padding: 18px; }
    .story-secondary { min-height: 104px; grid-template-columns: minmax(88px, .65fr) minmax(0, 1.5fr); }
    .story-secondary .story-media img { min-height: 104px; }
    .story-grid { gap: 12px; }
    .story-grid .story-copy { padding: 10px; }
    .story-grid .story-title { font-size: .99rem; }
    .story-excerpt { display: none; }
    .footer-row { flex-direction: column; align-items: flex-start; gap: 14px; }
}
@media (max-width: 360px) {
    .wrap { width: calc(100% - 16px); }
    .story-grid { grid-template-columns: 1fr; }
}
@media (max-width: 318px) {
    .sidebar-banner { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .story-card, .update-card, .related-tile, .editorial-sidebar, .sidebar-backdrop { transition: none; }
}
