/* One Clear Prayer: the tools under each prayer, the slow view, printing, and search.
   Loaded after site.css on every page; reuses its colors, shadows and easing.
   Nothing here shows unless tools.js has added it. */

/* =====================================================================
   The row under the prayer: part of the navy panel, not a toolbar
   ===================================================================== */
.pray-tools {
  position: relative;
  margin-top: 56px; padding-top: 28px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 28px;
}
.pray-tools::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px;
  background: linear-gradient(90deg, rgba(244,192,108,.38) 0%, rgba(244,192,108,.16) 60%, rgba(244,192,108,0) 100%);
}
.pt-rest { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 30px; }
.pt-btn {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  margin: 0; padding: 8px 1px; border: 0; border-radius: 0; background: none;
  font: inherit; font-size: 17px; line-height: 1.2; color: var(--cream-soft);
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  background-image: linear-gradient(var(--amber), var(--amber));
  background-repeat: no-repeat; background-position: 0 calc(100% - 6px); background-size: 0% 1.5px;
  transition: color .25s ease, background-size .4s cubic-bezier(.2,.7,.2,1);
}
.pt-btn:hover, .pt-btn:focus-visible { color: var(--cream); background-size: 100% 1.5px; }
.pray-tools .pt-btn:focus-visible { outline-color: var(--amber); outline-offset: 4px; }
.pt-copy.is-done { color: var(--amber); }

/* The one that matters: a quiet amber frame with her sun */
.pt-btn.pt-slow {
  gap: 11px; padding: 11px 22px 11px 17px;
  color: var(--amber);
  border: 1px solid rgba(244,192,108,.42); border-radius: 4px;
  background: rgba(244,192,108,.05);
  box-shadow: 0 0 0 0 rgba(244,192,108,0), 0 12px 28px -18px rgba(0,0,0,.6);
  transition: color .25s ease, border-color .3s ease, background-color .3s ease, box-shadow .5s ease, transform .3s ease;
}
.pt-btn.pt-slow:hover, .pt-btn.pt-slow:focus-visible {
  color: #FBD38E; border-color: rgba(244,192,108,.8); background-color: rgba(244,192,108,.10);
  box-shadow: 0 0 0 5px rgba(244,192,108,.07), 0 14px 34px -14px rgba(244,192,108,.40);
}
.pt-sun { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; overflow: visible; }
.pt-sun line { transform-origin: 12px 12px; transition: transform .9s cubic-bezier(.2,.7,.2,1), opacity .5s ease; }
.pt-slow:hover .pt-sun line, .pt-slow:focus-visible .pt-sun line { transform: rotate(22.5deg) scale(1.08); }
.pt-offscreen { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 760px) {
  .pray-tools { margin-top: 44px; padding-top: 22px; flex-direction: column; align-items: stretch; gap: 10px; }
  .pt-btn.pt-slow { justify-content: center; padding: 13px 18px; font-size: 18px; }
  .pt-rest { justify-content: space-between; gap: 0 12px; }
  .pt-btn { font-size: 16px; }
}

/* =====================================================================
   Pray it slowly: the whole screen, one line at a time
   ===================================================================== */
html.pt-lock, html.pt-lock body { overflow: hidden; }

