/* =========================================================
   NOVAFITHUB — CALORIE DEFICIT ARTICLE
   Uses the same theme system as the website: body.dark
========================================================= */

:root {
  --bg: #ffffff;
  --text: #0b1f3a;
  --primary: #009970;
  --card: #f3f4f6;
  --border: #d1d5db;
  --para: #374151;

  --article-surface: #ffffff;
  --article-soft: #f7faf9;
  --article-green-soft: rgba(0, 153, 112, 0.09);
  --article-green-border: rgba(0, 153, 112, 0.22);
  --article-shadow: 0 18px 55px rgba(11, 31, 58, 0.08);
  --article-bottom: #071a31;
}

body.dark {
  --bg: #06162c;
  --text: #f9fafb;
  --primary: #00d09c;
  --card: #0b2038;
  --border: #1f3a52;
  --para: #cbd5e1;

  --article-surface: #081b32;
  --article-soft: #0a2039;
  --article-green-soft: rgba(0, 208, 156, 0.10);
  --article-green-border: rgba(0, 208, 156, 0.23);
  --article-shadow: 0 18px 55px rgba(0, 0, 0, 0.24);
  --article-bottom: #020b18;
}

.article-page,
.article-page * {
  box-sizing: border-box;
}

.article-page {
  padding: 48px 20px 80px;
  background: var(--bg);
  color: var(--text);
  transition: background-color .3s ease, color .3s ease;
}

.article-wrap {
  width: min(100%, 1080px);
  margin: 0 auto;
}

.article-hero {
  position: relative;
  overflow: hidden;
  padding: 58px 58px 48px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--article-surface);
  box-shadow: var(--article-shadow);
  text-align: left;
}

.article-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -95px;
  top: -110px;
  border-radius: 50%;
  background: var(--article-green-soft);
  pointer-events: none;
}

.article-badge {
  display: inline-flex;
  padding: 8px 18px;
  margin-bottom: 24px;
  border: 1px solid var(--article-green-border);
  border-radius: 999px;
  background: var(--article-green-soft);
  color: var(--primary);
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.article-hero h1 {
  position: relative;
  z-index: 1;
  max-width: 850px;
  margin: 0;
  color: var(--text);
  font-size: clamp(2.35rem, 5vw, 4.4rem);
  line-height: 1.08;
  letter-spacing: -.035em;
  text-align: left;
}

.article-intro-text {
  max-width: 760px;
  margin: 24px 0 0;
  color: var(--para);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  line-height: 1.75;
  text-align: left;
}

.article-featured-image {
  margin: 34px 0 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--card);
}

.article-featured-image img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-content {
  width: 100%;
  max-width: 920px;
  margin: 46px 0 0;
  padding: 0 8px;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.8;
  text-align: left !important;
}

.article-content p,
.article-content h2,
.article-content h3,
.article-content ul,
.article-content ol,
.article-content li,
.article-content section {
  text-align: left !important;
}

.article-content p {
  max-width: 870px;
  margin: 0 0 20px;
  color: var(--para);
}

.article-content h2 {
  max-width: 900px;
  margin: 52px 0 17px;
  color: var(--text);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
  line-height: 1.25;
  letter-spacing: -.02em;
}

.article-content h3 {
  margin: 30px 0 10px;
  color: var(--text);
  font-size: 1.24rem;
  line-height: 1.35;
}

.article-content ul,
.article-content ol {
  margin: 0 0 26px 22px;
  padding-left: 18px;
}

.article-content li {
  margin-bottom: 11px;
  color: var(--para);
}

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

.article-content a {
  color: var(--primary);
  font-weight: 650;
  text-decoration: none;
}

.article-content a:hover {
  text-decoration: underline;
}

/* Key takeaways */
.key-takeaways {
  max-width: 920px;
  margin: 36px 0 46px;
  padding: 28px 30px;
  border: 1px solid var(--article-green-border);
  border-left: 5px solid var(--primary);
  border-radius: 20px;
  background: var(--article-green-soft);
}

.key-takeaways h2 {
  margin: 0 0 16px;
  font-size: 1.55rem;
}

.key-takeaways ul {
  margin-bottom: 0;
}

/* CTA */
.article-cta {
  max-width: 920px;
  margin: 34px 0 46px;
  padding: 28px 30px;
  border: 1px solid var(--article-green-border);
  border-radius: 22px;
  background: linear-gradient(135deg, var(--article-green-soft), var(--article-surface));
}

.article-cta h2 {
  margin: 3px 0 9px;
  font-size: 1.6rem;
}

.article-cta p {
  margin-bottom: 12px;
}

.cta-kicker {
  color: var(--primary);
  font-size: .86rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.article-content .cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  padding: 13px 19px;
  border-radius: 11px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  text-align: center !important;
}

.article-content .cta-button:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

.compact-cta {
  margin-top: 38px;
}

/* Examples */
.example-box,
.calculation-card {
  max-width: 760px;
  margin: 26px 0 30px;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
}

.example-box h3 {
  margin-top: 0;
}

.example-box ul {
  margin-bottom: 0;
}

.calculation-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 920px;
}

.calculation-card > div {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--article-surface);
}

.calculation-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--para);
  font-size: .88rem;
}

.calculation-card strong {
  display: block;
  color: var(--text);
  font-size: 1.08rem;
}

.calculation-card .formula {
  grid-column: 1 / -1;
  max-width: none;
  margin: 4px 0 0;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--article-green-soft);
  color: var(--text);
  font-weight: 800;
}

