/* ==========================================================================
   FRONT-PAGE — homepage (mockup D · Editorial quente)
   ========================================================================== */

/* --- HERO --- */
.fp-hero {
  padding: clamp(72px, 9vw, 130px) 0 clamp(50px, 7vw, 90px);
  position: relative;
  overflow: hidden;
}
.fp-hero__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
}
.fp-hero__title {
  font-family: var(--amato-serif);
  font-size: clamp(42px, 6vw, 74px);
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0 0 24px;
  color: var(--amato-ink);
}
.fp-hero__title em { font-style: italic; color: var(--amato-green); }
.fp-hero__lede {
  font-size: 19px;
  color: var(--amato-muted);
  max-width: 540px;
  margin-bottom: 32px;
  line-height: 1.6;
}
.fp-hero__lede p:first-child { margin-top: 0; }
.fp-hero__lede p:last-child { margin-bottom: 0; }
.fp-hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }

.fp-portrait-wrap { position: relative; padding: 20px; }
.fp-portrait-wrap::before {
  content: ''; position: absolute; inset: 0;
  border: 1.5px solid var(--amato-green);
  border-radius: var(--amato-radius);
}
.fp-portrait {
  aspect-ratio: 4 / 5;
  background: linear-gradient(135deg, #3d6f5f 0%, #1e4236 70%, #0e2820 100%);
  border-radius: var(--amato-radius);
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(26, 46, 46, .3);
}
/* Fallback para browsers sem aspect-ratio: usa padding-top trick.
   ::before invisivel garante altura proporcional (5/4 = 125%). */
@supports not (aspect-ratio: 4 / 5) {
  .fp-portrait::before {
    content: '';
    display: block;
    padding-top: 125%;
  }
}
.fp-portrait::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 35%, rgba(212, 164, 84, .35) 0%, transparent 55%);
}
.fp-portrait__label {
  position: absolute; bottom: 20px; left: 20px; right: 20px;
  color: var(--amato-paper);
  font-family: var(--amato-serif); font-style: italic;
  font-size: 13px; opacity: .55; z-index: 2;
}
.fp-portrait__cap {
  position: absolute; bottom: 32px; right: 32px;
  background: var(--amato-ochre); color: var(--amato-ink);
  padding: 8px 14px;
  font-family: var(--amato-serif); font-style: italic; font-size: 14px;
  border-radius: var(--amato-radius);
  box-shadow: 0 4px 12px rgba(26, 46, 46, .2);
  z-index: 2;
}

/* --- SECTIONS --- */
.fp-section {
  padding: clamp(60px, 8vw, 100px) 0;
  position: relative;
  border-top: 1px solid var(--amato-line);
}
.fp-sec-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--amato-line);
}
.fp-sec-head__title {
  font-family: var(--amato-serif);
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  margin: 0;
}
.fp-sec-head__title em { font-style: italic; color: var(--amato-green); }
.fp-sec-head__all {
  font-size: 14px; font-weight: 600; color: var(--amato-ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--amato-ochre);
  padding-bottom: 3px;
  transition: color .15s;
}
.fp-sec-head__all:hover { color: var(--amato-ochre-d); }
.fp-sec-head__intro {
  max-width: 640px;
  color: var(--amato-muted);
  font-size: 16px;
  margin: 20px 0 32px;
  font-family: var(--amato-serif); font-style: italic;
  line-height: 1.6;
}
.fp-sec-head__intro p:first-child { margin-top: 0; }
.fp-sec-head__intro p:last-child { margin-bottom: 0; }

