/*
Theme Name: Pensaci e Risparmia
Theme URI: https://pensacierisparmia.it
Author: Biagio
Description: Tema minimalista editoriale per pensacierisparmia.it
Version: 1.1
License: GNU General Public License v2
Text Domain: pensacierisparmia
*/

/* ─── RESET & BASE ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #FFFFFF;
  --bg-alt:    #F5F5F5;
  --text:      #1A1817;
  --muted:     #8C867C;
  --accent:    #2B4A36;
  --accent-lt: #3D6B4F;
  --border:    #E5E5E5;
  --white:     #FFFFFF;

  --font-sans: 'Figtree', 'Helvetica Neue', sans-serif;

  --max-w: 720px;
  --nav-h: 64px;
}

html { scroll-behavior: smooth; font-size: 150%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }

/* ─── HEADER ───────────────────────────────────────── */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 5vw, 60px);
  justify-content: space-between;
}

.site-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  cursor: pointer;
  text-decoration: none;
}
.site-name {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  letter-spacing: -0.01em;
  color: var(--text);
  transition: color .2s;
}
.site-brand:hover .site-name { color: var(--accent); }
.site-tagline {
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 300;
}

/* ─── HAMBURGER ─────────────────────────────────────── */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 5px;
  padding: 4px;
}
.hamburger span {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: all .35s cubic-bezier(.4,0,.2,1);
}
.hamburger span:nth-child(1) { width: 22px; }
.hamburger span:nth-child(2) { width: 16px; }
.hamburger span:nth-child(3) { width: 22px; }

.hamburger.open span:nth-child(1) { width: 22px; transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { width: 22px; transform: translateY(-6.5px) rotate(-45deg); }

/* ─── MENU OVERLAY ──────────────────────────────────── */
.menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.menu-overlay.open { opacity: 1; pointer-events: all; }
.menu-overlay .menu-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2.5rem;
  font-weight: 400;
}
.menu-overlay nav { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.menu-overlay nav a {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 300;
  color: var(--text);
  letter-spacing: -0.02em;
  padding: 0.1em 0.3em;
  position: relative;
  transition: color .2s;
}
.menu-overlay nav a::after {
  content: '';
  position: absolute;
  bottom: 0.1em;
  left: 0.3em;
  right: 0.3em;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .25s ease;
  transform-origin: left;
}
.menu-overlay nav a:hover { color: var(--accent); }
.menu-overlay nav a:hover::after { transform: scaleX(1); }

/* ─── LAYOUT PRINCIPALE ─────────────────────────────── */
#page { display: flex; flex-direction: column; flex: 1; }

main.site-main {
  flex: 1;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(40px, 8vw, 80px) clamp(20px, 5vw, 0px);
  animation: fadeUp .5s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── HOME: HERO ─────────────────────────────────────── */
.home-hero {
  padding-bottom: 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 48px;
}
.home-hero-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 400;
  margin-bottom: 12px;
  display: block;
}
.home-hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 6vw, 2.8rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 520px;
}
.home-hero h1 em {
  font-style: normal;
  font-weight: 600;
  color: var(--accent);
}

/* ─── ARTICOLI: LISTA ───────────────────────────────── */
.articles-header {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 28px;
  font-weight: 400;
}

.article-list { display: flex; flex-direction: column; }

.article-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0 20px;
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  border-radius: 4px;
  transition: background .15s, padding .15s, margin .15s;
  text-decoration: none;
  color: inherit;
}
.article-item:first-child { border-top: 1px solid var(--border); }
.article-item:hover { background: var(--bg-alt); margin: 0 -12px; padding-left: 12px; padding-right: 12px; }

.article-date {
  grid-column: 1;
  grid-row: 1 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 3px;
}
.article-date .day {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  font-weight: 300;
  line-height: 1;
  color: var(--accent);
}
.article-date .month {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 400;
}

.article-meta {
  grid-column: 2;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 400;
}

