/* ============================================================
   Daily Calculator — article.css
   Long-form article layout, FAQ accordion, related content
   ============================================================ */

/* ---------- Article header ---------- */
.article-header {
  padding-block: var(--space-8) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-8);
}

.article-header h1 {
  font-size: var(--fs-2xl);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-3);
  letter-spacing: -0.01em;
  max-width: 900px;
}

@media (min-width: 768px) {
  .article-header h1 { font-size: var(--fs-3xl); }
}

.article-header__lead {
  font-size: var(--fs-md);
  color: var(--color-text-muted);
  line-height: var(--lh-base);
  max-width: 780px;
  margin: 0;
}

/* ---------- Content sections on calculator pages ---------- */
.content-section {
  margin-top: var(--space-10);
  scroll-margin-top: 80px;
}

.content-section h2 {
  font-size: var(--fs-xl);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-primary-light);
}

.content-section h3 {
  font-size: var(--fs-lg);
  color: var(--color-text);
  margin-top: var(--space-6);
  margin-bottom: var(--space-3);
}

.content-section p {
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  margin-bottom: var(--space-4);
  color: var(--color-text);
}

.content-section ul,
.content-section ol {
  font-size: var(--fs-md);
  line-height: var(--lh-loose);
  margin-bottom: var(--space-4);
  padding-left: var(--space-6);
}

.content-section li { margin-bottom: var(--space-2); }

.content-section a {
  color: var(--color-primary);
  font-weight: var(--fw-medium);
}

/* ---------- Variables table ---------- */
.variables-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-block: var(--space-4);
}

.variables-table th,
.variables-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.variables-table th {
  background: var(--color-bg-subtle);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.variables-table code {
  font-family: var(--font-mono);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.9em;
}

.variables-table tbody tr:last-child td { border-bottom: none; }

/* ---------- FAQ accordion ---------- */
.faq-section {
  margin-top: var(--space-10);
}

.faq-section h2 {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-primary-light);
}

.faq-list {
  display: grid;
  gap: var(--space-2);
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-white);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.faq-item[data-open="true"] {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

.faq-item__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: transparent;
  border: none;
  text-align: left;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--color-text);
  cursor: pointer;
  min-height: 60px;
  line-height: var(--lh-snug);
}

.faq-item__btn:hover { color: var(--color-primary-dark); }

.faq-item__btn:focus-visible {
  outline: var(--focus-outline);
  outline-offset: -2px;
}

.faq-item__icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--color-primary);
  transition: transform var(--transition-base);
}

.faq-item[data-open="true"] .faq-item__icon {
  transform: rotate(180deg);
}

.faq-item__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--transition-slow);
}

.faq-item[data-open="true"] .faq-item__panel {
  grid-template-rows: 1fr;
}

.faq-item__inner {
  overflow: hidden;
}

.faq-item__content {
  padding: 0 var(--space-5) var(--space-5);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  color: var(--color-text);
}

.faq-item__content p { margin-bottom: var(--space-3); }
.faq-item__content p:last-child { margin-bottom: 0; }

.faq-item__content ul,
.faq-item__content ol {
  padding-left: var(--space-5);
  margin-bottom: var(--space-3);
}

/* ---------- Related content blocks ---------- */
.related-articles {
  margin-top: var(--space-10);
}

.related-articles h2 {
  font-size: var(--fs-lg);
  margin-bottom: var(--space-5);
}

.related-articles__grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .related-articles__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .related-articles__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Disclaimer ---------- */
.disclaimer {
  margin-top: var(--space-8);
  padding: var(--space-4) var(--space-5);
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning-border);
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  line-height: var(--lh-base);
  color: #6B3F05;
}

.disclaimer strong { color: var(--color-warning); }

/* ---------- Print-only hint ---------- */
.print-only { display: none; }