/* =========================================================
   Gardixo Article — Modern editorial reading UI
   Applies to all /articles/*.html pages
   ========================================================= */

body.article-page {
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(64, 145, 108, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(27, 67, 50, 0.06), transparent 50%),
    linear-gradient(180deg, #f3f7f4 0%, #fafbfa 28%, #ffffff 100%);
}

body.article-page main {
  overflow-x: clip;
}

/* Breadcrumb */
body.article-page .breadcrumb {
  margin: 0;
  padding: 1.25rem 0 0.5rem;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

body.article-page .breadcrumb a {
  color: var(--color-text-muted);
  font-weight: 500;
}

body.article-page .breadcrumb a:hover {
  color: var(--color-green-primary);
}

/* Layout spacing */
body.article-page .page-layout {
  padding-top: 0.75rem;
  gap: 2.75rem;
  align-items: start;
}

/* ---------- Article column ---------- */
.article-single {
  max-width: 740px;
  min-width: 0;
  animation: article-enter 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes article-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.article-single__header {
  margin-bottom: 1.75rem;
}

.article-single__category {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--color-green-primary);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0;
  border-radius: 0;
  margin-bottom: 1rem;
  position: relative;
}

.article-single__category::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-green-light);
  box-shadow: 0 0 0 4px rgba(64, 145, 108, 0.18);
}

.article-single__category:hover {
  color: var(--color-green-dark);
  text-decoration: none;
}

.article-single h1,
.article-single #article-title {
  margin: 0 0 1.15rem;
  font-size: clamp(2rem, 4.5vw, 2.85rem);
  line-height: 1.15;
  letter-spacing: -0.025em;
  color: var(--color-green-dark);
  max-width: 18ch;
}

@media (min-width: 700px) {
  .article-single h1,
  .article-single #article-title {
    max-width: none;
  }
}

.article-single__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  padding: 0;
  border-bottom: none;
  margin: 0;
}

.article-single__meta > span {
  display: inline-flex;
  align-items: center;
}

.article-single__meta > span:not(:last-child)::after {
  content: '';
  width: 4px;
  height: 4px;
  margin: 0 0.75rem;
  border-radius: 50%;
  background: var(--color-border);
}

.article-single__meta a,
.article-single__meta strong {
  color: var(--color-green-dark);
  font-weight: 600;
}

.article-single__meta a:hover {
  color: var(--color-green-primary);
}

/* Featured image — cinematic */
.article-single__featured {
  margin: 1.75rem 0 1.5rem;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.5) inset,
    0 20px 50px rgba(27, 67, 50, 0.14);
  background: #d8e8de;
}

.article-single__featured::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(27, 67, 50, 0.12));
  pointer-events: none;
}

.article-single__featured img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  transform: scale(1.02);
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.article-single:hover .article-single__featured img {
  transform: scale(1.05);
}

/* Hide empty / placeholder ad feel when unused — keep slot subtle */
body.article-page .ad-slot--in-article {
  margin: 1.25rem 0 1.75rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px dashed var(--color-border);
  background: rgba(245, 240, 232, 0.45);
}

body.article-page .ad-placeholder {
  min-height: 90px;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  opacity: 0.65;
}

/* ---------- TOC ---------- */
.article-toc {
  background: linear-gradient(145deg, #ffffff 0%, #f4f9f6 100%);
  border: 1px solid rgba(216, 226, 220, 0.9);
  border-radius: 16px;
  padding: 1.35rem 1.4rem 1.4rem;
  margin-bottom: 2.25rem;
  border-left: none;
  box-shadow: 0 10px 30px rgba(27, 67, 50, 0.05);
  position: relative;
  overflow: hidden;
}

.article-toc::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--color-green-light), var(--color-green-dark));
}

.article-toc h2 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 0.9rem;
}

.article-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
  display: grid;
  gap: 0.15rem;
}

.article-toc li {
  margin: 0;
  font-size: 0.92rem;
  counter-increment: toc;
}

.article-toc a {
  display: grid;
  grid-template-columns: 1.6rem 1fr;
  gap: 0.55rem;
  align-items: baseline;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.article-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--color-green-light);
  font-variant-numeric: tabular-nums;
}

.article-toc a:hover {
  background: rgba(64, 145, 108, 0.08);
  color: var(--color-green-dark);
}

/* ---------- Prose ---------- */
#article-intro.article-content {
  margin-bottom: 0.5rem;
}

#article-intro.article-content > p:first-child {
  font-size: clamp(1.08rem, 2vw, 1.2rem);
  line-height: 1.7;
  color: var(--color-green-dark);
  font-weight: 500;
}

#article-intro.article-content > p:first-child::first-letter {
  font-family: var(--font-heading);
  font-size: 3.4rem;
  float: left;
  line-height: 0.85;
  padding: 0.12rem 0.45rem 0 0;
  color: var(--color-green-primary);
  font-weight: 700;
}

.article-content {
  font-size: 1.05rem;
  color: #243d32;
}

.article-content h2 {
  margin: 2.75rem 0 1rem;
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
  letter-spacing: -0.02em;
  scroll-margin-top: 6rem;
  position: relative;
  padding-top: 0.35rem;
}

.article-content h2::before {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-green-light);
  margin-bottom: 0.85rem;
}

.article-content h3 {
  margin: 1.75rem 0 0.75rem;
  font-size: 1.2rem;
  scroll-margin-top: 6rem;
}

.article-content p {
  margin-bottom: 1.2rem;
  line-height: 1.8;
}

.article-content ul,
.article-content ol {
  margin: 1.1rem 0 1.5rem;
  padding-left: 0;
  list-style: none;
}

