/*
Theme Name: WebSalad Magazine
Theme URI: https://websalad.it
Author: Franco Aquini
Description: Tema magazine minimalista in bianco e nero
Version: 1.2
License: GNU General Public License v2 or later
Text Domain: websalad-magazine
*/

/* ===== BASE ===== */
body {
  font-family: 'Inter', sans-serif;
  color: #222;
  background-color: #fff;
  margin: 0;
  line-height: 1.7;
}

h1, h2, h3, h4, h5 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #000;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: auto;
  padding: 2rem 0;
}

/* ===== HEADER ===== */
header.site-header {
  border-bottom: 2px solid #000;
  background: #fff;
}

/* Riga superiore: logo centrato + hamburger a destra */
.header-inner {
  display: flex;
  justify-content: center; /* centro logo */
  align-items: center;
  height: auto;
  padding: 0.8rem 0;
  position: relative;
}

/* Logo */
.site-branding img {
  max-height: 70px; /* Altezza header = altezza logo */
  height: auto;
  width: auto;
  display: block;
  margin: 0 auto;
}

.site-title a {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 1.6rem;
  color: #000;
  text-decoration: none;
}

/* Bottone menu (hamburger) */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 24px;
  display: none; /* 🔹 visibile solo su mobile */
  justify-content: center;
  align-items: center;
  z-index: 2001;
}

.menu-toggle .hamburger,
.menu-toggle .hamburger::before,
.menu-toggle .hamburger::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  background-color: #000;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle .hamburger::before {
  transform: translateY(-8px);
}
.menu-toggle .hamburger::after {
  transform: translateY(8px);
}

/* Stato attivo (animazione X) */
.menu-toggle.active .hamburger {
  background-color: transparent;
}
.menu-toggle.active .hamburger::before {
  transform: rotate(45deg);
}
.menu-toggle.active .hamburger::after {
  transform: rotate(-45deg);
}

/* ===== NAV MENU ===== */
.main-nav {
  border-top: 1px solid #000;
  border-bottom: 1px solid #000;
  padding: 0.8rem 0;
}

.main-nav .menu {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.main-nav .menu a {
  color: #000;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.main-nav .menu a:hover {
  text-decoration: underline;
}

/* ===== MENU FULLSCREEN (MOBILE) ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .main-nav {
    border: none;
  }

  .main-nav .menu {
    position: fixed;
    inset: 0;
    background: #fff;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    transform: translateY(-100%);
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 2000;
  }

  .main-nav .menu.open {
    transform: translateY(0);
    opacity: 1;
  }

  .main-nav .menu a {
    font-size: 1.4rem;
  }
}

/* ===== CATEGORY BLOCKS ===== */
.category-block {
  margin-bottom: 3rem;
}

.category-title {
  border-bottom: 2px solid #000;
  margin-bottom: 1rem;
  text-transform: uppercase;
  font-weight: 700;
}

/* Alternanza di sfondo sobria */
.category-block:nth-child(odd) {
  background: #fafafa;
  padding: 2rem 1rem;
  border-radius: 6px;
}

/* ===== POST GRID ===== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  column-gap: 2rem;
  row-gap: 4rem;
}

.post-grid article {
  display: flex;
  flex-direction: column;
  border: 1px solid #eee;
  padding: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  background: #fff;
}

.post-grid article:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Immagini uniformi */
.post-grid article img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  margin-bottom: 1rem;
  border-radius: 4px;
}

/* Titolo e testo */
.post-grid article h3,
.post-grid article h2 {
  font-size: 1.1rem;
  margin: 0 0 .5rem 0;
  line-height: 1.3;
}

.post-grid article .excerpt {
  flex-grow: 1;
  font-size: 0.9rem;
  color: #444;
}

/* ===== FEATURED POSTS ===== */
.featured-posts {
  background: #fafafa;
  border-radius: 8px;
  padding: 2.5rem 3rem;
  margin-bottom: 4rem;
}

.featured-title {
  text-transform: uppercase;
  font-size: 1.3rem;
  border-bottom: 1px solid #000;
  margin-bottom: 2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2.5rem;
}

.featured-article {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
  min-height: 420px;
}

.featured-article:hover {
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

.featured-article img {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.featured-article h3 {
  font-size: 1.15rem;
  line-height: 1.4;
  margin: 1.2rem 1rem 0.6rem;
  min-height: 2.8em;
}

.featured-article p {
  font-size: 0.9rem;
  color: #444;
  margin: 0 1rem 1.5rem;
  flex-grow: 1;
}

.featured-article a {
  color: inherit;
  text-decoration: none;
}

.featured-article a:hover h3 {
  text-decoration: underline;
}

/* ===== FOOTER ===== */
footer.site-footer {
  border-top: 1px solid #000;
  text-align: center;
  padding: 1.5rem 0;
  font-size: .9rem;
}

/* ===== MEDIA TUNING ===== */
@media (max-width: 600px) {
  .featured-article {
    min-height: 360px;
  }
  .featured-article img {
    height: 200px;
  }
}

/* ===== FIX IMMAGINI ARTICOLO SU MOBILE ===== */
.single-content img,
article img {
  max-width: 100%;
  height: auto;
  display: block;
}

.single-content {
  overflow-x: hidden;
}
