/* ==========================================================================
   Conteúdo do blog — Figma "Desk - Blog" (node 13926:821)

   Medidas do desktop (frame 1440):
   - 120px entre o header e o título, e entre o grid e o footer
   - título "Blog Côrte": Optima Medium 80 / 1.15 (text-box-trim)
   - flex com 4 cards por linha de 297px, gap 24px (coluna) e 60px (linha)
   - imagem 297×400; meta Gotham Book 14/1.5 #6a6a6a, 12px abaixo;
     título Gotham Medium 17/1.5 caixa-alta, 12px abaixo da meta;
     descrição Gotham Book 17/1.5, 1.5px abaixo do título

   Mobile (Figma "Mobile", node 13926:2144 — frame 390):
   - 40px entre o header e o título; título Optima Medium 35 / 1.15 (trim)
   - 40px até o primeiro card; cards 310×400 (altura fixa); 60px entre cards
   - 60px entre o último card e o footer
   ========================================================================== */

.blog-page {
  padding-top: 40px;
  padding-bottom: 60px;
  color: var(--corte-blue);
}

.blog-page__container {
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/*
 * Título: Optima Medium 80 / 1.15 com text-box-trim (cap → alphabetic),
 * como no Figma — a caixa tem só a altura das maiúsculas, então os 120px
 * acima e os 68.56px abaixo são medidos a partir do texto visível.
 * Fallback (sem suporte a text-box): margens negativas equivalentes ao
 * corte, medidas na Optima LT Pro (0.1234em acima, 0.3375em abaixo).
 */
.blog-page__title {
  --title-gap: 40px;
  margin-top: -0.1234em;
  margin-bottom: calc(var(--title-gap) - 0.3375em);
  font-family: var(--corte-font-optima);
  font-size: 35px;
  font-weight: 500;
  line-height: 1.15;
}

@supports (text-box: trim-both cap alphabetic) {
  .blog-page__title {
    margin-top: 0;
    margin-bottom: var(--title-gap);
    text-box: trim-both cap alphabetic;
  }
}

.blog-page__grid {
  --cards-per-row: 1;
  --card-gap: 24px;
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--card-gap);
  row-gap: 60px;
}

.blog-card {
  flex: 0 0 calc((100% - var(--card-gap) * (var(--cards-per-row) - 1)) / var(--cards-per-row));
  min-width: 0;
  /* O Figma arredonda as caixas de texto de 25.5 para 26px: card = 498px */
  padding-bottom: 0.5px;
}

.blog-page__empty {
  font-family: var(--corte-font-gotham);
  font-size: 16px;
  line-height: 26px;
}

.blog-page__empty-link {
  display: inline-block;
  margin-top: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Card
   -------------------------------------------------------------------------- */

.blog-card__link {
  display: block;
}

.blog-card__media {
  position: relative;
  overflow: hidden;
  height: 400px;
  background-color: #d9d9d9;
}

.blog-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--corte-ease);
}

.blog-card__link:hover .blog-card__image {
  transform: scale(1.03);
}

.blog-card__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #6a6a6a;
  font-family: var(--corte-font-gotham);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

.blog-card__date {
  white-space: nowrap;
}

.blog-card__title {
  display: -webkit-box;
  margin-top: 12px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-family: var(--corte-font-gotham);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.5;
  text-transform: uppercase;
  transition: color 300ms var(--corte-ease);
}

.blog-card__link:hover .blog-card__title {
  color: var(--corte-beige);
}

