/* A shared rhythm for the site's coloured content bands and reading columns. */
:root {
  --site-gutter: clamp(24px, 6vw, 88px);
  --section-space: 80px;
  --section-stack: 32px;
  --label-space: 12px;
  --title-copy-space: 24px;
  --overview-space: 24px;
}
@media (min-width: 761px) and (max-width: 1100px) { :root { --section-space: 64px; --section-stack: 28px; } }
@media (max-width: 760px) { :root { --section-space: 48px; --section-stack: 24px; --title-copy-space: 20px; } }
html body .site-header, html body .piratas-footer { padding-inline: var(--site-gutter); }
html body :is(main, #main-content) > section:not(:where([data-screen-hero], .home-owner-feature, .sea-passages, .sea-owners-teaser)),
html body.code-page :is(main, #main-content) .principle {
  box-sizing: border-box;
  padding: var(--section-space) var(--site-gutter) !important;
  align-items: start;
}
/* The photographs meet the edges; their reading panels use the same spacing. */
html body :is(main, #main-content) > :is(.home-owner-feature, .sea-passages, .sea-owners-teaser) { padding: 0 !important; align-items: stretch; }
html body :is(main, #main-content) :is(.home-owner-content, .sea-passages-copy, .sea-owner-copy) {
  padding: var(--section-space) var(--site-gutter) !important;
  align-self: stretch;
  align-items: start;
}
html body :is(main, #main-content) :is(.eyebrow, .hp-kicker):has(+ :is(h2, h3, .declaration)) {
  display: block;
  margin-bottom: var(--label-space) !important;
}
html body :is(main, #main-content) :is(.eyebrow, .hp-kicker) + :is(h2, h3, .declaration) { margin-top: 0 !important; }
html body :is(main, #main-content) h2 + p:not(.eyebrow) { margin-top: var(--title-copy-space); }
html body :is(main, #main-content) > :is(.section-overview, .shore-routes, .principle-index) {
  padding: 0 var(--site-gutter) var(--section-space) !important;
  margin-top: 0 !important;
}
/* Opening blocks share one label row, then aligned heading and reading columns. */
html body :is(main, #main-content) > :is(.about-opening, .code-opening, .sea-ways, .shore-opening, .art-opening, .log-opening, .owners-intro) {
  padding-bottom: var(--overview-space) !important;
}
/* Give the Art and Ashore section links a little more space above them. */
html body :is(main, #main-content) > :is(.art-opening, .shore-opening) {
  padding-bottom: clamp(36px, 4vw, 48px) !important;
}
html body :is(main, #main-content) :is(.home-opening > .hp-label, .owners-intro-copy > .eyebrow) { margin: 0 0 var(--label-space) !important; }
html body :is(main, #main-content) :is(.about-opening, .code-opening, .sea-ways, .shore-opening, .art-opening, .log-opening) > .eyebrow { margin: 0 !important; }
html body :is(main, #main-content) :is(.about-opening, .code-opening, .sea-ways, .shore-opening, .art-opening, .log-opening) { row-gap: var(--label-space); }
html body :is(main, #main-content) :is(.about-opening, .code-opening, .sea-ways, .shore-opening, .art-opening, .log-opening) > h2,
html body.code-page :is(main, #main-content) .code-opening .declaration { margin: 0 !important; }
html body :is(main, #main-content) :is(.about-summary, .opening-reading, .ways-summary, .shore-opening > div, .art-opening > div:not(.mintaka-scene)) > p:first-child,
html body :is(main, #main-content) .log-opening > p:not(.eyebrow) { margin: 0 !important; }
html body :is(main, #main-content) .sea-ways > .section-overview {
  padding: 0;
  margin-top: calc(var(--overview-space) - var(--label-space));
}
/* Keep a consistent edge below and above the overview, including its embedded form. */
html body :is(main, #main-content) > .sea-ways { padding-bottom: var(--section-space) !important; }
html body :is(main, #main-content) .section-overview { column-gap: clamp(20px, 4vw, 64px); }
html body :is(main, #main-content) :is(.section-heading, .shore-continuing-heading, .art-intro, .films-heading, .course-heading) { align-items: start; }
html body :is(main, #main-content) .owners-custom > .eyebrow { margin: 0 !important; }
html body :is(main, #main-content) .owners-custom { row-gap: var(--label-space); }
@media (min-width: 761px) {
  html body :is(main, #main-content) :is(.about-opening, .code-opening, .sea-ways, .shore-opening, .art-opening, .log-opening) {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 8%;
    align-items: start;
  }
  html body :is(main, #main-content) :is(.about-opening, .code-opening, .sea-ways, .shore-opening, .art-opening, .log-opening) > .eyebrow { grid-column: 1 / -1; }
  html body :is(main, #main-content) :is(.about-opening > .about-summary, .code-opening > .opening-reading, .sea-ways > .ways-summary, .shore-opening > div, .art-opening > div:not(.mintaka-scene), .log-opening > p:not(.eyebrow)) {
    margin: 0 !important;
    padding-top: clamp(4px, .45vw, 7px);
    align-self: start;
  }
}
@media (max-width: 760px) {
  html body :is(main, #main-content) :is(.about-opening, .sea-ways, .shore-opening, .art-opening, .log-opening) { display: block; }
  html body.about-page :is(main, #main-content) #story { display: block; }
  html body :is(main, #main-content) :is(.about-opening, .sea-ways, .shore-opening, .art-opening, .log-opening) > .eyebrow { margin-bottom: var(--label-space) !important; }
  html body :is(main, #main-content) :is(.about-opening, .sea-ways, .shore-opening, .art-opening, .log-opening) > h2 { margin-bottom: var(--title-copy-space) !important; }
  html body :is(main, #main-content) :is(.about-summary, .opening-reading, .ways-summary) { margin: 0; padding: 0; max-width: none; }
  html body :is(main, #main-content) .sea-ways > .section-overview { margin-top: var(--overview-space); }
  html body :is(main, #main-content) .owners-intro-copy > h2 { margin-bottom: var(--title-copy-space); }
}

html body.shore-page :is(main, #main-content) .shore-development { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
html body.shore-page :is(main, #main-content) .shore-development article { min-width: 0; }
html body.shore-page :is(main, #main-content) .shore-development .status { min-height: 0; }
html body.shore-page :is(main, #main-content) .shore-development article > .major-action { margin-top: 24px; }
@media (min-width: 761px) and (max-width: 1100px) {
 html body.shore-page :is(main, #main-content) .shore-development { grid-template-columns: repeat(2, minmax(0, 1fr)); }
 html body.shore-page :is(main, #main-content) #pirate-treasures { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
 html body.shore-page :is(main, #main-content) .shore-development { grid-template-columns: minmax(0, 1fr); gap: 32px; }
 html body.shore-page :is(main, #main-content) #mentorship > figure { width: 100%; margin: 0; align-self: stretch; justify-self: stretch; }
 html body.shore-page :is(main, #main-content) #mentorship > .mentorship-copy { width: 100%; }
}

/* Remove remaining legacy stack gaps from the mobile opening components. */
html body :is(main, #main-content) .owners-intro-copy > h2 { margin-bottom: 0; }
html body :is(main, #main-content) .owners-intro-copy > h2 + p { margin-top: var(--title-copy-space) !important; }
html body :is(main, #main-content) #code-overview > a:nth-child(1) { grid-area: 1 / 1; }
html body :is(main, #main-content) #code-overview > a:nth-child(2) { grid-area: 2 / 1; }
html body :is(main, #main-content) #code-overview > a:nth-child(3) { grid-area: 3 / 1; }
html body :is(main, #main-content) #code-overview > a:nth-child(4) { grid-area: 1 / 2; }
html body :is(main, #main-content) #code-overview > a:nth-child(5) { grid-area: 2 / 2; }
html body :is(main, #main-content) .principles-mobile-intro { padding: 0 var(--site-gutter) 12px; }
@media (max-width: 760px) {
 html body :is(main, #main-content) .home-opening .why-copy { row-gap: var(--title-copy-space); }
 html body.code-page :is(main, #main-content) .code-opening .declaration { margin-bottom: calc(var(--title-copy-space) - var(--label-space)) !important; }
 html body :is(main, #main-content) :is(.shore-opening, .art-opening) > div:not(.mintaka-scene) { margin: 0; padding: 0; }
}
