/* =========================================================================
   PianetaPc.com — Restyling 2026
   Sistema visivo bianco/blu, editoriale-tech. Vanilla CSS, nessun framework.
   Display: Space Grotesk · Testo: Inter
   ========================================================================= */

:root {
  --ink:        #0b1b33;
  --ink-soft:   #4a627f;
  --ink-faint:  #7d90aa;
  --white:      #ffffff;
  --surface:    #f4f8fd;
  --surface-2:  #e9f1ff;
  --line:       #e2e9f4;
  --line-soft:  #eef3fa;

  --blue:       #1650cf;
  --blue-dark:  #0e3aa0;
  --blue-bright:#2f6bff;

  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 1px 2px rgba(16,58,160,.05), 0 8px 24px rgba(16,58,160,.06);
  --shadow-lg:  0 10px 40px rgba(11,27,51,.12);

  --wrap:       1220px;
  --gap:        28px;

  --font-body:  'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head:  'Space Grotesk', 'Inter', system-ui, sans-serif;
}

/* ---------- Reset ---------- */
*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--blue-dark); }
h1,h2,h3,h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; color: var(--ink); margin: 0 0 .5em; letter-spacing: -.01em; }
ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }

/* =========================================================================
   HEADER / MASTHEAD
   ========================================================================= */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--white); border-bottom: 1px solid var(--line); }
.site-header::before { content: ""; display: block; height: 4px; background: linear-gradient(90deg, var(--blue-dark), var(--blue), var(--blue-bright)); }

