/* Keep the opening lines, full portrait, and invitation in reading order. */
html:has(#home-welcome:not([hidden])) {
  overflow-y: auto;
}

html:has(body.site-menu-open #home-welcome:not([hidden])) {
  overflow-y: hidden;
}

body:has(#home-welcome:not([hidden])) {
  height: var(--site-viewport-height, 100dvh);
  max-height: none;
  overflow: visible;
  background-image: none !important;
}

body:has(#home-welcome:not([hidden])) > header.site-header {
  position: sticky;
  top: 0;
}

body:has(#home-welcome:not([hidden])) > main {
  flex: 1 0 0;
  min-height: min-content;
  overflow: visible;
}

body #home-welcome {
  flex: 1 0 0;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.6dvh, 16px);
  padding: clamp(8px, 1.7dvh, 18px) max(16px, env(safe-area-inset-right))
    clamp(8px, 1.7dvh, 18px) max(16px, env(safe-area-inset-left));
}

body #home-welcome #welcome-title {
  font-size: clamp(20px, min(6vw, 3.7dvh), 32px);
  line-height: 1.12;
  margin: 0;
}

/* Allocate the remaining height to the portrait, leaving space for the links and credits. */
#home-welcome .welcome-portrait-frame {
  position: relative;
  flex: 1 0 64px;
  width: min(100%, 260px);
  max-height: 390px;
}

#home-welcome .welcome-portrait {
  position: absolute;
  inset: 0;
  display: block;
  width: auto;
  max-width: 100%;
  height: 100%;
  margin: auto;
  object-fit: contain;
  border-radius: 5px;
}

#home-welcome .welcome-invitation {
  width: min(100%, 440px);
  text-align: center;
}

body #home-welcome .welcome-intro {
  font-size: clamp(15px, 2.2dvh, 17px);
  line-height: 1.4;
  margin: 0;
}

#home-welcome .welcome-prayers {
  max-width: none;
  justify-items: center;
}

#home-welcome .welcome-prayers #prayer-start {
  display: inline-flex;
  gap: .35em;
  width: auto;
  max-width: 100%;
  min-height: 44px;
  padding: 6px 0;
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  color: #ddbf7c;
  font: italic 400 clamp(19px, 2.4vw, 23px)/1.2 'Cormorant Garamond', Georgia, serif;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .16em;
}

#home-welcome .welcome-prayers #prayer-start:hover {
  color: #f3deb2;
}

#home-welcome .welcome-prayers #prayer-start > span {
  position: static;
  transform: none;
  flex: none;
}

body #home-welcome .welcome-gathering {
  max-width: none;
  margin: 2px auto 0;
}

#home-welcome .welcome-gathering p:first-child {
  color: #ddbf7c;
  font: italic 400 20px/1.25 'Cormorant Garamond', Georgia, serif;
}

#home-welcome .welcome-gathering p:nth-child(2) {
  font-size: 15px;
  margin-top: 0;
}

#home-welcome .welcome-live {
  font-size: 16px;
  font-weight: 400;
  margin-top: 0;
}

body:has(#home-welcome:not([hidden])) > footer {
  padding-block: 8px max(8px, env(safe-area-inset-bottom));
}

body:has(#home-welcome:not([hidden])) > footer > p.site-attribution {
  font-size: clamp(11px, 2.35vw, 13px);
  font-weight: 400;
}

@media (max-width: 700px) and (orientation: portrait) {
  body:has(#home-welcome:not([hidden])) > header.site-header {
    padding-block: max(6px, env(safe-area-inset-top)) 6px;
  }

  body:has(#home-welcome:not([hidden])) > header.site-header .brand .brand-tagline {
    font-size: 16px;
    line-height: 1.1;
    margin-top: 2px;
  }

  body #home-welcome {
    gap: 6px;
    padding-block: 6px;
  }

  body #home-welcome #welcome-title {
    font-size: clamp(19px, 5.5vw, 23px);
    line-height: 1.04;
  }

  #home-welcome #welcome-title > span + span {
    margin-top: .06em;
  }

  #home-welcome .welcome-portrait-frame {
    width: min(54vw, 260px);
    max-height: min(81vw, 390px);
  }

  body #home-welcome .welcome-intro {
    font-size: 14px;
    line-height: 1.3;
    text-wrap: balance;
  }

  #home-welcome .welcome-prayers #prayer-start {
    font-size: 18px;
  }

  #home-welcome .welcome-gathering p:first-child {
    font-size: 17px;
    margin-inline-end: .5em;
  }

  #home-welcome .welcome-gathering p:nth-child(-n+2) {
    display: inline-block;
    line-height: 1.2;
  }

  #home-welcome .welcome-gathering p:nth-child(2) {
    font-size: 14px;
  }

  #home-welcome .welcome-live {
    display: flex;
    width: fit-content;
    margin-inline: auto;
  }

  #home-welcome .welcome-gathering .welcome-meet-note {
    font-size: 12px;
    line-height: 1.3;
    text-wrap: balance;
  }

  body:has(#home-welcome:not([hidden])) > footer {
    padding-block: 6px max(6px, env(safe-area-inset-bottom));
  }

  body:has(#home-welcome:not([hidden])) > footer > p.site-attribution {
    line-height: 1.35;
  }
}

