/* ============================================================
   LITURGY PAGE (liturgy.html) — sub-menu and sub-sections
   The calendar inside it is styled by calendar.css
   ============================================================ */
html:has(.subnav){scroll-padding-top:calc(var(--nav-h) + 72px)}

/* Sticky sub-menu under the main menu */
.subnav{position:sticky;top:var(--nav-h);z-index:40;background:var(--leaf);border-bottom:1px solid var(--line);box-shadow:none}
.subnav ul{list-style:none;display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding-block:10px;-webkit-overflow-scrolling:touch}
.subnav ul::-webkit-scrollbar{display:none}
.subnav a{
  display:block;white-space:nowrap;padding:8px 16px;border-radius:var(--radius-1);border:1px solid var(--line);
  color:var(--navy);font-size:.9rem;font-weight:600;background:var(--leaf);transition:background-color .2s,color .2s,border-color .2s;
}
.subnav a:hover{border-color:var(--navy)}
.subnav a.active{background:var(--pigment-lapis);border-color:var(--navy);color:var(--on-pigment)}

/* Sub-sections */
.lit-section{padding-block:clamp(36px,5vw,64px);border-bottom:1px solid var(--line)}
.lit-section.alt{background:var(--leaf)}
.lit-head{display:flex;gap:clamp(14px,2vw,22px);align-items:flex-start;margin-bottom:clamp(20px,3vw,28px)}
.lit-icon{flex:none;width:clamp(48px,6vw,60px);height:clamp(48px,6vw,60px);border-radius:50%;display:grid;place-items:center;background:var(--navy-soft)}
.lit-icon svg{width:55%;height:55%;fill:none;stroke:var(--navy);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.lit-lead{max-width:70ch;color:var(--muted);margin-top:8px}
html[lang="ti"] .lit-page .section-title{font-family:var(--ethiopic-serif)}

.lit-cards{display:grid;gap:clamp(14px,2vw,20px);grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr))}
.lit-card{display:flex;flex-direction:column;gap:8px;padding:clamp(18px,2.5vw,24px);background:var(--card);border:1px solid var(--line);border-top:3px solid var(--red);border-radius:var(--radius);box-shadow:var(--frame)}
.lit-section.alt .lit-card{background:var(--bg)}
.lit-card h3{font-family:var(--serif);font-weight:600;font-size:1.12rem;color:var(--ink)}
html[lang="ti"] .lit-card h3{font-family:var(--ethiopic-serif)}
.lit-card p{color:var(--muted);font-size:.93rem}
.lit-card .more{margin-top:auto;padding-top:6px}

/* Calendar inside the Liturgy page: no overlap with a coloured header */
.lit-section .cal-top{margin-top:0}
.lit-section .cal-year{margin-bottom:0}

/* Resources */
.res-grid{display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(min(100%,300px),1fr))}
.res-item{
  position:relative;display:flex;flex-direction:column;gap:4px;padding:16px 44px 16px 18px;border-radius:var(--radius-sm);
  background:var(--card);border:1px solid var(--line);color:var(--ink);transition:border-color .2s,box-shadow .2s,transform .2s;
}
.res-item::after{content:"→";position:absolute;right:16px;top:50%;transform:translateY(-50%);color:var(--navy);font-weight:700;transition:transform .2s}
.res-item:hover{border-color:var(--navy);box-shadow:var(--shadow);transform:none}
.res-item:hover::after{transform:translate(3px,-50%)}
.res-item strong{color:var(--navy);font-size:.98rem}
.res-item span{color:var(--muted);font-size:.86rem}
.res-item.is-soon{opacity:.7;border-style:dashed}
.res-item.is-soon::after{content:""}

@media (max-width:560px){
  .lit-head{flex-direction:column}
}

/* Printing from the calendar's Print button: only the calendar */
@media print{
  body.print-cal .lit-section:not(#calendar),
  body.print-cal .subnav,
  body.print-cal .page-head,
  body.print-cal #calendar .lit-head .lit-icon{display:none !important}
  .subnav{display:none}
  .lit-section{border:0;padding:0}
}

/* ---------- Calendar: compact view + "Show full calendar" ---------- */
.cal-compact{display:grid;gap:clamp(16px,2vw,24px);grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));align-items:start}
.upcoming{list-style:none;margin-top:8px;display:grid;gap:6px}
.up-btn{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 12px;
  border:0;border-top:4px solid var(--gold-leaf);border-radius:var(--radius-sm);background:var(--leaf);text-align:left;cursor:pointer;
  transition:transform .15s,box-shadow .15s;
}
.up-btn:hover{transform:translateX(2px);box-shadow:var(--shadow)}
.upcoming .rank-major .up-btn{border-left-color:var(--red);background:var(--leaf)}
.upcoming .rank-fast .up-btn{border-left-color:var(--navy);background:var(--navy-soft)}
.up-body{display:flex;flex-direction:column;min-width:0}
.up-body strong{font-size:.92rem;color:var(--ink)}
.up-date{font-size:.78rem;color:var(--muted)}
.up-when{flex:none;font-size:.75rem;font-weight:700;color:var(--navy);background:var(--leaf);border-radius:var(--radius-1);padding:3px 10px;white-space:nowrap}
.upcoming .rank-major .up-when{color:var(--rubric)}

