/*
 Theme Name:   Twenty Twentyone Child
 Description:  Marco Montemagno – child theme di TwentyTwentyone
 Template:     twentytwentyone
 Version:      2.0.0
 Text Domain:  twentytwentyonechild
*/

/* ══════════════════════════════════════════════════════
   1. HOMEPAGE: nasconde solo il chrome di TT1
      Il contenuto custom (mm-hero, mm-nav, ecc.) è dentro
      #page → entry-content, quindi non nascondiamo #page.
   ══════════════════════════════════════════════════════ */
body.home #masthead,
body.home #colophon,
body.home .skip-link,
body.home #site-navigation { display: none !important; }

/* Rimuovi padding/margini TT1 dall'area contenuto */
body.home #content,
body.home .site-content,
body.home #primary,
body.home #main,
body.home article.page,
body.home .entry-content,
body.home .entry-header,
body.home .default-max-width {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}
body.home #page,
body.home .site {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ══════════════════════════════════════════════════════
   2. DESIGN TOKENS (global)
   ══════════════════════════════════════════════════════ */
:root {
  --mm-black:       #080808;
  --mm-dark:        #111111;
  --mm-card:        #181818;
  --mm-white:       #ffffff;
  --mm-yellow:      #f5c518;
  --mm-yellow-dark: #c9a10e;
  --mm-gray:        #888888;
  --mm-max:         1240px;
  --mm-pad:         clamp(20px,4vw,60px);
  --font-display:   "Bebas Neue", Impact, cursive;
  --font-body:      "DM Sans", "Helvetica Neue", sans-serif;
}

/* ══════════════════════════════════════════════════════
   3. GLOBAL DARK BACKGROUND (non-home pages)
   ══════════════════════════════════════════════════════ */
body:not(.home),
body:not(.home) #page,
body:not(.home).custom-background {
  background: var(--mm-black) !important;
  color: #ffffff !important;
}
body:not(.home) {
  font-family: var(--font-body) !important;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body:not(.home) * { box-sizing: border-box; }
body:not(.home) a { color: inherit; text-decoration: none; }

/* ══════════════════════════════════════════════════════
   4. HIDE TT1 CHROME (non-home)
   ══════════════════════════════════════════════════════ */
body:not(.home) #masthead,
body:not(.home) #colophon,
body:not(.home) .skip-link,
body:not(.home) .widget-area,
body:not(.home) #site-navigation { display: none !important; }

/* ══════════════════════════════════════════════════════
   5. MM NAV (injected via PHP on non-home pages)
   ══════════════════════════════════════════════════════ */
.mm-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--mm-pad);
  height: 72px;
  background: rgba(8,8,8,0.97);
  border-bottom: 1px solid rgba(245,197,24,0.15);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}
body.admin-bar .mm-nav { top: 32px; }
.mm-nav-logo img {
  height: 44px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  transition: opacity .2s;
}
.mm-nav-logo:hover img { opacity: .75; }
.mm-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.mm-nav-links a {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--mm-gray);
  transition: color .2s;
  white-space: nowrap;
}
.mm-nav-links a:hover { color: var(--mm-yellow); }
@media (max-width: 768px) { .mm-nav-links { display: none; } }

/* ══════════════════════════════════════════════════════
   6. MM FOOTER (injected via PHP on non-home pages)
   ══════════════════════════════════════════════════════ */
