/* ── Homepage (novo design Figma) — estilos escopados a .hp ───────────── */
.hp {
  --hp-navy: #0f172a;
  --hp-blue: #0078c0;
  max-width: 1580px;
  margin: 0 auto;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  font-family: 'Inter', sans-serif;
  color: var(--hp-navy);
}
.hp a { text-decoration: none; color: inherit; }
.hp img { display: block; }
.hp-title {
  margin: 0;
}
.hp-title em, .hp-hero__title em { font-style: normal; color: var(--hp-blue); }
.hp-title--blue { color: var(--hp-blue); }
.hp-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.hp-sec-sub { margin: 4px 0 0; }
.hp-sec-link { font-size: 13px; font-weight: 600; color: var(--gp-accent-strong, #006fa8); white-space: nowrap; }
.hp-sec-link:hover { text-decoration: underline !important; }

/* Hero */
.hp-hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 106px; }
.hp-hero__brand { display: flex; align-items: center; padding-left: 164px; }
.hp-hero__title {
  font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 900; font-size: 38px;
  line-height: 1.04; margin: 0; color: var(--hp-navy); text-transform: uppercase;
}
.hp-hero__title span { display: block; }
/* palavra animada (static/js/home_typewriter.js) */
.hp-hero__title .hp-type { font-weight: inherit; color: var(--hp-blue); }
.hp-caret { display: inline-block; width: .06em; height: .85em; margin-left: .06em; vertical-align: -.05em; background: var(--hp-blue); animation: hp-blink 1s steps(1) infinite; }
@keyframes hp-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .hp-caret { animation: none; display: none; } }
.hp-hero__sub { font-size: 14px; font-weight: 700; line-height: 1.5; color: #475569; width: 297px; margin: 0; flex-shrink: 0; }
.hp-logo { position: absolute; left: 0; top: -28px; width: 159px; height: auto; }

/* Etiquetas */
.hp-tag { display: inline-flex; font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #e0f2fe; color: var(--hp-blue); white-space: nowrap; }
.hp-tag--white { background: #fff; border-radius: 6px; }

/* A decorrer */
.hp-live { display: flex; align-items: center; gap: 20px; background: var(--hp-navy); color: #fff; border-radius: 14px; padding: 20px 24px; }
.hp-live[hidden] { display: none; }
.hp-live__pill { display: inline-flex; align-items: center; gap: 8px; background: #e52633; border: 1px solid #ff6b75; border-radius: 999px; padding: 7px 14px 7px 12px; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.hp-live__pill i { width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.hp-live__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hp-live__name { font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-live__meta { font-size: 13px; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-live__btn { background: #fff; color: var(--hp-navy) !important; font-size: 13px; font-weight: 600; padding: 10px 16px; border-radius: 6px; white-space: nowrap; }
#liveWrap { display: flex; flex-direction: column; gap: 12px; }
#liveWrap:empty { display: none; }

/* Cartões de prova */
.hp-events { display: flex; gap: 16px; }
.hp-evt { flex: 1 1 0; min-width: 0; height: 120px; display: flex; background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; transition: box-shadow .15s; }
.hp-evt:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.hp-evt__cover { width: 96px; flex-shrink: 0; object-fit: cover; height: 100%; }
.hp-evt__nocover { width: 96px; flex-shrink: 0; background: #e0f2fe; color: var(--gp-accent-strong, #006fa8); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.hp-evt__nocover b { font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 900; font-size: 32px; line-height: 1.2; }
.hp-evt__nocover span { font-size: 13px; font-weight: 700; text-transform: uppercase; }
.hp-evt__body { flex: 1; min-width: 0; padding: 12px 14px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 6px; }
.hp-evt__chip { background: var(--gp-yellow, #f4c300); color: var(--hp-navy); font-size: 11px; font-weight: 700; padding: 6px 8px; border-radius: 8px; text-transform: uppercase; white-space: nowrap; }
.hp-evt__name { font-size: 15px; font-weight: 700; line-height: 1.2; max-width: 100%; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hp-evt__org { font-size: 12px; color: #64748b; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hp-evt--cal { flex: 0 0 440px; align-items: center; gap: 16px; padding: 0 24px; }
.hp-evt--cal div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hp-evt--cal strong { font-size: 16px; font-weight: 600; }
.hp-evt--cal small { font-size: 13px; color: #64748b; }
.hp-evt--cal span { font-size: 20px; font-weight: 600; color: var(--hp-blue); }
#upcomingGrid.hp-events { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#upcomingGrid .hp-evt--cal { padding: 0 20px; gap: 12px; }
.hp-events--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.hp-skel { background: linear-gradient(90deg, #eef2f7 25%, #f6f8fb 50%, #eef2f7 75%); background-size: 200% 100%; animation: hpShimmer 1.4s infinite; border-radius: 12px; }
@keyframes hpShimmer { to { background-position: -200% 0; } }

/* Notícias */
.hp-news-top { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px 16px; }
.hp-news-side { display: flex; flex-direction: column; gap: 16px; }
.hp-news-lead { position: relative; min-height: 560px; border-radius: 12px; overflow: hidden; background: linear-gradient(180deg, #94a8c2, #5c708c); color: #fff !important; display: flex; align-items: flex-end; }
.hp-news-lead > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hp-news-lead::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15,20,31,0) 25%, rgba(15,20,31,.88)); }
.hp-news-lead__body { position: relative; z-index: 1; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.hp-news-lead__title { font-size: 28px; line-height: 34px; font-weight: 800; letter-spacing: -0.015em; margin: 0; }
.hp-news-lead__sum { font-size: 14px; line-height: 21px; margin: 0; max-height: 42px; overflow: hidden; }
.hp-meta { display: flex; align-items: center; gap: 8px; }
.hp-chip { font-size: 11px; font-weight: 700; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: #e0f2fe; color: var(--gp-accent-strong, #006fa8); }
.hp-news-lead .hp-chip { background: var(--gp-accent-strong, #006fa8); color: #fff; }
.hp-date { font-size: 12px; font-weight: 500; color: #64748b; }
.hp-news-lead .hp-date { color: #fff; }
.hp-ncard { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s; }
.hp-ncard:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.hp-news-side .hp-ncard { flex: 1; min-height: 272px; border-color: #d1d5db; box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.hp-ncard__img { flex: 1 1 auto; min-height: 160px; background: linear-gradient(173deg, #e6eaf0 8%, #d5e3f1 68%); position: relative; overflow: hidden; }
.hp-news-grid .hp-ncard__img { flex: none; height: 184px; }
.hp-ncard__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hp-ncard__body { padding: 14px 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.hp-ncard__title { font-size: 16px; line-height: 22px; font-weight: 700; margin: 0; max-height: 44px; overflow: hidden; }
.hp-news-ad { margin: 24px 0 0; }
.hp-news-ad:empty { display: none; }
.hp-news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.hp-news-grid:empty { display: none; }
/* Entram 8 notícias na grelha; em 3 colunas mostram-se 6 (linhas cheias), em 4 colunas as 8. */
.hp-news-grid > .hp-ncard:nth-child(n+7) { display: none; }
@media (min-width: 1400px) {
  .hp-news-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hp-news-grid > .hp-ncard:nth-child(n+7) { display: flex; }
}

/* Disciplinas */
.hp-disc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hp-dcard { border-radius: 16px; padding: 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; background: var(--gp-cream, #fdf7f0); }
.hp-dcard--y { background: var(--gp-yellow-light, #fff8d6); }
.hp-dcard--b { background: #e0f2fe; }
.hp-dcard h3 { font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 900; font-size: 21px; line-height: 1.04; margin: 0; text-transform: uppercase; }
.hp-dcard p { font-size: 14px; line-height: 1.45; color: #475569; margin: 0; }
.hp-dcard .hp-tag { background: #fff; color: #735400; }
.hp-btn { margin-top: auto; background: #fff; border: 1.5px solid var(--hp-blue); color: var(--hp-blue) !important; font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 6px; }
.hp-btn:hover { background: var(--hp-blue); color: #fff !important; }

/* Barra amarela + dados */
.hp-why { display: flex; align-items: center; gap: 18px; background: var(--gp-yellow, #f4c300); border-radius: 14px; padding: 18px 22px; }
.hp-why div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hp-why strong { font-size: 15px; font-weight: 700; }
.hp-why span { font-size: 13px; line-height: 1.45; }
.hp-why a { background: var(--hp-navy); color: #fff !important; font-size: 13px; font-weight: 600; padding: 9px 14px; border-radius: 6px; white-space: nowrap; }
.hp-stats { display: flex; background: var(--hp-navy); border-radius: 14px; padding: 18px 8px; }
.hp-stat { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.hp-stat b { font-family: 'Montserrat', 'Inter', sans-serif; font-weight: 900; font-size: 26px; color: var(--gp-yellow, #f4c300); }
.hp-stat span { font-size: 12px; font-weight: 500; color: #fff; }
.hp .gp-footer { margin: 0; padding: 8px 0; }

@media (max-width: 1024px) {
  .hp-hero__sub { display: none; }
  .hp-events { flex-wrap: wrap; }
  .hp-evt { flex: 1 1 calc(50% - 8px); }
  .hp-evt--cal { flex: 1 1 100%; }
  #upcomingGrid.hp-events { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-news-top { grid-template-columns: 1fr; }
  .hp-news-lead { min-height: 440px; }
  .hp-news-side { flex-direction: row; }
  .hp-news-side .hp-ncard { min-width: 0; }
  .hp-news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .hp { padding: 16px; gap: 24px; }
  .hp-hero { flex-direction: column; align-items: flex-start; gap: 14px; min-height: 0; }
  .hp .hp-logo { display: none; }
  .hp .hp-evt--cal { display: none; }
  .hp-hero__brand { padding-left: 0; }
  .hp-hero__title { font-size: 28px; }
  .hp-hero__sub { width: auto; }
  .hp-live { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .hp-live__text { flex-basis: 100%; order: 3; }
  .hp-live__name { white-space: normal; font-size: 16px; }
  .hp-live__btn { margin-left: auto; }
  .hp-evt { flex: 1 1 100%; }
  #upcomingGrid.hp-events { grid-template-columns: 1fr; }
  .hp-events--grid { grid-template-columns: 1fr; }
  .hp-news-lead { min-height: 420px; }
  .hp-news-lead__title { font-size: 22px; line-height: 28px; }
  .hp-news-side { flex-direction: column; }
  .hp-news-grid { grid-template-columns: 1fr; }
  .hp-disc { grid-template-columns: 1fr; }
  .hp-why { flex-direction: column; align-items: flex-start; }
  .hp-stats { flex-wrap: wrap; row-gap: 16px; }
  .hp-stat { flex: 1 1 50%; }
}
