/* ================================================
   GOOD IN BALANCE - MAIN STYLESHEET
   Brand Colors:
   - Charcoal Ink: #1F1F1F
   - Ivory Linen: #F8F5F1
   - Clay Blush: #E4B7A0
   - Moss Grey-Green: #A8B6A3
   - Soft Gold Beige: #D7C4A3
================================================ */

/* === RESET & BASE === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: #F8F5F1;
  color: #1F1F1F;
  line-height: 1.6;
  margin: 0;
}

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Playfair Display', serif;
}

/* === HEADER (Sticky Navigation) === */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 4rem;
  border-bottom: 1px solid rgba(228, 183, 160, 0.3);
  background-color: rgba(248, 245, 241, 0.98);
  backdrop-filter: blur(8px);
}

header h1 {
  font-size: 1.8rem;
  letter-spacing: 2px;
  font-weight: 400;
  margin: 0;
}

header nav a {
  margin-left: 2.5rem;
  text-decoration: none;
  color: #1F1F1F;
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

header nav a:hover {
  color: #E4B7A0;
}

/* === HERO SECTIONS === */

/* Homepage Hero */
.hero {
  position: relative;
  text-align: center;
  padding: 2rem 2rem 2rem;  /* Top/bottom now 2rem/4rem, sides 2rem — adjust bottom if needed */
  background-size: cover;
  background-position: center;
  color: #FFFFFF;
  opacity: 0;
  transform: translateY(0px); /* FIXED: was 20px */
  animation: fadeIn 1s ease forwards 0.2s;
}

.hero h2 {
  font-size: 3rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}

.hero p {
  max-width: 600px;
  margin: 0 auto 2.5rem;
  font-size: 1.15rem;
  font-weight: 300;
  line-height: 1.7;
  opacity: 0.95;
}

.hero button {
  background-color: #E4B7A0;
  color: #1F1F1F;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 2px;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
}

.hero button:hover {
  background-color: #D7C4A3;
  transform: translateY(-2px);
}

/* Article Page Hero */
.article-hero {
  padding: 1.5rem 2rem 2.5rem;
  text-align: left;
  max-width: 900px;
  margin: 0 auto;
}

.article-hero .badge {
  display: inline-block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7B5A3A;
  background-color: #F1E1D4;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.article-hero h2 {
  font-size: 2.3rem;
  margin: 0 0 0.75rem;
  font-weight: 500;
}

.article-hero .meta {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #777;
  margin-bottom: 1.2rem;
}

.article-hero p {
  max-width: 750px;
  color: #444;
  font-size: 1rem;
}

/* === CATEGORY GRID (Homepage) === */
.sections {
  max-width: 1400px;
  margin: 0 auto;
  padding: 6rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 3rem;
}

.section-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.section {
  position: relative;
  height: 420px;
  border-radius: 4px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeIn 0.8s ease forwards;
}

.section:nth-child(1) { animation-delay: 0.1s; }
.section:nth-child(2) { animation-delay: 0.2s; }
.section:nth-child(3) { animation-delay: 0.3s; }
.section:nth-child(4) { animation-delay: 0.4s; }
.section:nth-child(5) { animation-delay: 0.5s; }
.section:nth-child(6) { animation-delay: 0.6s; }
.section:nth-child(7) { animation-delay: 0.7s; }

.section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0.15));
  transition: background 0.4s ease;
}

.section-content {
  position: absolute;
  left: 2.5rem;
  right: 2.5rem;
  bottom: 2.5rem;
  color: #fff;
  transform: translateY(0);
  transition: transform 0.4s ease;
}

.section-content h3 {
  margin: 0 0 0.8rem;
  font-weight: 400;
  font-size: 2rem;
  letter-spacing: 0.5px;
}

.section-content p {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  font-weight: 300;
  opacity: 0.95;
}

.section:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.section:hover::before {
  background: linear-gradient(to top, rgba(0,0,0,0.5), rgba(0,0,0,0.1));
}

.section:hover .section-content {
  transform: translateY(-5px);
}

/* === ARTICLE BODY === */
.article-body {
  max-width: 900px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
  font-size: 1rem;
  color: #333;
  line-height: 1.7;
}

