/**
 * PicDiet Blog Stylesheet
 * Responsive, accessible, and lightweight styling for Blog Index & Article pages
 * Reuses site variables and light/dark theme tokens from style.css
 */

/* Blog Layout Container */
.blog-main {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
  box-sizing: border-box;
}

.blog-index-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 6rem;
  box-sizing: border-box;
}

/* Breadcrumbs */
.blog-breadcrumb {
  margin-bottom: 1.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.blog-breadcrumb ol {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.blog-breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.blog-breadcrumb li+li::before {
  content: "›";
  margin-right: 0.45rem;
  color: var(--text-secondary);
  font-weight: 700;
}

.blog-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-breadcrumb a:hover {
  color: var(--color-green-text);
  text-decoration: underline;
}

.blog-breadcrumb [aria-current="page"] {
  color: var(--text-color);
  font-weight: 600;
}

/* Article Header */
.article-header {
  margin-bottom: 2.25rem;
}

.article-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--text-color);
  margin: 0 0 1rem 0;
}

@media (max-width: 640px) {
  .article-header h1 {
    font-size: 1.75rem;
    line-height: 1.3;
  }
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.article-meta span.separator {
  opacity: 0.5;
}

.reading-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 210, 106, 0.1);
  color: var(--color-green-text);
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
}

body.light-theme .reading-badge {
  background: rgba(5, 150, 105, 0.12);
  color: #047857;
}

/* Article Body Content */
.article-content {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--text-color);
}

.article-content p {
  margin: 0 0 1.25em 0;
}

.article-content h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.625rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text-color);
  margin: 2.25rem 0 0.85rem 0;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--card-border);
}

.article-content h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text-color);
  margin: 1.75rem 0 0.65rem 0;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.3em 0;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5em;
  line-height: 1.7;
}

.article-content strong {
  color: var(--text-color);
  font-weight: 700;
}

.article-content a {
  color: var(--color-green-text);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.article-content a:hover {
  color: var(--color-green);
}

body.light-theme .article-content a {
  color: #047857;
}

body.light-theme .article-content a:hover {
  color: #065f46;
}

/* Blockquotes & Callouts */
.article-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--card-bg);
  border-left: 4px solid var(--color-green);
  border-radius: 0 0.75rem 0.75rem 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.table-wrap th,
.table-wrap td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--card-border);
}

.table-wrap th {
  background: var(--card-bg);
  font-weight: 700;
}

/* Blog FAQ Accordion */
.blog-faq-section {
  margin: 3rem 0 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--card-border);
}

.blog-faq-section h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.625rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  border-bottom: none;
  padding-bottom: 0;
}

.blog-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.blog-faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.blog-faq-item:hover,
.blog-faq-item[open] {
  border-color: var(--color-green);
}

.blog-faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.25rem;
  font-family: 'Outfit', sans-serif;
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-color);
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 1rem;
}

.blog-faq-question::-webkit-details-marker {
  display: none;
}

.blog-faq-icon {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--color-green-text);
}

.blog-faq-item[open] .blog-faq-icon {
  transform: rotate(180deg);
}

.blog-faq-answer {
  padding: 0 1.25rem 1.25rem 1.25rem;
  font-size: 0.9875rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.blog-faq-answer p:last-child {
  margin-bottom: 0;
}

/* CTA Card (Section 9) */
.blog-cta-card {
  margin: 3.5rem 0 2rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 12px 35px var(--shadow-color);
  display: flex;
  align-items: center;
  gap: 1.75rem;
  position: relative;
  overflow: hidden;
}

.blog-cta-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-orange), var(--color-green));
}

.blog-cta-logo {
  width: 4rem;
  height: 4rem;
  flex-shrink: 0;
  background: #ffffff;
  padding: 0.4rem;
  border-radius: 1rem;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.blog-cta-content {
  flex: 1;
}

.blog-cta-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
}

.blog-cta-text {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0 0 1.25rem 0;
}

.blog-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--color-green);
  color: #022612;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none !important;
  padding: 0.8rem 1.5rem;
  border-radius: 2rem;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 210, 106, 0.25);
}

.blog-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 210, 106, 0.4);
  color: #022612;
}

@media (max-width: 680px) {
  .blog-cta-card {
    flex-direction: column;
    text-align: center;
    padding: 1.75rem 1.25rem;
  }
  .blog-cta-logo {
    margin: 0 auto;
  }
  .blog-cta-btn {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
}

/* Disclaimer at footer of article */
.blog-disclaimer {
  margin: 2rem 0;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

body.light-theme .blog-disclaimer {
  background: rgba(0, 0, 0, 0.02);
}

/* "Leia também" / "Read next" / "Sigue leyendo" Card */
.blog-read-next {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--card-border);
}

.blog-read-next-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-color);
  margin-bottom: 1rem;
}

.read-next-card {
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  padding: 1.5rem;
  text-decoration: none !important;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px var(--shadow-color);
}

.read-next-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-green);
  box-shadow: 0 8px 25px var(--shadow-color);
}

.read-next-card h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.5rem 0;
  transition: color 0.2s ease;
}

.read-next-card:hover h3 {
  color: var(--color-green-text);
}

.read-next-card p {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 0.85rem 0;
}

.read-next-meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   BLOG INDEX PAGE STYLES
   ========================================================================== */

.blog-index-header {
  margin-bottom: 3rem;
  text-align: center;
}

.blog-index-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text-color);
  margin: 0 0 1rem 0;
}

.blog-index-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.6;
}

@media (max-width: 640px) {
  .blog-index-header h1 {
    font-size: 1.85rem;
  }
  .blog-index-subtitle {
    font-size: 1rem;
  }
}

/* Grid of Articles */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem;
}

@media (max-width: 768px) {
  .blog-grid {
    grid-template-columns: 1fr;
  }
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 1.5rem;
  padding: 1.75rem;
  box-shadow: 0 6px 20px var(--shadow-color);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-green);
  box-shadow: 0 12px 30px var(--shadow-color);
}

.blog-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.blog-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem 0;
}

.blog-card h2 a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.blog-card:hover h2 a {
  color: var(--color-green-text);
}

.blog-card-excerpt {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 1.25rem 0;
  flex: 1;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.875rem;
}

.blog-card-link {
  color: var(--color-green-text);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap 0.2s ease;
}

.blog-card:hover .blog-card-link {
  gap: 0.55rem;
}
