/* Scripture drifts through the quiet margin of the library. Keep the art, copy
   and reading controls on their own layer and reserve space for large text. */
#reel-explorer .library-verses {
  position:absolute; inset:auto 5% 3.4%; min-height:2.75em;
  pointer-events:none; user-select:none; display:grid; align-content:center;
  font:italic clamp(14px,1.48cqw,22px)/1.32 Georgia,serif;
  color:#e1cda7; text-shadow:0 1px 4px #160f08;
}
#reel-explorer .library-verses span {
  grid-area:1/1; align-self:center; max-width:100%; opacity:0;
  font-variant:normal; text-transform:none; color:#ead9b9;
  animation:library-verse-drift 27s ease-in-out infinite both;
  animation-delay:calc(-1 * var(--verse-phase));
}
#reel-explorer .library-verses span::before {content:attr(data-line)}
#reel-explorer .library-verses span::after {
  content:attr(data-ref); display:inline-block; margin-inline-start:.8em;
  font:normal .65em/1.3 system-ui,sans-serif; letter-spacing:.075em;
  color:#efd29f; white-space:nowrap;
}
#reel-explorer[hidden] .library-verses span {animation-play-state:paused}
@keyframes library-verse-drift {
  0%,33%,100% {opacity:0;transform:translateX(-.32em)}
  5% {opacity:.83;}
  28% {opacity:.83;}
  32% {opacity:0;transform:translateX(.95em)}
}
@media (orientation:portrait),(max-width:700px) {
  #reel-explorer .library-verses {
    position:relative; inset:auto; order:-1; min-height:2.6em;
    margin:0 6%; font-size:clamp(14px,3.8cqw,38px); line-height:1.16;
  }
  #reel-explorer .library-verses span::after {font-size:.72em}
  #main-content-home #reel-explorer .enc-library-collection {order:-2}
}
@media (prefers-reduced-motion:reduce) {
  #reel-explorer .library-verses span {animation:none;opacity:0}
  #reel-explorer .library-verses span:first-child {opacity:.84}
}

/* Preserve study ink on the left leaf; only the right pencil and the paper tabs cover it. */
#main-content-home .op-atlas .study-desk-foreground {
  mask-image: url("/assets/home-refresh14/study-desk-foreground.svg");
}

/* Youth Library is an illustrated selection within the existing activity switcher. */

