/*
Theme Name: TechBoom Minimal
Theme URI: https://techboom.net
Author: Michele Prendin
Author URI: https://techboom.net
Description: Tema minimale e velocissimo per blog di gadget tech e contenuti affiliate. Niente framework, niente jQuery, niente build. Dark mode automatico, box affiliate integrata, ottimizzato per Core Web Vitals.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: techboom-minimal
Tags: minimal, fast, affiliate, blog, two-columns, custom-logo, featured-images, threaded-comments, translation-ready
*/

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  --bg:        #FAFAF6;
  --surface:   #FFFFFF;
  --ink:       #15161A;
  --ink-soft:  #54565E;
  --line:      #E7E6DF;
  --accent:    #C9F227;   /* lime elettrico */
  --accent-ink:#15161A;   /* testo sopra l'accento */
  --link:      #1B6E3C;
  --radius:    14px;
  --maxw:      1140px;
  --readw:     720px;
  --shadow:    0 1px 2px rgba(20,22,26,.04), 0 8px 24px -12px rgba(20,22,26,.12);
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: "Bricolage Grotesque", var(--font-body);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0E0F12;
    --surface:   #16181D;
    --ink:       #F2F2EE;
    --ink-soft:  #A0A2AB;
    --line:      #262A31;
    --accent:    #C9F227;
    --accent-ink:#15161A;
    --link:      #8FE6AC;
    --shadow:    0 1px 2px rgba(0,0,0,.4), 0 12px 30px -14px rgba(0,0,0,.7);
  }
  img { opacity: .94; }
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, picture, svg, video { display: block; max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }

/* ============================================================
   LAYOUT
   ============================================================ */
.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2rem); }
.read { max-width: var(--readw); margin-inline: auto; }
.section { padding-block: clamp(2rem, 5vw, 3.5rem); }

/* ============================================================
   HEADER / MASTHEAD  (reinventato — reset robusto, niente bullet)
   ============================================================ */
.masthead {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 68px;
}

/* Brand */
.masthead__brand { display: inline-flex; align-items: center; }
.masthead__brand img { max-height: 40px; width: auto; }
.brand { text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand__name { font-family: var(--font-head); font-weight: 800; font-size: 1.45rem; letter-spacing: -.02em; color: var(--ink); line-height: 1; display: inline-flex; align-items: center; }
.brand__dot { color: var(--accent-ink); background: var(--accent); border-radius: 6px; padding: 0 .26em; margin-left: .12em; }
.brand__tag { display: block; font-family: var(--font-body); font-weight: 600; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }

/* Nav — HARD reset così nessun bullet o margine ereditato può comparire */
.site-nav__list,
.site-nav__list li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.site-nav__list {
  display: flex; align-items: center; gap: .35rem; flex-wrap: wrap;
}
.site-nav__list li { position: relative; }
.site-nav__list a {
  position: relative; display: inline-flex; align-items: center;
  font-family: var(--font-head); font-weight: 600; font-size: .96rem; letter-spacing: -.01em;
  color: var(--ink-soft); padding: .5rem .35rem; text-decoration: none;
  transition: color .18s ease;
}
/* underline lime che scorre da sinistra */
.site-nav__list a::after {
  content: ""; position: absolute; left: .35rem; right: .35rem; bottom: .15rem; height: 2px;
  background: var(--accent); border-radius: 2px;
  transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.site-nav__list a:hover { color: var(--ink); text-decoration: none; }
.site-nav__list a:hover::after { transform: scaleX(1); }
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a,
.site-nav__list .current-cat > a {
  color: var(--ink);
}
.site-nav__list .current-menu-item > a::after,
.site-nav__list .current_page_item > a::after,
.site-nav__list .current-cat > a::after { transform: scaleX(1); }

/* Hamburger animato */
.masthead__toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 10px; cursor: pointer;
  background: none; border: 1px solid var(--line); border-radius: 10px;
}
.masthead__toggle-bar { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .25s ease, opacity .2s ease; }
.masthead__toggle.is-active .masthead__toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.masthead__toggle.is-active .masthead__toggle-bar:nth-child(2) { opacity: 0; }
.masthead__toggle.is-active .masthead__toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 760px) {
  .masthead__toggle { display: flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); border-bottom: 1px solid var(--line);
    padding: .5rem clamp(1rem, 4vw, 2rem) 1rem;
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav__list li + li { border-top: 1px solid var(--line); }
  .site-nav__list a { display: flex; padding: .85rem .25rem; font-size: 1.05rem; }
  .site-nav__list a::after { display: none; }
  .site-nav__list .current-menu-item > a,
  .site-nav__list .current_page_item > a { color: var(--accent-ink); }
  .site-nav__list .current-menu-item > a { box-shadow: inset 3px 0 0 var(--accent); padding-left: .75rem; }
}

/* ============================================================
   HERO / ARCHIVE HEADER
   ============================================================ */
.page-hero { padding-block: clamp(2rem, 5vw, 3rem) 1rem; }
.page-hero h1 { font-family: var(--font-head); font-weight: 800; letter-spacing: -.03em; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; }
.page-hero p { color: var(--ink-soft); margin-top: .6rem; max-width: 54ch; }

/* ============================================================
   POST GRID (archive / home)
   ============================================================ */
.grid {
  display: grid; gap: clamp(1.25rem, 3vw, 2rem);
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: clip; display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.card__media { aspect-ratio: 16 / 10; overflow: hidden; background: var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__cat { font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--link); }
.card__title { font-family: var(--font-head); font-weight: 700; letter-spacing: -.02em; font-size: 1.25rem; line-height: 1.2; }
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--link); text-decoration: none; }
.card__excerpt { color: var(--ink-soft); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin-top: auto; padding-top: .4rem; font-size: .82rem; color: var(--ink-soft); }

