/* ==========================================================
   Guided Rosary (/armory/rosary/). Loaded only on that page.
   Builds on drc.css tokens: night base, one gold accent.
   ========================================================== */

.ro-screen[hidden] { display: none !important; }
.ro [hidden] { display: none !important; }  /* .btn's display would otherwise override hidden */

/* ---------- Sky: one picture per mystery set, swapped by rosary.js ---------- */
.ro-sky { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.ro-sky .hero-media, .ro-sky .hero-media img { object-position: 70% 60%; }
.ro-sky::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(0deg, var(--night-950) 4%, rgba(7,9,15,.78) 45%, rgba(7,9,15,.45) 100%);
}

/* ---------- 1. Start ---------- */
.ro-start { position: relative; isolation: isolate; min-height: 100svh; display: grid; align-items: end; }
.ro-start-inner { padding-block: 7.5rem 3.5rem; max-width: 40rem; margin-left: max(var(--gutter), (100% - 76rem) / 2); }
.ro-start .breadcrumb { margin-bottom: 1.5rem; }
.ro-kicker {
  font-family: var(--font-display); color: var(--gold-400); letter-spacing: 0.04em;
  font-size: 1.05rem; margin: 0 0 0.5rem;
}
.ro-start h1 { font-size: var(--step-4); margin-bottom: 0.6em; }
.ro-title .ro-kicker { display: block; }
.ro-mysteries { margin: 0 0 1.5rem; padding-left: 1.4rem; color: var(--sand-300); }
.ro-mysteries li { padding: 0.15rem 0; }
.ro-mysteries li::marker { font-family: var(--font-display); color: var(--gold-400); }
.ro-mysteries small { color: var(--sand-500); font-size: var(--step--1); margin-left: 0.4rem; }

