/* rosarium.si — mobile-first, no dependencies */

:root {
  color-scheme: light;
  --bg: #f2f5fa;
  --card: #fdfeff;
  --ink: #242b3a;
  --muted: #8b93a6;
  --line: #dfe5f0;
  --accent: #33549c;
  --accent-ink: #fdfeff;
  --radius: 1.125rem;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Charter, Georgia, "Times New Roman", serif;
}

/* dark theme: applies when the system prefers dark (and the user has not
   chosen light), or when the user explicitly chose dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1521;
    --card: #171f30;
    --ink: #dde4f0;
    --muted: #7e88a0;
    --line: #29334c;
    --accent: #92b2e6;
    --accent-ink: #0f1521;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1521;
  --card: #171f30;
  --ink: #dde4f0;
  --muted: #7e88a0;
  --line: #29334c;
  --accent: #92b2e6;
  --accent-ink: #0f1521;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--serif);
}

.wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 3rem;
}

a { color: inherit; }

/* ---------- header / titles ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .25rem 0 1.5rem;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .25rem;
  font: 500 .8rem/1 var(--sans);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
}

.back:hover { color: var(--ink); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
}

.theme-toggle:hover { color: var(--accent); }

.theme-toggle .ic-light { display: none; }

:root[data-theme="dark"] .theme-toggle .ic-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-light { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ic-dark { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .ic-light { display: block; }
}

.title { margin: 0 0 1rem; }

.title h1 {
  margin: 0;
  font: 400 1.75rem/1.2 var(--serif);
  letter-spacing: .01em;
}

.title p {
  margin: .35rem 0 0;
  font: 500 .72rem/1.4 var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.title.home { padding-top: 1rem; margin-bottom: 2.25rem; }

.title.home h1 { font-size: 2rem; }

/* ---------- bead ornaments ---------- */

.beads {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  margin: 1.75rem 0;
  color: var(--muted);
}

.beads i {
  width: .32rem;
  height: .32rem;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}

.beads i.lg {
  width: .5rem;
  height: .5rem;
  background: var(--accent);
  opacity: .9;
}

.beads .sp { width: .5rem; }

.cross {
  font-size: 1.15rem;
  line-height: 1;
  color: var(--accent);
}

.beads.end { margin: 2.5rem 0 1rem; }

/* ---------- prayer cards ---------- */

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.4rem;
}

.card p { margin: 0; }

.card p + p { margin-top: .7em; }

.card b {
  font-weight: 700;
  color: var(--accent);
}

.mystery {
  font-weight: 700;
  color: var(--accent);
}

/* ---------- decade carousel (swipe) ---------- */

/* only the mystery line swipes; it reads as the next line of the prayer.
   the arrows float in the card's side gutters so the mystery text keeps
   the exact same left edge as the rest of the card text */
.swipe {
  position: relative;
  margin: 0 -1.4rem .7em;
}

.arr {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2rem;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  font: 300 1.2rem/1 var(--sans);
  color: var(--muted);
  cursor: pointer;
}

.arr:hover { color: var(--accent); }

.arr.prev { left: 0; justify-content: flex-start; padding-left: .3rem; }
.arr.next { right: 0; justify-content: flex-end; padding-right: .3rem; }

.secret-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.secret-strip::-webkit-scrollbar { display: none; }

.secret {
  padding: 0 1.4rem;
  scroll-snap-align: start;
}

.secret .mystery {
  display: inline;
  margin: 0;
}

.num {
  margin-left: .5rem;
  font: 500 .68rem/1 var(--sans);
  letter-spacing: .08em;
  color: var(--muted);
  white-space: nowrap;
}

.count {
  display: flex;
  justify-content: space-between;
  margin-top: 1.15rem;
  padding: 0 .35rem;
  color: var(--muted);
}

.count i {
  width: .32rem;
  height: .32rem;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}

/* ---------- index: parts list ---------- */

.parts {
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.part {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.part-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  font: 400 1.2rem/1.3 var(--serif);
  text-decoration: none;
}

.part-link .arrow {
  color: var(--accent);
  transition: transform .15s ease;
}

.part-link:hover .arrow { transform: translateX(.25rem); }

.part details { border-top: 1px solid var(--line); }

.part summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.4rem;
  font: 500 .72rem/1.4 var(--sans);
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  -webkit-user-select: none;
  user-select: none;
}

.part summary::-webkit-details-marker { display: none; }

.chev {
  width: .5rem;
  height: .5rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s ease;
}

.part details[open] .chev { transform: rotate(-135deg); }

.part details[open] summary { color: var(--ink); }

.secrets { padding: .25rem 1.4rem 1.35rem; }

.rubric {
  margin: 1rem 0 .6rem;
  font: 400 italic .85rem/1.5 var(--serif);
  color: var(--muted);
}

.mysteries {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: n;
}

.mysteries li {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  padding: .28rem 0;
  counter-increment: n;
}

.mysteries li::before {
  content: counter(n);
  flex: 0 0 1.45rem;
  height: 1.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font: 600 .7rem/1 var(--sans);
  color: var(--muted);
  transform: translateY(.2rem);
}

.mysteries.fill li::before {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.foot {
  margin-top: 3rem;
  text-align: center;
}

/* ---------- larger screens ---------- */

@media (min-width: 40rem) {
  .wrap { padding: 2rem 2rem 4rem; }
  .title h1 { font-size: 2rem; }
  .title.home h1 { font-size: 2.4rem; }
}
