/* ============================================================
   ALI GAADOUDI — BLOG (indice + articoli)
   Carica DOPO styles.css, sections.css e pages.css
============================================================ */

/* ============================================================
   INDICE — filtri categoria
============================================================ */
.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: clamp(3rem, 5vw, 4rem);
}
.filter {
  height: 40px;
  padding-inline: 1.125rem;
  border-radius: var(--r-pill);
  background: var(--white);
  border: 1px solid var(--hairline);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-body);
  white-space: nowrap;
  transition: background .3s var(--ease), border-color .3s var(--ease),
              color .3s var(--ease), transform .3s var(--ease);
}
.filter:hover { border-color: var(--navy); color: var(--navy); transform: translateY(-2px); }
.filter.active { background: var(--navy); border-color: var(--navy); color: var(--white); }

/* ============================================================
   INDICE — articolo in evidenza
============================================================ */
.featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: clamp(2.5rem, 5vw, 4rem);
  margin-bottom: clamp(3.5rem, 6vw, 5rem);
  padding: clamp(1.25rem, 2vw, 1.75rem);
  border-radius: var(--r-xl);
  background: var(--cream);
  border: 1px solid var(--cream-line);
}

.featured-media {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 16 / 11;
  background: var(--surface);
}
.featured-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.featured:hover .featured-media img { transform: scale(1.03); }

.featured-body { padding-right: clamp(0rem, 2vw, 1.5rem); }

.featured-flag {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  padding: .375rem .875rem;
  border-radius: var(--r-pill);
  background: rgba(255, 145, 77, .16);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--orange-deep);
}
.featured-flag .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--orange); }

.featured-body h2 {
  font-size: clamp(1.625rem, 2.6vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.featured-body h2 a { transition: color .3s var(--ease); }
.featured-body h2 a:hover { color: var(--orange-deep); }

.featured-body p {
  margin-top: 1rem;
  font-size: var(--fs-body);
  line-height: 1.75;
  color: var(--text-body);
}

/* ============================================================
   INDICE — griglia articoli
============================================================ */
.articles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
  gap: 1.5rem;
}

.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-sm);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.article-card:hover { transform: translateY(-6px); box-shadow: var(--sh-md); }

.article-card .media {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
}
.article-card .media img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: transform .8s var(--ease);
}
.article-card:hover .media img { transform: scale(1.04); }

.article-card .body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.75rem;
}

.tag {
  align-self: flex-start;
  margin-bottom: .875rem;
  padding: .25rem .6875rem;
  border-radius: var(--r-pill);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.tag-biomechanics { background: rgba(11, 31, 64, .07);    color: var(--navy); }
.tag-pain         { background: rgba(255, 145, 77, .16);  color: var(--orange-deep); }
.tag-posture      { background: rgba(175, 119, 124, .14); color: var(--rose-deep); }
.tag-performance  { background: rgba(139, 94, 60, .12);   color: var(--clay-deep); }

.article-card h3 {
  font-size: 1.1875rem;
  line-height: 1.35;
  letter-spacing: -0.025em;
}
.article-card h3 a { transition: color .3s var(--ease); }
.article-card h3 a:hover { color: var(--orange-deep); }

.article-card p {
  margin-top: .625rem;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: var(--text-body);
}

.meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: 1.25rem;
  padding-top: 1.125rem;
  border-top: 1px solid var(--hairline);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.meta .sep { color: var(--hairline); }

/* CTA dentro la card — spinta in fondo, sempre allineata */
.card-cta {
  margin-top: auto;
  padding-top: 1.5rem;
}
.card-cta .btn {
  width: 100%;
  height: 46px;
  font-size: .875rem;
}

/* ============================================================
   ARTICOLO — hero
============================================================ */
.article-hero {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--nav-h) + clamp(4.5rem, 7vw, 6.5rem));
  /* spazio sufficiente perché la copertina possa risalire senza coprire la firma */
  padding-bottom: clamp(4.5rem, 6vw, 6rem);
  text-align: center;
  color: var(--white);
  background: var(--navy);
}
.article-hero > .container { position: relative; z-index: 1; }

.article-hero .tag { margin-inline: auto; align-self: center; }

.article-hero h1 {
  max-width: 22ch;
  margin: 1.25rem auto 0;
  font-size: clamp(2.125rem, 3.8vw, 3.25rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--white);
}

.article-hero .standfirst {
  max-width: 42rem;
  margin: 1.375rem auto 0;
  font-size: var(--fs-lead);
  line-height: 1.65;
  color: rgba(255, 255, 255, .78);
}

.byline {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .75rem;
  margin-top: 2rem;
}
.byline img {
  width: 42px; height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .22);
}
.byline .who { text-align: left; line-height: 1.35; }
.byline .who span { display: block; }
.byline .name { font-size: .9375rem; font-weight: 600; color: var(--white); }
.byline .when { font-size: var(--fs-xs); color: rgba(255, 255, 255, .52); }