.mm-footer {
  background: var(--mm-dark);
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 80px;
  width: 100%;
}
.mm-footer-inner {
  max-width: var(--mm-max);
  margin: 0 auto;
  padding: 48px var(--mm-pad) 32px;
}
.mm-footer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.mm-footer-logo img {
  height: 40px;
  width: auto;
  filter: brightness(0) invert(1);
  opacity: .7;
  display: block;
}
.mm-footer-social {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}
.mm-footer-social a { color: var(--mm-gray); transition: color .2s; }
.mm-footer-social a:hover { color: var(--mm-yellow); }
.mm-footer-social svg { width: 20px; height: 20px; fill: currentColor; }
.mm-footer-address {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--mm-gray);
  line-height: 1.7;
}
.mm-footer-address address { font-style: normal; }
.mm-footer-address-name { font-weight: 600; color: rgba(255,255,255,0.6); }
.mm-footer-address-vat { margin-top: 4px; }
.mm-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.07);
  font-size: 13px;
  color: var(--mm-gray);
}
.mm-footer-legal { display: flex; gap: 20px; flex-wrap: wrap; }
.mm-footer-legal a { color: var(--mm-gray); transition: color .2s; }
.mm-footer-legal a:hover { color: #fff; }
@media (max-width: 600px) {
  .mm-footer-bottom { flex-direction: column; align-items: flex-start; }
  .mm-footer-legal { flex-direction: column; gap: 8px; }
}

/* ══════════════════════════════════════════════════════
   7. PAGE / POST LAYOUT
   ══════════════════════════════════════════════════════ */
body:not(.home) #page,
body:not(.home) .site {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
}
body:not(.home) #content,
body:not(.home) .site-content {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
body:not(.home) #primary {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
}
body:not(.home) #main {
  margin: 0 !important;
  padding: 0 !important;
}
body:not(.home) .entry-content {
  max-width: var(--mm-max) !important;
  margin: 0 auto !important;
  padding: 48px var(--mm-pad) 80px !important;
}

/* ══════════════════════════════════════════════════════
   8. POST HEADER (single.php)
   ══════════════════════════════════════════════════════ */
.mm-post-hero {
  background: var(--mm-dark);
  padding: 60px var(--mm-pad) 48px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mm-post-hero-inner {
  max-width: var(--mm-max);
  margin: 0 auto;
}
.mm-post-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  font-family: var(--font-body);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.mm-post-cat {
  background: var(--mm-yellow);
  color: var(--mm-black);
  padding: 3px 10px;
  border-radius: 2px;
  font-weight: 700;
  font-size: 11px;
}
.mm-post-date,
.mm-post-read { color: var(--mm-gray); }
.mm-post-title {
  font-family: var(--font-display) !important;
  font-size: clamp(32px, 5vw, 64px) !important;
  font-weight: 400 !important;
  line-height: 1.05 !important;
  color: #fff !important;
  margin: 0 0 24px !important;
  letter-spacing: 0.02em !important;
}

/* ══════════════════════════════════════════════════════
   9. TYPOGRAPHY (non-home entry-content)
   ══════════════════════════════════════════════════════ */
body:not(.home) .entry-content h1,
body:not(.home) .entry-content h2,
body:not(.home) .entry-content h3,
body:not(.home) .entry-content h4 {
  font-family: var(--font-display) !important;
  font-weight: 400 !important;
  color: #fff !important;
  letter-spacing: 0.02em;
  line-height: 1.1;
}
body:not(.home) .entry-content h1 { font-size: clamp(32px, 4vw, 56px) !important; }
body:not(.home) .entry-content h2 { font-size: clamp(26px, 3vw, 44px) !important; margin-top: 56px !important; }
body:not(.home) .entry-content h3 { font-size: clamp(20px, 2.5vw, 32px) !important; margin-top: 40px !important; }
body:not(.home) .entry-content p {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
  margin-bottom: 1.4em;
}
body:not(.home) .entry-content strong { color: #fff; font-weight: 700; }
body:not(.home) .entry-content em { color: rgba(255,255,255,0.75); }
body:not(.home) .entry-content a {
  color: var(--mm-yellow);
  text-decoration: underline;
  text-decoration-color: rgba(245,197,24,0.4);
  transition: color .2s, text-decoration-color .2s;
}
body:not(.home) .entry-content a:hover {
  color: #fff;
  text-decoration-color: rgba(255,255,255,0.4);
}
body:not(.home) .entry-content ul,
body:not(.home) .entry-content ol {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.8vw, 18px);
  line-height: 1.8;
  color: rgba(255,255,255,0.85);
  padding-left: 1.5em;
  margin-bottom: 1.4em;
}
body:not(.home) .entry-content li { margin-bottom: 0.4em; }
body:not(.home) .entry-content blockquote {
  border-left: 3px solid var(--mm-yellow);
  padding: 16px 24px;
  margin: 32px 0;
  background: var(--mm-card);
  border-radius: 0 4px 4px 0;
  font-size: clamp(18px, 2vw, 22px);
  font-family: var(--font-display);
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1.3;
}
body:not(.home) .entry-content hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 48px 0;
}