.slow {
  position: fixed; inset: 0;
  width: 100%; height: 100vh; height: 100dvh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; overflow: hidden;
  color: var(--cream);
  background:
    radial-gradient(ellipse 80% 55% at 72% 0%, #2B3562 0%, rgba(38,47,88,.45) 45%, rgba(26,36,70,0) 80%),
    linear-gradient(to bottom, #1D2750 0%, var(--navy) 45%, var(--navy-deep, #121A36) 100%);
  opacity: 0;
  transition: opacity .6s ease;
}
.slow[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.slow.is-open { opacity: 1; }
.slow::backdrop { background: rgba(18,26,54,.55); }
.slow :focus-visible { outline-color: var(--amber); }

/* Warm light from below that grows as the prayer goes on, and breathes */
.slow-glow {
  position: absolute; z-index: 0; left: 50%; bottom: -46vh;
  width: 150vmax; height: 92vh; margin-left: -75vmax;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(244,192,108,.30) 0%, rgba(244,192,108,.12) 38%, rgba(244,192,108,.035) 62%, rgba(244,192,108,0) 74%);
  opacity: calc(.3 + var(--glow, 0) * .7);
  transition: opacity 3s ease;
  pointer-events: none;
}

.slow-head, .slow-stage, .slow-foot { position: relative; z-index: 1; }
.slow-head {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px var(--gutter);
}
.slow-mark { display: flex; align-items: center; gap: 14px; min-width: 0; }
.slow-logo { width: 34px; height: 34px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px rgba(244,192,108,.10), 0 0 24px 2px rgba(244,192,108,.22); }
.slow-title { margin: 0; font-style: italic; font-size: 19px; line-height: 1.3; color: rgba(244,192,108,.88); }

.slow-btn {
  flex: none; min-height: 44px; margin: 0; padding: 9px 18px;
  font: inherit; font-size: 16px; line-height: 1.2; color: var(--cream-soft);
  background: rgba(253,243,226,.03); border: 1px solid rgba(253,243,226,.22); border-radius: 4px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color .25s ease, border-color .25s ease, background-color .25s ease;
}
.slow-btn:hover { color: var(--cream); border-color: rgba(244,192,108,.6); background-color: rgba(244,192,108,.06); }
.slow-btn:disabled { color: rgba(253,243,226,.3); border-color: rgba(253,243,226,.1); background: none; cursor: default; }
.slow-btn[hidden] { display: none; }
.slow-pause { min-width: 104px; }
/* Back and Next: words, not boxes */
.slow-step { display: inline-flex; align-items: center; gap: 8px; border-color: transparent; background: none; color: rgba(253,243,226,.62); }
.slow-step:hover { border-color: transparent; background: none; color: var(--cream); }
.slow-step:disabled { border-color: transparent; color: rgba(253,243,226,.22); }
.slow-arrow { color: var(--amber); opacity: .8; transition: transform .25s ease; }
.slow-step:disabled .slow-arrow { opacity: .3; }
.slow-step:hover .slow-arrow:first-child { transform: translateX(-3px); }
.slow-step:hover .slow-arrow:last-child { transform: translateX(3px); }
.is-end .slow-pause { color: var(--amber); border-color: rgba(244,192,108,.5); }

.slow-stage {
  overflow: hidden; cursor: pointer; outline: none;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, #000 16%, #000 80%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, #000 16%, #000 80%, rgba(0,0,0,0) 100%);
  -webkit-tap-highlight-color: transparent;
}
.slow-track {
  width: min(860px, calc(100% - 2 * var(--gutter))); margin: 0 auto;
  text-align: center;
  transition: transform 1.5s cubic-bezier(.22,.7,.18,1);
  will-change: transform;
}
.slow-ln {
  margin: 0; padding: .3em 0;
  font-size: clamp(25px, 1.3vw + 17px, 38px); line-height: 1.38;
  text-wrap: balance;
  color: rgba(253,243,226,.19);
  transform: scale(.965);
  transition: color 1.2s ease, transform 1.5s cubic-bezier(.22,.7,.18,1), text-shadow 1.2s ease;
}
.slow-gap { margin-top: .85em; }
.slow-ln.is-past { color: rgba(253,243,226,.27); }
.slow-ln.is-now {
  color: var(--cream); transform: none;
  text-shadow: 0 0 34px rgba(244,192,108,.30), 0 0 2px rgba(253,243,226,.18);
}
.slow-amen { font-style: italic; color: rgba(244,192,108,.26); }
.slow-amen.is-now { color: var(--amber); text-shadow: 0 0 40px rgba(244,192,108,.55); }
/* At the end the whole prayer comes softly back into view around the Amen */
.is-end .slow-ln.is-past { color: rgba(253,243,226,.52); transition-delay: .5s; }
.is-instant, .is-instant * { transition: none !important; }

.slow-foot {
  display: grid; justify-items: center; gap: 18px;
  padding: 14px var(--gutter) 30px;
}
.slow-keys { display: flex; gap: 12px; }
.slow-bar { width: min(220px, 56%); height: 2px; border-radius: 2px; background: rgba(253,243,226,.10); overflow: hidden; }
.slow-bar span {
  display: block; height: 100%;
  background: var(--gilt, #D69628);
  transform: scaleX(0); transform-origin: left;
  transition-property: transform; transition-timing-function: linear;
}
.is-paused .slow-bar span { opacity: .55; }

@media (prefers-reduced-motion: no-preference) {
  .slow-glow { animation: pt-breathe 9s ease-in-out infinite; }
  .slow.is-open .slow-head, .slow.is-open .slow-foot { animation: pt-settle 1.1s cubic-bezier(.2,.7,.2,1) both; }
  .slow.is-open .slow-foot { animation-delay: .15s; }
}
@keyframes pt-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06) translateY(-1.5%); } }
@keyframes pt-settle { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
  .slow-head { padding: 14px 18px; gap: 14px; }
  .slow-logo { width: 28px; height: 28px; }
  .slow-mark { gap: 11px; }
  .slow-title { font-size: 16px; }
  .slow-track { width: calc(100% - 40px); }
  .slow-ln { font-size: 23px; line-height: 1.4; }
  .slow-foot { padding: 10px 18px 22px; gap: 16px; }
  .slow-keys { gap: 10px; }
  .slow-btn { padding: 9px 15px; font-size: 15px; }
}

