/* ============================================================
   POST PAGE — Estilos específicos
   Complementa o style.css principal.
   Adicione no <head> APÓS o link do style.css:
   <link rel="stylesheet" href="post.css">
   ============================================================ */


/* ============================================================
   CARTÃO PRINCIPAL DO ARTIGO
   ============================================================ */
.post-article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-sh);
  padding: clamp(24px, 4vw, 48px);
  min-width: 0;
}

/* ============================================================
   CABEÇALHO DO POST
   ============================================================ */
.post-header {
  margin-bottom: 22px;
}

.post-cat-badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #fff;
  padding: 5px 16px;
  border-radius: 50px;
  margin-bottom: 16px;
  text-decoration: none;
  transition: opacity .2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.post-cat-badge:hover { opacity: .85; }

.post-title {
  font-family: var(--font-head);
  font-size: clamp(1.55rem, 3.8vw, 2.5rem);
  font-weight: 900;
  color: var(--navy);
  line-height: 1.25;
  margin-bottom: 14px;
  letter-spacing: -.02em;
}


/* ============================================================
   META BAR (autor / data / views / tempo de leitura)
   ============================================================ */
.post-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 22px;
  padding: 13px 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 28px;
  font-size: .81rem;
  color: var(--muted);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.meta-item svg {
  flex-shrink: 0;
  color: var(--accent-dk);
}


/* ============================================================
   IMAGEM HERO
   ============================================================ */
.post-hero {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 34px;
  box-shadow: var(--card-sh);
  background: var(--border);
}

.post-hero img {
  width: 100%;
  display: block;
  max-height: 540px;
  object-fit: cover;
}

.post-hero figcaption {
  font-size: .78rem;
  color: var(--muted);
  padding: 9px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  text-align: center;
  font-style: italic;
}


/* ============================================================
   CORPO DO ARTIGO
   ============================================================ */
.post-content {
  max-width: 780px;
  font-size: 1.07rem;
  line-height: 1.82;
  color: #2f3744;
  margin: 0 auto 36px;
  overflow-wrap: anywhere;
}

/* O reset global zera as margens. Aqui devolvemos ritmo editorial ao texto. */
.post-content > :first-child { margin-top: 0; }
.post-content p,
.post-content > div {
  margin: 0 0 1.35em;
}


.post-content h2 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  margin-top: 2.15em;
  margin-bottom: .75em;
  line-height: 1.3;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.post-content h3 {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 1.8em;
  margin-bottom: .7em;
  line-height: 1.4;
}

.post-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-top: 1.5em;
  margin-bottom: .65em;
}

.post-content a {
  color: var(--accent-dk);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .2s ease;
}
.post-content a:hover { color: var(--navy); }

.post-content ul,
.post-content ol {
  padding-left: 1.6em;
  margin-bottom: 1.2em;
}
.post-content ul { list-style: disc; }
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: .55em; }

.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 18px 24px;
  margin: 2em 0;
  background: rgba(0, 192, 212, .06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--navy-mid);
  font-size: 1.08rem;
  line-height: 1.7;
}

.post-content blockquote cite {
  display: block;
  font-size: .82rem;
  font-style: normal;
  font-weight: 700;
  color: var(--muted);
  margin-top: 10px;
}

.post-content strong { font-weight: 750; color: #182238; }

.post-content em { font-style: italic; }

.post-content img {
  border-radius: var(--radius-sm);
  margin: 1.5em auto;
  box-shadow: var(--card-sh);
  width: 100%;
  max-width: 100%;
  height: auto;
}

.post-content figure {
  margin: 2em 0;
  text-align: center;
}
.post-content figcaption {
  font-size: .78rem;
  color: var(--muted);
  margin-top: 8px;
  font-style: italic;
}

.post-content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2.5em 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: .9rem;
}
.post-content th,
.post-content td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.post-content th {
  background: var(--navy);
  color: #fff;
  font-weight: 700;
}
.post-content tr:nth-child(even) td { background: var(--bg); }


/* ============================================================
   GALERIA DE FOTOS
   ============================================================ */