/* Steps */
.step-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 20px;
  max-width: 920px;
  margin: 18px 0;
  padding: 24px 26px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--article-surface);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--article-green-soft);
  color: var(--primary);
  font-weight: 900;
}

.step-card h3 {
  margin: 0 0 8px;
}

.step-card p:last-child {
  margin-bottom: 0;
}

/* Lists */
.check-list,
.mistake-list {
  max-width: 900px;
}

.check-list li::marker {
  color: var(--primary);
}

.mistake-list li::marker {
  color: #f59e0b;
}

/* Medical note */
.medical-note {
  max-width: 920px;
  margin: 30px 0;
  padding: 24px 26px;
  border: 1px solid var(--article-green-border);
  border-radius: 18px;
  background: var(--article-soft);
}

.medical-note h3 {
  margin-top: 0;
}

.medical-note p:last-child {
  margin-bottom: 0;
}

/* Table */
.calorie-table-wrap {
  width: 100%;
  max-width: 920px;
  margin: 25px 0 34px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--article-surface);
  -webkit-overflow-scrolling: touch;
}

.calorie-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.calorie-table th,
.calorie-table td {
  padding: 15px 17px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.calorie-table th {
  background: var(--card);
  color: var(--text);
  font-weight: 800;
}

.calorie-table td {
  background: var(--article-surface);
  color: var(--para);
}

.calorie-table tbody tr:last-child td {
  border-bottom: 0;
}

/* FAQ */
.faq-section {
  max-width: 920px;
  margin-top: 50px;
}

.faq-item {
  margin-bottom: 15px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: var(--article-surface);
}

.faq-item h3 {
  margin-top: 0;
}

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

/* References */
.references-section {
  max-width: 920px;
  margin-top: 50px;
  padding: 26px 28px;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--article-soft);
}

.references-section h2 {
  margin-top: 0;
}

.references-section li {
  margin-bottom: 13px;
  overflow-wrap: anywhere;
}

/* Bottom CTA */
.article-bottom-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 920px;
  margin-top: 50px;
  padding: 25px 28px;
  border-radius: 19px;
  background: var(--article-bottom);
}

.article-bottom-cta span,
.article-bottom-cta small {
  display: block;
  color: #fff;
}

.article-bottom-cta span {
  font-size: 1.05rem;
  font-weight: 800;
}

.article-bottom-cta small {
  margin-top: 2px;
  opacity: .75;
}

.article-content .article-bottom-cta a {
  color: #6ee7b7;
  font-weight: 800;
  white-space: nowrap;
}

/* Explicit dark-mode protection */
body.dark .article-page {
  background: var(--bg);
}

body.dark .article-hero,
body.dark .step-card,
body.dark .faq-item,
body.dark .calorie-table-wrap,
body.dark .calorie-table td {
  background: var(--article-surface);
}

body.dark .article-content p,
body.dark .article-content li,
body.dark .article-intro-text {
  color: var(--para);
}

body.dark .article-content h2,
body.dark .article-content h3,
body.dark .article-content strong,
body.dark .article-hero h1 {
  color: var(--text);
}

/* Responsive */
@media (max-width: 1024px) {
  .article-wrap {
    width: min(100%, 960px);
  }

  .article-hero {
    padding: 48px 42px 40px;
  }

  .article-content {
    max-width: 880px;
  }
}

@media (max-width: 768px) {
  .article-page {
    padding: 28px 14px 60px;
  }

  .article-hero {
    padding: 36px 25px 31px;
    border-radius: 23px;
  }

  .article-featured-image {
    margin-top: 26px;
    border-radius: 21px;
  }

  .article-content {
    margin-top: 34px;
    padding: 0 2px;
    font-size: 1rem;
  }

  .article-content h2 {
    margin-top: 40px;
  }

  .article-cta,
  .key-takeaways,
  .medical-note,
  .references-section {
    padding: 21px;
  }

  .calculation-card {
    grid-template-columns: 1fr;
  }

  .calculation-card .formula {
    grid-column: auto;
  }
}

@media (max-width: 480px) {
  .article-page {
    padding: 20px 10px 48px;
  }

  .article-hero {
    padding: 29px 18px 25px;
    border-radius: 19px;
  }

  .article-hero h1 {
    font-size: 2rem;
    line-height: 1.15;
  }

  .article-intro-text {
    margin-top: 18px;
    font-size: 1rem;
  }

  .article-featured-image {
    border-radius: 17px;
  }

  .article-content {
    margin-top: 28px;
    padding: 0;
    font-size: .98rem;
  }

  .article-content h2 {
    margin-top: 35px;
    font-size: 1.55rem;
  }

  .article-content h3 {
    font-size: 1.14rem;
  }

  .article-content ul,
  .article-content ol {
    margin-left: 7px;
    padding-left: 20px;
  }

  .article-cta,
  .key-takeaways,
  .medical-note,
  .references-section,
  .faq-item,
  .example-box,
  .calculation-card {
    padding: 18px;
    border-radius: 15px;
  }

  .article-content .cta-button {
    width: 100%;
  }

  .step-card {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 19px;
  }

  .step-number {
    width: 44px;
    height: 44px;
  }

  .calorie-table {
    min-width: 500px;
  }

  .article-bottom-cta {
    align-items: flex-start;
    flex-direction: column;
    padding: 20px;
  }

  .article-content .article-bottom-cta a {
    white-space: normal;
  }
}
