/**
 * CoreTheme shell layout
 *
 * Shared layout, singular shell and editor-owned page flow rules.
 */

/* Shared layout system
   -------------------------------------------------------------------------- */

.goe-layout,
.goe-layout--full {
  width: 100%;
  min-width: 0;
}

.goe-layout__inner,
.goe-layout__inner--wide {
  width: var(--goe-layout-wide-width);
  margin-inline: auto;
}

.goe-layout__inner--contained {
  width: var(--goe-layout-contained-width);
  margin-inline: auto;
}

.goe-layout__inner--full {
  width: 100%;
  margin-inline: 0;
}

.goe-shell__main {
  min-height: 50vh;
  position: relative;
}

body.goe-shell--has-transparent-chrome .goe-shell__main {
  margin-top: calc(-1 * var(--goe-shell-transparent-safe-offset, 0px));
}

/* Shared content widths
   -------------------------------------------------------------------------- */

.goe-shell__content,
.goe-singular__inner,
.goe-page__inner {
  width: var(--goe-layout-wide-width);
  margin-inline: auto;
}

.goe-shell__content {
  padding-inline: 0;
}

/* Owned plugin/core routes
   -------------------------------------------------------------------------- */

.goe-shell__owned {
  width: 100%;
}

.goe-singular {
  width: 100%;
  min-width: 0;
}

.goe-singular--owned {
  width: 100%;
}

.goe-singular__header {
  padding-block: var(--goe-section-space-lg);
  padding-inline: var(--goe-layout-gutter);
}

.goe-singular__header--owned {
  background: var(--goe-singular-header-bg, transparent);
}

.goe-singular--category_landing .go-category__hero-inner,
.goe-singular--experience_owned .go-experience__header,
.goe-singular--editor-owned .goe-editorial-hero:first-child .goe-editorial-hero__inner,
.goe-singular--standard .goe-page__header {
  padding-block-start: calc(var(--goe-shell-transparent-safe-offset, 0px) + var(--goe-transparent-content-extra-space, 0px));
}

