/*
Theme Name: Lavori e Concorsi News
Theme URI: https://lavorieconcorsi.it/
Author: Rocco Belfiore · Web Developer
Description: Tema editoriale in stile news moderno. Home componibile a sezioni dal Personalizza (drag & drop, anteprima live), header e footer gestiti con i Menu nativi di WordPress, archivi con scroll infinito SEO-friendly (paginazione reale crawlabile), lettura continua negli articoli.
Version: 5.0.0
Requires at least: 6.0
Tested up to: 6.8
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: lavori-e-concorsi-news
*/

/* ---------- Variabili (sovrascritte dal Personalizza) ---------- */
:root{
  --lc-primary:#1a73e8;--lc-text:#202124;--lc-muted:#5f6368;--lc-bg:#ffffff;--lc-soft:#f8f9fa;--lc-border:#e5e7eb;
  --lc-header-bg:#ffffff;--lc-footer-bg:#fafafa;--lc-max:1240px;--lc-radius:14px;--lc-font-size:16px;
  --lc-font:Arial,Helvetica,sans-serif;--lc-font-heading:var(--lc-font);
  --lc-primary-soft:#e8f0fe;--lc-primary-strong:#174ea6
}
@supports (color:color-mix(in srgb,red,blue)){
  :root{--lc-primary-soft:color-mix(in srgb,var(--lc-primary) 12%,var(--lc-bg));--lc-primary-strong:color-mix(in srgb,var(--lc-primary) 72%,#000)}
}

/* ---------- Base ---------- */
*{box-sizing:border-box}
html{scroll-behavior:smooth;font-size:var(--lc-font-size)}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{animation:none!important;transition:none!important}}
body{margin:0;background:var(--lc-bg);color:var(--lc-text);font-family:var(--lc-font);font-size:1rem;line-height:1.55;-webkit-font-smoothing:antialiased}
h1,h2,h3,h4,.section-title,.post-card-title,.article-title{font-family:var(--lc-font-heading)}
a{color:inherit;text-decoration:none}
a:hover{color:var(--lc-primary)}
a:focus-visible,button:focus-visible,input:focus-visible{outline:2px solid var(--lc-primary);outline-offset:2px}
img{display:block;max-width:100%;height:auto}
.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!important;width:1px;word-wrap:normal!important}
.skip-link:focus{clip:auto;clip-path:none;height:auto;width:auto;margin:0;left:12px;top:12px;z-index:1000;background:#fff;color:var(--lc-text);padding:10px 14px;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,.2)}
.site-shell{min-height:100vh;display:flex;flex-direction:column}
.site-main{flex:1}
.lc-container{width:min(calc(100% - 32px),var(--lc-max));margin-inline:auto}

/* ---------- Top bar ---------- */
.topbar{background:var(--lc-soft);border-bottom:1px solid var(--lc-border);font-size:.8rem}
.topbar-menu{list-style:none;margin:0;padding:6px 0;display:flex;gap:18px;justify-content:flex-end;flex-wrap:wrap}
.topbar-menu a{color:var(--lc-muted)}

/* ---------- Header ---------- */
.site-header{background:var(--lc-header-bg);border-bottom:1px solid var(--lc-border);z-index:100}
.site-header.is-sticky{position:sticky;top:0}
.admin-bar .site-header.is-sticky{top:32px}
@media(max-width:782px){.admin-bar .site-header.is-sticky{top:46px}}
@media(max-width:600px){.admin-bar .site-header.is-sticky{top:0}}
.header-main{height:70px;display:flex;align-items:center;gap:22px}
.menu-toggle{display:none;border:0;background:transparent;color:inherit;font-size:1.5rem;line-height:1;padding:6px;cursor:pointer;border-radius:8px}
.site-brand{display:flex;align-items:center;gap:10px;min-width:max-content}
.site-brand .custom-logo{max-height:42px;width:auto}
.brand-text{font-size:1.375rem;font-weight:700;letter-spacing:-.5px}
.header-search{margin-left:auto;display:flex;align-items:center;border:1px solid var(--lc-border);background:var(--lc-soft);border-radius:24px;overflow:hidden;width:min(360px,38vw)}
.header-search input{border:0;outline:0;background:transparent;padding:10px 14px;width:100%;font:inherit;font-size:.875rem;color:inherit}
.header-search button{border:0;background:transparent;color:inherit;padding:0 14px;cursor:pointer;font-size:1.05rem;align-self:stretch}
.category-bar{border-top:1px solid var(--lc-border);overflow-x:auto;scrollbar-width:none}
.category-bar::-webkit-scrollbar{display:none}
.category-list{list-style:none;margin:0;display:flex;gap:6px;min-width:max-content;padding:8px 0}
.category-list li{margin:0}
.category-list a{display:block;padding:7px 13px;border-radius:20px;color:var(--lc-muted);font-size:.875rem;white-space:nowrap}
.category-list a:hover,.category-list .current-menu-item>a,.category-list .current-menu-ancestor>a,.category-list .current-category-ancestor>a{background:var(--lc-primary-soft);color:var(--lc-primary-strong)}
.mobile-nav{border-top:1px solid var(--lc-border)}
.mobile-nav[hidden]{display:none}
.mobile-menu{list-style:none;margin:0;padding:8px 0 14px}
.mobile-menu a{display:block;padding:9px 0;font-weight:600}
.mobile-menu .sub-menu{list-style:none;margin:0 0 6px;padding-left:16px}
.mobile-menu .sub-menu a{font-weight:400;color:var(--lc-muted);padding:6px 0}
.mobile-menu--secondary{border-top:1px solid var(--lc-border);padding-top:8px}
.mobile-menu--secondary a{font-weight:400;font-size:.875rem;color:var(--lc-muted)}
.header-after{padding-top:16px}

/* ---------- Layout generale ---------- */
.site-main{padding:28px 0 60px}
.breadcrumbs{font-size:.8rem;color:var(--lc-muted);margin-bottom:16px}
.breadcrumbs ol{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px}
.breadcrumbs li+li::before{content:"›";margin-right:6px}
.breadcrumbs a:hover{text-decoration:underline}
.archive-header{margin-bottom:24px}
.archive-kicker,.section-kicker{font-size:.75rem;font-weight:700;color:var(--lc-primary);letter-spacing:.04em;margin-bottom:5px}
.archive-description{font-size:1.05rem;color:var(--lc-muted);max-width:75ch}
.archive-description p{margin:.5em 0 0}
.section-head{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;border-bottom:1px solid var(--lc-border);padding-bottom:9px;margin:0 0 18px}
.section-title{font-size:1.5rem;line-height:1.2;margin:0;letter-spacing:-.4px}
.section-link{font-size:.8rem;color:var(--lc-primary);font-weight:600;white-space:nowrap}
.section-link:hover{text-decoration:underline}
.section-block{margin-bottom:40px}
.topic-row{display:flex;gap:8px;overflow-x:auto;padding:2px 0 14px;scrollbar-width:none}
.topic-row::-webkit-scrollbar{display:none}
.topic-link{font-size:.8rem;border:1px solid var(--lc-border);border-radius:18px;padding:6px 11px;white-space:nowrap}
.topic-link:hover{border-color:var(--lc-primary)}
.home-h1{font-size:1.75rem;line-height:1.2;margin:0 0 22px;letter-spacing:-.5px}
.lc-section--tinted{background:var(--lc-soft);border-radius:var(--lc-radius);padding:22px}
.lc-section-empty{padding:16px;border:1px dashed var(--lc-border);border-radius:10px;color:var(--lc-muted);font-size:.875rem;margin-bottom:24px}
@media(max-width:640px){.lc-vis-desktop{display:none!important}}
@media(min-width:641px){.lc-vis-mobile{display:none!important}}

/* ---------- Card articolo (varianti) ---------- */
.post-meta{font-size:.75rem;color:var(--lc-muted);display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.post-meta a:hover{text-decoration:underline}
.post-category{color:var(--lc-primary);font-size:.75rem;font-weight:700}
.post-card{min-width:0}
.post-card-media{display:block}
.post-card-image{width:100%;aspect-ratio:16/9;object-fit:cover;border-radius:calc(var(--lc-radius) - 2px);background:var(--lc-soft)}
.post-card-body{min-width:0}
.post-card-title{font-size:1.125rem;line-height:1.28;margin:5px 0 6px;font-weight:700;letter-spacing:-.2px}
.post-excerpt{font-size:.875rem;color:var(--lc-muted);margin:6px 0 0}
.post-card--card .post-card-body,.post-card--compact .post-card-body{margin-top:10px}
.post-card--hero .post-card-image{border-radius:var(--lc-radius)}
.post-card--hero .post-card-body{margin-top:13px}
.post-card--hero .post-card-title{font-size:1.875rem;line-height:1.15;letter-spacing:-.8px;margin:5px 0 8px}
.post-card--hero .post-excerpt{font-size:.95rem}
.post-card--side{display:grid;grid-template-columns:1fr 112px;gap:14px;padding:15px 0;border-bottom:1px solid var(--lc-border)}
.post-card--side .post-card-media{order:2}
.post-card--side .post-card-image{aspect-ratio:auto;height:78px;border-radius:10px}
.post-card--side .post-card-title{font-size:1rem;line-height:1.25}
.post-card--row{display:grid;grid-template-columns:230px 1fr;gap:18px;padding-bottom:18px;border-bottom:1px solid var(--lc-border)}
.post-card--row .post-card-image{aspect-ratio:auto;height:145px}
.post-card--row .post-card-title{font-size:1.25rem;line-height:1.25}
.post-card--row:not(:has(.post-card-media)),.post-card--side:not(:has(.post-card-media)){grid-template-columns:1fr}

/* ---------- Griglie ---------- */
.lead-grid{display:grid;grid-template-columns:1.65fr 1fr;gap:24px}
.lead-grid--single{grid-template-columns:1fr}
.side-list{border-top:1px solid var(--lc-border)}
.news-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:22px 20px}
.news-grid.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.news-grid.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
.news-grid.cols-4 .post-card-title{font-size:1rem}
.mixed-grid{display:grid;grid-template-columns:1.3fr 1fr;gap:24px}
.mixed-grid .post-card--card .post-card-title{font-size:1.4rem}
.mixed-list{border-top:1px solid var(--lc-border)}
.latest-feed{display:grid;gap:18px}
.columns-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:24px}
.topic-col{border-top:3px solid var(--lc-primary);padding-top:10px}
.topic-col-title{font-size:1.05rem;margin:0 0 8px}
.topic-col ul{list-style:none;margin:0;padding:0}
.topic-col li{padding:9px 0;border-bottom:1px solid var(--lc-border)}
.topic-col li a{font-weight:600;line-height:1.3;display:block}
.topic-col time{font-size:.72rem;color:var(--lc-muted)}