.article-cover {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  /* risalita contenuta e sempre inferiore al padding della testata */
  margin: -2.5rem auto 0;
  padding-inline: var(--gutter);
}
.article-cover figure {
  border-radius: var(--r-xl);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  box-shadow: var(--sh-lg);
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   ARTICOLO — corpo
============================================================ */
.article-body { padding-block: clamp(4rem, 7vw, 6rem); background: var(--white); }

.prose { max-width: 720px; margin-inline: auto; }

.prose h2 {
  margin-top: 3rem;
  font-size: clamp(1.5rem, 2.2vw, 1.875rem);
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.prose h3 { margin-top: 2.25rem; font-size: 1.1875rem; letter-spacing: -0.02em; }
.prose p {
  margin-top: 1.25rem;
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--text-body);
}
.prose p .em, .prose p .font-semibold { color: var(--text); }

.prose ul, .prose ol { margin-top: 1.25rem; }
.prose li {
  position: relative;
  margin-bottom: .75rem;
  padding-left: 1.75rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--text-body);
}
.prose li::before {
  content: "";
  position: absolute;
  left: 0; top: .75rem;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--orange);
}
.prose ol { counter-reset: item; }
.prose ol li::before {
  counter-increment: item;
  content: counter(item);
  top: 0;
  width: auto; height: auto;
  border-radius: 0;
  background: none;
  font-size: .875rem;
  font-weight: 700;
  color: var(--orange-deep);
}

.prose blockquote {
  margin-top: 2rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--r-md);
  background: var(--cream);
  border-left: 3px solid var(--orange);
  font-size: 1.125rem;
  font-style: italic;
  line-height: 1.65;
  color: var(--text);
}

.takeaway {
  margin-top: 2.5rem;
  padding: 2rem 2rem 1.75rem;
  border-radius: var(--r-lg);
  background: linear-gradient(160deg, #14305C 0%, #0B1F40 100%);
  color: var(--white);
  box-shadow: 0 24px 50px -22px rgba(11, 31, 64, .45);
}
.takeaway h3 {
  margin: 0 0 1rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--orange);
}
.takeaway ul { margin: 0; }
.takeaway li {
  padding-left: 1.75rem;
  margin-bottom: .625rem;
  font-size: var(--fs-sm);
  line-height: 1.7;
  color: rgba(255, 255, 255, .84);
}
.takeaway li::before { background: var(--orange); top: .6rem; }
.takeaway li:last-child { margin-bottom: 0; }

.callout {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  border-radius: var(--r-md);
  background: rgba(255, 145, 77, .10);
  border: 1px solid rgba(255, 145, 77, .28);
}
.callout h3 {
  margin: 0 0 .5rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--orange-deep);
}
.callout p { margin: 0; font-size: var(--fs-sm); line-height: 1.7; color: var(--text-body); }

.inline-cta {
  margin-top: 3rem;
  /* padding laterale ridotto sui telefoni stretti, così il CTA respira */
  padding: 2rem clamp(1.25rem, 5vw, 2rem);
  border-radius: var(--r-lg);
  background: var(--cream);
  border: 1px solid var(--cream-line);
  text-align: center;
}
.inline-cta h3 { margin: 0 0 .5rem; font-size: 1.25rem; letter-spacing: -0.025em; }
.inline-cta p  { margin: 0 0 1.5rem; font-size: var(--fs-sm); color: var(--text-body); }

.author-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: 720px;
  margin: clamp(3rem, 5vw, 4rem) auto 0;
  padding: 1.75rem;
  border-radius: var(--r-lg);
  background: var(--white);
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-sm);
}
.author-card img {
  width: 68px; height: 68px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}
.author-card .who h3 { margin: 0; font-size: 1.0625rem; letter-spacing: -0.02em; }
.author-card .who span { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: .5rem; }
.author-card .who p { margin: 0; font-size: var(--fs-sm); line-height: 1.65; color: var(--text-body); }

/* ponte verso l'indice del blog */
.back-to-blog {
  display: flex;
  justify-content: center;
  margin: clamp(2.5rem, 4vw, 3.5rem) auto 0;
}
.back-to-blog .btn { gap: .625rem; }
.back-to-blog .btn svg { transition: transform .4s var(--ease); }
.back-to-blog .btn:hover svg { transform: translateX(-3px); }

/* ============================================================
   ARTICOLO — correlati
============================================================ */
.related { padding-block: clamp(4rem, 7vw, 6rem); background: var(--cream); }
.related .section-head { margin-bottom: clamp(2.5rem, 4vw, 3.5rem); }
.related .articles { grid-template-columns: repeat(2, 1fr); }
.related .article-card { border-color: var(--cream-line); }

.related-cta { display: flex; justify-content: center; margin-top: clamp(2.5rem, 4vw, 3.5rem); }

/* ============================================================
   Responsive
============================================================ */
@media (max-width: 1080px) {
  .articles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .featured { grid-template-columns: 1fr; }
  .featured-media { order: 1; aspect-ratio: 16 / 10; }
  .featured-body  { order: 2; padding-right: 0; }
  .related .articles { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .articles { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
  .article-cover { margin-top: -1.5rem; }
  .author-card { flex-direction: column; text-align: center; }
  .filters { gap: .375rem; }
  .filter { height: 36px; padding-inline: .875rem; }
  .back-to-blog .btn, .related-cta .btn { width: 100%; }
}

/* I chip filtro restano alti 40px (36px sotto i 700px) per non
   alterare la grafica: l'area sensibile al tocco viene estesa a
   42-46px con un overlay trasparente. L'estensione è di 3px per
   lato, cioè meno dello spazio libero tra una riga di chip e
   l'altra (6px), così due chip non si rubano mai il tocco. */
.filter { position: relative; }
.filter::after { content: ""; position: absolute; inset: -3px 0; }
