/* ==========================================================================
   GTApt v2.7.4 — "Notícias em Destaque" layouts A/B/C/D (front page only).
   Layout: Personalizar → Notícias em Destaque. Markup: inc/home-featured.php
   Uses theme variables so dark + Vice City light palettes both apply.
   ========================================================================== */

/* ---------- shared ---------- */
.fp a { text-decoration: none; }
.fp-media {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-secondary);
}
.fp-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.fp a:hover .fp-media img { transform: scale(1.04); }
.fp-media--169 { aspect-ratio: 16 / 9; }
.fp-media--none {
  background:
    radial-gradient(circle at 78% 22%, rgba(236, 72, 153, 0.55), transparent 55%),
    radial-gradient(circle at 12% 90%, rgba(139, 92, 246, 0.6), transparent 60%),
    linear-gradient(135deg, #1a0a2e, #0a0a0f 60%, #2a0a22);
}
html[data-theme="light"] .fp-media--none {
  background: linear-gradient(135deg, #ffd9c7 0%, #f9c6d6 48%, #bfe6e0 100%);
}
.fp-media__ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.1em;
}
html[data-theme="light"] .fp-media__ph { color: #8a2a55; }

.fp-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--accent-purple);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
html[data-theme="light"] .fp-badge { background: linear-gradient(90deg, #b4235f, #b83a4b 50%, #c2410c); }
.fp-kicker {
  color: var(--accent-pink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.fp-meta { color: var(--text-muted); font-size: 0.8rem; }
.fp-meta--light { color: rgba(255, 255, 255, 0.78); }

/* Overlay text on image (always dark gradient + white text) */
.fp-overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  color: #fff;
  background: linear-gradient(to top, rgba(10, 8, 16, 0.94) 0%, rgba(10, 8, 16, 0.7) 45%, rgba(10, 8, 16, 0) 100%);
  padding-top: 90px;
}
.fp-overlay--sm { gap: 7px; padding: 18px; padding-top: 60px; }

.fp-clamp-2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }

/* ---------- A: lead overlay + 2 stacked + row ---------- */
.fpA__top {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 20px;
}
.fpA__lead,
.fpA__side-card {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 16px;
}
.fpA__lead { min-height: 480px; }
.fpA__lead .fp-media,
.fpA__side-card .fp-media { position: absolute; inset: 0; }
.fpA__lead-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  text-wrap: balance;
}
.fpA__lead-exc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  max-width: 60ch;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.98rem;
  line-height: 1.55;
}
.fpA__side { display: grid; grid-template-rows: 1fr 1fr; gap: 20px; }
.fpA__side-card { min-height: 230px; }
.fpA__side-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}
.fpA__row { gap: 20px; margin-top: 20px; }
.fpA__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--bg-card);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.fpA__card:hover { border-color: var(--accent-purple); transform: translateY(-2px); }
.fpA__card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.fpA__card-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  color: var(--text-primary);
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
}

/* ---------- B: uniform 3-column cards ---------- */
.fpB { gap: 22px; }
.fpB__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-card);
  box-shadow: var(--shadow-card, none);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.fpB__card:hover { transform: translateY(-3px); border-color: var(--accent-purple); }
.fpB__img { position: relative; display: block; }
.fpB__badge { position: absolute; top: 12px; left: 12px; z-index: 1; }
.fpB__body { display: flex; flex: 1; flex-direction: column; gap: 10px; padding: 16px 18px 18px; }
.fpB__title { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.fpB__title a {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  color: var(--text-primary);
}
.fpB__title a:hover { color: var(--accent-purple); }
.fpB__exc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.55;
}
.fpB__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}
.fpB__more { color: var(--accent-purple); font-size: 0.82rem; font-weight: 600; white-space: nowrap; }