/* ============================================================
   SINGLE / PAGE
   ============================================================ */
.entry-header { padding-block: clamp(1.5rem, 4vw, 2.5rem) .5rem; }
.entry-header .cat { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--link); }
.entry-title { font-family: var(--font-head); font-weight: 800; letter-spacing: -.03em; font-size: clamp(1.9rem, 4.5vw, 2.9rem); line-height: 1.08; margin-top: .4rem; }
.entry-meta { color: var(--ink-soft); font-size: .9rem; margin-top: .9rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.featured { margin-block: 1.5rem; border-radius: var(--radius); overflow: clip; border: 1px solid var(--line); }

.entry-content { font-size: 1.12rem; line-height: 1.75; }
.entry-content > * + * { margin-top: 1.15rem; }
.entry-content h2 { font-family: var(--font-head); font-weight: 700; letter-spacing: -.02em; font-size: 1.7rem; line-height: 1.2; margin-top: 2.4rem; }
.entry-content h3 { font-family: var(--font-head); font-weight: 700; font-size: 1.32rem; margin-top: 1.8rem; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; }
.entry-content li + li { margin-top: .4rem; }
.entry-content img { border-radius: var(--radius); margin-block: 1.5rem; }
.entry-content blockquote { border-left: 3px solid var(--accent); padding: .2rem 0 .2rem 1.2rem; color: var(--ink-soft); font-size: 1.15rem; }
.entry-content code { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: .1em .4em; font-size: .9em; }
.entry-content pre { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; overflow-x: auto; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: .6rem .8rem; text-align: left; }
.entry-content th { background: var(--surface); }

.tags { margin-top: 2.5rem; display: flex; flex-wrap: wrap; gap: .5rem; }
.tags a { font-size: .82rem; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: .25rem .8rem; }
.tags a:hover { color: var(--ink); text-decoration: none; border-color: var(--accent); }

/* ============================================================
   AFFILIATE BOX  [deal] shortcode
   ============================================================ */
.deal {
  --pad: clamp(1.1rem, 3vw, 1.6rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; grid-template-columns: 200px 1fr; gap: var(--pad);
  padding: var(--pad); margin-block: 2rem; position: relative; overflow: hidden;
}
.deal::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.deal__media { border-radius: 10px; overflow: hidden; align-self: start; background: var(--line); }
.deal__media img { width: 100%; aspect-ratio: 1; object-fit: cover; margin: 0; border-radius: 0; }
.deal__body { display: flex; flex-direction: column; gap: .5rem; }
.deal__badge { align-self: flex-start; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--accent); color: var(--accent-ink); padding: .22rem .6rem; border-radius: 6px; }
.deal__title { font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
.deal__rating { color: var(--ink-soft); font-size: .9rem; display: flex; align-items: center; gap: .4rem; }
.deal__stars { color: #E8A317; letter-spacing: 1px; }
.deal__desc { color: var(--ink-soft); font-size: .96rem; margin: 0; }
.deal__cols { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.5rem; margin: .4rem 0; }
.deal__cols ul { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.deal__cols li { display: flex; gap: .45rem; align-items: flex-start; margin-top: .25rem; line-height: 1.35; }
.deal__cols .pros li::before { content: "+"; color: var(--link); font-weight: 800; }
.deal__cols .cons li::before { content: "–"; color: #C04545; font-weight: 800; }
.deal__foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.deal__price { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; }
.deal__price small { font-size: .8rem; font-weight: 500; color: var(--ink-soft); text-decoration: line-through; margin-left: .4rem; }
.btn {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); font-weight: 800; font-size: 1rem;
  padding: .7rem 1.4rem; border: none; border-radius: 999px; text-decoration: none;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(.95); text-decoration: none; }
.btn svg { width: 18px; height: 18px; }
.deal__disc { font-size: .74rem; color: var(--ink-soft); margin-top: .2rem; }
@media (max-width: 560px) {
  .deal { grid-template-columns: 1fr; }
  .deal__media { max-width: 160px; }
  .deal__cols { grid-template-columns: 1fr; }
}

/* ============================================================
   PAGINATION / SEARCH / COMMENTS
   ============================================================ */
.pagination { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; margin-top: 3rem; }
.pagination .page-numbers { padding: .5rem .85rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-soft); font-weight: 600; }
.pagination .current { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.pagination a:hover { border-color: var(--accent); text-decoration: none; color: var(--ink); }

.search-form { display: flex; gap: .5rem; }
.search-form input[type="search"] { flex: 1; padding: .6rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.search-form button { padding: .6rem 1.1rem; border: none; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; }

.comments { margin-top: 3rem; }
.comment-list { list-style: none; padding: 0; }
.comment-list li { border-top: 1px solid var(--line); padding: 1.2rem 0; }
.comment-form input, .comment-form textarea { width: 100%; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); margin-top: .4rem; }
.comment-form p { margin-top: 1rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { border-top: 1px solid var(--line); margin-top: 4rem; }
.site-footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-block: 2rem; color: var(--ink-soft); font-size: .9rem; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--ink); }
.footer-nav__list, .footer-nav__list li { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.footer-nav__list { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.footer-nav__list a { font-weight: 600; }

/* ============================================================
   UTIL / A11Y
   ============================================================ */
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { left: 1rem; top: 1rem; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* subtle staggered load-in */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card { animation: rise .4s ease both; }
.grid .card:nth-child(2) { animation-delay: .04s; }
.grid .card:nth-child(3) { animation-delay: .08s; }
.grid .card:nth-child(4) { animation-delay: .12s; }
.grid .card:nth-child(5) { animation-delay: .16s; }
.grid .card:nth-child(6) { animation-delay: .2s; }