.cal-toggle-row{display:flex;justify-content:center;margin-top:clamp(16px,2vw,24px)}
.cal-toggle{
  display:inline-flex;align-items:center;gap:10px;min-height:46px;padding:10px 24px;border-radius:var(--radius-1);cursor:pointer;
  border:1px solid var(--navy);background:var(--pigment-lapis);color:var(--on-pigment);font-weight:600;font-size:.95rem;transition:background-color .2s;
}
.cal-toggle:hover{background:var(--nave)}
.cal-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;transition:transform .25s}
.cal-toggle .when-open{display:none}
.cal-toggle[aria-expanded="true"]{background:var(--leaf);color:var(--navy)}
.cal-toggle[aria-expanded="true"] .when-open{display:inline}
.cal-toggle[aria-expanded="true"] .when-closed{display:none}
.cal-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
.cal-full{margin-top:clamp(16px,2vw,24px);animation:calOpen .3s ease}
@keyframes calOpen{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.cal-full .cal-top{grid-template-columns:minmax(0,1fr)}
@media (min-width:760px){ .cal-full .conv-card{display:grid;grid-template-columns:1fr 1fr;gap:0 24px;align-items:start} .cal-full .conv-card > .eyebrow{grid-column:1/-1} }
@media print{ body.print-cal .cal-compact,body.print-cal .cal-toggle-row{display:none !important} .cal-full[hidden]{display:block !important} }

/* ---------- Calendar page: "A year lived with Christ" (the thirteen months as a wheel) ---------- */
.ci{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(300px,1fr);gap:clamp(24px,4.5vw,64px);align-items:center}
.ci-kicker{font-style:italic;color:var(--red)}
html[lang="ti"] .ci-kicker{font-family:var(--ethiopic);font-style:normal}
.ci-text h2{margin:2px 0 12px;font-family:var(--serif);font-size:clamp(1.8rem,1.3rem + 2vw,2.7rem);line-height:1.12;color:var(--ink)}
html[lang="ti"] .ci-text h2{font-family:var(--ethiopic);font-weight:400}
.ci-lead{max-width:58ch;font-size:1.08rem;line-height:1.75;color:var(--ink)}
.ci-ways{list-style:none;margin:20px 0 0;padding:0;display:flex;flex-direction:column;gap:12px}
.ci-ways li{display:grid;grid-template-columns:118px minmax(0,1fr);gap:14px;align-items:baseline}
.ci-ways b{padding-left:12px;border-left:4px solid var(--c);font-family:var(--serif);font-size:1.08rem;color:var(--c)}
html[lang="ti"] .ci-ways b{font-family:var(--ethiopic);font-weight:400}
.ci-ways span{color:var(--muted)}
.cw-f{--c:var(--rubric)}.cw-p{--c:var(--lapis)}.cw-r{--c:var(--brass)}
.ci-facts{display:flex;flex-wrap:wrap;gap:12px 30px;margin:24px 0 0;padding-top:16px;border-top:1px dotted var(--rule)}
.ci-facts div{display:flex;flex-direction:column-reverse;max-width:200px}
.ci-facts dd{margin:0;display:flex;align-items:baseline;gap:8px;font-family:var(--serif);font-weight:700;font-size:1.9rem;line-height:1;color:var(--navy)}
.ci-facts dd[lang],.ci-facts dd i{font-family:var(--ethiopic);font-weight:400;font-style:normal;color:var(--red)}
.ci-facts dd i{font-size:1.2rem}
.ci-facts dt{margin-top:4px;font-size:.88rem;color:var(--muted)}

.ci-wheel-wrap{position:relative;margin:0;width:100%;max-width:470px;justify-self:center}
.ci-wheel{display:block;width:100%;height:auto;overflow:visible}
.ci-seg{cursor:pointer;outline:none}
.ci-base{fill:var(--leaf);stroke:var(--gold-leaf);stroke-width:1;transition:fill .25s}
.ci-seg.has-fast .ci-base{fill:var(--vellum)}
.ci-seg:hover .ci-base{fill:var(--gold-wash)}
.ci-seg.is-now .ci-base{fill:var(--leaf)}
.ci-seg.is-sel .ci-base{fill:var(--navy);stroke:var(--navy)}
.ci-seg:focus-visible .ci-base{stroke:var(--red);stroke-width:2.5}
.ci-name{font-family:var(--ethiopic);font-size:10.5px;fill:var(--ink);text-anchor:middle;dominant-baseline:middle;pointer-events:none}
.ci-name.is-small{font-size:8.5px}
.ci-seg.is-sel .ci-name{fill:var(--on-pigment)}
.ci-dot{fill:var(--red);pointer-events:none}
.ci-seg.is-sel .ci-dot{fill:var(--gold-leaf)}
.ci-hub{fill:var(--on-pigment);stroke:var(--gold);stroke-width:1.5}
.ci-today{fill:var(--red);stroke:var(--on-pigment);stroke-width:2}
.ci-centre{position:absolute;left:50%;top:50%;width:46%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;text-align:center;gap:2px}
.ci-m{font-family:var(--ethiopic);font-weight:400;font-size:clamp(1.5rem,1.1rem + 1.4vw,2.1rem);line-height:1.1;color:var(--red)}
.ci-en{font-family:var(--serif);font-size:.95rem;color:var(--navy)}
.ci-gr{font-size:.78rem;color:var(--muted)}
.ci-list{list-style:none;margin:6px 0 0;padding:0;font-size:.74rem;line-height:1.35;color:var(--ink)}
html[lang="ti"] .ci-list{font-family:var(--ethiopic)}
.ci-list i{font-style:normal;font-family:var(--ethiopic);color:var(--red)}
.ci-list .is-fast{color:var(--lapis);font-style:italic}
.ci-go{margin-top:6px;font-size:.8rem;font-weight:700}
html[lang="ti"] .ci-go{font-family:var(--ethiopic);font-weight:400}

/* the key under the wheel */
.ci-key{list-style:none;margin:14px 0 0;padding:0;display:flex;flex-wrap:wrap;justify-content:center;gap:6px 18px;font-size:.85rem;color:var(--muted)}
html[lang="ti"] .ci-key{font-family:var(--ethiopic)}
.ci-key li{display:inline-flex;align-items:center;gap:7px}
.ci-key i{display:inline-block;flex:none}
.k-dot{width:8px;height:8px;border-radius:50%;background:var(--pigment-red)}
.k-fast{width:16px;height:11px;border-radius:var(--radius-1);background:var(--leaf);box-shadow:inset 0 0 0 1px var(--rule)}
.k-now{width:11px;height:11px;border-radius:50%;background:var(--pigment-red);box-shadow:0 0 0 2px var(--leaf),0 0 0 3px var(--rule)}

@media (max-width:900px){
  .ci{grid-template-columns:1fr}
  .ci-ways li{grid-template-columns:1fr;gap:2px}
}
@media (max-width:420px){.ci-list{display:none}}
@media (prefers-reduced-motion:reduce){.ci-base{transition:none}}

/* Today and Upcoming feasts side by side, the same height; the rest of the feasts open with "See more" */
.cal-compact:not(.is-open){align-items:stretch}
.upcoming-card{display:flex;flex-direction:column}
.upcoming-card .up-more{margin:12px auto 0}
.upcoming-card .up-more[hidden]{display:none}

/* the Liturgy page: the bishop and clergy at the altar as the page cover (the veil under the title is at least 80% nave) */
.page-head.lit-cover{background:linear-gradient(90deg,var(--nave) 0%,var(--nave) 30%,color-mix(in srgb,var(--nave) 70%,transparent) 36%,color-mix(in srgb,var(--nave) 25%,transparent) 44%,transparent 52%),url("../images/liturgy/cover.jpg") right 42%/min(1100px,72%) auto no-repeat,var(--nave) !important;min-height:clamp(360px,36vw,520px);display:flex;align-items:center}
.page-head.lit-cover > .wrap{width:100%}
.page-head.lit-cover .page-lead{max-width:38ch;text-shadow:0 1px 3px rgba(0,0,0,.5)}
@media (max-width:760px){ .page-head.lit-cover{background:linear-gradient(180deg,color-mix(in srgb,var(--nave) 25%,transparent) 0%,color-mix(in srgb,var(--nave) 86%,transparent) 48%,color-mix(in srgb,var(--nave) 92%,transparent) 100%),url("../images/liturgy/cover.jpg") 55% 35%/cover no-repeat,var(--nave) !important;min-height:0;display:block;padding-top:200px} }