.article-content li {
  position: relative;
  margin-bottom: 0.65rem;
  padding-left: 1.55rem;
  line-height: 1.7;
}

.article-content ul > li::before {
  content: '';
  position: absolute;
  left: 0.15rem;
  top: 0.62rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-green-light);
  box-shadow: 0 0 0 3px rgba(64, 145, 108, 0.15);
}

.article-content ol {
  counter-reset: prose;
}

.article-content ol > li {
  counter-increment: prose;
}

.article-content ol > li::before {
  content: counter(prose);
  position: absolute;
  left: 0;
  top: 0.1rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 6px;
  background: rgba(64, 145, 108, 0.12);
  color: var(--color-green-dark);
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.article-content strong {
  color: var(--color-green-dark);
  font-weight: 600;
}

.article-content a {
  color: var(--color-green-primary);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

/* ---------- FAQ ---------- */
.article-faq {
  margin: 3rem 0 2rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.article-faq > h2 {
  font-size: clamp(1.4rem, 2.5vw, 1.7rem);
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
}

.article-faq > h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 0.7rem;
  border-radius: 2px;
  background: var(--color-green-light);
}

#article-faqs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid rgba(216, 226, 220, 0.95);
  border-bottom: 1px solid rgba(216, 226, 220, 0.95);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
  border-color: rgba(64, 145, 108, 0.45);
  box-shadow: 0 8px 24px rgba(27, 67, 50, 0.06);
}

.faq-item:last-child {
  border-bottom: 1px solid rgba(216, 226, 220, 0.95);
}

.faq-item h3 {
  font-family: var(--font-body);
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--color-green-dark);
  line-height: 1.35;
}

.faq-item p {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.65;
}

/* ---------- Share ---------- */
.article-share {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem 1.1rem;
  padding: 1.75rem 0;
  margin-top: 2.25rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.article-share > span {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.share-buttons {
  display: flex;
  gap: 0.55rem;
}

.share-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
  background: var(--color-green-primary);
  border-color: var(--color-green-primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(45, 106, 79, 0.22);
  text-decoration: none;
}

.share-btn:hover img {
  filter: brightness(0) invert(1);
}

.share-btn img {
  width: 17px;
  height: 17px;
}

/* ---------- Prev / Next ---------- */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0 0.5rem;
}

.article-nav a {
  padding: 1.15rem 1.2rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  font-size: 0.92rem;
  color: var(--color-text);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

.article-nav a:hover {
  background: var(--color-green-dark);
  border-color: var(--color-green-dark);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(27, 67, 50, 0.16);
  text-decoration: none;
}

.article-nav__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.35rem;
}

.article-nav a:hover .article-nav__label {
  color: rgba(255, 255, 255, 0.72);
}

.article-nav__title {
  font-weight: 600;
  line-height: 1.35;
}

.article-nav__next {
  text-align: right;
}

/* ---------- Related ---------- */
.related-articles {
  margin: 3.25rem 0 1rem;
  padding-top: 0.5rem;
}

.related-articles > h2 {
  margin: 0 0 1.35rem;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
  letter-spacing: -0.02em;
}

.related-articles > h2::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 0.65rem;
  border-radius: 2px;
  background: var(--color-green-light);
}

body.article-page .related-articles .articles-grid {
  gap: 1.15rem;
}

/* ---------- Comments ---------- */
.comments-section {
  margin: 2.5rem 0 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.comments-section > h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.35rem, 2.4vw, 1.65rem);
}

.comment-form {
  background: linear-gradient(160deg, #ffffff, #f5f9f6);
  padding: 1.5rem;
  border-radius: 16px;
  margin-bottom: 1.75rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 28px rgba(27, 67, 50, 0.04);
}

.comment-form .form-group {
  margin-bottom: 1rem;
}

.comment-form label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
  color: var(--color-green-dark);
}

.comment-form input,
.comment-form textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
  outline: none;
  border-color: var(--color-green-light);
  box-shadow: 0 0 0 4px rgba(64, 145, 108, 0.14);
}

.comment-form textarea {
  min-height: 120px;
  resize: vertical;
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.comment {
  padding: 1.1rem 1.2rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 14px;
}

.comment__author {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-green-dark);
}

.comment__date {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.comment__text {
  margin-top: 0.55rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- Sidebar polish on article pages ---------- */
body.article-page .sidebar-widget {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(216, 226, 220, 0.9);
  box-shadow: 0 10px 28px rgba(27, 67, 50, 0.04);
  backdrop-filter: blur(8px);
}

body.article-page .sidebar-widget__title {
  border-bottom-color: rgba(64, 145, 108, 0.35);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--color-text-muted);
}

/* Progressive reveal for long sections */
@media (prefers-reduced-motion: no-preference) {
  .article-content h2,
  .faq-item {
    animation: article-fade 0.55s ease both;
    animation-timeline: view();
    animation-range: entry 0% cover 18%;
  }
}

@keyframes article-fade {
  from {
    opacity: 0.35;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  body.article-page .page-layout {
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .article-single h1,
  .article-single #article-title {
    font-size: clamp(1.75rem, 7vw, 2.15rem);
  }

  #article-intro.article-content > p:first-child::first-letter {
    font-size: 2.75rem;
  }

  .article-single__featured {
    border-radius: 14px;
    margin-left: -0.15rem;
    margin-right: -0.15rem;
  }

  .article-nav {
    grid-template-columns: 1fr;
  }

  .article-nav__next {
    text-align: left;
  }

  .article-toc {
    padding: 1.15rem 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-single,
  .article-single__featured img,
  .article-content h2,
  .faq-item {
    animation: none !important;
    transition: none !important;
  }
}
