/* OneWorld Peace Library — language editions (English, Tigrinya, Amharic) of classic texts.
   Builds on school.css tokens (forest green, gold, cream), course.css/school.css reader layout and chapter-theme.css
   (dark mode). Tigrinya and Amharic use Noto Serif Ethiopic for reading and Noto Sans Ethiopic for the interface. */
.ed-ethiopic{--ed-read:'Noto Serif Ethiopic',Georgia,'Times New Roman',serif;--ed-head:'Noto Serif Ethiopic','Noto Sans Ethiopic',serif;--ed-ui:'Noto Sans Ethiopic',system-ui,sans-serif}
.ed-latin{--ed-read:Georgia,'Iowan Old Style','Palatino Linotype',Palatino,'Times New Roman',serif;--ed-head:'Cormorant Garamond',Georgia,serif;--ed-ui:var(--sans)}
.ed-page .reader-top h1,.ed-page .reader-panel h2,.ed-page .ed-part h3{font-family:var(--ed-head)}
.ed-ethiopic .reader-top h1{font-weight:700;line-height:1.3;font-size:clamp(30px,4.4vw,48px)}
.ed-ethiopic .reader-panel h2{font-weight:700;line-height:1.35;font-size:clamp(26px,3.6vw,38px)}
.ed-page .reader-toc,.ed-page .reader-tools,.ed-page .chapter-pager,.ed-page .reader-bar{font-family:var(--ed-ui)}