/* =====================================================================
   Search
   ===================================================================== */
.ps { width: 100%; max-width: 780px; margin: 0 auto; }
.ps-label { display: block; font-weight: 700; font-size: 22px; line-height: 1.3; margin-bottom: 14px; }
.ps-input {
  width: 100%; margin: 0;
  font: inherit; font-size: 22px; line-height: 1.3; color: var(--ink);
  padding: 17px 20px 17px 58px;
  border: 1.5px solid rgba(27,33,62,.42); border-radius: 4px;
  background: #FFFDF8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B213E' stroke-opacity='.62' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cline x1='15.5' y1='15.5' x2='20.5' y2='20.5'/%3E%3C/svg%3E") 20px 50% / 24px 24px no-repeat;
  box-shadow: inset 0 2px 5px rgba(18,26,54,.08), 0 18px 40px -30px rgba(18,26,54,.45);
  transition: border-color .25s ease, box-shadow .25s ease;
  -webkit-appearance: none; appearance: none;
}
.ps-input::placeholder { color: rgba(27,33,62,.55); }
.ps-input:focus { outline: none; border-color: var(--gold); box-shadow: inset 0 2px 5px rgba(18,26,54,.05), 0 0 0 4px rgba(214,150,40,.18), 0 18px 40px -26px rgba(18,26,54,.45); }
.ps-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231B213E' stroke-width='2' stroke-linecap='round'%3E%3Cline x1='6' y1='6' x2='18' y2='18'/%3E%3Cline x1='18' y1='6' x2='6' y2='18'/%3E%3C/svg%3E") center / 18px no-repeat; opacity: .6; }
.ps-try { margin-top: 16px; font-style: italic; font-size: 18px; color: var(--ink-soft); }
.ps-try[hidden] { display: none; }
.ps-try-word {
  font-style: normal; color: var(--ink); text-decoration: underline;
  text-decoration-color: rgba(214,150,40,.6); text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.ps-try-word:hover { text-decoration-color: var(--gold); text-decoration-thickness: 2.5px; }
.ps-status { margin-top: 30px; min-height: 1.5em; font-style: italic; font-size: 18px; color: var(--ink-soft); }
.ps-try:not([hidden]) + .ps-status { margin-top: 0; min-height: 0; }

.ps-results { margin-top: 14px; border-top: 1px solid var(--rule-ink); }
.ps-results:empty { display: none; }
.ps-results li { position: relative; border-bottom: 1px solid var(--rule-ink); transition: background-color .3s ease; }
.ps-results li::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1.5px;
  background: var(--gilt, #D69628); transform: scaleX(0); transform-origin: left;
  transition: transform .45s cubic-bezier(.2,.7,.2,1);
}
.ps-results li:hover, .ps-results li:focus-within { background-color: rgba(251,236,218,.55); }
.ps-results li:hover::after, .ps-results li:focus-within::after { transform: scaleX(1); }
.ps a.ps-hit.ps-hit { text-decoration: none; background-image: none; }
.ps-hit {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 28px; row-gap: 4px;
  padding: 24px 6px 26px; text-decoration: none; color: var(--ink);
}
.ps-hit:focus-visible { outline-offset: -3px; }
.ps-kind { grid-column: 1; display: flex; align-items: center; gap: 10px; font-size: 15px; letter-spacing: .05em; color: var(--ink-soft); }
.ps-kind::before { content: ""; width: 18px; height: 1.5px; background: var(--gilt, #D69628); flex: none; }
.ps-title { grid-column: 1; font-weight: 700; font-size: 24px; line-height: 1.3; }
.ps-desc { grid-column: 1; font-size: 18px; line-height: 1.5; color: var(--ink-soft); }
.ps-ref { grid-column: 2; grid-row: 2; align-self: baseline; max-width: 13em; text-align: right; font-size: 17px; white-space: normal; color: var(--ink-soft); }

.ps-none { margin-top: 26px; }
.ps-none[hidden] { display: none; }
.ps-none p { font-size: 20px; line-height: 1.6; }
.ps-none a {
  color: var(--ink); text-decoration: underline;
  text-decoration-color: rgba(214,150,40,.6); text-decoration-thickness: 1.5px; text-underline-offset: 4px;
}
.ps-none a:hover { text-decoration-color: var(--gold); text-decoration-thickness: 2.5px; }
.ps-needs { margin-top: 22px; columns: 2; column-gap: 40px; border-top: 1px solid var(--rule-ink); padding-top: 10px; }
.ps-needs li { break-inside: avoid; padding: 9px 0; font-size: 19px; }

@media (max-width: 760px) {
  .ps-label { font-size: 19px; }
  .ps-input { font-size: 19px; padding: 15px 16px 15px 50px; background-position: 16px 50%; background-size: 22px 22px; }
  .ps-try { font-size: 17px; }
  .ps-status { font-size: 17px; margin-top: 24px; }
  .ps-hit { grid-template-columns: minmax(0, 1fr); padding: 20px 2px 22px; }
  .ps-title { font-size: 21px; }
  .ps-desc { font-size: 17px; }
  .ps-ref { grid-column: 1; grid-row: auto; font-size: 16px; margin-top: 2px; white-space: normal; max-width: none; text-align: left; }
  .ps-none p { font-size: 18px; }
  .ps-needs { columns: 2; column-gap: 20px; }
  .ps-needs li { font-size: 17px; line-height: 1.35; padding: 8px 0; }
}

/* =====================================================================
   Print
   ===================================================================== */
.pt-sheet { display: none; }

@media print {
  .pray-tools, .slow { display: none !important; }

  /* The whole page, printed from the browser's menu: keep the prayer readable on white paper */
  .pray-panel { background: none !important; box-shadow: none !important; color: #1A2446 !important; }
  .pray-panel h2, .pray-panel .amen { color: #1A2446 !important; }

  /* The Print button: only the prayer, on one page */
  html.pt-print, html.pt-print body { background: #fff !important; }
  html.pt-print body > * { display: none !important; }
  html.pt-print body > .pt-sheet { display: block !important; }

  .pt-sheet {
    max-width: 128mm; margin: 0 auto; padding-top: 4mm;
    color: #1A2446; font-family: "Source Serif 4", Georgia, serif;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .pt-sheet p { margin: 0; }
  .pt-sheet-logo { display: block; width: 12mm; height: 12mm; border-radius: 50%; margin: 0 0 8mm; }
  .pt-sheet-title { font-style: italic; font-size: 21pt; line-height: 1.22; text-wrap: balance; break-after: avoid; }
  .pt-sheet-rule { display: block; width: 20mm; border-top: 1.4pt solid #D69628; margin: 5.5mm 0 8mm; }
  .pt-sheet-verse { border-left: 1.4pt solid #D69628; padding: .5mm 0 .5mm 5mm; margin: 0 0 10mm; break-inside: avoid; }
  .pt-sheet-verse p { font-style: italic; font-size: 11.5pt; line-height: 1.55; }
  .pt-sheet-verse p + p { margin-top: 2mm; }
  .pt-sheet-verse .pt-sheet-ref { font-style: normal; font-size: 9.5pt; letter-spacing: .03em; margin-top: 3mm; }
  .pt-sheet-prayer { break-inside: avoid; }
  .pt-sheet-prayer p { font-size: 13.5pt; line-height: 1.62; }
  .pt-sheet-prayer p + p { margin-top: 4.5mm; }
  .pt-sheet-ln { display: block; padding-left: 1.4em; text-indent: -1.4em; }
  .pt-sheet-prayer .pt-sheet-amen { font-style: italic; margin-top: 6mm; }
  .pt-sheet-site { margin-top: 13mm; padding-top: 3.5mm; border-top: .6pt solid #D69628; font-size: 9.5pt; letter-spacing: .08em; }

  @page { margin: 20mm 22mm; }
}
