/* =============================================================
   EMOTIONS — page-specific styles
   Loaded on the Emotions overview page (emotions/index.html) and
   on each per-emotion description page (emotions/anger.html etc.).
   Anything reused across the rest of the site lives in global.css.
   ============================================================= */


/* -------------------------------------------------------------
   SHARED — vertical rhythm
   The description pages and the overview page both contain long
   stretches of body copy: a single H1, then alternating H2/H3
   headings, paragraphs, lists, and the occasional CTA button.
   These rules give those elements consistent spacing so each
   section reads as a clearly separated chunk.
   ------------------------------------------------------------- */
.emotion-page,
.emotions-overview {
  padding: var(--space-xl) 0;
}

/* Section headings get extra space above so they visually start
   a new chunk after the preceding paragraph. The :first-child
   rule prevents an unwanted gap above the very first heading. */
.emotion-page h2,
.emotions-overview__text h2 {
  margin-top:    var(--space-xl);
  margin-bottom: var(--space-md);
}

.emotion-page h2:first-child,
.emotions-overview__text h2:first-child {
  margin-top: 0;
}

.emotion-page h3,
.emotions-overview__text h3 {
  margin-top:    var(--space-lg);
  margin-bottom: var(--space-sm);
}

.emotion-page ul,
.emotions-overview__text ul {
  margin:      var(--space-sm) 0 var(--space-md) var(--space-lg);
  padding-left: var(--space-sm);
}

.emotion-page li,
.emotions-overview__text li {
  margin-bottom: var(--space-xs);
}

/* In-body links (those not styled as buttons) keep the steel-blue
   accent set globally, but here we underline them so they're
   clearly distinguishable from surrounding text in long copy. */
.emotion-page a:not(.btn),
.emotions-overview__text a:not(.btn) {
  text-decoration: underline;
}

/* Standalone CTA buttons in body copy need a little air around them
   so they don't crowd against the preceding paragraph or the next
   heading. */
.emotion-page .btn,
.emotions-overview__text .btn {
  margin: var(--space-md) 0;
}


/* -------------------------------------------------------------
   EMOTION DESCRIPTION PAGE
   Used by anger.html, anxiety.html, excitement.html, overwhelm.html,
   sadness.html, and shame.html. Each page has:
     1. A centered H1
     2. A centered hero image (the emotion character illustration)
     3. Body copy flowing below at the standard reading width
   ------------------------------------------------------------- */
.emotion-page h1 {
  text-align:    center;
  margin-bottom: var(--space-lg);
}

.emotion-page__hero {
  display:       block;
  width:         100%;
  max-width:     360px;
  height:        auto;
  aspect-ratio:  1 / 1;
  object-fit:    cover;
  margin:        0 auto var(--space-xl);
  border-radius: var(--radius-md);
}

/* Cap the readable body width so lines don't stretch uncomfortably
   wide on large monitors. The page itself still uses the standard
   1100px container, but the running text inside is narrower. */
.emotion-page__body {
  max-width: 820px;
  margin:    0 auto;
}


/* -------------------------------------------------------------
   EMOTIONS OVERVIEW PAGE
   Two columns on desktop:
     - Left column: the long-form description, links, and CTAs
     - Right column: a vertical stack of image + description cards,
       one per emotion, each a link to that emotion's page

   Below 768px the layout collapses to a single column. The text
   block appears first; the image + description cards follow it
   in document order so they're not stranded above the scroll.
   ------------------------------------------------------------- */
.emotions-overview__layout {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   var(--space-xl);
  align-items:           start;
}

/* The vertical stack of emotion cards on the right side */
.emotions-overview__cards {
  display:        flex;
  flex-direction: column;
  gap:            var(--space-md);
}

/* Each card pairs one image with one short description, and the
   whole card is a single link so any part of it is clickable. */
.emotion-link-card {
  display:               grid;
  grid-template-columns: 140px 1fr;
  gap:                   var(--space-md);
  align-items:           center;
  padding:               var(--space-sm);
  border:                1px solid var(--color-border);
  border-radius:         var(--radius-md);
  text-decoration:       none;
  color:                 var(--color-text);
  transition:            border-color var(--transition), transform var(--transition);
}

.emotion-link-card:hover {
  opacity:      1;            /* override the default link hover fade */
  border-color: var(--color-coral);
  transform:    translateY(-2px);
}

.emotion-link-card:hover .emotion-link-card__title {
  color: var(--color-steel-blue);
}

.emotion-link-card__image {
  width:         140px;
  height:        140px;
  object-fit:    cover;
  border-radius: var(--radius-sm);
  display:       block;
}

.emotion-link-card__title {
  font-size:     var(--text-h4);
  font-weight:   var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
  transition:    color var(--transition);
}

.emotion-link-card__body {
  font-size:   var(--text-small);
  color:       var(--color-text);
  line-height: var(--line-height-body);
}


/* -------------------------------------------------------------
   RESPONSIVE — TABLET / MOBILE
   At ≤768px we collapse to a single column on both pages so the
   layout reads cleanly on phones.
   ------------------------------------------------------------- */
@media (max-width: 768px) {

  .emotion-page,
  .emotions-overview {
    padding: var(--space-lg) 0;
  }

  /* Smaller hero image on phones so the H1 + image fit comfortably
     above the fold and the user reaches body copy faster. */
  .emotion-page__hero {
    max-width: 240px;
    margin-bottom: var(--space-lg);
  }

  /* Single column. The text block (declared first in HTML) goes on
     top; the image + description card stack flows beneath it. */
  .emotions-overview__layout {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  /* Each card stacks vertically: image on top, title + description
     below. This is the "alternating image, description, image,
     description …" rhythm specified in the design brief. */
  .emotion-link-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align:    center;
    padding:       var(--space-md);
  }

  .emotion-link-card__image {
    width:        100%;
    max-width:    280px;
    height:       auto;
    aspect-ratio: 1 / 1;
  }

}