/* ══════════════════════════════════════════════════════
   10. GUTENBERG BLOCKS
   ══════════════════════════════════════════════════════ */
body:not(.home) .wp-block-embed,
body:not(.home) .wp-block-embed__wrapper {
  width: 100% !important;
  max-width: 100% !important;
}
body:not(.home) .wp-block-embed figcaption {
  color: var(--mm-gray);
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}
body:not(.home) .wp-block-embed iframe,
body:not(.home) .wp-block-embed video {
  width: 100% !important;
  aspect-ratio: 16/9;
  height: auto !important;
  border-radius: 4px;
  display: block;
}
body:not(.home) .wp-block-image img {
  border-radius: 4px;
  max-width: 100%;
  height: auto;
}
body:not(.home) .wp-block-image figcaption {
  color: var(--mm-gray);
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}
body:not(.home) .wp-block-gallery .blocks-gallery-item img {
  border-radius: 4px;
}
body:not(.home) .wp-block-separator {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin: 48px 0;
}
body:not(.home) .wp-block-separator.is-style-wide { max-width: none; }
body:not(.home) .wp-block-buttons .wp-block-button__link {
  background: var(--mm-yellow) !important;
  color: var(--mm-black) !important;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 28px !important;
  border-radius: 3px !important;
  border: none !important;
  cursor: pointer;
  transition: background .2s, transform .15s;
  text-decoration: none !important;
}
body:not(.home) .wp-block-buttons .wp-block-button__link:hover {
  background: var(--mm-yellow-dark) !important;
  transform: translateY(-1px);
}
body:not(.home) .wp-block-buttons .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent !important;
  border: 2px solid var(--mm-yellow) !important;
  color: var(--mm-yellow) !important;
}
body:not(.home) .wp-block-buttons .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: var(--mm-yellow) !important;
  color: var(--mm-black) !important;
}
body:not(.home) .wp-block-quote {
  border-left: 3px solid var(--mm-yellow);
  padding: 16px 24px;
  background: var(--mm-card);
  border-radius: 0 4px 4px 0;
  margin: 32px 0;
}
body:not(.home) .wp-block-quote p {
  font-family: var(--font-display);
  font-size: clamp(18px, 2vw, 24px) !important;
  color: #fff !important;
  line-height: 1.3;
  margin: 0 !important;
}
body:not(.home) .wp-block-quote cite {
  color: var(--mm-gray);
  font-size: 13px;
  margin-top: 8px;
  display: block;
}
body:not(.home) .wp-block-pullquote {
  border-top: 3px solid var(--mm-yellow);
  border-bottom: 3px solid var(--mm-yellow);
  padding: 32px var(--mm-pad);
  text-align: center;
  margin: 48px 0;
}
body:not(.home) .wp-block-pullquote blockquote {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
}
body:not(.home) .wp-block-pullquote p {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 40px) !important;
  color: #fff !important;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