/* ---------- CTA / HTML / widget ---------- */
.lc-cta{display:grid;grid-template-columns:1fr;gap:20px;align-items:center;padding:26px;border-radius:var(--lc-radius);background:var(--lc-primary-soft)}
.lc-cta.has-image{grid-template-columns:180px 1fr}
.lc-cta--primary{background:var(--lc-primary);color:#fff}
.lc-cta--outline{background:transparent;border:1px solid var(--lc-border)}
.lc-cta-image{border-radius:10px;width:100%;height:auto}
.lc-cta-title{font-size:1.4rem;line-height:1.2;margin:0 0 8px}
.lc-cta-text{color:inherit;opacity:.9}
.lc-cta-text p{margin:0 0 .6em}
.lc-cta-button{display:inline-block;margin-top:8px;padding:10px 18px;border-radius:24px;background:var(--lc-primary);color:#fff;font-weight:700}
.lc-cta-button:hover{color:#fff;filter:brightness(1.08)}
.lc-cta--primary .lc-cta-button{background:#fff;color:var(--lc-primary)}
.lc-html,.home-widgets{min-width:0}
.widget{margin-bottom:24px}
.widget-title{font-size:1rem;margin:0 0 10px}

/* ---------- Archivi / scroll infinito ---------- */
.archive-stream{margin-top:8px}
.lc-page-marker{grid-column:1/-1;height:0;margin:0;padding:0}
.load-sentinel{height:2px}
.load-more-status{text-align:center;color:var(--lc-muted);font-size:.8rem;padding:18px;display:none}
.load-more-status.is-visible{display:block}
.load-spinner{display:inline-block;width:18px;height:18px;border:2px solid var(--lc-border);border-top-color:var(--lc-primary);border-radius:50%;animation:lc-spin .8s linear infinite;vertical-align:-4px;margin-right:7px}
@keyframes lc-spin{to{transform:rotate(360deg)}}
.lc-load-more{display:block;margin:26px auto 0;padding:11px 22px;border-radius:24px;border:1px solid var(--lc-border);background:var(--lc-bg);color:var(--lc-primary);font:inherit;font-weight:700;cursor:pointer}
.lc-load-more:hover{background:var(--lc-primary-soft)}
.lc-load-more[hidden]{display:none}
.pagination{margin:32px 0}
.pagination ul{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;list-style:none;padding:0;margin:0}
.pagination a,.pagination span{display:inline-block;padding:8px 12px;border:1px solid var(--lc-border);border-radius:8px}
.pagination .current{background:var(--lc-primary-soft);border-color:var(--lc-primary-soft);color:var(--lc-primary-strong);font-weight:700}
.pagination[hidden]{display:none}

/* ---------- Articolo ---------- */
.single-stream{max-width:850px;margin:0 auto}
.article{max-width:850px;margin:0 auto 55px;padding-bottom:45px;border-bottom:1px solid var(--lc-border)}
.article-stream-label{font-size:.72rem;letter-spacing:.06em;color:var(--lc-primary);font-weight:700;margin-bottom:8px}
.article-title{font-size:2.75rem;line-height:1.1;letter-spacing:-1.2px;margin:8px 0 12px}
.article-featured{margin:24px 0}
.article-featured img{width:100%;border-radius:var(--lc-radius)}
.article-featured figcaption{font-size:.75rem;color:var(--lc-muted);margin-top:6px}
.article-content{font-size:1.125rem;line-height:1.75;overflow-wrap:break-word}
.article-content h2{font-size:1.8rem;line-height:1.2;margin-top:36px}
.article-content h3{font-size:1.45rem;margin-top:28px}
.article-content img{border-radius:10px}
.article-content a{color:var(--lc-primary);text-decoration:underline;text-underline-offset:2px}
.article-content table{width:100%;border-collapse:collapse;display:block;overflow-x:auto}
.article-content th,.article-content td{border:1px solid var(--lc-border);padding:8px}
.article-tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:26px}
.article-tags a{font-size:.8rem;border:1px solid var(--lc-border);border-radius:18px;padding:5px 11px}
.share-links{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:22px;font-size:.8rem}
.share-links>span{color:var(--lc-muted);margin-right:4px}
.share-links a,.share-links button{border:1px solid var(--lc-border);border-radius:18px;padding:5px 12px;background:var(--lc-bg);color:inherit;font:inherit;cursor:pointer}
.share-links a:hover,.share-links button:hover{border-color:var(--lc-primary);color:var(--lc-primary)}
.share-links [hidden]{display:none}
.related-block{margin-top:32px;padding:20px;background:var(--lc-soft);border-radius:var(--lc-radius)}
.related-title{font-size:1.05rem;margin:0 0 10px}
.related-block ul{list-style:none;margin:0;padding:0}
.related-block li{padding:8px 0;border-bottom:1px solid var(--lc-border)}
.related-block li:last-child{border-bottom:0}
.related-block a{font-weight:600}
.article-open{margin-top:25px;font-size:.8rem}
.article-open a{color:var(--lc-primary);font-weight:700}
.single-after{margin-top:28px}
.page-links{margin-top:24px;font-weight:600}

/* ---------- Footer ---------- */
.footer-widgets{border-top:1px solid var(--lc-border);padding:28px 0}
.footer-widgets-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:24px}
.site-footer{border-top:1px solid var(--lc-border);background:var(--lc-footer-bg);padding:34px 0 18px;color:var(--lc-muted);font-size:.8rem}
.footer-grid{display:grid;grid-template-columns:2fr repeat(3,1fr);gap:30px}
.footer-grid.cols-1{grid-template-columns:1fr}
.footer-grid.cols-2{grid-template-columns:2fr 1fr}
.footer-grid.cols-3{grid-template-columns:2fr 1fr 1fr}
.footer-title{font-weight:700;color:var(--lc-text);margin-bottom:8px;font-size:.875rem}
.footer-about p{margin:0 0 .6em}
.footer-menu{list-style:none;padding:0;margin:0;display:grid;gap:6px}
.social-links{list-style:none;padding:0;margin:12px 0 0;display:flex;flex-wrap:wrap;gap:8px}
.social-links a{display:inline-block;border:1px solid var(--lc-border);border-radius:18px;padding:4px 11px;background:var(--lc-bg)}
.footer-bottom{display:flex;flex-wrap:wrap;gap:12px 24px;align-items:center;justify-content:space-between;border-top:1px solid var(--lc-border);margin-top:26px;padding-top:16px}
.legal-menu{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:16px}
.back-to-top{font-weight:600}

/* ---------- Varie ---------- */
.empty-state{text-align:center;padding:50px 20px;border:1px dashed var(--lc-border);border-radius:var(--lc-radius);color:var(--lc-muted)}
.search-form{display:flex;gap:8px;justify-content:center;margin:18px 0}
.search-form input[type=search]{padding:10px 14px;border:1px solid var(--lc-border);border-radius:24px;font:inherit;min-width:0;width:min(360px,100%)}
.search-form input[type=submit],.search-form button{padding:10px 18px;border-radius:24px;border:0;background:var(--lc-primary);color:#fff;font:inherit;font-weight:700;cursor:pointer}
.alignwide{max-width:var(--lc-max)}
.alignfull{width:100%}
.wp-caption-text,.wp-element-caption{font-size:.8rem;color:var(--lc-muted)}

/* ---------- Responsive ---------- */
@media(max-width:1000px){
  .news-grid.cols-4{grid-template-columns:repeat(3,minmax(0,1fr))}
  .footer-grid,.footer-grid.cols-3{grid-template-columns:1fr 1fr}
}
@media(max-width:900px){
  .lead-grid,.mixed-grid{grid-template-columns:1fr}
  .news-grid,.news-grid.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}
  .header-search{width:260px}
  .article-title{font-size:2.25rem}
}
@media(min-width:641px){.mobile-nav{display:none!important}}
@media(max-width:640px){
  .lc-container{width:min(calc(100% - 22px),var(--lc-max))}
  .header-main{height:62px;gap:10px}
  .menu-toggle{display:block}
  .brand-text{font-size:1.1rem}
  .site-brand .custom-logo{max-height:34px}
  .header-search{width:auto;flex:1;max-width:none}
  .header-search input{min-width:0}
  .category-bar{display:none}
  .site-main{padding-top:18px}
  .home-h1{font-size:1.4rem}
  .post-card--hero .post-card-title{font-size:1.55rem}
  .news-grid,.news-grid.cols-2,.news-grid.cols-4{grid-template-columns:1fr 1fr;gap:18px 14px}
  .post-card-title{font-size:1rem}
  .news-grid .post-excerpt{display:none}
  .post-card--side{grid-template-columns:1fr 92px}
  .post-card--side .post-card-image{height:66px}
  .post-card--row{grid-template-columns:120px 1fr;gap:12px}
  .post-card--row .post-card-image{height:82px}
  .post-card--row .post-card-title{font-size:1rem}
  .post-card--row .post-excerpt{display:none}
  .lc-cta.has-image{grid-template-columns:1fr}
  .lc-section--tinted{padding:16px}
  .article-title{font-size:1.95rem}
  .article-content{font-size:1.06rem}
  .footer-grid,.footer-grid.cols-2,.footer-grid.cols-3{grid-template-columns:1fr}
  .section-title{font-size:1.3rem}
}