#main-content-home #reel-youth .y14-library {
    display:grid; grid-template-columns:minmax(0,36fr) minmax(0,64fr); align-items:center;
    gap:clamp(18px,3vw,50px); padding:clamp(24px,3.5vw,60px) var(--reel-inset); margin:0;
    color:#fff6e2; background:radial-gradient(ellipse at 70% 60%,#304d39,#192b22 60%,#102019);
}
#main-content-home .y14-library header { display:block;position:static;background:none;border:0;margin:0;padding:0; }
#main-content-home .y14-library h3 { margin:0; }
#main-content-home .y14-library p { margin:.7em 0 0;max-width:27em; }
#main-content-home .y14-shelf {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(9px,1vw,16px);
}
#main-content-home .y14-shelf .y14-tile {
    position:relative;display:block;min-width:0;min-height:44px;overflow:hidden;isolation:isolate;
    padding:0;margin:0;border-radius:4px;box-shadow:0 4px 13px #0003;background:#20352b;
}
#main-content-home .y14-tile img {
    display:block;width:100%;aspect-ratio:1.68;height:auto;object-fit:cover;object-position:50% 50%;
}
#main-content-home .y14-story img { object-position:50% 61%; }
#main-content-home .y14-room { grid-column:1/-1; }
#main-content-home .y14-room img { aspect-ratio:5.8;object-position:50% 52%; }
#main-content-home .y14-label {
    position:absolute;inset:auto 0 0;display:flex;flex-direction:column;justify-content:flex-end;
    padding:20% .8em .7em;background:linear-gradient(0deg,#101c15f7,#101c15c7 45%,transparent);
}
#main-content-home .y14-room .y14-label {
    inset:0;justify-content:center;padding:.55em 1em;
    background:linear-gradient(90deg,#0c1b13f2,#0c1b13c4 27%,transparent 72%);
}
@layer ar-home-catalog {
    body[data-ar-page=home] #main-content-home .home-showcase .y14-library h3 {
        font:500 clamp(42px,4vw,78px)/1.04 Georgia,serif !important;color:#fff4e0 !important;
    }
    body[data-ar-page=home] #main-content-home .home-showcase .y14-library p {
        font:400 clamp(16px,1.4vw,23px)/1.47 system-ui,sans-serif !important;color:#dddccc !important;
    }
    body[data-ar-page=home] #main-content-home .home-showcase .y14-tile {
        text-decoration:none !important;border:0 !important;color:#fff8e4 !important;
    }
    body[data-ar-page=home] #main-content-home .home-showcase .y14-tile:is(:hover,:focus-visible) {
        outline:2px solid #ebd6a4 !important;outline-offset:2px;
    }
    body[data-ar-page=home] #main-content-home .home-showcase .y14-label strong {
        color:#fff7e4 !important;font:600 clamp(18px,1.6vw,28px)/1.1 Georgia,serif !important;
    }
    body[data-ar-page=home] #main-content-home .home-showcase .y14-label > span {
        margin-top:.25em;color:#eee5cd !important;font:540 clamp(12px,.95vw,16px)/1.25 system-ui,sans-serif !important;
    }
    body[data-ar-page=home] #main-content-home .home-showcase .y14-label i { font-style:normal; }
}
#main-content-home .home12-sanctuary .st-room-choices {
    grid-template-columns:repeat(6,minmax(0,1fr)); padding-inline:clamp(15px,2.8vw,46px);
}
@media (orientation:portrait) {
    html[data-unified-phone-layout] #main-content-home #reel-youth .y14-library {
        display:block;padding:26px 29px 19px;
    }
    html[data-unified-phone-layout] #main-content-home .y14-library header {margin-bottom:20px;}
    html[data-unified-phone-layout] #main-content-home .y14-shelf {gap:14px;}
    html[data-unified-phone-layout] #main-content-home .y14-label {padding:19% 16px 13px;}
    html[data-unified-phone-layout] #main-content-home .y14-room .y14-label {padding:12px 19px;}
    html[data-unified-phone-layout] #main-content-home .y14-room img {aspect-ratio:6;}
    html[data-unified-phone-layout] #main-content-home .home12-sanctuary .st-room-choices {
        grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 12px;padding:13px 25px 6px;
    }
    html[data-unified-phone-layout] #main-content-home .home12-sanctuary .st-room-choice img {
        width:28%;aspect-ratio:.94;border-radius:3px;object-fit:cover;
    }
    html[data-unified-phone-layout] #main-content-home .home12-sanctuary .st-room-choice span {padding:0;text-align:left;}
    @layer ar-home-catalog {
        html[data-unified-phone-layout] body[data-ar-page=home] #main-content-home .home-showcase .y14-library h3 {font-size:54px !important;}
        html[data-unified-phone-layout] body[data-ar-page=home] #main-content-home .home-showcase .y14-library p {font-size:32px !important;margin:.28em 0 0;}
        html[data-unified-phone-layout] body[data-ar-page=home] #main-content-home .home-showcase .y14-label strong {font-size:36px !important;}
        html[data-unified-phone-layout] body[data-ar-page=home] #main-content-home .home-showcase .y14-label > span {font-size:28px !important;}
        html[data-unified-phone-layout] body[data-ar-page=home] #main-content-home .home-showcase .home12-sanctuary .st-room-choice {
            display:flex;flex-direction:row;align-items:center;justify-content:flex-start;gap:10px;font-size:30px !important;
        }
    }
}
@media (orientation:landscape) {
    html[data-unified-phone-layout] #main-content-home #reel-youth .y14-library {
        padding:10px 22px;grid-template-columns:35fr 65fr;gap:16px;
    }
    html[data-unified-phone-layout] #main-content-home .y14-shelf {grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;}
    html[data-unified-phone-layout] #main-content-home .y14-shelf .y14-room {grid-column:auto;}
    html[data-unified-phone-layout] #main-content-home .y14-shelf .y14-tile img {aspect-ratio:1.15;}
    html[data-unified-phone-layout] #main-content-home .y14-shelf .y14-label {
        padding:35px 8px 8px;inset:auto 0 0;background:linear-gradient(0deg,#101c15,transparent);
    }
    html[data-unified-phone-layout] #main-content-home .home12-sanctuary .st-room-choice img {width:29%;}
}
#main-content-home .y14-shelf :is(.y14-sheep,.y14-story) img {aspect-ratio:2.05;object-position:50% 78%;}
#main-content-home .y14-shelf .y14-story img {object-position:50% 75%;}
#main-content-home .y14-shelf :is(.y14-sheep,.y14-story) .y14-label {
    position:static;padding:.42em .8em .65em;background:linear-gradient(105deg,#263e2e,#192b22);
}
@media (orientation:portrait) {
    html[data-unified-phone-layout] #main-content-home .home12-sanctuary .st-room-choice {isolation:isolate;position:relative;overflow:hidden;}
    html[data-unified-phone-layout] #main-content-home .home12-sanctuary .st-room-choice::before {
        content:"";position:absolute;z-index:-1;inset:0;background:linear-gradient(0deg,#130f11ec 2%,#130f1133 70%);
    }
    html[data-unified-phone-layout] #main-content-home .home12-sanctuary .st-room-choice img {
        position:absolute;z-index:-2;inset:0;width:100%;height:100%;max-height:none;object-fit:cover;border-radius:0;
    }
    html[data-unified-phone-layout] #main-content-home .home12-sanctuary .st-room-choice span {
        position:absolute;inset:auto 9px 12px;text-shadow:0 2px 4px #000;line-height:1.14;
    }
    @layer ar-home-catalog {
        html[data-unified-phone-layout] body[data-ar-page=home] #main-content-home .home-showcase .home12-sanctuary .st-room-choice {
            height:max(140px,var(--reel-hit)) !important;min-height:max(140px,var(--reel-hit)) !important;font-size:34px !important;
        }
        html[data-unified-phone-layout] body[data-ar-page=home] #main-content-home .home-showcase .home12-sanctuary .st-room-choice[aria-pressed=true] {
            outline:3px solid #e2cdb1 !important;outline-offset:-3px;
        }
        html[data-unified-phone-layout] body[data-ar-page=home] #main-content-home .home-showcase .y14-label strong {font-size:40px !important;}
        html[data-unified-phone-layout] body[data-ar-page=home] #main-content-home .home-showcase .y14-label > span {font-size:32px !important;}
    }
    html[data-unified-phone-layout] #main-content-home .y14-shelf :is(.y14-sheep,.y14-story) .y14-label {padding:9px 13px 14px;}
}
@media (orientation:landscape) and (max-device-height:600px) {
    html[data-unified-phone-layout] #main-content-home .y14-shelf :is(.y14-sheep,.y14-story) img {aspect-ratio:1.84;}
}