.goe-singular__title {
  margin: 0;
  max-width: min(100%, max(var(--goe-title-width, 14ch), clamp(16ch, 42vw, 22ch)));
  font-family: var(--goe-shell-heading-font, inherit);
  font-size: clamp(2.25rem, 6vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-wrap: balance;
  overflow-wrap: break-word;
  color: var(--goe-text, #1a2e1a);
}

.goe-singular__content {
  width: 100%;
  min-width: 0;
}

.goe-singular__content--full_bleed {
  width: 100%;
}

/* Category landing pages
   -------------------------------------------------------------------------- */

.goe-singular--category_landing .goe-singular__content {
  width: 100%;
}

/*
 * Category composition is plugin-owned.
 * The theme only normalizes shared content widths as a safety net.
 */
.goe-singular--category_landing .go-category {
  width: 100%;
  min-width: 0;
}

.goe-singular--category_landing .go-category__hero-inner,
.goe-singular--category_landing .go-category__practical,
.goe-singular--category_landing .go-category__faq {
  width: 100%;
  max-width: var(--goe-layout-wide-width);
  margin-inline: auto;
}

.goe-singular--category_landing .go-category__experiences,
.goe-singular--category_landing .go-category__related {
  width: 100%;
  max-width: var(--goe-grid-width);
  margin-inline: auto;
}

.goe-singular--category_landing .go-category__hero {
  width: 100%;
}

.goe-singular--category_landing .go-category__hero-inner {
  max-width: min(var(--goe-layout-contained-max), var(--goe-layout-wide-width));
}

/* Keep the first category hero flush with the neutral singular shell. */
.goe-singular--category_landing .go-category__hero:first-child {
  margin-top: 0;
}

/* Experience owned pages
   -------------------------------------------------------------------------- */

.goe-singular--experience_owned .goe-singular__content {
  width: 100%;
}

/*
 * Keep experience pages plugin-friendly. If the plugin has its own page shell,
 * it can still use full-width sections. If it outputs simpler content, this
 * prevents it from becoming visually uncontrolled.
 */
.goe-singular--experience_owned .go-exp,
.goe-singular--experience_owned .go-experience {
  width: 100%;
}

/* Editor-owned Gutenberg pages
   -------------------------------------------------------------------------- */

.goe-singular--editor-owned .goe-singular__content {
  width: 100%;
  min-width: 0;
}

.goe-singular--editor-owned .goe-singular__content > :first-child {
  margin-top: 0;
}

.goe-singular--editor-owned .goe-singular__content > * {
  margin-block: 0;
}

.goe-singular--editor-owned .goe-singular__content > :last-child {
  margin-bottom: 0;
}

.goe-singular--editor-owned .goe-singular__content > * + * {
  margin-block-start: var(--goe-block-gap);
}

.goe-singular--editor-owned .goe-singular__content > :where(.alignfull, .goe-editorial-band, .goe-migrated-section, .goe-migrated-columns, .goe-front) {
  margin-block-start: 0;
}

.goe-singular--editor-owned .goe-singular__content > :where(.alignfull, .goe-editorial-band, .goe-migrated-section, .goe-migrated-columns, .goe-front):first-child {
  margin-block-start: 0;
}

.goe-singular--editor-owned .goe-singular__content > :where(.alignfull, .goe-editorial-band, .goe-migrated-section, .goe-migrated-columns, .goe-front):last-child {
  margin-block-end: 0;
}

.goe-singular--editor-owned .goe-singular__content :where(
  .wp-block-group:not(.is-layout-flex):not(.is-layout-grid):not([class*="goe-editorial"]):not([class*="goe-migrated"]) > .wp-block-group__inner-container,
  .wp-block-cover:not([class*="goe-editorial"]):not([class*="goe-migrated"]) > .wp-block-cover__inner-container,
  .wp-block-column:not([class*="goe-editorial"]):not([class*="goe-migrated"]),
  .wp-block-media-text__content,
  .wp-block-details__content
) > * {
  margin-block: 0;
}

.goe-singular--editor-owned .goe-singular__content :where(
  .wp-block-group:not(.is-layout-flex):not(.is-layout-grid):not([class*="goe-editorial"]):not([class*="goe-migrated"]) > .wp-block-group__inner-container,
  .wp-block-cover:not([class*="goe-editorial"]):not([class*="goe-migrated"]) > .wp-block-cover__inner-container,
  .wp-block-column:not([class*="goe-editorial"]):not([class*="goe-migrated"]),
  .wp-block-media-text__content,
  .wp-block-details__content
) > * + * {
  margin-block-start: var(--goe-block-gap);
}

.goe-singular--editor-owned .goe-singular__content :where(
  .goe-singular__content,
  .wp-block-group:not(.is-layout-flex):not(.is-layout-grid):not([class*="goe-editorial"]):not([class*="goe-migrated"]) > .wp-block-group__inner-container,
  .wp-block-cover:not([class*="goe-editorial"]):not([class*="goe-migrated"]) > .wp-block-cover__inner-container,
  .wp-block-column:not([class*="goe-editorial"]):not([class*="goe-migrated"]),
  .wp-block-media-text__content,
  .wp-block-details__content
) > :where(h1, h2, h3, h4, h5, h6, .wp-block-heading) + * {
  margin-block-start: var(--goe-heading-gap);
}

/* Standard pages/posts
   -------------------------------------------------------------------------- */

.goe-page {
  width: 100%;
  padding-block: var(--goe-section-space);
}

.goe-page__header {
  margin-bottom: calc(var(--goe-section-space) * 0.75);
}

.goe-page__body,
.goe-singular--editor-owned .goe-singular__content {
  width: 100%;
  min-width: 0;
}

.goe-page__body > *,
.goe-singular--editor-owned .goe-singular__content > * {
  width: 100%;
  max-width: var(--goe-page-default-layout-width);
  margin-inline: auto;
}

.goe-page__body > :where(.go-exp-grid, .go-categories-grid, .go-cat-grid, .goe-grid),
.goe-singular--editor-owned .goe-singular__content > :where(.go-exp-grid, .go-categories-grid, .go-cat-grid, .goe-grid) {
  width: 100%;
  max-width: var(--goe-page-grid-width);
  margin-inline: auto;
}

.goe-page__body > .wp-block-shortcode:has(> :where(.go-exp-grid, .go-categories-grid, .go-cat-grid, .goe-grid)),
.goe-singular--editor-owned .goe-singular__content > .wp-block-shortcode:has(> :where(.go-exp-grid, .go-categories-grid, .go-cat-grid, .goe-grid)) {
  width: 100%;
  max-width: var(--goe-page-grid-width);
  margin-inline: auto;
}

.goe-page__body > .wp-block-shortcode > :where(.go-exp-grid, .go-categories-grid, .go-cat-grid, .goe-grid),
.goe-singular--editor-owned .goe-singular__content > .wp-block-shortcode > :where(.go-exp-grid, .go-categories-grid, .go-cat-grid, .goe-grid) {
  width: 100%;
}

.goe-page__body > :where(
  p,
  ul,
  ol,
  dl,
  blockquote,
  pre,
  table,
  hr,
  h2,
  h3,
  h4,
  h5,
  h6,
  .wp-block-heading,
  .wp-block-paragraph,
  .wp-block-list,
  .wp-block-quote,
  .wp-block-table,
  .wp-block-preformatted,
  .wp-block-code,
  .wp-block-pullquote,
  .wp-block-details,
  .goe-page__pages
),
.goe-singular--editor-owned .goe-singular__content > :where(
  p,
  ul,
  ol,
  dl,
  blockquote,
  pre,
  table,
  hr,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  .wp-block-heading,
  .wp-block-paragraph,
  .wp-block-list,
  .wp-block-quote,
  .wp-block-table,
  .wp-block-preformatted,
  .wp-block-code,
  .wp-block-pullquote,
  .wp-block-details,
  .goe-page__pages
) {
  width: 100%;
  max-width: var(--goe-layout-contained-width);
}

.goe-page__body > :where(
  .wp-block-columns,
  .wp-block-media-text,
  .wp-block-cover,
  .wp-block-gallery,
  .wp-block-group.is-layout-grid,
  .wp-block-group.has-background,
  .wp-block-group[class*="goe-editorial"],
  .wp-block-group[class*="goe-migrated"]
),
.goe-singular--editor-owned .goe-singular__content > :where(
  .wp-block-columns,
  .wp-block-media-text,
  .wp-block-cover,
  .wp-block-gallery,
  .wp-block-group.is-layout-grid,
  .wp-block-group.has-background,
  .wp-block-group[class*="goe-editorial"],
  .wp-block-group[class*="goe-migrated"]
) {
  width: 100%;
  max-width: var(--goe-layout-wide-width);
  margin-inline: auto;
}

.goe-page__body > .alignwide,
.goe-singular--editor-owned .goe-singular__content > .alignwide {
  width: 100%;
  max-width: var(--goe-layout-wide-width);
  margin-inline: auto;
}

.goe-page__body > .alignfull,
.goe-singular--editor-owned .goe-singular__content > .alignfull {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

.goe-page__body > .alignfull > :where(.wp-block-group__inner-container, .wp-block-cover__inner-container, .wp-block-columns, .wp-block-media-text, .wp-block-post-content),
.goe-singular--editor-owned .goe-singular__content > .alignfull > :where(.wp-block-group__inner-container, .wp-block-cover__inner-container, .wp-block-columns, .wp-block-media-text, .wp-block-post-content) {
  width: 100%;
  max-width: var(--goe-full-width-content-width);
  margin-inline: auto;
}

.goe-page__body > .alignfull > .alignwide,
.goe-singular--editor-owned .goe-singular__content > .alignfull > .alignwide {
  width: 100%;
  max-width: var(--goe-full-width-content-width);
  margin-inline: auto;
}

.goe-page__body > :where(.goe-migrated-section, .goe-migrated-columns),
.goe-singular--editor-owned .goe-singular__content > :where(.goe-migrated-section, .goe-migrated-columns) {
  margin-block: var(--goe-section-space);
}

.goe-page__body > :where(.goe-migrated-section, .goe-migrated-columns):first-child,
.goe-singular--editor-owned .goe-singular__content > :where(.goe-migrated-section, .goe-migrated-columns):first-child {
  margin-top: 0;
}

.goe-page__body > :where(.goe-migrated-section, .goe-migrated-columns):last-child,
.goe-singular--editor-owned .goe-singular__content > :where(.goe-migrated-section, .goe-migrated-columns):last-child {
  margin-bottom: 0;
}

.goe-migrated-section,
.goe-migrated-columns,
.goe-migrated-section__inner {
  display: grid;
  gap: clamp(1rem, 2vw, 1.5rem);
}

.goe-migrated-section--full {
  padding-block: var(--goe-section-space);
}

.goe-migrated-section :where(.goe-migrated-section, .goe-migrated-columns) {
  margin-block: 0;
}

.goe-migrated-section :where(.alignwide) {
  width: 100%;
  max-width: var(--goe-layout-wide-width);
  margin-inline: auto;
}

.goe-page__title {
  margin: 0;
  max-width: min(100%, max(var(--goe-title-width, 14ch), clamp(16ch, 40vw, 22ch)));
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
  overflow-wrap: break-word;
  color: var(--goe-text, #1a2e1a);
}

.goe-page__body > :where(h1, h2, h3, h4, h5, h6, .wp-block-heading),
.goe-singular--editor-owned .goe-singular__content > :where(h1, h2, h3, h4, h5, h6, .wp-block-heading),
.goe-prose :where(h1, h2, h3, h4, h5, h6) {
  text-wrap: balance;
  overflow-wrap: break-word;
}

.goe-page__media {
  margin: 0 0 calc(var(--goe-section-space) * 0.75);
}

.goe-page__media img,
.goe-page__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--goe-radius-lg, 1rem);
}

.goe-prose {
  width: 100%;
  line-height: 1.7;
  color: var(--goe-text, #1a2e1a);
}

.goe-prose > * {
  margin-top: 0;
  margin-bottom: 1.1em;
}

.goe-prose > *:last-child {
  margin-bottom: 0;
}

.goe-prose h2 {
  margin-top: 2em;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  line-height: 1.2;
}

.goe-prose h3 {
  margin-top: 1.6em;
  font-size: clamp(1.2rem, 2.5vw, 1.4rem);
  line-height: 1.25;
}

.goe-prose a {
  color: var(--goe-primary, #2563eb);
  text-underline-offset: 0.15em;
}

.goe-prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--goe-radius-md, 0.6rem);
}

.goe-prose ul,
.goe-prose ol {
  padding-left: 1.4em;
}

.goe-prose li + li {
  margin-top: 0.4em;
}

.goe-prose blockquote {
  margin-inline: 0;
  padding-left: 1.2em;
  border-left: 4px solid var(--goe-primary, #2563eb);
  color: var(--goe-text-muted, #5a6b5a);
  font-style: italic;
}

.goe-page__body > :where(.wp-block-table, table),
.goe-singular--editor-owned .goe-singular__content > :where(.wp-block-table, table) {
  width: 100%;
  max-width: var(--goe-layout-wide-width);
  margin-inline: auto;
}

.goe-page__body :where(.wp-block-table),
.goe-singular--editor-owned .goe-singular__content :where(.wp-block-table) {
  width: 100%;
  overflow-x: auto;
}

.goe-page__body :where(.wp-block-table table, table:not(.goe-editorial-table)),
.goe-singular--editor-owned .goe-singular__content :where(.wp-block-table table, table:not(.goe-editorial-table)) {
  width: 100%;
  min-width: var(--goe-table-min-inline-size, 42rem);
  border-collapse: collapse;
  line-height: 1.6;
  color: var(--goe-text, #1a2e1a);
  background: #fff;
}

.goe-page__body :where(.wp-block-table th, .wp-block-table td, table:not(.goe-editorial-table) th, table:not(.goe-editorial-table) td),
.goe-singular--editor-owned .goe-singular__content :where(.wp-block-table th, .wp-block-table td, table:not(.goe-editorial-table) th, table:not(.goe-editorial-table) td) {
  padding: 0.9rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid color-mix(in srgb, var(--goe-text, #1a2e1a) 10%, transparent);
}

.goe-page__body :where(.wp-block-table thead th, table:not(.goe-editorial-table) thead th),
.goe-singular--editor-owned .goe-singular__content :where(.wp-block-table thead th, table:not(.goe-editorial-table) thead th) {
  font-size: 0.88em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--goe-text, #1a2e1a) 74%, transparent);
  background: color-mix(in srgb, var(--goe-primary, #2d6a4f) 5%, #fff);
}

.goe-page__body :where(.wp-block-table tbody tr:nth-child(even), table:not(.goe-editorial-table) tbody tr:nth-child(even)),
.goe-singular--editor-owned .goe-singular__content :where(.wp-block-table tbody tr:nth-child(even), table:not(.goe-editorial-table) tbody tr:nth-child(even)) {
  background: color-mix(in srgb, var(--goe-primary, #2d6a4f) 3%, #fff);
}

@media (max-width: 640px) {
  .goe-page__body :where(.wp-block-table table, table:not(.goe-editorial-table)),
  .goe-singular--editor-owned .goe-singular__content :where(.wp-block-table table, table:not(.goe-editorial-table)) {
    min-width: var(--goe-table-min-inline-size-compact, 28rem);
  }
}

.goe-page__pages {
  margin-top: 2rem;
  font-weight: 600;
}

