/*
 * EAM redesign: pages/conference-single.css (each congress's own page,
 * single `conferences-archive` posts, e.g. /conferences-archive/eam-2027-in-kaunas-lithuania/).
 * Owner: eam-conferences page track. Rulebook P-29: RS article layout (RS
 * BlogArticle.tsx, S-10), the same grid as a single news post (templates.css
 * .rd-single): breadcrumb, H1 and text in columns 1-7 of 10, the congress
 * facts in the aside (columns 9-10), aside after the H1 at <= 820px.
 * Markup: Kadence single template + eam-conferences/templates/single.php
 * (.rd-article__main / .rd-article__aside added while the redesign is on).
 * Page layout only: the facts panel look, status tag and buttons are
 * components.css / forms.css.
 */

/* ---------------------------------------------------------------------------
 * Page shell: no outer card, no centred 920px column
 * (eam-conference-single.css:7-24), RS no-hero top spacing.
 * ------------------------------------------------------------------------- */
body.eam-redesign.single-conferences-archive .content-area {
  margin-top: var(--rd-space-xl);
  margin-bottom: calc(var(--rd-space-xl) + var(--rd-space-base));
}

body.eam-redesign.single-conferences-archive .content-container.site-container {
  max-width: var(--rd-container);
  padding-inline: var(--rd-gutter);
}

body.eam-redesign.single-conferences-archive article.entry.content-bg {
  /* Kadence pulls the boxed entry out by 1rem on phones
   * (.content-style-boxed .content-bg:not(.loop-entry)); RS keeps the gutter. */
  margin-inline: 0;
  border: 0;
  border-radius: var(--rd-radius);
  background: none;
  box-shadow: none;
}

body.eam-redesign.single-conferences-archive article.entry > .entry-content-wrap {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  /* Breadcrumb and title rows size to their content; a taller aside gives
   * its extra height to the last row, so the text follows the title. */
  grid-template-rows: auto auto 1fr;
  column-gap: var(--rd-grid-gap);
  align-items: start;
  padding: 0;
}

body.eam-redesign.single-conferences-archive .entry-content-wrap > .rd-breadcrumb {
  grid-column: 1 / 8;
  grid-row: 1;
}

body.eam-redesign.single-conferences-archive .entry-content-wrap > .entry-header {
  grid-column: 1 / 8;
  grid-row: 2;
  margin: 0 0 var(--rd-space-m);
}

body.eam-redesign.single-conferences-archive .entry-content-wrap > .entry-header .entry-title {
  margin: 0;
  font-size: var(--rd-fs-h1);
  line-height: var(--rd-lh-h1);
  overflow-wrap: break-word;
}

/* The content wrappers step aside so the aside and the main column sit on
 * the same grid as the title. */
body.eam-redesign.single-conferences-archive .entry-content-wrap > .entry-content,
body.eam-redesign.single-conferences-archive .entry-content-wrap > .entry-content > .eam-conf-single {
  display: contents;
}

body.eam-redesign.single-conferences-archive .eam-conf-single > .rd-article__main {
  grid-column: 1 / 8;
  grid-row: 3;
  min-width: 0;
}

body.eam-redesign.single-conferences-archive .eam-conf-single > .rd-article__aside {
  grid-column: 9 / 11;
  grid-row: 2 / span 2;
  min-width: 0;
  margin: 0;
}

/* ---------------------------------------------------------------------------
 * Facts in the narrow aside: one fact per line, links stacked.
 * ------------------------------------------------------------------------- */
body.eam-redesign.single-conferences-archive .eam-conf-single .eam-conf-single__list {
  flex-direction: column;
  gap: var(--rd-space-xs);
}

body.eam-redesign.single-conferences-archive .eam-conf-single ul.eam-conf-single__links {
  flex-direction: column;
  align-items: flex-start;
}

/* ---------------------------------------------------------------------------
 * Main column: whole photo (R-50: eam-conference-single.css:161-167 cut it at
 * 460px with "cover"), text, back link.
 * ------------------------------------------------------------------------- */
body.eam-redesign.single-conferences-archive .eam-conf-single .eam-conf-single__photo {
  margin: 0 0 var(--rd-space-m);
  background: var(--rd-color-surface-muted);
}

body.eam-redesign.single-conferences-archive .eam-conf-single .eam-conf-single__img {
  max-height: none;
  object-fit: contain;
}

body.eam-redesign.single-conferences-archive .eam-conf-single .eam-conf-single__body {
  margin: 0 0 var(--rd-space-m);
}

body.eam-redesign.single-conferences-archive .eam-conf-single .eam-conf-single__body > :first-child {
  margin-top: 0;
}

body.eam-redesign.single-conferences-archive .eam-conf-single .eam-conf-single__back {
  padding-top: var(--rd-space-s);
  border-top-color: var(--rd-border-light);
}

/* ---------------------------------------------------------------------------
 * Tablet and phone: one column, facts right after the title.
 * ------------------------------------------------------------------------- */
@media (max-width: 820px) {
  body.eam-redesign.single-conferences-archive .content-area {
    margin-top: var(--rd-space-l);
    margin-bottom: var(--rd-space-xl);
  }

  body.eam-redesign.single-conferences-archive article.entry > .entry-content-wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  body.eam-redesign.single-conferences-archive .entry-content-wrap > :is(.rd-breadcrumb, .entry-header),
  body.eam-redesign.single-conferences-archive .eam-conf-single > :is(.rd-article__main, .rd-article__aside) {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  body.eam-redesign.single-conferences-archive .eam-conf-single > .rd-article__aside {
    margin: 0 0 var(--rd-space-m);
  }

  /* Wider than the desktop aside: facts side by side again. */
  body.eam-redesign.single-conferences-archive .eam-conf-single .eam-conf-single__list {
    flex-direction: row;
    gap: var(--rd-space-xs) var(--rd-space-m);
  }
}
