/* ==========================================================================
   IronNest — Article Stylesheet
   Uses the same :root variables as style.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   Article Hero
   -------------------------------------------------------------------------- */
.article-hero {
  position: relative;
  min-height: 52vh;
  display: flex;
  align-items: flex-end;
  padding-bottom: var(--sp-8);
  margin-top: var(--header-h);
  overflow: hidden;
}

.article-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform-origin: center;
}

.article-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, var(--navy-dark) 0%, rgba(13,13,26,0.80) 40%, rgba(13,13,26,0.40) 75%, transparent 100%),
    linear-gradient(to right, rgba(13,13,26,0.50) 0%, transparent 60%);
}

.article-hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
}

.article-hero-cat {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  text-decoration: none;
  margin-bottom: var(--sp-2);
}

.article-hero-cat:hover { color: var(--text-inverse); }

.article-hero-title {
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-inverse);
  line-height: 1.08;
  margin-bottom: var(--sp-2);
  max-width: 22ch;
}

.article-hero-sub {
  font-size: var(--text-xl);
  color: var(--text-inverse-muted);
  line-height: 1.55;
  max-width: 52ch;
}

/* --------------------------------------------------------------------------
   Article Meta
   -------------------------------------------------------------------------- */
.article-meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5);
}

.article-meta-item {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-meta-item svg { color: var(--red); }

.article-meta-item + .article-meta-item::before {
  content: '·';
  margin-right: 0;
  color: var(--border-dark);
}

/* --------------------------------------------------------------------------
   Article Layout
   -------------------------------------------------------------------------- */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--sp-8);
  align-items: start;
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-12);
}

.article-main {
  min-width: 0;
}

.article-body {
  font-size: var(--text-lg);
  line-height: 1.7;
  color: var(--text);
}

.article-intro {
  font-size: var(--text-xl);
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-5);
  border-bottom: 2px solid var(--border);
}

.article-body h2 {
  font-size: var(--text-3xl);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
  letter-spacing: -0.03em;
  color: var(--navy);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.article-body h3 {
  font-size: var(--text-2xl);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
  color: var(--navy);
  letter-spacing: -0.02em;
}

.article-body p {
  margin-bottom: var(--sp-4);
  max-width: none;
}

.article-body ul,
.article-body ol {
  margin-bottom: var(--sp-4);
  padding-left: var(--sp-3);
}

.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }

.article-body li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.article-body a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.article-body a:hover { color: var(--red-dark); }

.article-body img {
  border-radius: var(--radius-md);
  margin-block: var(--sp-5);
  width: 100%;
}

/* --------------------------------------------------------------------------
   TOC Sidebar
   -------------------------------------------------------------------------- */
.toc-sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-4));
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
}

.toc-title {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-item a {
  display: block;
  padding: 6px 10px;
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  transition:
    color var(--dur-fast) var(--ease-smooth),
    background-color var(--dur-fast) var(--ease-smooth),
    border-color var(--dur-fast) var(--ease-smooth);
  line-height: 1.45;
}

.toc-item a:hover,
.toc-item a.active {
  color: var(--navy);
  background-color: var(--parchment);
  border-color: var(--red);
}

/* --------------------------------------------------------------------------
   Author Byline
   -------------------------------------------------------------------------- */
.author-byline {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background-color: var(--parchment);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-5);
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--red);
}

.author-info .name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  display: block;
}

.author-info .title {
  font-size: var(--text-sm);
  color: var(--text-muted);
  display: block;
}

/* --------------------------------------------------------------------------
   Disclosure Notice
   -------------------------------------------------------------------------- */
.disclosure-notice {
  background-color: var(--parchment);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: var(--radius-md);
  padding: 12px var(--sp-3);
  margin-bottom: var(--sp-5);
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.55;
  max-width: none;
}

.disclosure-notice a {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Quick Picks
   -------------------------------------------------------------------------- */
.qp {
  background-color: var(--navy);
  border-radius: var(--radius-xl);
  padding: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-6);
}

.qp-heading {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: var(--sp-3);
}

.qp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-2);
}

.qp-card {
  background-color: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: var(--sp-3);
  transition:
    background-color var(--dur-fast) var(--ease-smooth),
    transform var(--dur-fast) var(--ease-smooth);
}

.qp-card:hover {
  background-color: rgba(255,255,255,0.09);
  transform: translateY(-2px);
}

.qp-label {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 6px;
}

.qp-name {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text-inverse);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

.qp-note {
  font-size: var(--text-xs);
  color: var(--text-inverse-muted);
  line-height: 1.45;
}

/* --------------------------------------------------------------------------
   Product Cards
   -------------------------------------------------------------------------- */
.prod {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-card);
}

.prod-hdr {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background-color: var(--navy);
  border-bottom: 1px solid rgba(255,255,255,0.07);
}

.prod-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: rgba(255,255,255,0.1);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-inverse);
  flex-shrink: 0;
}

.prod-rank.gold {
  background-color: var(--red);
  color: var(--text-inverse);
  box-shadow: var(--shadow-red);
}

.prod-title-area {
  flex: 1;
  min-width: 0;
}

.prod-title-area h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-inverse);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prod-badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.prod-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  background-color: var(--red-muted);
  border: 1px solid rgba(230,57,70,0.25);
  border-radius: 3px;
  padding: 2px 7px;
}

.prod-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  gap: 2px;
}

.prod-score-num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-inverse);
  line-height: 1;
}

