/* ==========================================================================
   PulseVerde Theme — CSS
   Visual DNA: Stocker template adaptation for editorial portal
   ========================================================================== */

/* --- CSS Variables --- */
:root {
  --color-primary: #00c974;
  --color-primary-dark: #00a35e;
  --color-primary-light: #e6faf0;
  --color-dark: #0b1a2b;
  --color-dark-mid: #132840;
  --color-body: #384860;
  --color-muted: #7a8ea3;
  --color-light: #f4f7fa;
  --color-white: #ffffff;
  --color-border: #dfe6ed;
  --color-card-shadow: rgba(0, 40, 20, 0.08);
  --font-heading: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 20px;
  --radius-pill: 50px;
  --transition: 0.35s ease;
  --container-max: 1180px;
  --section-py: 80px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-body);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--color-primary-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-dark);
  line-height: 1.25;
  font-weight: 700;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Utility --- */
.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  margin-bottom: 16px;
}

.section-desc {
  color: var(--color-muted);
  max-width: 640px;
  font-size: 1.02rem;
}

.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* --- Buttons (pill style from source) --- */
.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  border-radius: var(--radius-pill);
  padding: 12px 30px;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  line-height: 1.4;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-dark);
  color: var(--color-primary);
}

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.btn-outline:hover {
  background: var(--color-primary);
  color: var(--color-white);
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.btn-light {
  background: var(--color-white);
  color: var(--color-primary);
}

.btn-light:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* --- Skip link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  z-index: 10000;
  font-size: 0.85rem;
}

.skip-link:focus {
  top: 16px;
  color: var(--color-white);
}

/* ==========================================================================
   HEADER / NAVBAR
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background: transparent;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.site-header.scrolled {
  background: var(--color-white);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.07);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  max-width: var(--container-max);
  margin: 0 auto;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--color-white);
  transition: var(--transition);
}

.brand img {
  height: 36px;
  width: auto;
}

.scrolled .brand { color: var(--color-dark); }

.main-nav { display: flex; align-items: center; gap: 6px; }

.main-nav a {
  position: relative;
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(255,255,255,0.85);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.main-nav a:hover,
.main-nav a:focus {
  color: var(--color-primary);
}

.main-nav a::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
  transform: translateX(-50%);
}

.main-nav a:hover::after { width: 60%; }

.scrolled .main-nav a { color: var(--color-body); }
.scrolled .main-nav a:hover { color: var(--color-primary); }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  z-index: 1001;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-primary);
  transition: var(--transition);
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    padding: 80px 24px 24px;
    gap: 4px;
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.12);
    transition: right 0.35s ease;
    z-index: 1000;
  }

  .main-nav.open { right: 0; }

  .main-nav a {
    color: var(--color-dark);
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: var(--radius-sm);
  }

  .main-nav a:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 999;
  }

  .nav-overlay.active { display: block; }
}

/* ==========================================================================
   HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  background: linear-gradient(165deg, var(--color-dark) 0%, var(--color-dark-mid) 100%);
  overflow: hidden;
  padding: 120px 0 80px;
}

.hero::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -10%;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(0, 201, 116, 0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0%, transparent 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 48px;
  align-items: center;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.hero-content { animation: heroFadeUp 0.8s ease both; }

@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--color-primary);
  margin-bottom: 16px;
  padding: 4px 14px;
  background: rgba(0, 201, 116, 0.12);
  border-radius: var(--radius-pill);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--color-white);
  margin-bottom: 20px;
  line-height: 1.15;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.08rem;
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 520px;
}

.hero-subtitle p { margin: 0; }

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-decoration {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: heroFadeUp 0.8s 0.3s ease both;
}

.hero-chart {
  width: 100%;
  max-width: 340px;
  opacity: 0.18;
}

.hero-chart svg { width: 100%; height: auto; }

@media (max-width: 768px) {
  .hero { padding: 100px 0 60px; min-height: auto; }
  .hero-inner { grid-template-columns: 1fr; gap: 24px; }
  .hero-decoration { display: none; }
}

/* ==========================================================================
   LATEST POSTS (prominent — editorial priority)
   ========================================================================== */
.section-posts {
  padding: var(--section-py) 0;
  background: var(--color-white);
}

.posts-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 16px;
}

.posts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.post-card {
  background: var(--color-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
}

.post-card:hover {
  box-shadow: 0 8px 40px var(--color-card-shadow);
  transform: translateY(-4px);
}

.post-card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.post-card:hover .post-card-img img {
  transform: scale(1.08);
}

.post-card-body {
  padding: 24px 26px 28px;
}

.post-card-date {
  font-size: 0.8rem;
  color: var(--color-muted);
  font-weight: 500;
  margin-bottom: 10px;
  display: block;
}

.post-card-title {
  font-size: 1.15rem;
  margin-bottom: 12px;
  line-height: 1.35;
}

.post-card-title a {
  color: var(--color-dark);
  transition: var(--transition);
}

.post-card-title a:hover { color: var(--color-primary); }

.post-card-excerpt {
  color: var(--color-muted);
  font-size: 0.92rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Featured (first) post takes full row */
.post-card.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

.post-card.featured .post-card-img { aspect-ratio: auto; min-height: 280px; }
.post-card.featured .post-card-body { display: flex; flex-direction: column; justify-content: center; padding: 32px 36px; }
.post-card.featured .post-card-title { font-size: 1.4rem; }

@media (max-width: 768px) {
  .posts-grid { grid-template-columns: 1fr; }
  .post-card.featured { grid-template-columns: 1fr; }
  .post-card.featured .post-card-img { aspect-ratio: 16 / 9; min-height: auto; }
}

/* ==========================================================================
   TOPICS
   ========================================================================== */
.section-topics {
  padding: var(--section-py) 0;
  background: var(--color-light);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 36px;
}

.topic-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 28px 26px;
  border-left: 4px solid var(--color-primary);
  transition: var(--transition);
  position: relative;
}

.topic-card:hover {
  box-shadow: 0 8px 36px var(--color-card-shadow);
  transform: translateY(-3px);
}

.topic-card-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--color-primary-light);
  line-height: 1;
  margin-bottom: 12px;
  font-family: var(--font-heading);
}