.article-title {
  grid-column: 2;
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: color .2s;
  margin-bottom: 8px;
}
.article-item:hover .article-title { color: var(--accent); }

.article-excerpt {
  grid-column: 2;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: 300;
}

.article-cta {
  grid-column: 2;
  margin-top: 10px;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}
.article-cta .arrow { transition: transform .2s; display: inline-block; }
.article-item:hover .article-cta .arrow { transform: translateX(4px); }

/* ─── ARTICOLO SINGOLO ───────────────────────────────── */
.post-header { margin-bottom: 36px; border-bottom: 1px solid var(--border); padding-bottom: 32px; }
.post-category {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 14px;
  display: block;
}
.post-title {
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
}
.post-meta { font-size: 0.72rem; color: var(--muted); letter-spacing: 0.04em; font-weight: 300; }

.post-content {
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  line-height: 1.85;
  font-weight: 300;
}
.post-content p { margin-bottom: 1.4em; }
.post-content h2 {
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  font-weight: 600;
  margin: 2.5em 0 0.8em;
  letter-spacing: -0.02em;
}
.post-content h3 {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  font-weight: 500;
  margin: 2em 0 0.6em;
}
.post-content a { color: var(--accent); border-bottom: 1px solid var(--border); transition: border-color .2s; }
.post-content a:hover { border-color: var(--accent); }
.post-content blockquote {
  margin: 2em 0;
  padding: 20px 24px;
  background: var(--bg-alt);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
  font-size: 1.05rem;
  line-height: 1.65;
  font-weight: 300;
}
.post-content strong { font-weight: 600; }
.post-content ul, .post-content ol { padding-left: 1.4em; margin-bottom: 1.4em; }
.post-content li { margin-bottom: 0.4em; }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.post-nav a { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; transition: color .2s; max-width: 45%; font-weight: 300; }
.post-nav a:hover { color: var(--accent); }
.post-nav .nav-label { display: block; font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 4px; font-weight: 500; }
.post-nav .nav-next { text-align: right; }

/* ─── ABOUT ──────────────────────────────────────────── */
.about-eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 14px;
  display: block;
}
.about-title {
  font-family: var(--font-sans);
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 36px;
}
.about-divider { width: 32px; height: 1px; background: var(--accent); margin-bottom: 36px; }
.about-body { font-size: clamp(0.95rem, 2.2vw, 1.05rem); line-height: 1.85; max-width: 600px; font-weight: 300; }
.about-body p + p { margin-top: 1.4em; }
.about-body strong { font-weight: 600; color: var(--accent); }
.about-body a { color: var(--accent); border-bottom: 1px solid var(--border); transition: border-color .2s; }
.about-body a:hover { border-color: var(--accent); }

.about-manifesto {
  margin-top: 48px;
  padding: 28px 32px;
  background: var(--bg-alt);
  border-left: 2px solid var(--accent);
  border-radius: 0 4px 4px 0;
}
.about-manifesto p {
  font-family: var(--font-sans);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 300;
  line-height: 1.65;
}
.about-manifesto cite {
  display: block;
  margin-top: 12px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-style: normal;
  font-weight: 400;
}

/* ─── FOOTER ─────────────────────────────────────────── */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: clamp(20px, 4vw, 32px) clamp(20px, 5vw, 60px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-copy { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.04em; }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.04em; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }

/* ─── MINIATURA ARTICOLO ─────────────────────────────── */.article-item.has-thumb {  grid-template-columns: 80px 1fr;}.article-thumb {  grid-column: 1;  grid-row: 1 / 4;}.article-thumb img {  width: 80px;  height: 80px;  object-fit: cover;  border-radius: 8px;}.article-body {  grid-column: 2;  display: contents;}

/* ─── RESPONSIVE ─────────────────────────────────────── */


@media (max-width: 520px) {
  .article-item { grid-template-columns: 44px 1fr; gap: 0 14px; }
  .article-date .day { font-size: 1.1rem; }
  .post-nav a { max-width: 100%; }
}
