/* ==========================================================================
   Krom Bike — shared stylesheet
   Faithful-but-clean rebuild of krombike.it (originally Adobe Portfolio).
   Structure: 0) @font-face  1) tokens  2) base  3) layout  4) header/nav
              5) footer  6) reusable page modules  7) responsive
   ========================================================================== */

/* 0) FONTS ------------------------------------------------------------------
   Self-hosted so pages render with the right type offline and straight from
   file:// — no third-party request to Google's CDN (also keeps visitor IPs
   off it, which matters for a site serving the EU).
   Files pulled from the Google Fonts API, latin + latin-ext subsets only:
   enough for the Italian copy, and unicode-range means a page only downloads
   the subset it actually uses. Barlow ships as static weights; Inter is a
   single variable file covering 400-700.
   To add a weight: download its woff2 into assets/fonts/ and add a block here.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/barlow-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/barlow-400-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/barlow-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/barlow-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/barlow-600-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/barlow-600-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/barlow-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/barlow-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/inter-var-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../assets/fonts/inter-var-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 1) DESIGN TOKENS ---------------------------------------------------------- */
:root {
  /* Palette (dark theme, red Krom accent) */
  --bg:           #191919;
  --bg-elevated:  #212121;
  --bg-panel:     #222222;
  --text:         #ffffff;
  --text-muted:   #a9a9a9;
  --border:       #333333;
  --brand:        #e1121c;   /* Krom red */
  --brand-dark:   #b60e16;

  /* Typography — two self-hosted faces (see the @font-face block above).
     Barlow  → headings, sub-headings and UI labels (a grotesque standing in
               for the licensed Typekit "fznc" of the original site).
     Inter   → body / description copy.
     Change a family here and the whole site follows. */
  --font-heading: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-body:    "Inter", "Helvetica Neue", Arial, sans-serif;

  /* Weights — reference these instead of hard-coding numbers. */
  --fw-regular:  400;
  --fw-medium:   500;
  --fw-semibold: 600;
  --fw-bold:     700;

  --step--1: clamp(0.83rem, 0.8rem + 0.15vw, 0.9rem);
  --step-0:  clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1:  clamp(1.3rem, 1.2rem + 0.5vw, 1.6rem);
  --step-2:  clamp(1.7rem, 1.5rem + 1vw, 2.4rem);
  --step-3:  clamp(2.2rem, 1.8rem + 2vw, 3.8rem);

  /* Spacing / layout */
  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 3rem);
  --section-y: clamp(3rem, 8vw, 6rem);
}

/* 2) BASE ------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

/* The heading face is assigned in exactly one rule. Everything that reads as a
   heading, sub-heading or UI label belongs in this list; everything else
   inherits the body face from <body>. */
h1, h2, h3, h4, h5, h6,
.eyebrow,
.nav a,
.nav-toggle,
.btn,
.footer-phone,
.card__meta,
.avatar {
  font-family: var(--font-heading);
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  line-height: 1.1;
  font-weight: var(--fw-bold);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p  { margin: 0 0 1em; }

/* 3) LAYOUT ----------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg-elevated); }

.section__head { text-align: center; margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.eyebrow {
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: var(--step--1);
  font-weight: var(--fw-bold);
  margin-bottom: 0.75rem;
}

/* Buttons — one variant only: brand-red fill, white text. The former
   --solid / --ghost split is gone; every call to action looks the same. */
.btn {
  display: inline-block;
  padding: 0.8em 1.6em;
  font-weight: var(--fw-semibold);
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--brand);
  transition: background .2s, border-color .2s;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* 4) HEADER / NAV ----------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(25, 25, 25, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 68px; gap: 1rem;
}
.brand-mark img { height: 34px; width: auto; }

.nav-toggle {
  display: none; background: none; border: 0; color: var(--text);
  font-size: 1.6rem; cursor: pointer; padding: 0.25rem 0.5rem;
}

