/**
 * Estilos para o Widget Últimos Posts
 * Usando tokens e especificações de design
 */

/* Container principal do widget - SEM box/card */
.nsig-latest-posts-widget {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* Conteúdo interno - alinhamento limpo */
.nsig-latest-posts-widget__content {
  padding: 0;
}

/* Título do widget - H4 Light (css1) */
.nsig-latest-posts-widget .widget__title,
.nsig-latest-posts-widget h2 {
  font-family: 'Merriweather', serif;
  font-style: normal;
  font-weight: 300;
  font-size: 24px;
  line-height: 135%; /* 32px */
  color: #263841; /* Gray 1 */
  position: relative;
  padding-bottom: 8px;
  margin: 0 0 1.5rem;
}

/* Barra amarela embaixo do título - padrão do tema */
.nsig-latest-posts-widget .widget__title::before,
.nsig-latest-posts-widget h2::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 64px;
  height: 6px;
  background: var(--color-2, #fec301);
  border-radius: 6px;
}

/* Card individual */
.nsig-latest-posts-widget__card {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.nsig-latest-posts-widget__card:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Wrapper da imagem */
.nsig-latest-posts-widget__image-wrapper {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 287 / 216;
  margin-bottom: 0.75rem;
  overflow: hidden;
  border-radius: 8px;
  transition: opacity 0.2s ease;
}

.nsig-latest-posts-widget__image-wrapper:hover {
  opacity: 0.9;
}

/* Imagem */
.nsig-latest-posts-widget__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
}

/* Conteúdo do card */
.nsig-latest-posts-widget__card-content {
  padding: 0;
}

/* Título do post - css2 modificado */
.nsig-latest-posts-widget__title {
  font-family: 'Merriweather', serif;
  font-style: normal;
  font-weight: 700;
  font-size: 18px;
  line-height: 140%; /* 25px */
  color: #000000;
  margin: 0 0 0.5rem;
}

.nsig-latest-posts-widget__title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.nsig-latest-posts-widget__title a:hover,
.nsig-latest-posts-widget__title a:focus {
  color: var(--color-3, #e97116);
}

/* Resumo/Excerpt - css2 */
.nsig-latest-posts-widget__excerpt {
  font-family: 'Source Sans 3', sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 14px;
  line-height: 150%; /* 21px */
  color: #4b5563;
  margin: 0 0 0.5rem;
}

/* Metadados */
.nsig-latest-posts-widget__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-family: 'Source Sans 3', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 11px;
  line-height: 140%;
  color: #6b7280;
  margin-top: 0.5rem;
  color: var(--color-3);
}

.nsig-latest-posts-widget__meta time,
.nsig-latest-posts-widget__author,
.nsig-latest-posts-widget__category,
.nsig-latest-posts-widget__comments {
  display: inline-block;
}

.nsig-latest-posts-widget__meta-separator {
  display: inline-block;
  margin: 0 0.25rem;
  color: #9ca3af;
}

/* Responsividade */

/* Layout horizontal (duas colunas) para telas entre 540px e 960px */
@media (min-width: 540px) and (max-width: 960px) {
  .nsig-latest-posts-widget__card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 1rem;
    align-items: start;
  }

  .nsig-latest-posts-widget__image-wrapper {
    width: 120px;
    height: 120px;
    aspect-ratio: 1 / 1;
    margin-bottom: 0;
  }

  .nsig-latest-posts-widget__card-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  .nsig-latest-posts-widget__title {
    font-size: 16px;
    line-height: 140%;
    margin-bottom: 0;
  }

  .nsig-latest-posts-widget__excerpt {
    font-size: 13px;
    line-height: 150%;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .nsig-latest-posts-widget__meta {
    font-size: 10px;
    margin-top: 0.25rem;
  }
}

/* Layout vertical para telas menores que 540px */
@media (max-width: 539px) {
  .nsig-latest-posts-widget .widget__title,
  .nsig-latest-posts-widget h2 {
    font-size: 20px;
    line-height: 135%;
    margin-bottom: 1.25rem;
  }

  .nsig-latest-posts-widget__card {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .nsig-latest-posts-widget__image-wrapper {
    aspect-ratio: 16 / 9;
  }

  .nsig-latest-posts-widget__title {
    font-size: 16px;
    line-height: 140%;
    margin-bottom: 0.375rem;
  }

  .nsig-latest-posts-widget__excerpt {
    font-size: 13px;
    line-height: 150%;
    margin-bottom: 0.375rem;
  }

  .nsig-latest-posts-widget__meta {
    font-size: 10px;
    margin-top: 0.375rem;
  }
}

/* Ajustes para telas menores que 768px mas maiores que 540px (título do widget) */
@media (max-width: 768px) {
  .nsig-latest-posts-widget .widget__title,
  .nsig-latest-posts-widget h2 {
    font-size: 20px;
    line-height: 135%;
    margin-bottom: 1.25rem;
  }
}

/* Estados de link e acessibilidade */
.nsig-latest-posts-widget a:focus-visible {
  outline: 2px solid var(--color-accent, #fec301);
  outline-offset: 2px;
}
