/*
Theme Name: FTH Theme
Theme URI: https://megify.ai
Description: Minimal WordPress theme for the Figma-to-HTML page builder. No framework, no bloat — just a clean container for FTH-generated pages.
Version: 1.0.0
Author: Megify
Author URI: https://megify.ai
Text Domain: fth-theme
*/

/* Reset base — scoped to avoid overriding @layer figma-to-html */
@layer fth-reset {
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
  body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-size: 16px; line-height: 1.5; color: #333; background: #fff; }
  img { max-width: 100%; height: auto; display: block; }
  a { color: inherit; }
}

/* WordPress core classes */
.alignleft { float: left; margin-right: 1em; }
.alignright { float: right; margin-left: 1em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.screen-reader-text { clip: rect(1px,1px,1px,1px); position: absolute; height: 1px; width: 1px; overflow: hidden; }

/* ─── Default [fth_menu] styles ─── */
.fth-nav__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 32px);
  flex-wrap: wrap;
}
.fth-nav__item { position: relative; }
.fth-nav__item--has-children > .fth-nav__link::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-left: 5px;
  vertical-align: middle;
}
.fth-nav__link {
  text-decoration: none;
  color: inherit;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  padding: 8px 0;
  transition: opacity 0.2s;
  display: inline-block;
}
.fth-nav__link:hover { opacity: 0.7; }
.fth-nav__link--active { font-weight: 700; }

/* Submenu (dropdown) */
.fth-nav__item__sub {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 200px;
  padding: 8px 0;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  list-style: none;
  z-index: 100;
  flex-direction: column;
  gap: 0;
}
.fth-nav__item--has-children:hover > .fth-nav__item__sub { display: flex; }
.fth-nav__item--sub { width: 100%; }
.fth-nav__item--sub .fth-nav__link {
  padding: 8px 20px;
  display: block;
  font-size: 14px;
}
.fth-nav__item--sub .fth-nav__link:hover { background: rgba(0,0,0,.04); opacity: 1; }

/* Hamburger toggle button (hidden on desktop) */
.fth-nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 101;
}
.fth-nav__toggle span,
.fth-nav__toggle span::before,
.fth-nav__toggle span::after {
  display: block;
  width: 24px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  position: relative;
}
.fth-nav__toggle span::before,
.fth-nav__toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
}
.fth-nav__toggle span::before { top: -7px; }
.fth-nav__toggle span::after { top: 7px; }
/* Animate to X when open */
.fth-nav--open .fth-nav__toggle span { background: transparent; }
.fth-nav--open .fth-nav__toggle span::before { top: 0; transform: rotate(45deg); }
.fth-nav--open .fth-nav__toggle span::after { top: 0; transform: rotate(-45deg); }

/* Mobile: hamburger */
@media (max-width: 768px) {
  .fth-nav__toggle { display: block; }
  .fth-nav__list {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    padding: 80px 24px 24px;
    z-index: 100;
    overflow-y: auto;
  }
  .fth-nav--open .fth-nav__list { display: flex; }
  .fth-nav__link { font-size: 18px; padding: 12px 0; }
  .fth-nav__item__sub {
    position: static;
    box-shadow: none;
    padding-left: 16px;
    display: flex;
  }
}

/* Non-FTH pages get basic styling */
.fth-fallback { max-width: 1200px; margin: 0 auto; padding: 40px 20px; }
.fth-fallback h1 { font-size: 2em; margin-bottom: 0.5em; }

/* ──────────────────────────────────────────────────────────────────────────
   Vehicle card (gv-card) — global Giadil/Figma look
   Override del CSS plugin giadil-vehicles. Usa "body" come prefix per battere
   la specificita' del plugin (caricato dopo il theme).
   ────────────────────────────────────────────────────────────────────────── */

body .gv-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
body .gv-card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

/* Badge prezzo */
body .gv-card-badge {
  top: 16px;
  left: 16px;
  background: #1a9dd9;
  color: #ffffff;
  border-radius: 14px;
  padding: 8px 18px;
  text-align: center;
  line-height: 1.3;
}
body .gv-badge-price { display: block; font-size: 18px; font-weight: 700; }
body .gv-badge-label { display: block; font-size: 11px; opacity: 0.9; }

/* Immagine: edge-to-edge cover, niente padding */
body .gv-card-image {
  aspect-ratio: 16/10;
  background: #ffffff;
  margin: 0;
  overflow: hidden;
}
body .gv-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
  display: block;
}

/* Titolo + sottotitolo */
body .gv-card-body { padding: 16px 16px 8px; }
body .gv-card-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #000000;
  margin: 0 0 4px;
}
body .gv-card-subtitle {
  font-size: 13px;
  color: #8b8b8b;
  margin: 0;
  line-height: 1.4;
}

/* Footer: 3 box meta sfondo grigio, niente bordo */
body .gv-card-footer {
  display: flex;
  gap: 8px;
  padding: 8px 14px 16px;
  border-top: none;
}
body .gv-card-info {
  flex: 1;
  background: #f2f2f2;
  border: none;
  border-radius: 10px;
  padding: 10px 4px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}
body .gv-info-icon { color: #000000; margin: 0 auto 4px; }
body .gv-info-label { font-size: 11px; color: #8b8b8b; }
body .gv-info-value { font-size: 12px; font-weight: 700; color: #000000; }

/* ─── Typography tokens (global) ─── */
/* Cluster di valori font-size/weight visti su tutte le pagine FTH, ridotti
   ai token qui sotto. Refactor incrementale: ogni pagina sostituisce i
   font-size inline con var(--text-*) o var(--heading-*). */
:root {
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Montserrat', sans-serif;
  --font-accent: 'Asap Condensed', sans-serif;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: clamp(14px, 1.1vw, 16px);
  --text-base: 15px;
  --text-lg: 17px;
  --heading-sm: clamp(16px, 1.4vw, 20px);
  --heading-md: clamp(18px, 1.6vw, 22px);
  --heading-lg: clamp(20px, 1.8vw, 25px);
  --heading-xl: clamp(24px, 3vw, 35px);
  --heading-2xl: clamp(28px, 3.6vw, 50px);
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;
}

/* ─── BREADCRUMB (global, used across hero pages) ─── */
/* Padding mirrors .fth-header padding so breadcrumb text aligns with logo. */
.section-breadcrumb {
  padding: 8px 7%;
  background: #ffffff;
}
.breadcrumb__text {
  font-family: 'Montserrat', sans-serif;
  font-size: 10px;
  font-weight: 500;
  color: #000000;
  letter-spacing: 0.2px;
}
.breadcrumb__text a {
  color: #000000;
  text-decoration: none;
}
.breadcrumb__text a:hover {
  color: #1a9dd9;
}
@media (max-width: 768px) {
  .section-breadcrumb { padding: 8px 5%; }
}

/* ─── Pagination anchor offset (gv archive) ─── */
/* Pagination links append #gv-archive-top to keep the user near the results
   instead of scrolling to the page top. Offset accounts for the sticky header. */
#gv-archive-top { scroll-margin-top: 100px; }