.topic-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-dark);
  margin-bottom: 10px;
}

.topic-card-desc {
  color: var(--color-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.topic-card-desc p { margin: 0; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.section-faq {
  padding: var(--section-py) 0;
  background: var(--color-white);
}

.faq-layout {
  display: grid;
  grid-template-columns: 0.4fr 1fr;
  gap: 48px;
  margin-top: 8px;
}

.faq-sidebar { position: sticky; top: 100px; align-self: start; }

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.faq-item.active { border-color: var(--color-primary); }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--color-dark);
  transition: var(--transition);
}

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

.faq-question:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.faq-item.active .faq-icon {
  background: var(--color-primary);
  transform: rotate(45deg);
}

.faq-icon::before {
  content: "+";
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}

.faq-item.active .faq-icon::before { color: var(--color-white); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 22px;
}

.faq-item.active .faq-answer {
  max-height: 400px;
  padding: 0 22px 20px;
}

.faq-answer-inner {
  color: var(--color-muted);
  font-size: 0.93rem;
  line-height: 1.7;
}

.faq-answer-inner p { margin: 0 0 8px; }

@media (max-width: 768px) {
  .faq-layout { grid-template-columns: 1fr; gap: 24px; }
  .faq-sidebar { position: static; }
}

/* ==========================================================================
   FOOTER (dark, multi-column — source DNA)
   ========================================================================== */
.site-footer {
  background: var(--color-dark);
  padding: 60px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--color-white);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-brand img { height: 30px; width: auto; }

.footer-desc {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-email a {
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.92rem;
}

.footer-email a:hover { color: var(--color-white); }

.footer-heading {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-links a::before {
  content: "›";
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 700;
}

.footer-links a:hover { color: var(--color-primary); }

.footer-bottom {
  padding: 20px 0;
  text-align: center;
}

.footer-bottom p {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
  margin: 0;
}

@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ==========================================================================
   PAGE TEMPLATE (generic page & blog index)
   ========================================================================== */
.page-header {
  background: linear-gradient(165deg, var(--color-dark) 0%, var(--color-dark-mid) 100%);
  padding: 120px 0 56px;
  text-align: center;
  position: relative;
}

.page-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0%, transparent 100%);
}

.page-header h1 {
  color: var(--color-white);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

/* Content area */
.page-content {
  padding: 56px 0 var(--section-py);
}

.page-content .container {
  max-width: 780px;
}

.page-content h1,
.page-content h2,
.page-content h3,
.page-content h4 {
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

.page-content p { margin-bottom: 1.1em; }

.page-content img {
  border-radius: var(--radius-md);
  margin: 1.5em 0;
}

.page-content ul, .page-content ol {
  padding-left: 1.4em;
  margin-bottom: 1.2em;
}

.page-content a { color: var(--color-primary); text-decoration: underline; }

/* ==========================================================================
   BLOG INDEX
   ========================================================================== */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  padding: 56px 0 var(--section-py);
}

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

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 0 var(--section-py);
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-body);
  background: var(--color-light);
  transition: var(--transition);
}

.pagination a:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.pagination .active {
  background: var(--color-primary);
  color: var(--color-white);
}

.pagination .prev-next {
  font-size: 0.85rem;
  padding: 0 18px;
}

/* ==========================================================================
   SINGLE POST
   ========================================================================== */
.post-hero {
  background: linear-gradient(165deg, var(--color-dark) 0%, var(--color-dark-mid) 100%);
  padding: 120px 0 48px;
  position: relative;
}

.post-hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary) 0%, transparent 100%);
}

.post-hero-inner {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.post-hero-date {
  color: var(--color-primary);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
  display: block;
}

.post-hero-title {
  color: var(--color-white);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 16px;
}

.post-hero-excerpt {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto;
  line-height: 1.7;
}

.post-hero-excerpt p { margin: 0; }

.post-cover {
  max-width: 880px;
  margin: -32px auto 0;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

.post-cover img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.post-body {
  padding: 48px 0 var(--section-py);
}

.post-body .container { max-width: 780px; }

.post-body h2, .post-body h3, .post-body h4 {
  margin-top: 1.6em;
  margin-bottom: 0.6em;
}

.post-body p { margin-bottom: 1.1em; }
.post-body img { border-radius: var(--radius-md); margin: 1.5em 0; }
.post-body ul, .post-body ol { padding-left: 1.4em; margin-bottom: 1.2em; }
.post-body a { color: var(--color-primary); text-decoration: underline; }

/* ==========================================================================
   BACK TO TOP
   ========================================================================== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: var(--color-white);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 201, 116, 0.3);
  transition: var(--transition);
  z-index: 90;
}

.back-to-top:hover {
  background: var(--color-dark);
  color: var(--color-primary);
}

.back-to-top.visible { display: flex; }

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* focus visible for keyboard */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
