/* =========================================================================
   ART DENTAL - BLOG STYLES & GLOBAL COMPONENTS
   ========================================================================= */

/* ========== HEADER DROPDOWN ========== */
.nav-dropdown { position: relative; display: inline-block; }
.nav-dropdown-btn { 
  background: none; border: none; font: inherit; color: inherit; cursor: pointer; 
  display: inline-flex; align-items: center; gap: 0.35rem; 
  text-transform: uppercase; font-size: 0.82rem; font-weight: 500; letter-spacing: 0.08em; 
  transition: color var(--transition);
}
.nav-dropdown-btn:hover { color: var(--gold); }
.nav-dropdown-btn svg { width: 14px; height: 14px; transition: transform var(--transition); }
.nav-dropdown:hover .nav-dropdown-btn svg { transform: rotate(180deg); color: var(--gold); }
.nav-dropdown-content { 
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(10px); 
  background: #ffffff; width: 280px; box-shadow: var(--shadow-lg); border-radius: var(--radius); 
  padding: 0.5rem 0; opacity: 0; visibility: hidden; transition: all var(--transition); 
  display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border);
}
.nav-dropdown:hover .nav-dropdown-content { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.nav-dropdown-content a { 
  padding: 0.75rem 1.5rem; color: var(--text) !important; font-size: 0.85rem !important; 
  font-weight: 500 !important; text-transform: none !important; letter-spacing: normal !important;
  transition: all var(--transition); border-bottom: 1px solid rgba(0,0,0,0.03); 
}
.nav-dropdown-content a:last-child { border-bottom: none; }
.nav-dropdown-content a:hover { color: var(--gold-dark) !important; background: var(--bg-warm); padding-left: 1.8rem; }

/* ========== HERO BLOG ========== */
.blog-hero {
  padding: 10rem 0 4rem;
  background: linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-section) 100%);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.blog-hero .container { position: relative; z-index: 1; }
.blog-hero-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dark);
  background: rgba(198, 168, 85, 0.15);
  padding: 0.4rem 1rem;
  border-radius: 100px;
  margin-bottom: 1.5rem;
}
.blog-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.2rem, 4.5vw, 3.8rem);
  font-weight: 500;
  line-height: 1.15;
  color: var(--dark);
  max-width: 800px;
  margin: 0 auto 1.5rem;
}
.blog-hero h1 span { color: var(--gold-dark); }
.blog-hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

/* ========== FILTROS E BUSCA ========== */
.blog-controls {
  padding: 2rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 72px; /* Height of header to be perfectly sticky under it */
  z-index: 100;
}
.blog-controls-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Search Bar */
.blog-search {
  max-width: 400px;
  width: 100%;
  position: relative;
}
.blog-search input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-warm);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  transition: all var(--transition);
  outline: none;
}
.blog-search input:focus {
  border-color: var(--gold);
  background: var(--bg);
  box-shadow: 0 0 0 4px rgba(198, 168, 85, 0.1);
}
.blog-search svg {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Filter Chips */
.blog-filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.blog-filters::-webkit-scrollbar { height: 4px; }
.blog-filters::-webkit-scrollbar-track { background: transparent; }
.blog-filters::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.filter-chip {
  white-space: nowrap;
  padding: 0.5rem 1.25rem;
  border-radius: 100px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.filter-chip:hover {
  background: var(--bg-section);
}
.filter-chip.active {
  background: var(--dark);
  color: white;
  border-color: var(--dark);
}

/* ========== GRID DE ARTIGOS ========== */
.blog-main {
  padding: 4rem 0 6rem;
  background: var(--bg-warm);
}
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.article-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: all var(--transition);
  height: 100%;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold-muted);
}
.article-card-media {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: var(--bg-section); /* Fallback base */
}
.article-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.article-card:hover .article-card-media img {
  transform: scale(1.05);
}

/* Image Fallback Style (Colored block + centered text) */
.article-card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  /* Backgroud color is injected dynamically via JS */
}
.article-card-fallback span {
  font-family: 'Playfair Display', serif;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.article-card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}
.article-card-cat {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  /* Color injected via JS */
  background: rgba(0,0,0,0.05); /* slightly tinted bg for the chip */
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  align-self: flex-start;
}
.article-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--dark);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card-resume {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}
.article-card-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  border-top: 1px solid rgba(0,0,0,0.04);
  padding-top: 1rem;
}
.article-card-meta strong { color: var(--dark); font-weight: 500; }

/* Placeholder for Empty State */
.blog-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.blog-empty-state h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

/* Pagination / Load More */
.blog-load-more {
  text-align: center;
  margin-top: 4rem;
}

/* ========== RESPONSIVO ========== */
@media (max-width: 900px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .blog-controls { top: 60px; /* Adjusted if header changes height */ }
  .blog-controls-inner { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
  .blog-search { max-width: 100%; order: 1; }
  .blog-filters { order: 2; width: 100%; }
}
@media (max-width: 600px) {
  .articles-grid { grid-template-columns: 1fr; }
  .blog-hero { padding: 8rem 0 3rem; }
  .blog-hero h1 { font-size: 1.8rem; }
}

/* ========== COMPONENTES INTERNOS NO ARTIGO ========== */

/* TOC Minimalista (Mobile/Inline) */
.article-toc {
  background: #f5f2ec;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 1.5rem 0 2.5rem;
  overflow: hidden;
}
.article-toc-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
  color: var(--dark);
  user-select: none;
}
.article-toc-header svg {
  width: 18px;
  height: 18px;
  transition: transform var(--transition);
}
.article-toc-header.open svg {
  transform: rotate(180deg);
}
.article-toc-list {
  display: none;
  padding: 0 1.5rem 1.5rem;
  margin: 0;
  list-style: none;
}
.article-toc-list.open { display: block; }
.article-toc-list li {
  margin-bottom: 0.6rem;
}
.article-toc-list a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color var(--transition);
}
.article-toc-list a:hover { color: var(--gold-dark); }
.article-toc-list a.active { color: var(--gold-dark); font-weight: 600; }

/* CTAs Dinâmicos / Compartilhar (Desktop Sidebar) - Opcional se for ter sidebar */
/* O CTA Whatsapp flutuante já existe na base css, mas manteremos a lógica via article.js */

/* Estilos para imagens e medias no corpo do artigo */
.article-figure {
  margin: 2.5rem 0;
  text-align: center;
}
.article-figure img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  display: block;
  margin: 0 auto;
}
.article-figure figcaption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
}

/* Estilos para o Autor/Revisor no final do artigo */
.article-author-bio {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-warm);
  padding: 2rem;
  border-radius: 12px;
  margin-top: 3rem;
  border: 1px solid var(--border);
}
.author-photo img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}
.author-details h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--dark);
  margin-bottom: 0.25rem;
}
.author-details .author-role {
  font-size: 0.85rem;
  color: var(--gold-dark);
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.author-details p {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 0;
}
@media (max-width: 768px) {
  .article-author-bio {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
  }
}