/* ---------- C: editorial lead + list ---------- */
.fpC__lead {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-card);
}
.fpC__lead-img { display: block; min-height: 340px; }
.fpC__lead-img .fp-media { height: 100%; }
.fpC__lead-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 30px 32px;
}
.fpC__lead-title { margin: 0; font-size: 1.7rem; line-height: 1.18; text-wrap: balance; }
.fpC__lead-title a { color: var(--text-primary); }
.fpC__lead-title a:hover { color: var(--accent-purple); }
.fpC__lead-exc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.6;
}
.fpC__list { margin: 12px 0 0; padding: 0; list-style: none; }
.fpC__item {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--border-color);
}
.fpC__item:last-child { border-bottom: 0; }
.fpC__thumb { display: block; overflow: hidden; border-radius: 12px; }
.fpC__thumb .fp-media { aspect-ratio: 16 / 9; }
.fpC__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fpC__title { margin: 0; font-size: 1.12rem; line-height: 1.3; }
.fpC__title a { color: var(--text-primary); }
.fpC__title a:hover { color: var(--accent-purple); }
.fpC__exc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* ---------- D: bento mosaic ---------- */
.fpD {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 210px;
  grid-template-areas:
    "t1 t1 t2 t2"
    "t1 t1 t3 t4"
    "t5 t5 t6 t6";
  gap: 16px;
}
.fpD__tile {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-secondary);
}
.fpD__tile .fp-media { position: absolute; inset: 0; }
.fpD__tile--1 { grid-area: t1; }
.fpD__tile--2 { grid-area: t2; }
.fpD__tile--3 { grid-area: t3; }
.fpD__tile--4 { grid-area: t4; }
.fpD__tile--5 { grid-area: t5; }
.fpD__tile--6 { grid-area: t6; }
.fpD__title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.fpD__tile--1 .fpD__title { font-family: var(--font-display); font-size: 1.8rem; line-height: 1.15; }
.fpD__tile--3 .fpD__title,
.fpD__tile--4 .fpD__title { font-size: 0.92rem; }
.fpD__exc {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ---------- flow grid (A row, B) ----------
   2 per row by default (main column ~660px next to the sidebar), 3 per row
   from 1400px, 1 per row on mobile.
   A lone last card spans the full row as a horizontal card, and a last row
   of 2 (in 3-per-row mode) splits the row in half, so there are no holes. */
.fp-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.fp-flow > .fp-flow__item { grid-column: span 3; }
/* images fill their box (lets horizontal lone cards crop instead of growing) */
.fp-flow__item .fp-media img { position: absolute; inset: 0; }
.fp-flow > .fp-flow__item:nth-child(odd):last-child { grid-column: 1 / -1; }
.fpA__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child,
.fpB__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.fpA__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child .fp-media { aspect-ratio: auto; height: 100%; min-height: 180px; }
.fpA__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child .fpA__card-body { justify-content: center; padding: 20px 24px; }
.fpB__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child .fpB__img .fp-media { aspect-ratio: auto; height: 100%; min-height: 220px; }

@media (min-width: 1400px) {
  .fp-flow > .fp-flow__item.fp-flow__item:nth-child(n) { grid-column: span 2; }
  /* reset the 2-per-row "lone odd" rule */
  .fpA__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child,
  .fpB__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child { display: flex; }
  .fpA__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child .fp-media,
  .fpB__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child .fpB__img .fp-media { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .fpA__card.fp-flow__item.fp-flow__item:nth-child(odd):last-child .fpA__card-body { justify-content: flex-start; padding: 14px 16px 16px; }
  /* last row of 2 → halves */
  .fp-flow > .fp-flow__item.fp-flow__item:nth-child(3n+1):nth-last-child(2),
  .fp-flow > .fp-flow__item.fp-flow__item:nth-child(3n+1):nth-last-child(2) + .fp-flow__item { grid-column: span 3; }
  /* last row of 1 → full-width horizontal card */
  .fp-flow > .fp-flow__item.fp-flow__item:nth-child(3n+1):last-child { grid-column: 1 / -1; }
  .fpA__card.fp-flow__item.fp-flow__item:nth-child(3n+1):last-child,
  .fpB__card.fp-flow__item.fp-flow__item:nth-child(3n+1):last-child { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .fpA__card.fp-flow__item.fp-flow__item:nth-child(3n+1):last-child .fp-media { aspect-ratio: auto; height: 100%; min-height: 180px; }
  .fpA__card.fp-flow__item.fp-flow__item:nth-child(3n+1):last-child .fpA__card-body { justify-content: center; padding: 20px 24px; }
  .fpB__card.fp-flow__item.fp-flow__item:nth-child(3n+1):last-child .fpB__img .fp-media { aspect-ratio: auto; height: 100%; min-height: 220px; }
}

/* ---------- A: fewer than 3 posts ---------- */
.fpA__top--solo { grid-template-columns: minmax(0, 1fr); }
.fpA__top--side-1 .fpA__side { grid-template-rows: 1fr; }

/* ---------- D: templates per block size (n1..n6), mirrored every other block ---------- */
.fpD + .fpD { margin-top: 16px; }
.fpD--n1 { grid-template-areas: "t1 t1 t1 t1" "t1 t1 t1 t1"; }
.fpD--n2 { grid-template-areas: "t1 t1 t2 t2" "t1 t1 t2 t2"; }
.fpD--n3 { grid-template-areas: "t1 t1 t2 t2" "t1 t1 t3 t3"; }
.fpD--n4 { grid-template-areas: "t1 t1 t2 t2" "t1 t1 t3 t4"; }
.fpD--n5 { grid-template-areas: "t1 t1 t2 t2" "t1 t1 t3 t4" "t5 t5 t5 t5"; }
.fpD--alt.fpD--n2 { grid-template-areas: "t2 t2 t1 t1" "t2 t2 t1 t1"; }
.fpD--alt.fpD--n3 { grid-template-areas: "t2 t2 t1 t1" "t3 t3 t1 t1"; }
.fpD--alt.fpD--n4 { grid-template-areas: "t2 t2 t1 t1" "t3 t4 t1 t1"; }
.fpD--alt.fpD--n5 { grid-template-areas: "t2 t2 t1 t1" "t3 t4 t1 t1" "t5 t5 t5 t5"; }
.fpD--alt.fpD--n6 { grid-template-areas: "t2 t2 t1 t1" "t3 t4 t1 t1" "t5 t5 t6 t6"; }

/* ---------- gradient fallback under overlay text: small watermark top-right ---------- */
.fpD .fp-media--none .fp-media__ph,
.fpA__lead .fp-media--none .fp-media__ph,
.fpA__side-card .fp-media--none .fp-media__ph {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 14px 16px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  opacity: 0.55;
}

.fp-empty { padding: 40px 20px; color: var(--text-secondary); text-align: center; }

/* ---------- mobile ---------- */
@media (max-width: 768px) {
  .fp-flow > .fp-flow__item.fp-flow__item:nth-child(n) { grid-column: 1 / -1; }
  .fpB__card.fp-flow__item.fp-flow__item:nth-child(n):last-child { display: flex; }
  .fpB__card.fp-flow__item.fp-flow__item:nth-child(n):last-child .fpB__img .fp-media { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
  .fpA__card.fp-flow__item.fp-flow__item:nth-child(n):last-child { display: flex; }
  .fpA__card.fp-flow__item.fp-flow__item:nth-child(n):last-child .fp-media { aspect-ratio: auto; height: auto; min-height: 96px; }
  .fpA__card.fp-flow__item.fp-flow__item:nth-child(n):last-child .fpA__card-body { justify-content: flex-start; padding: 14px 16px 16px; }
  .fpA__top--side-1 .fpA__side { grid-template-columns: minmax(0, 1fr); }

  /* D mobile: 2 columns, lead tile big, no holes */
  .fpD,
  .fpD--alt {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: none;
    grid-auto-rows: 170px;
    gap: 10px;
  }
  .fpD + .fpD { margin-top: 10px; }
  .fpD .fpD__tile { grid-area: auto; }
  .fpD .fpD__tile--1 { grid-column: 1 / -1; grid-row: span 2; }
  .fpD .fpD__tile--2 { grid-column: 1 / -1; }
  .fpD .fpD__tile:nth-child(odd):last-child:not(:first-child) { grid-column: 1 / -1; }
}

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  .fpA__top,
  .fpC__lead { grid-template-columns: minmax(0, 1fr); }
  .fpA__lead { min-height: 380px; }
  .fpA__lead-title { font-size: 1.45rem; }
  .fpA__side { grid-template-rows: none; grid-template-columns: 1fr 1fr; gap: 12px; }
  .fpA__side-card { min-height: 230px; }
  .fpA__side-card .fp-overlay { padding: 12px; padding-top: 44px; }
  .fpA__side-card .fp-badge { display: none; }
  .fpA__side-title { font-size: 0.9rem; }
  .fpA__row { gap: 12px; }
  .fpA__card { flex-direction: row; }
  .fpA__card .fp-media { flex: 0 0 38%; aspect-ratio: auto; min-height: 96px; }
  .fpB { gap: 16px; }
  .fpC__lead-img { min-height: 220px; }
  .fpC__lead-body { padding: 20px; }
  .fpC__lead-title { font-size: 1.3rem; }
  .fpC__item { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 14px 0; }
  .fpC__exc { display: none; }
  .fpC__title { font-size: 0.98rem; }
  .fpD__tile--1 .fpD__title { font-size: 1.35rem; }
  .fpD__exc { display: none; }
  .fpD__tile--3 .fp-overlay,
  .fpD__tile--4 .fp-overlay,
  .fpD__tile--5 .fp-overlay,
  .fpD__tile--6 .fp-overlay { padding: 12px; padding-top: 40px; }
  .fpD__tile--3 .fp-badge,
  .fpD__tile--4 .fp-badge,
  .fpD__tile--5 .fp-badge,
  .fpD__tile--6 .fp-badge { display: none; }
  .fpD__tile--5 .fpD__title,
  .fpD__tile--6 .fpD__title { font-size: 0.88rem; }
}