.prod-score-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-inverse-muted);
}

.star-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.star-row svg {
  color: #F5A623;
}

.prod-img {
  width: 100%;
  aspect-ratio: 16 / 8;
  object-fit: cover;
}

.prod-body {
  padding: var(--sp-4) var(--sp-5);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

.prod-review {
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text-mid);
  grid-column: 1 / -1;
  max-width: none;
}

.prod-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.prod-price {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.03em;
}

.prod-price-note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  display: block;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   Specs
   -------------------------------------------------------------------------- */
.specs {
  background-color: var(--parchment);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4) var(--sp-5);
  margin-block: var(--sp-4);
}

.specs-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}

.spec {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--sp-3);
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.spec:last-child { border-bottom: none; }

.spec-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.spec-value {
  font-size: var(--text-sm);
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Pros / Cons
   -------------------------------------------------------------------------- */
.pc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  margin-block: var(--sp-4);
}

.pc-heading {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-1);
  border-bottom: 2px solid currentColor;
}

.pros { border: 1px solid rgba(5, 150, 105, 0.25); border-radius: var(--radius-lg); padding: var(--sp-4); background-color: rgba(5, 150, 105, 0.04); }
.pros .pc-heading { color: #059669; }

.cons { border: 1px solid rgba(230, 57, 70, 0.25); border-radius: var(--radius-lg); padding: var(--sp-4); background-color: rgba(230, 57, 70, 0.04); }
.cons .pc-heading { color: var(--red); }

.pc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pc-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--text-mid);
  line-height: 1.5;
}

.pc-item svg { flex-shrink: 0; margin-top: 2px; }
.pros .pc-item svg { color: #059669; }
.cons .pc-item svg { color: var(--red); }

/* --------------------------------------------------------------------------
   Comparison Table
   -------------------------------------------------------------------------- */
.comparison-table-wrap {
  overflow-x: auto;
  margin-block: var(--sp-5);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.comparison-table th {
  background-color: var(--navy);
  color: var(--text-inverse);
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 12px 16px;
  white-space: nowrap;
}

.comparison-table th:first-child {
  border-radius: var(--radius-md) 0 0 0;
}

.comparison-table th:last-child {
  border-radius: 0 var(--radius-md) 0 0;
}

.comparison-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

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

.comparison-table tr:nth-child(even) td {
  background-color: var(--parchment);
}

.winner-cell {
  background-color: rgba(230,57,70,0.06) !important;
  font-weight: 700;
  color: var(--red);
}

.check { color: #059669; }
.cross { color: var(--red); }

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-block: var(--sp-5);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--surface);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: 16px var(--sp-4);
  cursor: pointer;
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--navy);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  transition: background-color var(--dur-fast) var(--ease-smooth);
  font-family: var(--font-body);
}

.faq-question:hover { background-color: var(--parchment); }

.faq-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: var(--parchment);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-base) var(--ease-smooth), background-color var(--dur-fast) var(--ease-smooth);
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  background-color: var(--red);
  border-color: var(--red);
}

.faq-item.open .faq-icon svg { color: #fff; }

.faq-answer {
  display: none;
  padding: 0 var(--sp-4) var(--sp-3);
  font-size: var(--text-base);
  color: var(--text-muted);
  line-height: 1.65;
}

.faq-item.open .faq-answer {
  display: block;
}

/* --------------------------------------------------------------------------
   Breadcrumbs in article context
   -------------------------------------------------------------------------- */
.article-breadcrumb {
  padding-top: calc(var(--header-h) + var(--sp-3));
  padding-bottom: var(--sp-2);
  background-color: var(--parchment);
  border-bottom: 1px solid var(--border);
}

/* --------------------------------------------------------------------------
   Category Page
   -------------------------------------------------------------------------- */
.cat-page {
  padding-top: calc(var(--header-h) + var(--sp-8));
  padding-bottom: var(--sp-12);
}

.cat-page-header {
  margin-bottom: var(--sp-8);
}

.cat-page-eyebrow {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: var(--sp-2);
  display: block;
}

.cat-page-title {
  font-size: var(--text-5xl);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--navy);
  margin-bottom: var(--sp-2);
}

.cat-page-sub {
  font-size: var(--text-lg);
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 56ch;
}

/* --------------------------------------------------------------------------
   Buying Guide Callout
   -------------------------------------------------------------------------- */
.buying-guide-callout {
  background-color: var(--navy);
  border-radius: var(--radius-xl);
  padding: var(--sp-5) var(--sp-6);
  margin-block: var(--sp-6);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
}

.buying-guide-callout__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--red-muted);
  border: 1px solid rgba(230,57,70,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.buying-guide-callout__icon svg { color: var(--red); }

.buying-guide-callout h4 {
  font-size: var(--text-xl);
  color: var(--text-inverse);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.buying-guide-callout p {
  font-size: var(--text-base);
  color: var(--text-inverse-muted);
  line-height: 1.6;
  max-width: none;
}

/* --------------------------------------------------------------------------
   Responsive — Article
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .toc-sidebar {
    position: static;
    margin-bottom: var(--sp-5);
  }

  .prod-body {
    grid-template-columns: 1fr;
  }

  .pc {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .article-hero-title {
    font-size: var(--text-4xl);
  }

  .qp-grid {
    grid-template-columns: 1fr 1fr;
  }

  .article-meta {
    gap: var(--sp-2);
  }
}

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

  .article-hero {
    min-height: 60vh;
  }
}
