/* ===== Feast color palette ===== */
:root { --dd-feast-h: 120; } /* default green */
[data-feast="Green"]  { --dd-feast-h:120; }
[data-feast="Violet"] { --dd-feast-h:270; }
[data-feast="Red"]    { --dd-feast-h:0; }
[data-feast="White"]  { --dd-feast-h:40; }
[data-feast="Gold"]   { --dd-feast-h:45; }
[data-feast="Black"]  { --dd-feast-h:220; }

/* ===== Page background ===== */
.dd-parchment { background: linear-gradient(180deg,#fdfaf4,#f6f1e6); position:relative; min-height:80vh; }
.dd-parchment::before{
  content:""; position:absolute; inset:0; pointer-events:none; opacity:.06; mix-blend:multiply;
  background-image:url('../img/parchment_noise.png'); background-size:600px;
}

/* ===== Toolbar & Meta ===== */
.dd-toolbar{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;padding:0 1rem 1rem}
.dd-spacer{flex:1}
.dd-input,.dd-select,.dd-toggle{
  font:400 .95rem 'Lora',serif;border:1px solid rgba(0,0,0,.12);border-radius:.6rem;padding:.45rem .6rem;background:#fff
}
.dd-toggle[aria-pressed="true"]{background:#fffdf6;outline:2px solid rgba(212,175,55,.45)}

.dd-meta{display:flex;gap:.5rem;align-items:center;padding:.5rem 1rem .75rem;flex-wrap:wrap}
.dd-badge{
  display:inline-block;font:600 .78rem/1 'Lora',serif;
  background:#fff;border:1px solid hsl(var(--dd-feast-h) 35% 35% / .28);
  padding:.25rem .5rem;border-radius:.55rem;color:#222 !important;
}
.dd-badge-outline{background:transparent}
.dd-badge-chip{margin-left:.5rem}

/* ===== Column layout ===== */
.dd-columns{
  display:flex;
  flex-direction:column;   /* stack Catechumens over Faithful */
  gap:1rem;
  padding:0 1rem 1rem;
}
@media (min-width:1080px){.dd-columns{grid-template-columns:1fr 1fr}}
.dd-section-title{
  font:700 1.6rem/1.2 'EB Garamond',serif;
  margin:.5rem 0 .25rem 0;
  text-align:left;
}

/* ===== Accordions ===== */
.dd-acc{border-radius:1rem;background:rgba(255,255,255,.78);overflow:hidden;border:1px solid hsl(var(--dd-feast-h) 35% 35% / .18)}
.dd-acc + .dd-acc{margin-top:.6rem}
.dd-acc--proper .dd-acc-head{background:linear-gradient(90deg,hsla(var(--dd-feast-h),45%,96%,.7),transparent)}
.dd-acc--ordinary .dd-acc-head{background:linear-gradient(90deg,hsla(var(--dd-feast-h),30%,96%,.45),transparent)}
.dd-acc--folder .dd-acc-head{background:linear-gradient(90deg,#f4f2ec,transparent)}
/* Ensure nested/folder section headers stack description under title */
.dd-acc--folder .dd-head-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.dd-acc--folder .dd-head-row1 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dd-acc--folder .dd-head-row2 {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding-left: 0;          /* aligns text neatly under the title */
  margin-top: 0.1rem;
}
.dd-acc-head{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:.75rem;
  padding:.65rem 1rem;border:0;background:transparent;cursor:pointer;text-align:left
}
.dd-head-text{display:flex;flex-direction:column;gap:.25rem}
.dd-head-row1{display:flex;align-items:center;gap:.5rem}
.dd-head-row2{display:flex;align-items:center;gap:.25rem}
.dd-acc-title{font:700 1rem/1.2 'EB Garamond',serif;color:#1b1b1b !important}
.dd-desc{
  font-style:italic;
  color:#222 !important;
  opacity:.95;
  font-size:0.88rem; /* ↓ smaller description text */
}
.dd-link{
  color:#2a5d2e !important;
  text-decoration:underline;
  font-size:0.82rem;        /* ↓ smaller text */
  font-weight:500;
  opacity:0.9;
  vertical-align:baseline;
}
.dd-link:hover{
  opacity:1;
  text-decoration:none;
}
.dd-sep{color:#888}
.dd-acc-icon{font-weight:700;opacity:.75;transition:transform .2s ease}
.dd-acc[aria-expanded="true"] .dd-acc-icon{transform:rotate(45deg)} /* + to × */

/* Accordion panel: allow very tall sections (Canon) to open fully */
.dd-acc-panel{
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  padding: 0 1rem;
}
.dd-acc[aria-expanded="true"] .dd-acc-panel{
  max-height: 9999px;            /* remove clipping */
  padding: .25rem 1rem 1rem;
}

/* Nested container */
.dd-nested{background:#f4f4f2;border-radius:.6rem;padding:.6rem .25rem;margin:.5rem 0 0 0}

/* Bilingual body */
.dd-acc-body{display:grid;grid-template-columns:1fr;gap:1rem}
@media (min-width:860px){.dd-acc-body{grid-template-columns:1fr 1fr}}
.dd-col .dd-block{background:rgba(255,255,255,.65);padding:.75rem .9rem;border-radius:.6rem;color:#1a1a1a}

/* Illuminated initial (Latin AND English) */
.dd-dropcap:first-letter{
  float:left;font-size:3.1em;line-height:.85;padding:.12em .18em .06em .08em;margin:.02em .18em .05em 0;
  color:hsl(var(--dd-feast-h) 50% 23%);background:linear-gradient(180deg,rgba(212,175,55,.25),rgba(212,175,55,.05));
  border:1px solid rgba(212,175,55,.35);border-radius:.15em;font-feature-settings:"liga","dlig","smcp";
}

/* Audio controls */
.dd-tools{display:flex;gap:.4rem;padding:.35rem 0 0}
.dd-tool{font-size:.85rem;border:1px solid rgba(0,0,0,.12);border-radius:.6rem;background:#fff;padding:.3rem .55rem;cursor:pointer}

/* View filters */
.dd-view-latin  .dd-acc-body .dd-col:nth-child(2){display:none}
.dd-view-english .dd-acc-body .dd-col:nth-child(1){display:none}

/* Ensure description/overview is readable (some themes forced it white) */
.dd-sub{
  color:#222;                     /* force dark text */
  font-style: italic;
}
.dd-sub .dd-overview{
  font-size:.9rem;                /* keep it smaller than body */
  margin-left:.5rem;
}

/* === Folder prominence: accent border + book icon + deeper parchment === */
.dd-acc--folder .dd-acc-head{
  /* slightly deeper parchment tone than regular cards */
  background:#f6f1e6;
  /* warm gold accent to the left */
  border-left:4px solid #b78b4b;
  /* gentle inner glow so it feels “filled” */
  box-shadow: inset 0 0 6px rgba(183,139,75,.25);
  transition: background .3s ease, box-shadow .3s ease;
}
.dd-acc--folder .dd-acc-head:hover{
  background:#f3e9d9;
  box-shadow: inset 0 0 8px rgba(183,139,75,.35);
}

/* add a 📖 before the existing + icon */
.dd-acc--folder .dd-acc-icon{
  display:inline-flex; align-items:center;
}
.dd-acc--folder .dd-acc-icon::before{
  content:'📖';
  font-size:.95rem;
  margin-right:.4rem;
  opacity:.8;
}

/* strengthen folder titles a touch */
.dd-acc--folder .dd-acc-title{
  font-weight:600; letter-spacing:.3px;
}

/* --- Domus Dei controls: keep text visible at rest --- */
#domusdei-propers-root button { 
  opacity: 1 !important; 
  color: inherit !important; 
}

/* Toolbar toggles (Expand/Collapse, Whole Mass/Propers) */
#domusdei-propers-root .dd-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .8rem;
  border-radius: 9999px;
  border: 1px solid #cdbfa9;
  background: #f2eee5;         /* visible at rest */
  color: #2f3e2e;               /* visible at rest */
  font-weight: 600;
}

/* Pressed state and hover */
#domusdei-propers-root .dd-toggle[aria-pressed="true"],
#domusdei-propers-root .dd-toggle:hover {
  background: #2f3e2e;
  color: #fff !important;
}

/* Audio buttons */
#domusdei-propers-root .dd-tool {
  display: inline-flex;
  align-items: center;
  padding: .3rem .6rem;
  border-radius: .6rem;
  border: 1px solid #cdbfa9;
  background: #f7f3ea;
  color: #2f3e2e;               /* visible at rest */
  font-weight: 600;
}

#domusdei-propers-root .dd-tool:hover {
  background: #2f3e2e;
  color: #fff !important;
}

/* Accordion header icon should also be visible */
#domusdei-propers-root .dd-acc-head .dd-acc-icon {
  color: #2f3e2e !important;
  opacity: 1 !important;
}

/* If the theme applies transparent text to *all* buttons, this neutralizes it inside the widget */
#domusdei-propers-root .dd-toolbar button,
#domusdei-propers-root .dd-tools .dd-tool {
  text-indent: 0 !important;    /* in case theme hides text with text-indent */
  filter: none !important;      /* in case theme uses filters to fade */
}

/* Inline line-by-line audio buttons: hidden until a block opts-in */
.dd-playline {
  border: 0;
  padding: 0.15rem 0.45rem;
  margin-left: .5rem;
  font-size: .8rem;
  line-height: 1;
  border-radius: .5rem;
  background: rgba(0,0,0,.06);
  cursor: pointer;
}
.dd-playline:hover { background: rgba(0,0,0,.12); }

/* Only show per-line controls when the block is in “lines mode” */
.dd-block:not(.dd-lines-on) .dd-playline { display: none; }

/* a little space so the last word doesn’t touch the button */
.dd-line-wrap { display: inline; }

/* --- Domus Dei line-pairs (tighten spacing & keep P/S together) --- */
.dd-block .dd-lines > .dd-line {
  margin: .65rem 0 .9rem;        /* opening “In nomine…” line */
}

.dd-block .dd-linepair {
  display: grid;                 /* keep the P/S as one unit */
  grid-auto-rows: auto;
  row-gap: .25rem;               /* small gap between P. and S. */
  margin: .55rem 0 .75rem;       /* space around each pair */
}

.dd-block .dd-linepair .dd-line {
  margin: 0;                     /* kill theme paragraph margins */
  line-height: 1.45;
}

.dd-block .dd-line .sp {
  font-weight: 700;              /* bold “P.” / “S.” */
  margin-right: .35rem;
}

/* keeps Pair 1 close under the opening line (with or without dropcap) */
.dd-block.dd-dropcap .dd-lines > .dd-line + .dd-linepair,
.dd-block .dd-lines > .dd-line + .dd-linepair {
  margin-top: .35rem;
}

/* --- Compact sentence-by-sentence prayers (like the Gloria) --- */
.dd-block .dd-lines > .dd-line {
  margin: 0.15rem 0;        /* tighten line spacing */
  line-height: 1.4;         /* consistent rhythm */
}