/* =========================================================
   CONC-M — PÁGINA BLOG

   1. Configurações gerais
   2. Destaque principal
   3. Áreas de informação
   4. Publicações
   5. Filtros
   6. Faixa de contacto
   7. Responsividade — tablets
   8. Responsividade — telemóveis
   9. Ecrãs pequenos
========================================================= */

/* =========================================================
   1. CONFIGURAÇÕES GERAIS
========================================================= */

.blog-hero,
.blog-areas-section,
.blog-posts-section,
.blog-cta-section {
  box-sizing: border-box;
}

.blog-hero *,
.blog-areas-section *,
.blog-posts-section *,
.blog-cta-section * {
  box-sizing: border-box;
}

.blog-eyebrow {
  display: block;
  color: #f47721;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 14px;
}

/* =========================================================
   2. DESTAQUE PRINCIPAL — BLOG
========================================================= */

.blog-hero {
  position: relative;

  width: 100%;
  height: 400px;
  min-height: 400px;
  max-height: 400px;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;
  padding: 0 7%;

  background-image: var(--page-image);
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  color: #ffffff;
}

.blog-hero-overlay {
  position: absolute;
  inset: 0;

  background: linear-gradient(
    90deg,
    rgba(9, 23, 42, 0.78) 0%,
    rgba(9, 23, 42, 0.55) 50%,
    rgba(9, 23, 42, 0.3) 100%
  );

  pointer-events: none;
}

.blog-hero-content {
  position: relative;
  z-index: 1;

  width: 100%;
  max-width: 1000px;

  margin: 0 auto;
  text-align: center;
}

.blog-hero .blog-eyebrow {
  color: #ff9b4a;
}

.blog-hero h1 {
  max-width: 900px;
  margin: 0 auto 20px;

  color: #ffffff;
  font-size: clamp(35px, 5vw, 58px);
  font-weight: 800;
  line-height: 1.13;
}

.blog-hero-content > p {
  max-width: 800px;
  margin: 0 auto 28px;

  color: #e4eaf1;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.8;
}

.blog-hero-button {
  display: inline-flex;
  align-items: center;
  gap: 15px;

  padding: 14px 23px;
  border-radius: 5px;

  background: #f47721;
  color: #ffffff;

  font-size: 12px;
  font-weight: 800;
  text-decoration: none;

  transition:
    background 0.3s ease,
    transform 0.3s ease;
}

.blog-hero-button:hover {
  background: #df6415;
  transform: translateY(-3px);
}

/* =========================================================
   3. ÁREAS DE INFORMAÇÃO
========================================================= */

.blog-areas-section {
  width: min(1240px, calc(100% - 50px));
  margin: 0 auto;
  padding: 75px 0 80px;
}

.blog-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 28px;
}

.blog-section-heading h2 {
  color: #17212b;
  font-size: clamp(25px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 12px;
}

.blog-section-heading p {
  max-width: 690px;
  color: #687585;
  font-size: 14px;
  line-height: 1.8;
  margin: 0;
}

.blog-view-all {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;

  color: #f47721;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0.5px;

  transition: gap 0.3s ease;
}

.blog-view-all:hover {
  gap: 16px;
}

/* =========================================================
   4. PUBLICAÇÕES
========================================================= */

.blog-posts-section {
  background: #f5f7fa;

  padding: 75px max(25px, calc((100% - 1240px) / 2)) 85px;
}

.blog-posts-heading {
  margin-bottom: 28px;
}

/* Grelha das publicações */

.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: start;
}

/* Cartão individual */

.blog-post-card {
  min-width: 0;
  overflow: hidden;

  background: #ffffff;
  border: 1px solid #e8ebef;
  border-radius: 10px;

  box-shadow: 0 5px 20px rgba(15, 31, 49, 0.045);

  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.blog-post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px rgba(15, 31, 49, 0.09);
}

.blog-post-card[hidden] {
  display: none !important;
}

/* Imagem da publicação */

.blog-post-image {
  position: relative;
  height: 205px;
  overflow: hidden;
  background: #172b43;
}

