/* OFFICIUM VERITATIS — custom PDF reader */
.reading{
  background:#f2f0e7;
}
.reading-page{
  padding-bottom:72px;
  background:
    linear-gradient(180deg,#f7f5ee 0,#f2f0e7 420px,#ecebe3 100%);
}
.reading-intro,
.reader-section{
  width:min(1180px,calc(100% - 64px));
  margin:0 auto;
}
.reading-intro{
  padding:34px 0 36px;
  border-bottom:1px solid #d8d5c9;
}
.reading-breadcrumbs{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:28px;
  font-size:.76rem;
  color:#77796e;
}
.reading-breadcrumbs a:hover{color:#8a713b}
.reading-breadcrumbs strong{font-weight:500;color:#3f443d}
.reading-intro-grid{
  display:grid;
  grid-template-columns:132px minmax(0,1fr);
  gap:34px;
  align-items:start;
}
.reading-cover{
  background:#e7e3d7;
  border:1px solid #d7d1bf;
  padding:10px;
  box-shadow:0 8px 22px #3c392c12;
}
.reading-cover img{
  display:block;
  width:100%;
  height:auto;
  box-shadow:0 5px 13px #1d1c1740;
}
.reading-kicker{
  margin:0 0 9px;
  font-size:.68rem;
  letter-spacing:.18em;
  color:#8a7640;
  font-weight:600;
}
.reading-author{
  margin:0 0 10px;
  font-size:.85rem;
  color:#40463d;
}
.reading-author a{text-decoration:none}
.reading-author span{color:#85877d;font-weight:400}
.reading-intro h1{
  margin:0 0 6px;
  font-size:clamp(2.3rem,4vw,4rem);
  letter-spacing:-.045em;
  color:#20251f;
}
.reading-latin{
  margin:0 0 18px;
  font-family:Georgia,'Times New Roman',serif;
  font-size:1.28rem;
  font-style:italic;
  color:#7a735e;
}
.reading-description{
  max-width:760px;
  margin:0 0 20px;
  color:#666b61;
  font-size:.96rem;
}
.reading-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin:0 0 24px;
}
.reading-meta span{
  border:1px solid #d6d1c3;
  background:#f8f6ef;
  color:#686a60;
  padding:6px 10px;
  font-size:.7rem;
  letter-spacing:.02em;
}
.reading-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.reading-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:9px 15px;
  font-size:.8rem;
  border:1px solid #9fa294;
}
.reading-action-primary{
  background:#191e18;
  color:#fff;
  border-color:#191e18;
}
.reading-action-primary:hover{background:#30382a;color:#fff}
.reading-action-secondary{background:#f7f5ee}
.reader-section{
  padding-top:32px;
}
.reader-section-heading{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:30px;
  margin:0 0 15px;
}
.reader-section-heading h2{
  margin:0;
  font-size:1.65rem;
  letter-spacing:-.025em;
}
.reader-section-heading>p{
  max-width:430px;
  margin:0;
  text-align:right;
  color:#777a70;
  font-size:.8rem;
}
.reader-footnote{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:28px;
  padding:16px 2px 0;
  color:#76796f;
  border-top:1px solid #d4d2c8;
}
.reader-footnote span{
  font-size:.65rem;
  letter-spacing:.13em;
  color:#8b7a4d;
  white-space:nowrap;
}
.reader-footnote p{
  margin:0;
  max-width:540px;
  text-align:right;
  font-size:.74rem;
}

.ov-pdf-reader{
  --reader-bg:#cfd0c6;
  --reader-panel:#222521;
  --reader-toolbar:#171b17;
  --reader-toolbar-2:#242824;
  --reader-border:#3a4038;
  --reader-gold:#b49a58;
  --reader-paper:#fff;
  --reader-muted:#a9aea4;
  position:relative;
  display:flex;
  flex-direction:column;
  width:100%;
  height:min(76vh,800px);
  min-height:650px;
  margin:0 auto 18px;
  border:1px solid #afb1a7;
  border-radius:2px;
  background:var(--reader-bg);
  box-shadow:0 16px 34px #27291f20,0 2px 8px #00000012;
  overflow:hidden;
}
.ov-reader-toolbar{
  min-height:52px;
  display:flex;
  align-items:center;
  gap:6px;
  padding:7px 10px;
  background:var(--reader-toolbar);
  color:#f3f1e7;
  border-bottom:1px solid #30352e;
  user-select:none;
  z-index:6;
}
.ov-reader-toolbar .tool-spacer{flex:1}
.ov-reader-toolbar .tool-sep{
  width:1px;height:25px;background:#40463e;margin:0 4px;
}
.ov-reader-toolbar button{
  width:36px;height:36px;
  display:inline-grid;place-items:center;
  border:1px solid transparent;
  background:transparent;
  color:#f0efe7;
  border-radius:4px;
  padding:0;
  cursor:pointer;
}
.ov-reader-toolbar button:hover{background:#30362f;border-color:#454c43;color:#fff}
.ov-reader-toolbar button:focus-visible{outline:2px solid var(--reader-gold);outline-offset:1px}
.ov-reader-toolbar button.active{background:#383d35;color:#d9c27d}
.ov-reader-toolbar svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ov-reader-title{
  max-width:220px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:.76rem;
  font-weight:600;
  color:#e9e8df;
  margin:0 8px 0 4px;
}
.ov-page-control,.ov-zoom-control{
  display:flex;align-items:center;gap:5px;
  font-size:.78rem;color:#dddcd4;
}
.ov-page-control input{
  width:52px;height:30px;
  border:1px solid #4b5148;
  background:#101310;color:#fff;
  text-align:center;border-radius:3px;
  padding:2px 4px;
  -moz-appearance:textfield;
}
.ov-page-control input::-webkit-outer-spin-button,
.ov-page-control input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.ov-page-total{min-width:50px;color:#c6c9c0}
.ov-zoom-label{
  min-width:54px;text-align:center;
  font-variant-numeric:tabular-nums;
  color:#f0efe7;font-size:.76rem
}
.ov-reader-body{display:flex;min-height:0;flex:1;background:var(--reader-bg)}
.ov-thumbs{
  width:168px;
  flex:0 0 168px;
  background:#242724;
  border-right:1px solid #3a3e38;
  overflow:auto;
  padding:10px 8px 22px;
  scrollbar-color:#62675f #252925;
  transition:width .18s ease,flex-basis .18s ease,padding .18s ease;
}
.ov-pdf-reader.sidebar-closed .ov-thumbs{
  width:0;flex-basis:0;padding-left:0;padding-right:0;border-right:0;overflow:hidden;
}
.ov-thumb{
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  margin:0 0 8px;
  padding:8px 6px;
  color:#e7e6df;
  background:transparent;
  border:1px solid transparent;
  cursor:pointer;
}
.ov-thumb:hover{background:#30342f}
.ov-thumb.active{background:#343932;border-color:#8f7a42}
.ov-thumb canvas{
  max-width:112px;
  height:auto;
  display:block;
  background:white;
  box-shadow:0 2px 7px #0007;
}
.ov-thumb-placeholder{
  width:112px;height:146px;
  display:grid;place-items:center;
  background:#3a3e39;
  color:#aeb2a9;
  font-family:Georgia,serif;
}
.ov-thumb span{font-size:.72rem;color:#c8cbc2}
.ov-reader-stage{
  position:relative;
  flex:1;
  min-width:0;
  overflow:auto;
  padding:24px 28px 40px;
  background:
    radial-gradient(circle at 50% 18%,#dcddd3 0,#d3d4ca 36%,#c8c9bf 100%);
  scrollbar-color:#8b8e83 #c8c9bf;
}
.ov-page-wrap{
  position:relative;
  margin:0 auto;
  background:var(--reader-paper);
  width:max-content;
  box-shadow:0 5px 24px #00000032;
  overflow:hidden;
}
.ov-page-wrap canvas{display:block}
.ov-page-wrap .textLayer{position:absolute;inset:0;z-index:2}
.ov-loading{
  position:absolute;inset:0;
  display:grid;place-items:center;
  z-index:5;
  background:#cfd0c6e6;
  color:#394039;
  font-family:Georgia,serif;
  font-size:.95rem;
}
.ov-loading[hidden]{display:none}
.ov-spinner{
  width:31px;height:31px;
  border:3px solid #aeb1a6;
  border-top-color:#635735;
  border-radius:50%;
  animation:ovspin .75s linear infinite;
  margin:0 auto 12px;
}
@keyframes ovspin{to{transform:rotate(360deg)}}
.ov-reader-status{
  min-height:30px;
  display:flex;align-items:center;justify-content:space-between;gap:18px;
  padding:4px 12px;
  background:#20241f;
  color:#bfc3ba;
  border-top:1px solid #363b34;
  font-size:.7rem;
}
.ov-reader-status strong{color:#e7e5dc;font-weight:500}
.ov-reader-error{
  max-width:680px;margin:auto;padding:28px;
  border:1px solid #b9aa84;background:#faf8ef;color:#403c30
}
.ov-reader-error a{text-decoration:underline}
.ov-pdf-reader:fullscreen{width:100%;height:100%;min-height:0;margin:0;border:0}
.ov-pdf-reader:fullscreen .ov-reader-stage{padding-top:20px}
.native-reader{display:none!important}

@media(max-width:1000px){
  .reading-intro,.reader-section{width:min(100% - 40px,900px)}
  .reading-intro-grid{grid-template-columns:112px minmax(0,1fr);gap:26px}
  .reader-section-heading{align-items:start}
  .reader-section-heading>p{max-width:330px}
  .ov-pdf-reader{height:72vh;min-height:590px}
  .ov-reader-title{display:none}
  .ov-reader-toolbar{gap:3px;padding:6px}
  .ov-reader-toolbar button{width:34px;height:34px}
  .ov-reader-toolbar .desktop-tool{display:none}
  .ov-thumbs{width:145px;flex-basis:145px}
  .ov-thumb canvas,.ov-thumb-placeholder{max-width:100px;width:100px}
  .ov-reader-stage{padding:16px 12px 36px}
}
@media(max-width:700px){
  .reading-page{padding-bottom:40px}
  .reading-intro,.reader-section{width:calc(100% - 28px)}
  .reading-intro{padding-top:22px}
  .reading-breadcrumbs{margin-bottom:20px}
  .reading-intro-grid{grid-template-columns:84px minmax(0,1fr);gap:18px}
  .reading-cover{padding:6px}
  .reading-intro h1{font-size:2.15rem}
  .reading-latin{font-size:1.05rem}
  .reading-description{font-size:.88rem}
  .reading-meta span{font-size:.65rem}
  .reader-section-heading{display:block}
  .reader-section-heading>p{text-align:left;margin-top:8px;max-width:none}
  .reader-footnote{display:block}
  .reader-footnote p{text-align:left;margin-top:8px}
}
@media(max-width:600px){
  .reading-intro-grid{grid-template-columns:1fr}
  .reading-cover{width:108px}
  .reading-actions{width:100%}
  .reading-action{flex:1}
  .ov-pdf-reader{height:calc(100vh - 150px);min-height:520px}
  .ov-reader-toolbar{flex-wrap:wrap;min-height:82px}
  .ov-page-control{order:8}
  .ov-zoom-control{order:9}
  .ov-reader-toolbar .tool-spacer{display:none}
  .ov-reader-toolbar .tool-sep{height:22px}
  .ov-thumbs{
    position:absolute;left:0;top:0;bottom:30px;z-index:8;
    width:145px;flex-basis:145px;
    box-shadow:8px 0 18px #0004;
  }
  .ov-pdf-reader.sidebar-closed .ov-thumbs{transform:translateX(-100%)}
  .ov-reader-stage{padding:12px 8px 30px}
  .ov-reader-status span:last-child{display:none}
}

/* Mobile audit — PDF reader */
@media(max-width:600px){
  .reading-intro,.reader-section{width:calc(100% - 20px)}
  .reading-intro{padding:16px 0 24px}
  .reading-breadcrumbs{font-size:.68rem;gap:6px;margin-bottom:16px}
  .reading-cover{width:92px}
  .reading-intro h1{font-size:1.9rem;line-height:1.05}
  .reading-latin{font-size:.98rem}
  .reading-description{font-size:.84rem;line-height:1.6}
  .reading-meta{gap:6px;margin-bottom:18px}
  .reading-meta span{padding:5px 7px}
  .reading-actions{display:grid;grid-template-columns:1fr}
  .reading-action{width:100%}
  .reader-section{padding-top:24px}
  .reader-section-heading h2{font-size:1.42rem}
  .ov-pdf-reader{
    width:100%;
    height:calc(100svh - 118px);
    min-height:500px;
    margin-bottom:12px;
    border-left:0;
    border-right:0;
  }
  .ov-reader-toolbar{
    flex-wrap:nowrap;
    min-height:52px;
    overflow-x:auto;
    justify-content:flex-start;
    scrollbar-width:none;
  }
  .ov-reader-toolbar::-webkit-scrollbar{display:none}
  .ov-page-control,.ov-zoom-control{order:initial;flex:0 0 auto}
  .ov-reader-toolbar .tool-sep{display:none}
  .ov-reader-toolbar button{flex:0 0 34px}
  .ov-page-total{min-width:40px}
  .ov-zoom-label{min-width:46px}
  .ov-thumbs{top:0;bottom:30px}
  .ov-reader-stage{padding:8px 6px 24px}
  .reader-footnote{font-size:.7rem}
}