/* --- MANUAIS --- */
.fp-manuais {
  display: grid;
  /* --fp-cols é injectado inline pelo template consoante count/cols */
  grid-template-columns: repeat(var(--fp-cols, 4), 1fr);
  gap: 28px;
  margin-bottom: 28px;
}
.fp-manuais:last-child { margin-bottom: 0; }
.fp-manuais__row-head {
  max-width: 720px;
  margin: 32px 0 18px;
  border-top: 1px solid var(--amato-line);
  padding-top: 20px;
}
.fp-manuais__row-title {
  font-family: var(--amato-serif);
  font-weight: 500;
  font-size: 22px;
  margin: 0 0 6px;
  color: var(--amato-ink);
}
.fp-manuais__row-title em { font-style: italic; color: var(--amato-green); }
.fp-manuais__row-lede {
  color: var(--amato-muted);
  font-family: var(--amato-serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
}
.fp-manuais__row-lede p:first-child { margin-top: 0; }
.fp-manuais__row-lede p:last-child { margin-bottom: 0; }
/* Alinhamento da última linha quando não está cheia: usa colunas com
   max-width para os cards não esticarem, e justify-content para os
   alinhar dentro do grid. */
.fp-manuais--align-center,
.fp-manuais--align-right {
  grid-template-columns: repeat(var(--fp-cols, 4), minmax(0, 260px));
}
.fp-manuais--align-center { justify-content: center; }
.fp-manuais--align-right  { justify-content: end; }
.fp-manual {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform .2s ease;
}
.fp-manual:hover { transform: translateY(-5px); }
.fp-manual__cover {
  aspect-ratio: 3 / 4;
  border-radius: var(--amato-radius);
  padding: 22px;
  color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
  margin-bottom: 14px;
  font-family: var(--amato-serif);
  box-shadow: 0 22px 40px -18px rgba(26, 46, 46, .35);
  position: relative;
  overflow: hidden;
  background: linear-gradient(170deg, var(--c1, #3d6f5f), var(--c2, #1e4236));
}
.fp-manual__cover::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 8px;
  background: var(--amato-ochre);
}
.fp-manual__top {
  font-size: 11px; opacity: .75;
  font-family: var(--amato-sans);
  text-transform: uppercase; letter-spacing: 0.12em;
}
.fp-manual__big {
  font-size: 30px; font-weight: 500;
  line-height: 1.05; letter-spacing: -0.01em;
}
.fp-manual__sub {
  font-size: 12px; opacity: .75;
  font-family: var(--amato-sans);
  margin-top: 4px;
}
.fp-manual__name {
  font-family: var(--amato-serif);
  font-size: 18px; font-weight: 500;
  color: var(--amato-ink);
  margin-bottom: 4px;
}
.fp-manual__meta {
  font-size: 13px; color: var(--amato-muted);
  font-family: var(--amato-serif); font-style: italic;
}

/* --- TESTES: tabs --- */
.fp-tabs {
  display: flex; gap: 0;
  margin-bottom: 32px;
  border-bottom: 1.5px solid var(--amato-line);
  flex-wrap: wrap;
  overflow-x: auto;
}
.fp-tab {
  padding: 12px 18px;
  font-size: 13px; font-weight: 600;
  font-family: var(--amato-sans);
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--amato-muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1.5px;
  transition: all .15s;
  white-space: nowrap;
}
.fp-tab:hover { color: var(--amato-ink); }
.fp-tab.is-active {
  color: var(--amato-green);
  border-color: var(--amato-green);
}

/* --- TESTES: grelha --- */
.fp-testes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.fp-teste {
  background: var(--amato-paper-2);
  border: 1px solid var(--amato-line);
  border-radius: var(--amato-radius);
  overflow: hidden;
  transition: all .2s ease;
  position: relative;
}
.fp-teste:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 40px -15px rgba(26, 46, 46, .22);
  border-color: var(--amato-green);
}
.fp-teste__thumb {
  aspect-ratio: 1 / 1.35;
  background: var(--amato-paper);
  border-bottom: 1px solid var(--amato-line);
  position: relative;
  overflow: hidden;
}
.fp-teste__paper {
  position: absolute; inset: 20px;
  background: #fff;
  border: 1px solid var(--amato-line);
  padding: 18px;
  display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 2px 8px rgba(26, 46, 46, .05);
}
.fp-teste__paper::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--amato-green);
}
.fp-teste__th {
  font-family: var(--amato-serif);
  font-size: 11px; font-style: italic;
  color: var(--amato-green);
  margin-top: 4px;
}
.fp-teste__eq {
  font-family: var(--amato-serif); font-style: italic;
  font-size: 22px; color: var(--amato-ink);
  text-align: center;
  margin: 10px 0;
  font-weight: 500;
}
.fp-teste__ln {
  height: 2px;
  background: var(--amato-paper-3);
  border-radius: 1px;
}
.fp-teste__ln:nth-of-type(odd) { width: 88%; }
.fp-teste__ln:nth-of-type(even) { width: 68%; }