.blog-post-image img {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  transition: transform 0.5s ease;
}

.blog-post-card:hover .blog-post-image img {
  transform: scale(1.05);
}

/* Categoria sobre a imagem */

.blog-post-image > span {
  position: absolute;
  top: 14px;
  left: 14px;

  padding: 7px 10px;
  border-radius: 3px;

  background: #f47721;
  color: #ffffff;

  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

/* Conteúdo da publicação */

.blog-post-content {
  padding: 23px 21px 24px;
}

.blog-post-type {
  display: block;

  color: #f47721;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.2px;

  margin-bottom: 10px;
}

.blog-post-content h3 {
  color: #17212b;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.4;

  margin: 0 0 11px;
}

.blog-post-content > p {
  color: #697686;
  font-size: 12px;
  line-height: 1.8;

  margin: 0 0 18px;
}

/* LER MAIS */

.blog-read-more {
  border-top: 1px solid #edf0f3;
  padding-top: 14px;
}

.blog-read-more summary {
  display: flex;
  align-items: center;
  justify-content: space-between;

  color: #f47721;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;

  cursor: pointer;
  list-style: none;
}

.blog-read-more summary::-webkit-details-marker {
  display: none;
}

.blog-read-more summary span {
  font-size: 17px;
  transition: transform 0.3s ease;
}

.blog-read-more[open] summary span {
  transform: rotate(90deg);
}

.blog-full-text {
  padding-top: 13px;
}

.blog-full-text p {
  color: #697686;
  font-size: 12px;
  line-height: 1.8;

  margin: 0 0 13px;
}

.blog-full-text a {
  display: inline-block;

  color: #172b43;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.blog-full-text a:hover {
  color: #f47721;
}

/* Mensagem sem resultados */

.blog-no-results {
  color: #687585;
  text-align: center;

  padding: 30px 10px;
  font-size: 14px;
}

/* =========================================================
   5. FILTROS
========================================================= */

.blog-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;

  gap: 9px;
  margin-bottom: 27px;
}

.blog-filter {
  padding: 10px 17px;

  border: 1px solid #dfe4e9;
  border-radius: 30px;

  background: #ffffff;
  color: #536171;

  font-family: inherit;
  font-size: 11px;
  font-weight: 700;

  cursor: pointer;

  transition: all 0.25s ease;
}

.blog-filter:hover,
.blog-filter.active {
  background: #172b43;
  border-color: #172b43;
  color: #ffffff;
}

/* =========================================================
   6. FAIXA FINAL DE CONTACTO
========================================================= */

.blog-cta-section {
  width: min(1240px, calc(100% - 50px));
  min-height: 150px;

  margin: 70px auto;
  padding: 30px 38px;

  display: flex;
  align-items: center;
  gap: 23px;

  background: #102642;
  border-radius: 10px;

  color: #ffffff;
}

/* Ícone */

.blog-cta-icon {
  width: 62px;
  height: 62px;
  min-width: 62px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: #f47721;
  border-radius: 50%;
}

.blog-cta-icon span {
  color: #ffffff;
  font-size: 30px;
}

/* Texto */

.blog-cta-content {
  flex: 1;
}

.blog-cta-content h2 {
  color: #ffffff;
  font-size: 19px;
  font-weight: 800;

  margin: 0 0 8px;
}

.blog-cta-content p {
  color: #d6dfeb;
  font-size: 12px;
  line-height: 1.6;

  margin: 0;
}

/* Botão */

.blog-cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;

  padding: 14px 23px;
  border-radius: 4px;

  background: #f47721;
  color: #ffffff;

  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;

  transition: background 0.3s ease;
}

.blog-cta-button:hover {
  background: #dc5c12;
}

/* =========================================================
   7. RESPONSIVIDADE — TABLETS
========================================================= */

@media (max-width: 1000px) {
  .blog-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, 210px);
  }

  .blog-feature-main {
    grid-row: span 2;
  }

  .blog-posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-cta-section {
    flex-wrap: wrap;
  }
}