.ro-choose { margin: 0 0 1.75rem; }
.ro-choose summary {
  display: inline-block; cursor: pointer; list-style: none; color: var(--gold-300);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
.ro-choose summary::-webkit-details-marker { display: none; }
.ro-choose fieldset { border: 0; padding: 0; margin: 1rem 0 0; }
.ro-sets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
.ro-set { position: relative; cursor: pointer; }
.ro-set input { position: absolute; opacity: 0; pointer-events: none; }
.ro-set span {
  display: grid; gap: 0.1rem; padding: 0.75rem 0.9rem; border-radius: var(--radius-sm);
  background: var(--glass); border: 1px solid rgba(239,230,212,.16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.ro-set strong { font-family: var(--font-display); font-weight: 400; font-size: 1.15rem; color: var(--sand-100); }
.ro-set small { color: var(--sand-500); font-size: var(--step--1); }
.ro-set input:checked + span { border-color: var(--gold-400); box-shadow: inset 0 0 0 1px var(--gold-400), 0 0 24px -8px rgba(242,182,90,.5); }
.ro-set input:focus-visible + span { outline: 2px solid var(--gold-400); outline-offset: 3px; }

.ro-intention { margin: 0 0 1.75rem; }
.ro-intention label { display: block; font-family: var(--font-scripture); font-style: italic; font-size: 1.2rem; margin-bottom: 0.4rem; }
.ro-intention label span { font-family: var(--font-body); font-style: normal; color: var(--sand-500); font-size: var(--step--1); }
.ro-intention input {
  width: 100%; font: inherit; color: var(--sand-100); padding: 0.75rem 0.95rem;
  background: rgba(7,9,15,.55); border: 1px solid rgba(239,230,212,.22); border-radius: var(--radius-sm);
}
.ro-intention input::placeholder { color: var(--sand-500); }
.ro-intention input:focus { border-color: var(--gold-400); outline: none; box-shadow: 0 0 0 1px var(--gold-400); }

.ro-hint { color: var(--sand-500); font-size: var(--step--1); margin: 0.45rem 0 0; }
.ro-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.ro-actions .btn-light { min-width: 9rem; }

@media (max-width: 700px) {
  .ro-start-inner { padding-block: 6.5rem 2.5rem; }
  /* Top-aligned on phones: a late web-font swap then only moves what is below it (no layout shift above). */
  .ro-start { align-items: start; }
  .ro-start h1 { font-size: 2.3rem; }
}
@media (max-width: 380px) {
  .ro-sets { grid-template-columns: 1fr; }
}

/* ---------- 2. Prayer: the Road view ---------- */
html.ro-praying, html.ro-praying body { overflow: hidden; }
.ro-pray {
  position: fixed; inset: 0; z-index: 60; isolation: isolate; background: var(--night-950);
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "top" "road" "now" "controls";
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* The hero photo, sharp. rosary.js sizes and places the img so the traced road and pillar sit in the
   clear area ([data-focus]); the overlay svg uses the same coordinates, so the light stays on the road. */
.ro-scene { grid-row: 1 / 3; grid-column: 1 / -1; position: relative; overflow: hidden; z-index: -1; }
.ro-scene img { position: absolute; max-width: none; left: 0; top: 0; }
.ro-scene::before, .ro-scene::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.ro-scene::before { background: linear-gradient(180deg, rgba(7,9,15,.55) 0%, rgba(7,9,15,0) 18%); }
.ro-scene::after { background: linear-gradient(0deg, var(--night-950) 0%, rgba(7,9,15,0) 14%); }
.ro-road { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }

.ro-pray-top { grid-area: top; display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.9rem var(--gutter) 0; }
.ro-where { min-width: 0; padding-top: 0.2rem; }
.ro-where p { margin: 0; font-family: var(--font-display); color: var(--sand-100); font-size: 1.05rem; line-height: 1.3; }
.ro-where .ro-for { font-family: var(--font-scripture); font-style: italic; color: var(--sand-300); font-size: 0.98rem; margin-top: 0.2rem; }

.ro-road-wrap { grid-area: road; min-height: 0; }
.ro-road .trail { fill: none; stroke: #f8cf86; stroke-linecap: round; stroke-linejoin: round; opacity: .5; }
.ro-road .wp { fill: #efe6d4; opacity: .42; }
.ro-road .wp.is-big { fill: none; stroke: #efe6d4; }
.ro-road .wp.is-done { fill: #f8cf86; opacity: 1; filter: url(#ro-soft); }
.ro-road .wp.is-big.is-done { fill: none; stroke: #f2b65a; }
.ro-road .pillar-glow, .ro-road .light { mix-blend-mode: screen; }
.ro-road .pillar-grow { transform-origin: 0 0; transition: transform 2.5s var(--ease), opacity 2.5s var(--ease); }

.ro-now {
  grid-area: now; width: min(100% - 2 * var(--gutter), 38rem); margin-inline: auto;
  text-align: center; max-height: 32vh; max-height: 32svh; overflow-y: auto; padding-top: 0.25rem;
}
.ro-count { margin: 0 0 0.2rem; color: var(--gold-400); font-family: var(--font-display); letter-spacing: 0.04em; font-size: 0.98rem; }
.ro-step { font-size: var(--step-2); margin: 0 0 0.5rem; }
.ro-lines p {
  margin: 0 auto 0.55rem; font-family: var(--font-scripture); font-style: italic; font-size: 1.12rem; line-height: 1.55;
  color: var(--sand-500); transition: color .4s var(--ease);
}
.ro-lines p.is-b { padding-left: 1.25rem; }
.ro-lines p.is-now { color: var(--sand-100); }
.ro-lines .ro-scripture { color: var(--sand-100); }
.ro-lines .ro-ref { display: block; font-family: var(--font-body); font-style: normal; font-size: var(--step--1); color: var(--sand-500); margin-top: 0.2rem; }
.ro-lines .ro-fruit { font-family: var(--font-body); font-style: normal; color: var(--gold-300); font-size: 1rem; }

.ro-controls { grid-area: controls; display: grid; justify-items: center; gap: 0.8rem; padding: 0.9rem var(--gutter) 1.2rem; }
.ro-transport { display: flex; align-items: center; gap: 1.5rem; }
.ro-icon, .ro-play {
  display: inline-grid; place-items: center; border-radius: 50%; cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.ro-icon { width: 3rem; height: 3rem; flex: none; background: var(--glass); border: 1px solid rgba(239,230,212,.2); color: var(--sand-100); }
.ro-icon:hover { border-color: var(--gold-400); }
.ro-play { width: 4.25rem; height: 4.25rem; background: var(--gold-400); border: 0; color: var(--night-950); box-shadow: 0 0 32px rgba(242,182,90,.45); }
.ro-play:hover { background: var(--gold-300); }
.ro-icon svg, .ro-play svg { width: 1.35rem; height: 1.35rem; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ro-play svg { width: 1.6rem; height: 1.6rem; }
[data-exit] svg, .ro-i-pause { fill: none; }
.ro-play .ro-i-play { display: none; }
.ro-play[aria-label="Play"] .ro-i-play { display: block; }
.ro-play[aria-label="Play"] .ro-i-pause { display: none; }

.ro-pace { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid rgba(239,230,212,.18); background: var(--glass); }
.ro-pace button {
  font: inherit; font-size: 0.95rem; color: var(--sand-300); background: none; border: 0; cursor: pointer;
  padding: 0.35rem 1rem; border-radius: 999px;
}
.ro-pace button[aria-pressed="true"] { background: rgba(242,182,90,.16); color: var(--gold-300); }

/* Landscape: the photo fills the screen. Words and controls sit on the left, over the open sky
   and dark ground, like the home page hero; the road and pillar keep the right. */
@media (orientation: landscape) and (min-width: 600px) {
  .ro-pray {
    grid-template-columns: minmax(17rem, 30rem) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas: "top top" "now road" "controls road";
  }
  .ro-scene { grid-row: 1 / -1; }
  .ro-scene::after { background: linear-gradient(90deg, rgba(7,9,15,.82) 0%, rgba(7,9,15,.55) 30%, rgba(7,9,15,0) 55%); }
  .ro-now { align-self: end; max-height: none; text-align: left; margin: 0; width: auto; padding: 0 0 0 var(--gutter); overflow: visible; }
  .ro-lines p { margin-left: 0; }
  .ro-controls { justify-items: start; padding-bottom: 2.5rem; }
}
@media (orientation: landscape) and (min-width: 900px) { .ro-step { font-size: var(--step-3); } }
@media (orientation: landscape) and (max-height: 520px) {
  .ro-now { overflow-y: auto; align-self: stretch; padding-top: 0.5rem; }
  .ro-step { font-size: var(--step-1); }
  .ro-lines p { font-size: 1rem; }
  .ro-controls { padding-block: 0.5rem 0.9rem; gap: 0.5rem; }
}

/* ---------- 3. Finish ---------- */
.ro-finish {
  position: fixed; inset: 0; z-index: 60; isolation: isolate; background: var(--night-950);
  display: grid; align-items: end; overflow-y: auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.ro-finish .ro-sky { position: fixed; }
.ro-finish .ro-sky::after {
  background: linear-gradient(0deg, var(--night-950) 4%, rgba(7,9,15,.78) 38%, rgba(7,9,15,.42) 62%, rgba(7,9,15,.08) 100%);
}
.ro-finish-inner { width: min(100% - 2 * var(--gutter), 36rem); margin-inline: auto; padding-block: 8rem 2.75rem; text-align: center; }
.ro-finish h2 { font-size: var(--step-3); margin-bottom: 0.4em; outline: none; }
.ro-finish .ro-for { font-family: var(--font-scripture); font-style: italic; color: var(--sand-300); margin: -0.2rem auto 1rem; }
.ro-finish-prayer {
  font-family: var(--font-scripture); font-style: italic; font-size: 1.15rem; line-height: 1.6;
  color: var(--sand-100); margin: 0 auto 1.75rem;
}
.ro-still { display: grid; justify-items: center; gap: 0.6rem; margin-bottom: 1.5rem; }
.ro-still p { margin: 0; color: var(--sand-300); font-size: 1rem; }
.ro-still-bar { display: block; width: 9rem; height: 2px; border-radius: 2px; background: rgba(242,182,90,.18); overflow: hidden; }
.ro-still-bar span { display: block; height: 100%; width: 100%; background: var(--gold-400); transform-origin: left; transform: scaleX(0); }
.ro-still.is-filling .ro-still-bar span { transform: scaleX(1); transition: transform var(--still, 10s) linear; }
.ro-still.is-done { opacity: .55; }
.ro-finish-end { display: grid; justify-items: center; gap: 1rem; }
.ro-finish-end[hidden] { display: none; }
.ro-finish-end .btn { min-width: 9rem; }
.ro-join { margin: 0; font-size: var(--step--1); }
.ro-join a { color: var(--sand-300); }
.ro-join a:hover { color: var(--gold-300); }

@media (prefers-reduced-motion: no-preference) {
  .ro-finish-end:not([hidden]) { animation: ro-rise .9s var(--ease) both; }
  @keyframes ro-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}

/* Landscape: words on the left, the pillar keeps the right, as in the prayer screen */
@media (orientation: landscape) and (min-width: 600px) {
  .ro-finish .ro-sky::after { background: linear-gradient(90deg, rgba(7,9,15,.85) 0%, rgba(7,9,15,.6) 35%, rgba(7,9,15,.1) 65%); }
  .ro-finish { align-items: center; }
  .ro-finish-inner { margin-left: max(var(--gutter), (100% - 76rem) / 2); margin-right: 0; text-align: left; padding-block: 4rem 2.5rem; }
  .ro-finish-prayer, .ro-finish .ro-for { margin-left: 0; }
  .ro-still, .ro-finish-end { justify-items: start; }
}

@media (prefers-reduced-motion: reduce) {
  .ro-road .pillar-grow, .ro-lines p { transition: none; }
  .ro-still-bar { display: none; }
}

/* ---------- Guide below the player (server-rendered, works without JavaScript) ---------- */
.ro-about { border-top: 1px solid rgba(239,230,212,.1); }
.ro-about .answer { margin: 0 0 1.5rem; }
.ro-schedule { border-collapse: collapse; width: 100%; max-width: 28rem; margin: 0 0 1rem; font-size: 1rem; }
.ro-schedule th, .ro-schedule td { text-align: left; padding: 0.55rem 0.9rem; border-bottom: 1px solid rgba(239,230,212,.12); }
.ro-schedule thead th { color: var(--sand-500); font-size: var(--step--1); font-weight: 700; letter-spacing: 0.03em; }
.ro-schedule tbody th { color: var(--sand-100); font-weight: 400; }
.ro-schedule td { color: var(--gold-300); }
.ro-list { padding-left: 1.4rem; }
.ro-list li::marker { color: var(--gold-400); font-family: var(--font-display); }
.ro-about h2 { font-size: var(--step-2); }

/* ---------- Mystery-set pages (/armory/rosary/<set>-mysteries/) ---------- */
.set-cta { margin: 1.5rem 0 0.6rem; }
.set-mystery { padding: 1.25rem 0; border-top: 1px solid rgba(239,230,212,.12); }
.set-mystery h3 { margin: 0 0 0.3rem; font-size: var(--step-1); }
.set-fruit { color: var(--gold-300) !important; font-size: 1rem; margin: 0 0 0.6rem; }
.set-verse { margin: 0; padding-left: 1rem; border-left: 2px solid rgba(242,182,90,.45); }
.set-verse p { font-family: var(--font-scripture); font-style: italic; font-size: 1.12rem; color: var(--sand-100) !important; margin: 0 0 0.3rem; }
.set-verse footer { color: var(--sand-500); font-size: var(--step--1); }