body:not(.home) .wp-block-pullquote cite {
  color: var(--mm-gray);
  font-size: 14px;
}
body:not(.home) .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 15px;
}
body:not(.home) .wp-block-table th {
  background: var(--mm-card);
  color: var(--mm-yellow);
  font-weight: 700;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid rgba(245,197,24,0.3);
}
body:not(.home) .wp-block-table td {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.85);
}
body:not(.home) .wp-block-table tr:hover td {
  background: rgba(255,255,255,0.03);
}
body:not(.home) .wp-block-columns {
  gap: clamp(20px,3vw,40px) !important;
}
body:not(.home) .wp-block-column {
  min-width: min(280px, 100%) !important;
}
body:not(.home) .wp-block-cover {
  border-radius: 4px;
  overflow: hidden;
  min-height: 300px !important;
}
body:not(.home) .wp-block-cover__inner-container {
  color: #fff !important;
}
body:not(.home) .wp-block-media-text {
  align-items: center !important;
  gap: 40px !important;
}
body:not(.home) .wp-block-media-text img {
  border-radius: 4px;
}
body:not(.home) .wp-block-media-text .wp-block-media-text__content {
  color: rgba(255,255,255,0.85);
}
body:not(.home) .wp-block-code {
  background: var(--mm-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  padding: 20px 24px;
  font-size: 14px;
  line-height: 1.7;
  overflow-x: auto;
  color: rgba(255,255,255,0.85);
}
body:not(.home) .wp-block-preformatted {
  background: var(--mm-card);
  padding: 20px 24px;
  border-radius: 4px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  overflow-x: auto;
}

/* ══════════════════════════════════════════════════════
   11. ARCHIVE PAGE
   ══════════════════════════════════════════════════════ */
.mm-archive-header {
  background: var(--mm-dark);
  padding: 60px var(--mm-pad) 48px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.mm-archive-header-inner {
  max-width: var(--mm-max);
  margin: 0 auto;
}
.mm-archive-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--mm-yellow);
  margin-bottom: 12px;
  display: block;
}
.mm-archive-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 72px);
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.02em;
  line-height: 1;
  margin: 0;
}
.mm-archive-grid {
  max-width: var(--mm-max);
  margin: 48px auto;
  padding: 0 var(--mm-pad);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.mm-post-card {
  background: var(--mm-card);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.mm-post-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245,197,24,0.3);
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.mm-post-card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  display: block;
  background: #181818;
}
.mm-post-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s;
  display: block;
}
.mm-post-card:hover .mm-post-card-thumb img { transform: scale(1.04); }
.mm-post-card-body { padding: 20px 24px; flex: 1; display: flex; flex-direction: column; }
.mm-post-card-tags {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.mm-post-card-tag {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mm-yellow);
  background: rgba(245,197,24,0.1);
  padding: 2px 8px;
  border-radius: 2px;
}
.mm-post-card-title {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  color: #fff;
  margin: 0 0 10px;
  transition: color .2s;
}
.mm-post-card:hover .mm-post-card-title { color: var(--mm-yellow); }
.mm-post-card-excerpt {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.65;
  color: rgba(255,255,255,0.5);
  margin: 0;
  flex: 1;
}
.mm-post-card-footer {
  padding: 12px 24px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--mm-gray);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}
.mm-pagination {
  max-width: var(--mm-max);
  margin: 0 auto 64px;
  padding: 0 var(--mm-pad);
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mm-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 16px;
  background: rgba(255,255,255,0.07);
  color: #fff;
  border-radius: 3px;
  font-family: var(--font-body);
  font-size: 14px;
  transition: background .15s, color .15s;
}
.mm-pagination .page-numbers.current,
.mm-pagination .page-numbers:hover {
  background: var(--mm-yellow);
  color: var(--mm-black);
}

/* ══════════════════════════════════════════════════════
   12. UTILITY
   ══════════════════════════════════════════════════════ */
body:not(.home) .default-max-width { max-width: none !important; }
body:not(.home) .alignwide  { max-width: min(calc(var(--mm-max) + 80px), 100%) !important; margin-left: auto !important; margin-right: auto !important; }
body:not(.home) .alignfull  { max-width: 100vw !important; margin-left: calc(50% - 50vw) !important; margin-right: calc(50% - 50vw) !important; }

/* ══════════════════════════════════════════════════════
   13. POST NAVIGATION
   ══════════════════════════════════════════════════════ */
.mm-post-nav {
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 48px;
}
.mm-post-nav-inner {
  max-width: var(--mm-max);
  margin: 0 auto;
  padding: 40px var(--mm-pad) 64px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.mm-post-nav-link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 45%;
  transition: opacity .2s;
}
.mm-post-nav-link:hover { opacity: .75; }
.mm-post-nav-next { text-align: right; margin-left: auto; }
.mm-post-nav-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--mm-yellow);
}
.mm-post-nav-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
}


/* ── CTA button fix — outline style, coherent with dark theme ── */
.mm-cta a {
    background: transparent !important;
    color: var(--mm-yellow, #f5c842) !important;
    border: 2px solid var(--mm-yellow, #f5c842);
    font-weight: 700;
    text-decoration: none !important;
}
.mm-cta a:hover {
    background: var(--mm-yellow, #f5c842) !important;
    color: #0a0a0a !important;
    text-decoration: none !important;
	
}@media(max-width:768px){
  .mm-footer-legal{display:block!important;}
  .mm-footer-legal a{display:block!important;padding:3px 0;}
}
