/* ALANON Safe Editor: published content adopts the existing CALM COMMUNITY EDITORIAL styles.
   Added only to the three archives and new ALANON story singles. Existing posts untouched. */

/* Speaker rows deliberately use the original .alanon-content-new__entry class.
   These rules only normalize the native player and avoid extra layout blocks. */
body.alanon-content-v2 .alanon-content-new__entry[data-alanon-live-speakers] .wp-block-audio {
  margin: 16px 0 0;
}
body.alanon-content-v2 .alanon-content-new__entry[data-alanon-live-speakers] audio {
  display: block;
  width: 100%;
  max-width: 720px;
  height: 40px;
}

/* New stories become native editorial list items, not a separate card grid. */
body.alanon-stories-v2 .alanon-content-new__story[data-alanon-live-stories] h3 a {
  color: inherit;
  text-decoration: none;
}
body.alanon-stories-v2 .alanon-content-new__story[data-alanon-live-stories] h3 a:hover,
body.alanon-stories-v2 .alanon-content-new__story[data-alanon-live-stories] h3 a:focus-visible {
  color: var(--teal-dark);
  text-decoration: underline;
}
body.alanon-stories-v2 .alanon-content-new__story[data-alanon-live-stories] .alanon-live-story-cover {
  margin: 0 0 22px;
}
body.alanon-stories-v2 .alanon-content-new__story[data-alanon-live-stories] .alanon-live-story-cover img {
  width: 100%;
  max-width: 660px;
  height: auto;
  border-radius: var(--radius);
}
body.alanon-stories-v2 .alanon-content-new__story[data-alanon-live-stories] .alanon-live-read-more {
  color: var(--teal-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: var(--font-sans);
  font-weight: 600;
}

/* Story teaser: concise editorial preview, not the full story. */
body.alanon-stories-v2 .alanon-content-new__story.alanon-live-story-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 12px 26px;
  align-items: start;
  margin: 0 0 30px;
  padding: 0 0 32px;
  border-bottom: 1px solid var(--line);
}
body.alanon-stories-v2 .alanon-live-story-preview__text { min-width: 0; }
body.alanon-stories-v2 .alanon-live-story-preview__text h3 {
  margin: 0 0 12px;
}
body.alanon-stories-v2 .alanon-live-story-preview__text .alanon-live-story-excerpt {
  max-width: 68ch;
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.7;
}
body.alanon-stories-v2 .alanon-live-story-preview__text .alanon-live-story-action {
  margin: 0;
}
body.alanon-stories-v2 .alanon-content-new__story.alanon-live-story-preview .alanon-live-story-cover {
  margin: 2px 0 0;
}
body.alanon-stories-v2 .alanon-content-new__story.alanon-live-story-preview .alanon-live-story-cover img {
  display: block;
  width: 128px;
  height: 104px;
  max-width: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}
body.alanon-stories-v2 .alanon-content-new__story.alanon-live-story-preview:not(:has(.alanon-live-story-cover)) {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 540px) {
  body.alanon-stories-v2 .alanon-content-new__story.alanon-live-story-preview {
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 16px;
  }
  body.alanon-stories-v2 .alanon-content-new__story.alanon-live-story-preview .alanon-live-story-cover img {
    width: 88px;
    height: 80px;
  }
}

/* Events: quiet archive-like editorial panels aligned with the existing info block. */
body.alanon-content-v2 .alanon-live-events {
  display: grid;
  gap: 22px;
  margin: 0 0 26px;
}
body.alanon-content-v2 .alanon-live-event {
  margin: 0;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--sand);
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface);
}
body.alanon-content-v2 .alanon-live-event h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font: 500 clamp(1.35rem, 3vw, 1.8rem)/1.28 var(--font-serif);
}
body.alanon-content-v2 .alanon-live-event p {
  max-width: 74ch;
  margin: 0 0 14px;
  line-height: 1.7;
}
body.alanon-content-v2 .alanon-live-event .alanon-live-event-meta {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.6;
}
body.alanon-content-v2 .alanon-live-event-cover {
  margin: 20px 0 0;
}
body.alanon-content-v2 .alanon-live-event-cover img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 520px;
  border-radius: var(--radius);
}
body.alanon-content-v2 .alanon-live-event-gallery,
body.alanon-stories-v2 .alanon-live-single-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
  gap: 14px;
  margin: 20px 0 0;
}
body.alanon-content-v2 .alanon-live-event-gallery figure,
body.alanon-stories-v2 .alanon-live-single-gallery figure {
  margin: 0;
}
body.alanon-content-v2 .alanon-live-event-gallery img,
body.alanon-stories-v2 .alanon-live-single-gallery img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
  border-radius: var(--radius);
}

/* WordPress's default single template is reused, with a normal editorial hero. */
body.single-alanon_story .entry-header { display: none; }
body.alanon-stories-v2 .alanon-live-single .alanon-content-new__hero {
  margin-inline: calc(-1 * var(--gutter, 20px));
}
body.alanon-stories-v2 .alanon-live-single .alanon-content-new__section {
  padding: 52px 0 64px;
}
body.alanon-stories-v2 .alanon-live-single .alanon-content-new__inner {
  max-width: 760px;
  margin-inline: auto;
}
body.alanon-stories-v2 .alanon-live-single-cover {
  margin: 0 0 30px;
}
body.alanon-stories-v2 .alanon-live-single-cover img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}
body.alanon-stories-v2 .alanon-live-single-copy p { line-height: 1.8; }
body.alanon-stories-v2 .alanon-live-back { margin: 34px 0 0; }
body.alanon-stories-v2 .alanon-live-back a {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: underline;
}

/* Fallback only if the production Gutenberg HTML has a different class structure. */
body.alanon-content-v2 .alanon-live-fallback {
  width: min(var(--container, 1120px), calc(100% - 2 * var(--gutter, 20px)));
  margin: 36px auto;
}
body.alanon-stories-v2 .alanon-live-fallback .alanon-content-new__story {
  padding: 0 0 32px;
  border-bottom: 1px solid var(--line);
}
body.alanon-content-v2 .alanon-live-fallback .alanon-content-new__entry {
  margin: 0 0 18px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--sand);
  border-radius: calc(var(--radius) + 2px);
}
@media (max-width: 768px) {
  body.alanon-content-v2 .alanon-live-event { padding: 20px 18px; }
  body.alanon-content-v2 .alanon-live-events { gap: 16px; }
  body.alanon-stories-v2 .alanon-live-single .alanon-content-new__section { padding: 38px 0 48px; }
}