.article-body h3 {
  font-size: 1.5rem;
  margin-top: 2.2rem;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body ul {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.article-body li {
  margin-bottom: 0.5rem;
}

.article-body li + li {
  margin-top: 0.35rem;
}

/* === HERO IMAGE === */
.hero-image-wrapper {
  max-width: 900px;
  margin: 0 auto 2.5rem;
  padding: 0 2rem;
}

.hero-image-wrapper img {
  width: 100%;
  display: block;
  border-radius: 18px;
}

/* === HIGHLIGHT BOXES === */
.highlight-box {
  background-color: #FAF4ED;
  border-radius: 14px;
  border: 1px solid #E4B7A0;
  padding: 1.4rem 1.3rem;
  margin: 1.5rem 0 2rem;
  font-size: 0.96rem;
}

.highlight-box strong {
  font-weight: 600;
}

/* === ARTICLE GRID (Articles Page) === */
.content-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.25rem;
}

.article-card {
  background-color: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #E3D6C6;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.06);
}

.article-card-image {
  height: 180px;
  background-size: cover;
  background-position: center;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.article-card-body {
  padding: 1.4rem;
}

/* === BADGE ALIGNMENT FIX — OVERRIDES INLINE STYLES === */
.article-card-body .badge {
  display: block !important;
  margin: 0 0 0.45rem 0 !important;
  padding: 0.25rem 0.6rem !important;
  width: fit-content !important;
  background-color: #F1E1D4 !important;
  color: #7B5A3A !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
}

.article-card-body h4 {
  font-size: 1.2rem;
  margin: 0 0 0.6rem;
  font-weight: 500;
}

.article-card-body p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: #444;
}

.article-card-body .meta {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #777;
  margin-bottom: 0.4rem;
}

.article-card-body .read-more {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-decoration: none;
  border-bottom: 1px solid #1F1F1F;
  padding-bottom: 0.1rem;
  color: #1F1F1F;
}

/* Featured Article */
.featured-article .badge {
  display: block !important;
  margin: 0 0 0.45rem 0 !important;
  padding: 0.25rem 0.6rem !important;
  width: fit-content !important;
  background-color: #F1E1D4 !important;
  color: #7B5A3A !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  letter-spacing: 0.08em !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
}

.featured-article {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr);
  gap: 2.5rem;
  align-items: stretch;
  margin-bottom: 3.5rem;
}

.featured-image {
  border-radius: 18px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  min-height: 260px;
}

.featured-copy {
  background-color: #FAF4ED;
  border-radius: 18px;
  border: 1px solid #E4B7A0;
  padding: 2rem 1.75rem;
}

.featured-copy h3 {
  font-size: 1.7rem;
  margin: 0 0 0.75rem;
  font-weight: 500;
}

.featured-copy p {
  margin: 0 0 1.5rem;
  font-size: 0.98rem;
  color: #333;
}

.read-more {
  display: inline-block;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid #1F1F1F;
  padding-bottom: 0.15rem;
  text-decoration: none;
  color: #1F1F1F;
}

/* === FOOTER === */
footer {
  background-color: #1F1F1F;
  color: #F8F5F1;
  text-align: center;
  padding: 3rem;
  font-size: 0.9rem;
  font-weight: 300;
  letter-spacing: 0.5px;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === ARTICLES PAGE TWEAKS === */
.articles-page .hero {
  padding: 1.5rem 2rem 2rem;
}

/* Ensure card image corners match */
.article-card {
  border-radius: 16px;
  overflow: hidden;
}

.article-card-image {
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

/* === RESPONSIVE DESIGN === */

/* Tablets */
@media (max-width: 1200px) {
  .sections {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
    padding: 5rem 3rem;
  }
  
  .section {
    height: 380px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  header {
    padding: 1.5rem 2rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  header nav a {
    margin-left: 1.5rem;
    font-size: 0.9rem;
  }

  .hero {
    padding: 1.5rem 2rem 3rem;  /* Reduced top/bottom */
  }

  .hero h2 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1.05rem;
  }

  .sections {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 4rem 2rem;
  }

  .section {
    height: 340px;
  }

  .section-content {
    left: 2rem;
    right: 2rem;
    bottom: 2rem;
  }

  .section-content h3 {
    font-size: 1.75rem;
  }

  .article-hero {
    padding: 4rem 1.5rem 2rem;
  }

  .hero-image-wrapper {
    padding: 0 1.5rem;
  }

  .article-body {
    padding: 0 1.5rem;
  }

  .featured-article {
    grid-template-columns: 1fr;
  }

  .featured-image {
    min-height: 220px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  header h1 {
    font-size: 1.3rem;
    letter-spacing: 1px;
  }

  header nav a {
    margin-left: 1rem;
    font-size: 0.85rem;
  }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  .section:hover {
    transform: none;
    box-shadow: none;
  }
  
  .section:hover .section-content {
    transform: none;
  }
}

/* === DEFINITIVE STICKY HEADER PADDING FIX === */

/* 1. Target the main content area for centering and standard spacing */
.single-article-page main {
  /* Set a large top padding to push content down and clear the sticky header. */
  padding-top: 8rem !important; 
  
  /* Retains the centering, max-width, and side padding */
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* 2. Reset any possible conflicting default margin on the first H2 inside main */
.single-article-page main h2:first-of-type {
  margin-top: 0 !important; 
}