.post-gallery-section {
  max-width: 900px;
  margin: 48px auto 20px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.post-gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.post-gallery-kicker {
  display: block;
  margin-bottom: 4px;
  color: var(--accent-dk);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.post-gallery-heading h2 {
  font-family: var(--font-head);
  color: var(--navy);
  font-size: 1.5rem;
  line-height: 1.25;
}
.post-gallery-count {
  color: var(--muted);
  font-size: .78rem;
  white-space: nowrap;
}
.post-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.post-gallery-item {
  min-width: 0;
}
.post-gallery-item.is-featured:nth-last-child(n+3) {
  grid-column: 1 / -1;
}
.post-gallery-item:only-child { grid-column: 1 / -1; }
.post-gallery-item:only-child .gallery-open { aspect-ratio: 16 / 8.5; }
.gallery-open {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  padding: 0;
  cursor: zoom-in;
  box-shadow: var(--card-sh);
}
.post-gallery-item.is-featured:nth-last-child(n+3) .gallery-open {
  aspect-ratio: 16 / 8.5;
}
.gallery-open img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}
.gallery-open:hover img { transform: scale(1.025); }
.gallery-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(12, 36, 128, .88);
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(0,0,0,.18);
}
.post-gallery-item figcaption {
  padding: 8px 4px 0;
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.45;
}
.gallery-lightbox[hidden] { display: none; }
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  align-items: center;
  background: rgba(4, 10, 28, .94);
  padding: 28px;
}
.gallery-lightbox-stage {
  max-width: 1180px;
  max-height: calc(100vh - 56px);
  margin: 0 auto;
  text-align: center;
  color: #fff;
}
.gallery-lightbox-stage img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
}
.gallery-lightbox-stage p {
  margin-top: 12px;
  color: rgba(255,255,255,.85);
  font-size: .9rem;
}
#gallery-lightbox-counter {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,.55);
  font-size: .75rem;
}
.gallery-lightbox-close,
.gallery-lightbox-nav {
  border: 0;
  color: #fff;
  background: rgba(255,255,255,.1);
  cursor: pointer;
}
.gallery-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
}
.gallery-lightbox-nav {
  width: 48px;
  height: 64px;
  justify-self: center;
  border-radius: 12px;
  font-size: 2rem;
}
.gallery-lightbox button:hover { background: rgba(255,255,255,.18); }
body.gallery-lightbox-open { overflow: hidden; }

/* ============================================================
   BARRA DE COMPARTILHAMENTO
   ============================================================ */
.post-footer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 20px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 44px;
}

.share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 50px;
  font-size: .8rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: all .22s ease;
  border: none;
  cursor: pointer;
  letter-spacing: .02em;
  font-family: var(--font-body);
}
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,.15);
  filter: brightness(1.08);
}

.share-fb  { background: #1877F2; }
.share-tw  { background: #1DA1F2; }
.share-wa  { background: #25D366; }
.share-native { background: var(--navy-mid); }
.share-copy { background: #6B7280; }


/* ============================================================
   SIDEBAR — CARDS HORIZONTAIS (Mais Lidas)
   ============================================================ */
.news-card-h {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: opacity .22s ease;
}
.news-card-h:first-of-type { padding-top: 0; }
.news-card-h:last-child    { border-bottom: none; padding-bottom: 0; }
.news-card-h:hover         { opacity: .75; }

.card-h-img {
  width: 84px;
  height: 66px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg);
  border: 1px solid var(--border);
}
.card-h-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-h-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-h-cat {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent-dk);
}

.card-h-title {
  font-size: .84rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-h-date {
  font-size: .72rem;
  color: var(--muted);
  margin-top: 2px;
}


/* ============================================================
   POSTS RELACIONADOS
   ============================================================ */
.related-section {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 2px solid var(--border);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}


/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  font-size: .8rem;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--accent-dk); transition: color .2s; }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb span[aria-hidden] { color: var(--border); }


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

@media (max-width: 640px) {
  .post-article-card {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .post-title {
    font-size: 1.45rem;
  }

  .post-meta-bar {
    gap: 5px 14px;
    padding: 10px 14px;
  }

  .post-content {
    font-size: 1rem;
    line-height: 1.75;
  }

  .post-content h2 {
    font-size: 1.25rem;
  }

  .post-content h3 {
    font-size: 1.08rem;
  }

  .post-footer-bar {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .share-btns {
    gap: 6px;
  }

  .share-btn {
    padding: 7px 14px;
    font-size: .76rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
  }

  .card-h-img {
    width: 70px;
    height: 56px;
  }
}


@media (max-width: 640px) {
  .post-gallery-section { margin-top: 36px; padding-top: 24px; }
  .post-gallery-heading { align-items: flex-start; }
  .post-gallery-heading h2 { font-size: 1.3rem; }
  .post-gallery-grid { gap: 9px; }
  .post-gallery-item.is-featured:nth-last-child(n+3) .gallery-open { aspect-ratio: 4 / 3; }
  .gallery-open { border-radius: 9px; }
  .gallery-lightbox { grid-template-columns: 46px minmax(0,1fr) 46px; padding: 14px 6px; }
  .gallery-lightbox-nav { width: 38px; height: 54px; }
  .gallery-lightbox-close { top: 10px; right: 10px; }
}
