/* Fresh Mind — Journal (stories) — listing + story pages */

.fm-stories-hero {
  text-align: center;
  padding: 3.4rem 1.2rem 2.6rem;
  background: var(--possibility);
  border-bottom: 1px solid var(--cloud);
}
.fm-stories-hero h1 {
  margin: 0 0 0.75rem;
  font-size: 2.6rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--universe);
}
.fm-stories-hero h1 em { color: var(--growth); font-style: normal; }
.fm-stories-hero p.subtitle {
  margin: 0 auto;
  max-width: 34rem;
  font-size: 1.12rem;
  line-height: 1.7;
  color: var(--silver);
}

.fm-stories {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.6rem 1.4rem 4rem;
}

.stories-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 640px) {
  .stories-grid { grid-template-columns: repeat(2, 1fr); gap: 1.6rem; }
}
@media (min-width: 1024px) {
  .stories-grid { grid-template-columns: repeat(3, 1fr); }
}

.story-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--cloud);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.story-card:hover,
.story-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -18px rgba(22,22,29,0.45);
  border-color: var(--growth);
  color: inherit;
}
.story-card:focus-visible { outline: 2px solid var(--growth); outline-offset: 2px; }
.story-card .card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, var(--ice), #fff);
  overflow: hidden;
}
.story-card .card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.story-card .card-image .card-image-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dust);
}
.story-card .card-image .card-image-placeholder img {
  width: 64px;
  height: auto;
  opacity: 0.55;
}
.story-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.05rem 1.15rem 1.15rem;
  flex: 1;
}
.story-card .card-meta {
  font-size: 0.875rem;
  letter-spacing: 0.04em;
  color: #17171A; /* date — high contrast, not dust */
  text-transform: none;
}
.story-card h2 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--universe);
}
.story-card .card-excerpt {
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
  color: #17171A;
  flex: 1;
}
.story-card .card-cta {
  margin-top: 0.45rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--growth);
}

.stories-empty {
  text-align: center;
  padding: 3.4rem 1.4rem;
  border: 1px dashed var(--cloud);
  border-radius: var(--radius);
  background: #fff;
}
.stories-empty h2 { margin: 0 0 0.6rem; font-size: 1.7rem; color: var(--universe); }
.stories-empty p { margin: 0 auto; max-width: 32rem; color: #17171A; line-height: 1.6; }

/* Story detail page */
.fm-story {
  max-width: 880px;
  margin: 0 auto;
  padding: 2.8rem 1.4rem 4.2rem;
}
.story-hero { margin: 0 0 2.2rem; }
.story-hero iframe,
.story-hero > img {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 20px 44px -22px rgba(22,22,29,0.45);
}
.story-hero iframe { aspect-ratio: 16 / 9; display: block; }
.story-hero > img { height: auto; display: block; }

.story-hero-text { color: #17171A; font-size: 1rem; }
.story-kicker {
  margin: 0 0 0.7rem;
  font-size: 0.875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--silver);
  font-weight: 500;
}
.story-kicker span { color: var(--growth); letter-spacing: 0.14em; }
.fm-story h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 600;
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--universe);
  margin: 0 0 0.9rem;
}
.fm-story .story-meta {
  margin: 0 0 1.8rem;
  font-size: 1rem;
  color: var(--silver);
}
.fm-story .story-meta time { color: var(--silver); }

.story-body { font-size: 1.15rem; line-height: 1.85; color: #17171A; }
.story-body p { margin: 0 0 1.5rem; }
.story-body p:last-child { margin-bottom: 0; }
.story-body blockquote {
  margin: 1.8rem 0;
  padding: 0.2rem 0 0.2rem 1.2rem;
  border-left: 3px solid var(--growth);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.65;
  color: var(--universe);
  font-style: italic;
}

.story-back {
  display: inline-block;
  margin-top: 2.6rem;
  padding: 0.7rem 0;
  font-weight: 600;
  color: var(--universe);
  text-decoration: none;
  border-bottom: 2px solid var(--cloud);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.story-back:hover,
.story-back:focus-visible { border-color: var(--growth); color: var(--growth); }
.story-back:focus-visible { outline: none; }

/* Form (add-story) */
.fm-form { max-width: 720px; margin: 0 auto; padding: 2.8rem 1.5rem 4.5rem; }
.fm-form label { display: block; font-weight: 600; color: var(--universe); margin-bottom: 0.45rem; font-size: 1.05rem; }
.fm-form .field { margin-bottom: 1.35rem; }
.fm-form input[type="text"],
.fm-form textarea,
.fm-form input[type="url"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  font-size: 1.05rem;
  font-family: inherit;
  color: var(--universe);
  background: #fff;
  border: 1px solid #D8D8DB;
  border-radius: 10px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.fm-form textarea { min-height: 260px; line-height: 1.7; resize: vertical; }
.fm-form input:focus,
.fm-form textarea:focus {
  outline: none;
  border-color: var(--growth);
  box-shadow: 0 0 0 3px rgba(255,0,98,0.14);
}
.fm-form .hint { font-size: 0.875rem; color: var(--silver); margin: 0.35rem 0 0; }
.fm-form .errors {
  background: #FFF4F6;
  border: 1px solid var(--growth);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin: 0 0 1.4rem;
  color: var(--universe);
}
.fm-form .errors ul { padding-left: 1.2rem; margin: 0; }
.fm-form button.submit {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--universe);
  color: #fff;
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.85rem 1.8rem;
  border-radius: 100px;
  border: 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.fm-form button.submit:hover,
.fm-form button.submit:focus-visible { opacity: 0.88; color: #fff; }
.fm-form button.submit:focus-visible { outline: 2px solid var(--growth); outline-offset: 2px; }
.fm-form .form-cta-link {
  display: inline-flex; align-items: center; margin-left: 1rem;
  color: var(--silver); font-size: 1rem; text-decoration: none;
}
.fm-form .form-cta-link:hover { color: var(--universe); }

/* Non-js error pages */
.fm-error { text-align: center; padding: 4rem 1.4rem 4.5rem; }
.fm-error h1 { font-size: 2rem; color: var(--universe); margin: 0 0 0.8rem; }
.fm-error p { color: var(--silver); font-size: 1.1rem; line-height: 1.7; max-width: 32rem; margin: 0 auto 1.4rem; }
.fm-error a { color: var(--growth); font-weight: 600; }

@media (max-width: 640px) {
  .fm-stories-hero h1 { font-size: 2.1rem; }
  .fm-stories-hero { padding: 2.8rem 1.2rem 2.1rem; }
  .fm-stories { padding-top: 1.9rem; }
  .story-card .card-image { aspect-ratio: 16 / 10; }
}

/* Subtle text link used in the listing hero */
.hero-link {
  font-weight: 600;
  font-size: inherit;
  color: var(--growth);
  text-decoration: none;
  border-bottom: 2px solid rgba(255,0,98,0.35);
  transition: border-color 0.2s ease;
}
.hero-link:hover,
.hero-link:focus-visible { border-color: var(--growth); }