/* =========================================================
   8. RESPONSIVIDADE — TELEMÓVEIS
========================================================= */

@media (max-width: 700px) {
  /* Banner */

  .blog-hero {
    height: 320px;
    min-height: 320px;
    max-height: 320px;

    padding: 20px;

    background-size: cover;
    background-position: center center;
  }

  .blog-hero h1 {
    font-size: 36px;
  }

  .blog-hero-content > p {
    font-size: 13px !important;
  }

  /* Áreas de informação */

  .blog-areas-section {
    width: calc(100% - 32px);
    padding: 50px 0;
  }

  .blog-section-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .blog-section-heading h2 {
    font-size: 26px;
  }

  .blog-section-heading p {
    font-size: 13px;
  }

  /* Cartões de destaque */

  .blog-feature-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 13px;
  }

  .blog-feature-card {
    min-height: 220px;
  }

  .blog-feature-main {
    grid-row: auto;
    min-height: 290px;
  }

  .blog-feature-overlay {
    padding: 20px;
  }

  .blog-feature-overlay h3 {
    font-size: 18px;
  }

  .blog-feature-main .blog-feature-overlay h3 {
    font-size: 23px;
  }

  /* Publicações */

  .blog-posts-section {
    padding: 50px 16px 55px;
  }

  .blog-posts-grid {
    grid-template-columns: 1fr;
    gap: 17px;
  }

  .blog-post-image {
    height: 220px;
  }

  /* Filtros */

  .blog-filters {
    gap: 7px;
  }

  .blog-filter {
    padding: 9px 13px;
    font-size: 10px;
  }

  /* Faixa de contacto */

  .blog-cta-section {
    width: calc(100% - 32px);

    margin: 40px auto;
    padding: 27px 20px;

    flex-direction: column;
    text-align: center;
    gap: 17px;
  }

  .blog-cta-content h2 {
    font-size: 18px;
  }

  .blog-cta-button {
    width: 100%;
  }
}

/* =========================================================
   9. ECRÃS PEQUENOS
========================================================= */

@media (max-width: 380px) {
  .blog-hero h1 {
    font-size: 30px;
  }

  .blog-feature-card {
    min-height: 205px;
  }

  .blog-post-content {
    padding: 19px 16px;
  }
}

/* =========================================================
   CONC-M — UNIFORMIZAR TODOS OS CARTÕES DO BLOG
   ========================================================= */

/* Grelha dos cartões */
.blog-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: 22px;
}

/* Todos os cartões com a mesma dimensão */
.blog-post-card {
  width: 100%;
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Imagens com altura uniforme */
.blog-post-image {
  width: 100%;
  height: 205px !important;
  min-height: 205px;
  flex-shrink: 0;
  overflow: hidden;
}

/* Imagem dentro do cartão */
.blog-post-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Conteúdo dos cartões */
.blog-post-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Espaço uniforme para o texto */
.blog-post-content h3 {
  min-height: 48px;
}

/* Descrição */
.blog-post-content > p {
  flex-grow: 1;
}

/* Ler mais alinhado na parte inferior */
.blog-read-more {
  margin-top: auto;
  width: 100%;
}

/* =========================================================
   TABLETS
   ========================================================= */

@media (max-width: 1000px) {
  .blog-posts-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 1fr;
  }
}

/* =========================================================
   TELEMÓVEIS
   ========================================================= */

@media (max-width: 700px) {
  .blog-posts-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .blog-post-card {
    height: 100%;
    min-height: 0;
  }

  .blog-post-image {
    height: 220px !important;
    min-height: 220px;
  }

  .blog-post-content h3 {
    min-height: 0;
  }
}

/* =====================================================
   FILTROS — FUNCIONAMENTO DAS PUBLICAÇÕES
   ===================================================== */

.blog-post-card[hidden] {
  display: none !important;
}

.blog-no-results[hidden] {
  display: none !important;
}
.blog-post-card[hidden] {
  display: none !important;
}