@media (max-width: 700px) and (max-height: 700px) and (orientation: portrait) {
  body:has(#home-welcome:not([hidden])) > header.site-header {
    padding-block: max(4px, env(safe-area-inset-top)) 4px;
  }

  body #home-welcome {
    gap: 4px;
    padding-block: 4px;
  }

  body #home-welcome #welcome-title {
    font-size: clamp(19px, 5.1vw, 21px);
    line-height: 1;
  }

  #home-welcome .welcome-prayers #prayer-start,
  #home-welcome .welcome-live {
    min-height: 38px;
  }

  body:has(#home-welcome:not([hidden])) > footer {
    padding-block: 4px max(4px, env(safe-area-inset-bottom));
  }

  body:has(#home-welcome:not([hidden])) > footer > p.site-attribution {
    line-height: 1.25;
  }
}

@media (max-height: 500px) and (min-width: 600px) {
  body:has(#home-welcome:not([hidden])) > header.site-header {
    padding-block: max(5px, env(safe-area-inset-top)) 5px;
  }

  body:has(#home-welcome:not([hidden])) > footer {
    padding-block: 4px max(4px, env(safe-area-inset-bottom));
  }

  body:has(#home-welcome:not([hidden])) > footer > p.site-attribution {
    font-size: 11px;
    line-height: 1.35;
  }

  body #home-welcome {
    padding-block: 6px;
    gap: 6px;
  }

  body #home-welcome #welcome-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .55em;
  }

  #home-welcome #welcome-title > span + span {
    margin-top: 0;
  }

  #home-welcome .welcome-invitation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    column-gap: 20px;
    width: min(100%, 680px);
  }

  #home-welcome .welcome-gathering {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  #home-welcome .welcome-gathering p:nth-child(-n+2) {
    display: inline-block;
  }

  #home-welcome .welcome-gathering p:first-child {
    margin-inline-end: .4em;
  }

  #home-welcome .welcome-live {
    display: flex;
    width: fit-content;
    margin-inline: auto;
  }
}

/* Readable installation instructions, independent of the devotional backdrop. */
body[data-destination="install"] #help-sharing{
 width:min(900px,calc(100% - 48px));margin:28px auto;
 padding:clamp(22px,4vw,44px);box-sizing:border-box;
 background:#102d45;color:#f7f3e9;border:1px solid #ddbf7c66;border-radius:16px;
}
body[data-destination="install"] #help-sharing .secondary-heading{padding:0;margin:0 0 24px;}
body[data-destination="install"] #help-sharing .secondary-heading h2{color:#f7f3e9;font-size:clamp(28px,3vw,38px);line-height:1.15;margin:0;}
body[data-destination="install"] #help{display:block;padding:0;margin:0;max-width:none;}
body[data-destination="install"] #help .help-details{width:100%;max-width:none;}
body[data-destination="install"] #install{border:0;padding:0;margin:0;}
body[data-destination="install"] #install :is(p,ol,li){color:#f7f3e9;font-size:18px;line-height:1.55;letter-spacing:normal;}
body[data-destination="install"] #install p{margin:0 0 20px;max-width:none;}
body[data-destination="install"] #install ol{padding-left:1.5em;margin:0 0 24px;}
body[data-destination="install"] #install li{padding-left:6px;margin-bottom:18px;}
body[data-destination="install"] #install strong{color:#f7f3e9;}
body[data-destination="install"] #install a{color:#f0d594;text-decoration:underline;text-underline-offset:3px;}
body[data-destination="install"] #install a:focus-visible{outline:2px solid #f0d594;outline-offset:4px;}
@media(max-width:600px){
 body[data-destination="install"] #help-sharing{width:calc(100% - 24px);margin:16px auto;padding:22px 18px;}
 body[data-destination="install"] #install :is(p,ol,li){font-size:17px;}
}