/* The lesson and library share an intrinsic grid row, including at larger text
   sizes. Visibility removes inactive links from focus without collapsing the row. */
#main-content-home #reel-youth .youth-stage {
  display:grid;
  grid-template-columns:minmax(0,1fr);
  background:#241c17;
}
#reel-youth .youth-stage > * {grid-area:1 / 1; min-width:0}
#main-content-home #reel-youth .y14-library {visibility:hidden}
#main-content-home #reel-youth:has(.youth-pick-library input:checked) .feature-youth {visibility:hidden}
#main-content-home #reel-youth:has(.youth-pick-library input:checked) .y14-library {visibility:visible}

#main-content-home .home-showcase[data-current-feature=youth] {--discovery-light:229 190 150}
#main-content-home #reel-youth,
#main-content-home #reel-youth .feature-youth {background:#241c17}
#main-content-home #reel-youth .feature-vignette {
  background:linear-gradient(90deg,#241c17 12%,#241c17f5 24%,#231a15ce 33%,#231a1552 43%,transparent 56%),
             linear-gradient(0deg,#20140d52,transparent 30%);
}
#main-content-home #reel-youth .home-youth-picks {
  background:linear-gradient(120deg,#30251f,#211b17 72%);
  border-color:#a887663e;
}
#main-content-home #reel-youth .home-youth-pick {
  --trim:#f1c68d;
  background:#352b24;
  border-color:#b79a7c55;
  box-shadow:0 2px 6px #160f0c40;
}
#main-content-home #reel-youth .home-youth-pick:has(:checked) {
  background:#433226;
  border-color:var(--trim);
  box-shadow:0 0 0 1px var(--trim);
}
#main-content-home #reel-youth .home-youth-pick:has(:checked) i {box-shadow:inset 0 0 0 2px #433226}
#main-content-home #reel-youth .y14-library {background:linear-gradient(130deg,#30241d,#211b18)}
#main-content-home #reel-youth .y14-tile {background:#342922}
#main-content-home #reel-youth :is(.y14-sheep,.y14-story) .y14-label {background:#342922}
#main-content-home #reel-youth .y14-room .y14-label {
  background:linear-gradient(90deg,#211913ee,#211913c9 30%,transparent 76%);
}

#main-content-home #reel-youth .feature-youth .feature-backdrop {
  display:block;
  visibility:hidden;
  opacity:0;
  transition:opacity .18s ease-out,visibility 0s linear .18s;
}
#main-content-home #reel-youth:has([value=abc]:checked) .youth-art-abc,
#main-content-home #reel-youth:has([value="123"]:checked) .youth-art-123 {
  opacity:1;
  visibility:visible;
  transition-delay:0s;
}
@media (orientation:portrait) {
  html[data-unified-phone-layout] #main-content-home #reel-youth .feature-youth .spread-copy {
    background:linear-gradient(to bottom,transparent,#241c17 44px);
  }
  html[data-unified-phone-layout] #main-content-home #reel-youth .y14-library {
    display:grid;grid-template-columns:minmax(0,1fr);align-content:center;
    gap:20px;
  }
  html[data-unified-phone-layout] #main-content-home #reel-youth .y14-library header {margin:0}
  html[data-unified-phone-layout] #main-content-home #reel-youth .y14-room img {aspect-ratio:3.65}
  @layer ar-home-catalog {
    html[data-unified-phone-layout] body #main-content-home #reel-youth .y14-library {
      --unit:var(--home-physical-px,2.5px);
    }
    html[data-unified-phone-layout] body #main-content-home #reel-youth .y14-library h3 {font-size:calc(24 * var(--unit))!important}
    html[data-unified-phone-layout] body #main-content-home #reel-youth .y14-library p {font-size:calc(14 * var(--unit))!important}
    html[data-unified-phone-layout] body #main-content-home #reel-youth .y14-label strong {font-size:calc(16 * var(--unit))!important}
    html[data-unified-phone-layout] body #main-content-home #reel-youth .y14-label > span {font-size:calc(12 * var(--unit))!important}
  }
}
@media (prefers-reduced-motion:reduce) {
  #main-content-home #reel-youth .feature-youth .feature-backdrop {transition:none}
}