.fp-teste__body { padding: 20px; }
.fp-teste__badges {
  display: flex; gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.fp-badge {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: var(--amato-radius);
  background: var(--amato-paper-3);
  color: var(--amato-ink);
}
.fp-badge--ano { background: var(--amato-green); color: var(--amato-paper); }
.fp-badge--man { background: var(--amato-ochre); color: var(--amato-ink); }

.fp-teste__title {
  font-family: var(--amato-serif);
  font-size: 18px; font-weight: 500;
  margin: 0 0 4px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.fp-teste__sub {
  font-size: 13px; color: var(--amato-muted);
  margin-bottom: 16px;
  font-style: italic;
  font-family: var(--amato-serif);
}
.fp-teste__actions { display: flex; gap: 8px; }
.fp-btn-sm {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  border-radius: var(--amato-radius);
  transition: all .15s;
}
.fp-btn-sm--test { background: var(--amato-ink); color: var(--amato-paper); }
.fp-btn-sm--test:hover { background: var(--amato-green); color: var(--amato-paper); }
.fp-btn-sm--sol {
  background: transparent;
  color: var(--amato-ink);
  border: 1.5px solid var(--amato-ink);
}
.fp-btn-sm--sol:hover { background: var(--amato-ink); color: var(--amato-paper); }

/* --- ANOS --- */
.fp-anos {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
  margin-top: 32px;
}
.fp-ano {
  aspect-ratio: 1;
  background: var(--amato-paper);
  border: 1.5px solid var(--amato-line);
  border-radius: var(--amato-radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-decoration: none;
  color: var(--amato-ink);
  transition: all .2s;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.fp-ano::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--amato-ochre);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s;
}
.fp-ano:hover {
  background: var(--amato-green);
  color: var(--amato-paper);
  border-color: var(--amato-green);
  transform: translateY(-3px);
}
.fp-ano:hover::before { transform: scaleX(1); background: var(--amato-ochre); }
.fp-ano__big {
  font-family: var(--amato-serif);
  font-size: 46px; font-weight: 500;
  line-height: 1; letter-spacing: -0.02em;
}
.fp-ano__sm {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: .75; font-weight: 500;
}

/* --- Últimos artigos --- */
.fp-latest {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 28px;
    margin-top: 32px;
}
.fp-latest__item {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.fp-latest__thumb {
    display: block;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: var(--amato-radius);
    background: #fff;
    border: 1px solid var(--amato-line);
    position: relative;
}
.fp-latest__thumb img {
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform .3s ease;
}
.fp-latest__thumb:hover img { transform: scale(1.03); }
.fp-latest__cat {
    display: inline-block;
    font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--amato-ochre-d);
    text-decoration: none;
    margin-bottom: 4px;
}
.fp-latest__cat:hover { color: var(--amato-green); }
.fp-latest__title {
    font-family: var(--amato-serif);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.2;
    margin: 0 0 8px;
}
.fp-latest__title a {
    color: var(--amato-ink);
    text-decoration: none;
}
.fp-latest__title a:hover { color: var(--amato-green); }
.fp-latest__meta {
    font-family: var(--amato-serif);
    font-style: italic;
    font-size: 13px;
    color: var(--amato-muted);
    margin-bottom: 10px;
}
.fp-latest__comments {
    font-style: normal;
    color: var(--amato-green);
    font-family: var(--amato-sans);
    font-weight: 500;
    font-size: 12px;
}
.fp-latest__excerpt {
    font-size: 14px;
    color: var(--amato-ink-2);
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 860px) {
    .fp-latest { grid-template-columns: repeat(2, 1fr); gap: 24px 20px; }
}
@media (max-width: 520px) {
    .fp-latest { grid-template-columns: 1fr; }
}

/* --- Tab panels --- */
.fp-tab-panel[hidden] { display: none !important; }
.fp-empty { color: var(--amato-muted); font-style: italic; text-align: center; padding: 40px 20px; }

/* --- Responsive --- */
@media (max-width: 860px) {
  .fp-hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .fp-portrait-wrap { max-width: 380px; margin: 0 auto; }
  /* Garantir altura mínima da foto mesmo se aspect-ratio falhar */
  .fp-portrait { min-height: 60vw; }
  .fp-manuais, .fp-testes { grid-template-columns: repeat(2, 1fr); }
  .fp-anos { grid-template-columns: repeat(3, 1fr); }
  .fp-sec-head { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 520px) {
  .fp-manuais, .fp-testes { grid-template-columns: 1fr; }
  .fp-anos { grid-template-columns: repeat(2, 1fr); }
  /* Legenda do retrato mais pequena em ecra estreito */
  .fp-portrait__cap {
    bottom: 16px; right: 16px;
    padding: 4px 9px;
    font-size: 12px;
  }
  /* Garantir altura proporcional da foto */
  .fp-portrait { min-height: 70vw; }
  /* Seccao colapsavel: cabecalho clicavel, conteudo escondido por defeito */
  [data-collapse-mobile] .fp-sec-head { cursor: pointer; user-select: none; position: relative; padding-right: 28px; }
  [data-collapse-mobile] .fp-sec-head::after {
    content: '\25BE'; /* triangulo apontado para baixo */
    position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
    color: var(--amato-muted); font-size: 14px; transition: transform .15s;
  }
  [data-collapse-mobile].is-collapsed .fp-sec-head::after { transform: translateY(-50%) rotate(-90deg); }
  [data-collapse-mobile].is-collapsed .fp-sec-head__intro,
  [data-collapse-mobile].is-collapsed .fp-manuais,
  [data-collapse-mobile].is-collapsed .fp-tabs,
  [data-collapse-mobile].is-collapsed .fp-tab-panel,
  [data-collapse-mobile].is-collapsed .fp-empty { display: none; }
}