.blog-card__excerpt {
  display: -webkit-box;
  margin-top: 1.5px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-family: var(--corte-font-gotham);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Paginação
   -------------------------------------------------------------------------- */

.blog-page__pagination {
  margin-top: 60px;
  font-family: var(--corte-font-gotham);
  font-size: 14px;
  line-height: 21px;
}

.blog-page__pagination .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.blog-page__pagination .page-numbers {
  display: flex;
  min-width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid var(--corte-gray-250);
  text-transform: uppercase;
  transition: color 300ms var(--corte-ease), background-color 300ms var(--corte-ease), border-color 300ms var(--corte-ease);
}

.blog-page__pagination a.page-numbers:hover {
  border-color: var(--corte-beige);
  background-color: var(--corte-beige);
}

.blog-page__pagination .page-numbers.current {
  border-color: var(--corte-blue);
  background-color: var(--corte-blue);
  color: var(--corte-white);
}

.blog-page__pagination .page-numbers.dots {
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   Artigo / página
   -------------------------------------------------------------------------- */

.article {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
  box-sizing: content-box;
}

.article__meta {
  display: flex;
  gap: 24px;
  font-family: var(--corte-font-gotham);
  font-size: 14px;
  line-height: 21px;
}

.article__category {
  transition: color 300ms var(--corte-ease);
}

.article__category:hover {
  color: var(--corte-beige);
}

.article__title {
  margin-top: 16px;
  font-family: var(--corte-font-optima);
  font-size: 32px;
  font-weight: 400;
  line-height: 115%;
}

.article__lead {
  margin-top: 16px;
  font-family: var(--corte-font-gotham);
  font-size: 18px;
  line-height: 28px;
}

.article__cover {
  margin-top: 40px;
}

.article__cover-image {
  width: 100%;
}

.article__content {
  margin-top: 40px;
  font-family: var(--corte-font-gotham);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
}

.article__content > * + * {
  margin-top: 1.25em;
}

.article__content h2,
.article__content h3,
.article__content h4 {
  margin-top: 2em;
  font-family: var(--corte-font-optima);
  font-weight: 500;
  line-height: 1.25;
}

.article__content h2 {
  font-size: 28px;
}

.article__content h3 {
  font-size: 22px;
}

.article__content h4 {
  font-size: 18px;
}

.article__content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 300ms var(--corte-ease);
}

.article__content a:hover {
  color: var(--corte-beige);
}

.article__content strong,
.article__content b {
  font-weight: 500;
}

.article__content ul,
.article__content ol {
  padding-left: 1.25em;
}

.article__content ul {
  list-style: disc;
}

.article__content ol {
  list-style: decimal;
}

.article__content li + li {
  margin-top: 0.5em;
}

.article__content blockquote {
  padding-left: 24px;
  border-left: 2px solid var(--corte-beige);
  font-family: var(--corte-font-optima);
  font-size: 22px;
  line-height: 1.4;
}

.article__content img {
  height: auto;
}

.article__content figcaption {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.7;
}

.article__content hr {
  border-color: var(--corte-gray-250);
}

.article__content .alignleft {
  float: left;
  margin: 0.5em 1.5em 1em 0;
}

.article__content .alignright {
  float: right;
  margin: 0.5em 0 1em 1.5em;
}

.article__content .aligncenter {
  margin-left: auto;
  margin-right: auto;
}

.article__footer {
  margin-top: 60px;
  padding-top: 24px;
  border-top: 1px solid var(--corte-gray-250);
  font-family: var(--corte-font-gotham);
  font-size: 14px;
  line-height: 21px;
}

.article__back {
  transition: color 300ms var(--corte-ease);
}

.article__back:hover {
  color: var(--corte-beige);
}

/* --------------------------------------------------------------------------
   Breakpoints (mesmos do app principal: md 768, lg 1024, xl 1280)
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {
  .blog-page {
    padding-top: 80px;
    padding-bottom: 100px;
  }

  .blog-page__container {
    padding-left: 50px;
    padding-right: 50px;
  }

  .blog-page__title {
    --title-gap: 56px;
    font-size: 56px;
  }

  .blog-card__media {
    height: auto;
    aspect-ratio: 297 / 400;
  }

  .blog-page__grid {
    --cards-per-row: 2;
  }

  .article {
    padding-left: 50px;
    padding-right: 50px;
  }

  .article__title {
    font-size: 40px;
  }
}

@media (min-width: 1024px) {
  .blog-page {
    padding-top: 120px;
    padding-bottom: 120px;
  }

  .blog-page__container {
    max-width: 1440px;
    padding-left: 60px;
    padding-right: 60px;
  }

  .blog-page__title {
    --title-gap: 68.56px;
    font-size: 80px;
  }

  .blog-page__grid {
    --cards-per-row: 4;
  }

  .article__title {
    font-size: 48px;
  }
}

@media (min-width: 1280px) {
  .blog-page__container {
    padding-left: 90px;
    padding-right: 90px;
  }
}