.masthead { display: flex; align-items: center; gap: 22px; padding: 16px 0; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img { height: 40px; width: auto; }
.brand .logo-text { font-family: var(--font-head); font-weight: 700; font-size: 25px; letter-spacing: -.02em; color: var(--ink); }
.brand .logo-text b { color: var(--blue); }

.masthead-search { margin-left: auto; }
.search-form { display: flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 4px 4px 16px; min-width: 240px; transition: border-color .15s, box-shadow .15s; }
.search-form:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--surface-2); }
.search-form input { border: 0; background: transparent; outline: none; font: inherit; font-size: 14px; color: var(--ink); width: 100%; }
.search-form input::placeholder { color: var(--ink-faint); }
.search-form button { border: 0; background: var(--blue); color: #fff; width: 34px; height: 34px; border-radius: 999px; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; transition: background .15s; }
.search-form button:hover { background: var(--blue-dark); }

/* ---------- Nav principale con sottocategorie ---------- */
.main-nav { border-top: 1px solid var(--line-soft); background: var(--white); }
.main-nav .wrap { display: flex; }
.nav-list { display: flex; flex-wrap: wrap; align-items: stretch; }
.nav-list > li { position: relative; display: flex; align-items: stretch; }
.nav-list > li.has-sub > a { padding-right: 4px; }
.nav-list > li > a {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 16px;
  font-family: var(--font-head); font-weight: 500; font-size: 14.5px;
  letter-spacing: .01em; color: var(--ink); white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav-list > li > a:hover,
.nav-list > li.is-active > a { color: var(--blue); border-bottom-color: var(--blue); }
.nav-list > li > a .home-i { font-size: 16px; line-height: 1; }
.subnav-toggle { display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; cursor: pointer; color: var(--ink); padding: 0 14px 0 4px; }
.nav-list > li.is-active .subnav-toggle { color: var(--blue); }
.subnav-toggle .caret { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin-top: -3px; opacity: .6; transition: transform .2s ease, margin-top .2s ease; }

/* dropdown */
.subnav {
  position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px; opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s;
  z-index: 120;
}
.nav-list > li:hover .subnav,
.nav-list > li:focus-within .subnav { opacity: 1; visibility: visible; transform: translateY(0); }
.subnav a { display: block; padding: 9px 14px; border-radius: 6px; font-size: 14px; color: var(--ink-soft); }
.subnav a:hover { background: var(--surface-2); color: var(--blue-dark); }

/* ---------- Mobile nav ---------- */
.nav-toggle { display: none; margin-left: auto; border: 1px solid var(--line); background: var(--white); border-radius: var(--radius-sm); width: 44px; height: 44px; cursor: pointer; color: var(--ink); }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { content: ""; display: block; width: 20px; height: 2px; background: currentColor; margin: 0 auto; position: relative; transition: transform .2s ease, top .2s ease, background .2s ease; }
.nav-toggle span::before { position: absolute; top: -6px; left: 0; }
.nav-toggle span::after  { position: absolute; top: 6px;  left: 0; }
body.nav-open .nav-toggle span { background: transparent; }
body.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
body.nav-open .nav-toggle span::after  { top: 0; transform: rotate(-45deg); }

/* =========================================================================
   LAYOUT
   ========================================================================= */
.page { padding: 30px 0 60px; }
.layout { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 44px; align-items: start; }
.section-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 20px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.section-title h1, .section-title h2 { font-size: 22px; margin: 0; }
.section-title .count { font-size: 13px; color: var(--ink-faint); font-family: var(--font-body); }

.page-intro { color: var(--ink-soft); font-size: 15.5px; max-width: 70ch; margin: -6px 0 26px; }

/* =========================================================================
   KICKER / CHIP CATEGORIA
   ========================================================================= */
.kicker {
  display: inline-block; font-family: var(--font-head); font-weight: 600;
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--blue); background: var(--surface-2);
  padding: 4px 10px; border-radius: 999px;
}

/* =========================================================================
   CARD LISTA ARTICOLI
   ========================================================================= */
.article-list { display: flex; flex-direction: column; gap: 20px; }
.post-card {
  display: grid; grid-template-columns: 220px 1fr; gap: 20px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: #d3e0f5; }
.post-card .thumb { position: relative; border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 16/10; background: var(--surface); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .thumb .kicker { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.94); backdrop-filter: blur(4px); }
.post-card .body { display: flex; flex-direction: column; }
.post-card h3 { font-size: 18.5px; margin: 4px 0 8px; }
.post-card h3 a { color: var(--ink); }
.post-card h3 a:hover { color: var(--blue); }
.post-card .meta { font-size: 12.5px; color: var(--ink-faint); font-family: var(--font-head); letter-spacing: .02em; margin-bottom: 8px; }
.post-card .excerpt { font-size: 14.5px; color: var(--ink-soft); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* =========================================================================
   PAGINAZIONE
   ========================================================================= */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 34px 0 0; }
.pagination a, .pagination span {
  min-width: 42px; height: 42px; padding: 0 12px; display: inline-flex;
  align-items: center; justify-content: center; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--white);
  font-family: var(--font-head); font-weight: 500; font-size: 14px; color: var(--ink);
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); background: var(--surface); }
.pagination .current { background: var(--blue); border-color: var(--blue); color: #fff; }
.pagination .disabled { color: var(--ink-faint); opacity: .5; pointer-events: none; }
.pagination .gap { border: 0; background: transparent; min-width: 20px; }

/* =========================================================================
   SIDEBAR
   ========================================================================= */
.sidebar { display: flex; flex-direction: column; gap: 28px; }
.module { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.module > h2 { font-size: 15px; margin: 0; padding: 14px 18px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.module > h2::before { content: ""; width: 4px; height: 16px; background: var(--blue); border-radius: 2px; }
.module .module-body { padding: 8px 18px 16px; }

.side-list li { border-bottom: 1px solid var(--line-soft); }
.side-list li:last-child { border-bottom: 0; }
.side-list a { display: block; padding: 11px 0; font-size: 14px; font-weight: 500; color: var(--ink); }
.side-list a:hover { color: var(--blue); }
.side-list .s-date { display: block; font-size: 12px; color: var(--ink-faint); font-family: var(--font-head); margin-top: 2px; }

.side-thumb { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.side-thumb:last-child { border-bottom: 0; }
.side-thumb img { width: 62px; height: 46px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: var(--surface); }
.side-thumb a { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.35; }
.side-thumb a:hover { color: var(--blue); }

.quote-module .module-body { font-style: italic; color: var(--ink-soft); font-size: 15px; line-height: 1.6; }
.quote-module .module-body::before { content: "“"; font-family: var(--font-head); font-size: 46px; color: var(--surface-2); line-height: 0; display: block; height: 20px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { font-size: 12.5px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); font-weight: 500; }
.chips a:hover { background: var(--surface-2); color: var(--blue-dark); border-color: #cddcf5; }

.ad-slot { border: 1px dashed var(--line); border-radius: var(--radius); background: var(--surface); min-height: 90px; display: grid; place-items: center; color: var(--ink-faint); font-size: 12px; }

/* =========================================================================
   DETTAGLIO ARTICOLO
   ========================================================================= */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-faint); font-family: var(--font-head); margin: 0 0 16px; }
.breadcrumb a { color: var(--ink-soft); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .sep { opacity: .5; }

.article-head h1 { font-size: 34px; line-height: 1.15; margin: 12px 0 14px; }
.article-hero { border-radius: var(--radius); overflow: hidden; margin: 0 0 22px; background: var(--surface); border: 1px solid var(--line); }
.article-hero img { width: 100%; max-height: 460px; object-fit: cover; }
.lead { font-size: 19px; line-height: 1.55; color: var(--ink-soft); font-weight: 400; margin: 0 0 24px; padding-left: 16px; border-left: 3px solid var(--blue); }

.article-body { font-size: 17px; line-height: 1.75; color: #223651; }
.article-body p { margin: 0 0 1.15em; }
.article-body img { border-radius: var(--radius-sm); margin: 10px auto 18px; }
.article-body h2 { font-size: 24px; margin: 1.6em 0 .5em; }
.article-body h3 { font-size: 20px; margin: 1.4em 0 .5em; }
.article-body a { text-decoration: underline; text-underline-offset: 2px; }
.article-body ul, .article-body ol { margin: 0 0 1.15em 1.25em; }
.article-body li { margin-bottom: .4em; }
.article-body blockquote { margin: 1.4em 0; padding: 14px 20px; background: var(--surface); border-left: 3px solid var(--blue); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-soft); }
.article-body iframe, .article-body table { max-width: 100%; }

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 28px 0; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tag-list .lbl { font-family: var(--font-head); font-weight: 600; font-size: 13px; color: var(--ink); margin-right: 4px; }

.author-box { display: flex; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin: 26px 0; }
.author-box img { width: 60px; height: 60px; border-radius: 999px; object-fit: cover; }
.author-box .name { font-family: var(--font-head); font-weight: 600; color: var(--ink); margin: 0; }
.author-box p { margin: 2px 0 0; font-size: 14px; color: var(--ink-soft); }

.video-embed { max-width: 480px; margin: 22px 0; }
.video-embed a { display: block; position: relative; border-radius: var(--radius-sm); overflow: hidden; }
.video-embed .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(11,27,51,.28); color: #fff; font-size: 34px; }

/* blocchi articoli correlati */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 34px 0 0; }
.related-col h2 { font-size: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--line); margin-bottom: 12px; }
.related-col li { padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.related-col li:last-child { border-bottom: 0; }
.related-col a { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.related-col a:hover { color: var(--blue); }

/* =========================================================================
   FOOTER
   ========================================================================= */
.site-footer { background: var(--ink); color: #c3d1e6; margin-top: 60px; }
.site-footer a { color: #dbe6f6; }
.site-footer a:hover { color: #fff; }
.footer-nav { border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-nav ul { display: flex; flex-wrap: wrap; gap: 4px; padding: 14px 0; }
.footer-nav a { display: block; padding: 8px 16px; font-family: var(--font-head); font-size: 14px; border-radius: var(--radius-sm); color: #c3d1e6; }
.footer-nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding: 40px 0; }
.footer-main h3 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-brand .logo-text { font-family: var(--font-head); font-weight: 700; font-size: 24px; color: #fff; }
.footer-brand .logo-text b { color: var(--blue-bright); }
.footer-brand p { font-size: 14px; color: #97a9c4; max-width: 34ch; }
.footer-social { display: flex; gap: 10px; margin-top: 14px; }
.footer-social a { width: 38px; height: 38px; border-radius: 999px; background: rgba(255,255,255,.06); display: grid; place-items: center; color: #dbe6f6; }
.footer-social a:hover { background: var(--blue); color: #fff; }
.footer-main ul li { margin-bottom: 9px; font-size: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 18px 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; color: #8598b5; }

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; gap: 40px; }
  .article-head h1 { font-size: 28px; }
  .related-grid { grid-template-columns: 1fr; gap: 30px; }
  .footer-main { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 720px) {
  .masthead-search { display: none; }
  .nav-toggle { display: block; }
  .main-nav { position: fixed; inset: 0 0 0 auto; width: min(320px, 84vw); background: var(--white);
    transform: translateX(100%); transition: transform .25s ease; box-shadow: var(--shadow-lg);
    z-index: 200; overflow-y: auto; border-top: 0; padding-top: 8px; }
  body.nav-open .main-nav { transform: translateX(0); }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(11,27,51,.4); z-index: 90; }
  .main-nav .wrap { display: block; padding: 0; }
  .nav-list { flex-direction: column; }
  .nav-list > li { border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; align-items: stretch; }
  .nav-list > li > a { flex: 1 1 auto; padding: 15px 22px; border-bottom: 0; justify-content: flex-start; }
  .nav-list > li.has-sub > a { padding-right: 22px; }
  .subnav-toggle { flex: 0 0 auto; width: 56px; padding: 0; border-left: 1px solid var(--line-soft); color: var(--ink-soft); }
  .subnav-toggle .caret { width: 10px; height: 10px; opacity: .8; }
  .subnav { position: static; flex: 1 0 100%; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; border-radius: 0; padding: 0 0 8px 12px; display: none; }
  .nav-list > li.open .subnav { display: block; }
  .nav-list > li.open .subnav-toggle .caret { transform: rotate(-135deg); margin-top: 3px; }
  .post-card { grid-template-columns: 130px 1fr; gap: 14px; }
  .post-card h3 { font-size: 16px; }
  .post-card .excerpt { -webkit-line-clamp: 2; }
}
@media (max-width: 460px) {
  .post-card { grid-template-columns: 1fr; }
  .post-card .thumb { aspect-ratio: 16/9; }
  .article-head h1 { font-size: 24px; }
}

/* Accessibilità */
:focus-visible { outline: 3px solid var(--blue-bright); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto; } }