.nav { display: flex; gap: clamp(0.75rem, 2vw, 1.75rem); }
.nav a {
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
}
.nav a:hover { color: var(--text); }
.nav a.is-active { color: var(--text); border-color: var(--brand); }

/* 5) FOOTER ----------------------------------------------------------------- */
.site-footer {
  background: #111;
  border-top: 1px solid var(--border);
  padding-block: clamp(2.5rem, 6vw, 4rem);
  color: var(--text-muted);
  font-size: var(--step--1);
}
.site-footer .container {
  display: flex; flex-wrap: wrap; gap: 2rem 3rem;
  justify-content: space-between; align-items: start;
}
.site-footer h4 { color: var(--text); font-size: var(--step-0); }
.site-footer a:hover { color: var(--brand); }
.footer-phone { color: var(--text); font-size: var(--step-1); font-weight: var(--fw-bold); }
.footer-bottom {
  margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border);
  text-align: center; font-size: var(--step--1);
}

/* 6) REUSABLE PAGE MODULES -------------------------------------------------- */

/* Hero — dark stage. A page sets --hero-media (via a modifier below) to put a
   photo behind it; the gradient stays on top so white text keeps its contrast.
   Without --hero-media the hero is just the flat dark stage, as before. */
.hero {
  position: relative;
  min-height: min(78vh, 640px);
  display: grid; place-items: center; text-align: center;
  padding-block: var(--section-y);
  overflow: hidden;
  background-color: #0d0d0d;
  background-image:
    linear-gradient(180deg, rgba(0,0,0,.62), rgba(0,0,0,.82)),
    var(--hero-media, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Home hero — the Krom shop front. Anchored to the bottom of the photo on
   purpose: the top of it is the shop's own Krom sign, which sat directly above
   the hero logo and read as the brand twice over. */
.hero--home {
  --hero-media: url('../assets/img/chi-siamo-hero.jpg');
  background-position: center bottom;
}
.hero__video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 0; opacity: 0.5;
}
.hero__inner { position: relative; z-index: 1; }
.hero__logo { width: min(460px, 80vw); margin: 0 auto 1.5rem; }
.hero__tagline { color: var(--text-muted); font-size: var(--step-1); margin-bottom: 2rem; }
/* The hero is centred as a block, so a trailing margin on its last child would
   sit inside the box and push the visible content optically high. */
.hero__inner > :last-child { margin-bottom: 0; }

/* Brand logo strip — bare marks, no panel behind them.
   Every logo renders at the same height (--logo-h) so the row reads as one
   line of marks rather than a set of differently-scaled images. Flex (not an
   equal-column grid) so each mark takes only its own width and `gap` is the
   real spacing between them — equal columns padded the row out with dead
   space that `gap` couldn't control. */
.logo-strip {
  /* The marks are wordmarks (ratios 4.6:1 - 7.2:1), so a tall --logo-h makes
     them enormously wide. 42px is the largest height at which all four still
     sit on one row inside the 1200px container. */
  --logo-h: clamp(26px, 3.3vw, 42px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(0.875rem, 2vw, 1.5rem);
}
.logo-strip__item { display: grid; place-items: center; }
.logo-strip__item img {
  height: var(--logo-h);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

/* Card grid (news / accessories / team / services) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}
.card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .2s, transform .2s;
}
/* Hover only on cards that are actually links. The static <article> cards
   (accessori, novità, membri) aren't clickable, so they must not look it —
   the generated bike cards are <a class="card"> and keep the affordance. */
a.card:hover { border-color: var(--brand); transform: translateY(-3px); }
.card__media { aspect-ratio: 1 / 1; overflow: hidden; }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: 1.25rem 1.25rem 1.5rem; }
.card__title { font-size: var(--step-0); margin: 0; }
.card__body p { color: var(--text-muted); margin: 0.5rem 0 0; }

/* Bike cards. Built on .card-grid / .card. .card__meta is the small red label
   above the title — the post date on generated cards, the brand on the
   hand-placed ones. Generated cards are <a> and so keep their hover. */
.card__meta {
  color: var(--brand);
  font-size: var(--step--1);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.4rem;
}
.card__body p.card__excerpt {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Social links — square icon buttons, sharp like everything else. The glyphs
   inherit currentColor so one rule drives icon + border together. */
.social {
  list-style: none; margin: 0; padding: 0;
  display: flex; justify-content: center;
  gap: clamp(1rem, 3vw, 2rem);
}
.social a {
  display: grid; place-items: center;
  width: clamp(56px, 8vw, 72px); aspect-ratio: 1;
  background: var(--brand);
  color: #fff;
  border: 2px solid var(--brand);
  transition: background .2s, border-color .2s;
}
.social a:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.social svg { width: 45%; height: 45%; fill: currentColor; display: block; }

/* Prose block (privacy, chi-siamo text) */
.prose { max-width: 70ch; margin-inline: auto; }
.prose h2 { margin-top: 2em; }
.prose a { color: var(--brand); text-decoration: underline; }

/* Privacy page. .todo marks facts only the owner can supply — deliberately loud,
   so the page can never go live with one still visible. Currently unused (all
   gaps are filled); kept for the next time the policy needs a fact we lack. */
.policy-date { color: var(--text-muted); font-size: var(--step--1); }
.todo {
  display: inline-block;
  background: var(--brand); color: #fff;
  font-weight: var(--fw-semibold);
  padding: 0.35em 0.6em;
}

/* Feature list — stacked blocks with a heading + description/sub-items
   (used by Servizi). */
.feature-list { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); max-width: 800px; margin-inline: auto; }
.feature {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  padding: 1.5rem 1.75rem;
}
.feature h3 { color: #fff; }
.feature ul { margin: 0; padding-left: 1.1rem; color: var(--text-muted); }
.feature li { margin-bottom: 0.4rem; }
.feature > p:last-child { margin-bottom: 0; color: var(--text-muted); }

/* Photo gallery (used by Il team) */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(0.5rem, 1.5vw, 1rem);
}
/* Static photos — no hover. They aren't links, so nothing here reacts to the
   pointer (the transition went with the :hover rule: it had nothing left to
   animate). */
.gallery img {
  width: 100%; height: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  border: 1px solid var(--border);
}

/* Member cards with monogram avatars (Chi siamo — no member photos available).
   Square, like every other surface: the UI has no rounded corners anywhere. */
.avatar {
  width: 96px; height: 96px; margin: 0 auto 0.75rem;
  display: grid; place-items: center;
  background: var(--brand); color: #fff;
  font-size: 2.2rem; font-weight: var(--fw-bold);
}

/* Contact layout (Contatti) */
.contact-grid {
  display: grid; gap: clamp(1.5rem, 4vw, 2.5rem);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  max-width: 900px; margin-inline: auto;
}
.contact-block h3 { color: var(--brand); font-size: var(--step-0); text-transform: uppercase; letter-spacing: 0.08em; }
.contact-block a:hover { color: var(--brand); }
/* "Where to find us" panel. Deliberately not an embedded map — see the note in
   contatti.html and section 5 of the privacy policy. */
.map-embed {
  margin-top: clamp(2rem, 5vw, 3rem);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  padding: clamp(1.75rem, 5vw, 2.5rem);
  text-align: center;
}
.map-embed__addr {
  font-family: var(--font-heading);
  font-size: var(--step-1);
  font-weight: var(--fw-semibold);
  margin: 0 0 1.25rem;
}
.map-embed p:last-child { margin: 0; }

/* Center helper */
.center { text-align: center; }
.mt-lg { margin-top: clamp(2rem, 5vw, 3rem); }

/* 7) RESPONSIVE / NAV ------------------------------------------------------- */
@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 0.75rem var(--gutter); border-bottom: 0; }
  .nav a.is-active { border-left: 3px solid var(--brand); }
}