/* Reading text */
.ed-text .chapter-body{font-family:var(--ed-read);max-width:68ch;line-height:1.85;hyphens:manual}
.ed-ethiopic .ed-text .chapter-body{line-height:2.05;letter-spacing:.005em;word-spacing:.04em}
.ed-text .chapter-body p{margin:0 0 1.05em}
.ed-text .chapter-body .ed-p{scroll-margin-top:calc(var(--header-h) + 20px)}
.ed-text .chapter-body .pn{font-family:var(--ed-ui);font-weight:700;font-size:.78em;color:var(--gold-deep);letter-spacing:.02em;margin-right:.15em;white-space:nowrap}
.ed-text .chapter-body .ms-section h3{font-family:var(--ed-head);font-size:1.3em;line-height:1.35;color:var(--forest);margin:1.6em 0 .7em;text-align:center}
.ed-text .chapter-body h4{font-family:var(--ed-head);font-size:1.1em;margin:1.4em 0 .5em;color:var(--forest-2)}
.ed-text .chapter-body .ed-quote{margin:1.3em 0;padding:.55em 1.2em;border-left:4px solid var(--gold);background:#c9a24a12;border-radius:0 12px 12px 0;font-style:normal}
.ed-latin .ed-text .chapter-body .ed-quote{font-style:italic}
.ed-text .chapter-body .ed-quote p:last-child{margin-bottom:0}
.ed-text .chapter-body hr{border:0;margin:2em auto;width:120px;height:14px;background:radial-gradient(circle,var(--gold) 0 2px,transparent 3px) center/24px 14px repeat-x}
/* Footnotes of the historical edition (translator/editor): small gold markers in the text, a separate Notes section after it */
.ed-text .chapter-body sup.ed-fn{font-family:var(--ed-ui);font-size:.68em;line-height:0;vertical-align:super;margin-left:.05em}
.ed-text .chapter-body sup.ed-fn a{color:var(--gold-deep);text-decoration:none;font-weight:700;padding:0 .15em;border-radius:4px}
.ed-text .chapter-body sup.ed-fn a:hover,.ed-text .chapter-body sup.ed-fn a:focus-visible{background:#c9a24a26;text-decoration:underline}
.ed-text .chapter-body .ed-notes{margin:2.6em 0 0;padding:1.1em 1.2em .6em;border-top:3px solid var(--gold);background:#2f6b520a;border-radius:0 0 12px 12px;font-family:var(--ed-ui);font-size:.86em;line-height:1.6}
.ed-text .chapter-body .ed-notes h4{margin:0 0 .2em;color:var(--forest);font-size:1.15em}
.ed-text .chapter-body .ed-notes .ed-notes-sub{margin:0 0 .9em;color:var(--muted);font-size:.92em}
.ed-text .chapter-body .ed-notes ol{margin:0;padding-left:2.1em}
.ed-text .chapter-body .ed-notes li{margin:0 0 .65em;scroll-margin-top:calc(var(--header-h) + 20px)}
.ed-text .chapter-body .ed-notes li::marker{color:var(--gold-deep);font-weight:700}
.ed-text .chapter-body .ed-notes li:target{background:#c9a24a22;border-radius:6px;outline:2px solid #c9a24a55;outline-offset:3px}
.ed-text .chapter-body .ed-fn-h{font-weight:700;color:var(--forest-2)}
.ed-text .chapter-body .ed-fn-back{color:var(--gold-deep);text-decoration:none;margin-left:.2em}
.ed-text .chapter-body{overflow-wrap:break-word}
.ed-text .chapter-body .ed-notes,.ed-src{overflow-wrap:anywhere}
.ed-text .chapter-body sup.ed-fn a{scroll-margin-top:calc(var(--header-h) + 40px)}
@media (pointer:coarse){.ed-text .chapter-body sup.ed-fn a{display:inline-block;min-width:1.6em;padding:.15em .3em;text-align:center}.ed-text .chapter-body .ed-fn-back{display:inline-block;min-width:44px;min-height:32px;text-align:center}}
@media (max-width:640px){.ed-text .chapter-body .ed-notes{padding:1em .85em .5em;font-size:.9em}.ed-text .chapter-body .ed-notes ol{padding-left:1.7em}}
.ed-text .ch-num{font-family:var(--ed-ui)}
.ed-src{margin:2.2em 0 0;padding-top:1em;border-top:1px solid var(--line);font-size:13.5px;color:var(--muted);font-family:var(--ed-ui)}

/* Language switcher */
.ed-langs{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:16px 0 0}
.ed-langs-l{font-size:13px;letter-spacing:1.4px;text-transform:uppercase;color:var(--gold-2);font-weight:700;margin-right:4px}
.ed-langs a,.ed-langs .off{display:inline-flex;align-items:center;min-height:44px;padding:6px 16px;border-radius:999px;border:1px solid #c9a24a88;color:var(--cream);text-decoration:none;font-weight:700;font-size:15px;font-family:'Noto Sans Ethiopic',system-ui,sans-serif}
.ed-langs a:hover{background:#c9a24a22;border-color:var(--gold-2)}
.ed-langs a[aria-current]{background:var(--gold);color:var(--forest);border-color:var(--gold)}
.ed-langs .off{opacity:.45;cursor:not-allowed;border-style:dashed}

/* Notices */
.ed-banner{margin:0 0 14px;padding:10px 14px;border-radius:12px;border:1px solid #8a6a22;background:#fff4d6;color:#5b4511;font-size:14.5px}
.ed-banner.info{background:#eef5f0;border-color:#2f6b5266;color:var(--forest-2)}
.ed-banner a{color:inherit;font-weight:700}

/* Contents grouped by book (part) */
.ed-toc .ed-toc-part>details>summary{display:flex;justify-content:space-between;align-items:center;gap:8px;min-height:44px;padding:8px;cursor:pointer;list-style:none;
  font-weight:800;color:var(--forest);border-radius:10px;font-size:15px}
.ed-toc .ed-toc-part>details>summary::-webkit-details-marker{display:none}
.ed-toc .ed-toc-part>details>summary::after{content:"";width:8px;height:8px;border-right:2px solid var(--gold-deep);border-bottom:2px solid var(--gold-deep);transform:rotate(45deg);margin-left:auto;transition:transform .15s}
.ed-toc .ed-toc-part>details[open]>summary::after{transform:rotate(-135deg)}
.ed-toc .ed-toc-part>details>summary:hover{background:var(--cream)}
.ed-toc .ed-toc-part .cnt{font-size:12px;font-weight:700;color:var(--muted);background:var(--cream-2);border-radius:999px;padding:1px 8px}
.ed-toc-ch{list-style:none;margin:0 0 6px;padding:0 0 0 6px;border-left:2px solid var(--line)}
.ed-toc-ch a{min-height:40px}
.ed-toc .toc-list .st.draft{grid-column:2}
.ed-part{margin:0 0 18px}
.ed-part h3{font-size:24px;margin:18px 0 4px;color:var(--forest);display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.ed-part-n{font-family:var(--ed-ui,var(--sans));font-size:13px;font-weight:700;color:var(--gold-deep)}
.ed-chapters li a{min-height:52px}

/* Overview: editions */
.ed-h2{font-family:var(--serif);font-size:26px;margin:18px 0 10px;color:var(--forest)}
.ed-cards{list-style:none;margin:0 0 18px;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}
.ed-card{display:flex;flex-direction:column;gap:4px;padding:16px;border-radius:14px;border:1px solid var(--line);background:var(--paper);border-top:4px solid var(--gold)}
.ed-card-lang{font-size:12px;letter-spacing:1.6px;text-transform:uppercase;font-weight:800;color:var(--gold-deep)}
.ed-card-t{font-family:var(--ed-head);font-weight:700;font-size:20px;line-height:1.35;color:var(--forest)}
.ed-card-c,.ed-card-m{font-size:14px;color:var(--muted)}
.ed-card .c-btn{margin-top:auto;align-self:flex-start}
.ed-cover{border-left-color:var(--gold)}
.ed-subtitle{font-family:var(--ed-head);font-size:20px;color:var(--gold-deep)}
.ed-source{font-size:14px;color:var(--muted)}
.ed-source p{margin:.2em 0}

/* Phones */
@media(max-width:960px){
  .ed-langs{gap:6px}
  .ed-langs a,.ed-langs .off{padding:6px 14px;font-size:14.5px}
  .ed-text .chapter-body{max-width:none}
}
@media(max-width:640px){
  .ed-langs-l{width:100%}
  .ed-langs a,.ed-langs .off{flex:1 1 0;justify-content:center;min-width:0;padding:6px 8px}
  .ed-ethiopic .ed-text .chapter-body{line-height:1.95}
  .ed-cards{grid-template-columns:1fr}
  .ed-part h3{font-size:21px}
}

/* Dark mode */
html[data-theme="dark"] .ed-text .chapter-body .ms-section h3,html[data-theme="dark"] .ed-text .chapter-body h4,
html[data-theme="dark"] .ed-toc .ed-toc-part>details>summary,html[data-theme="dark"] .ed-part h3,html[data-theme="dark"] .ed-card-t,html[data-theme="dark"] .ed-h2{color:var(--heading,#f3e1ad)}
html[data-theme="dark"] .ed-toc .ed-toc-part>details>summary:hover{background:#183a2d}
html[data-theme="dark"] .ed-toc .ed-toc-part .cnt{background:#1d4f3d;color:#d6dfd9}
html[data-theme="dark"] .ed-toc-ch{border-left-color:#24443a}
html[data-theme="dark"] .ed-text .chapter-body .pn{color:#e2c47e}
html[data-theme="dark"] .ed-text .chapter-body .ed-quote{background:#c9a24a1a}
html[data-theme="dark"] .ed-text .chapter-body sup.ed-fn a,html[data-theme="dark"] .ed-text .chapter-body .ed-fn-back,html[data-theme="dark"] .ed-text .chapter-body .ed-notes li::marker{color:#e2c47e}
html[data-theme="dark"] .ed-text .chapter-body .ed-notes{background:#c9a24a0f}
html[data-theme="dark"] .ed-text .chapter-body .ed-notes h4,html[data-theme="dark"] .ed-text .chapter-body .ed-fn-h{color:var(--heading,#f3e1ad)}
html[data-theme="dark"] .ed-banner{background:#2a2616;color:#f0d68e}
html[data-theme="dark"] .ed-banner.info{background:#163327;color:#cfe3d8;border-color:#35574a}
html[data-theme="dark"] .ed-card{background:#13281f;border-color:#24443a;border-top-color:var(--gold)}
html[data-theme="dark"] .ed-src{border-top-color:#24443a}
@media print{.ed-langs,.ed-banner,.reader-toc,.reader-tools,.reader-bar,.chapter-pager{display:none!important}}
