/* =========================================================
   UNIVERSAL DOCUMENT VIEWER MODAL
   Accessible text version + original PDF, in two tabs.
   Markup is injected by js/doc-viewer.js
   ========================================================= */

.doc-modal{
  position:fixed;
  inset:0;
  display:none;
  z-index:9999;
}

.doc-modal.doc-modal--open{ display:block; }

.doc-modal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.7);
}

.doc-modal__dialog{
  position:relative;
  margin:4vh auto;
  width:min(1100px, calc(100% - 24px));
  height:92vh;
  background:#fff;
  border-radius:4px;
  border-top:4px solid #c89a3c;
  overflow:hidden;
  box-shadow:0 18px 50px rgba(0,0,0,.45);
  display:flex;
  flex-direction:column;
  overscroll-behavior:contain;
}

.doc-modal__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 22px;
  border-bottom:1px solid #e6e2d6;
  background:#fff;
}

.doc-modal__title{
  margin:0;
  font-size:19px;
  font-weight:800;
  letter-spacing:.01em;
  color:#1a1a1d;
}

.doc-modal__close{
  border:2px solid #1a1a1d;
  background:#fff;
  color:#1a1a1d;
  padding:9px 20px;
  border-radius:3px;
  cursor:pointer;
  font:inherit;
  font-size:13px;
  font-weight:800;
  letter-spacing:.06em;
}

.doc-modal__close:hover{ background:#1a1a1d; color:#f4d99a; }
.doc-modal__close:focus-visible{ outline:3px solid #c89a3c; outline-offset:2px; }

/* Tabs */
.doc-modal__tabs{
  display:flex;
  flex-wrap:wrap;
  gap:26px;
  padding:0 22px;
  border-bottom:1px solid #e6e2d6;
  background:#fff;
}

.doc-tab{
  border:0;
  border-bottom:3px solid transparent;
  background:none;
  color:#4a4a46;
  padding:14px 2px;
  margin-bottom:-1px;
  cursor:pointer;
  font:inherit;
  font-size:14.5px;
  font-weight:700;
}

.doc-tab[aria-selected="true"]{
  color:#1a1a1d;
  border-bottom-color:#c89a3c;
}

.doc-tab:focus-visible{ outline:3px solid #c89a3c; outline-offset:2px; }

.doc-modal__panels{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  background:#fff;
}

.doc-panel{ display:none; height:100%; overflow:hidden; }
.doc-panel.is-active{ display:block; }

/* ---------- Text panel ---------- */

#doc-text{
  height:100%;
  overflow:auto;
  padding:26px 22px 40px;
  text-align:left;
  color:#1a1a1d;
  font-size:16px;
  line-height:1.65;
  overflow-wrap:anywhere;
  word-break:break-word;
}

#doc-text *{ max-width:100%; box-sizing:border-box; text-align:left; }

#doc-text h2.doc-title{
  margin:0 0 8px;
  font-size:27px;
  line-height:1.2;
  font-weight:800;
  color:#1a1a1d;
  border-top:0;
  padding-top:0;
}

#doc-text h2{
  margin:32px 0 8px;
  font-size:19px;
  line-height:1.3;
  font-weight:800;
  color:#1a1a1d;
  border-top:1px solid #e6e2d6;
  padding-top:20px;
}

#doc-text p{ margin:0 0 14px; max-width:70ch; text-wrap:pretty; }
#doc-text .doc-meta{ color:#6b695f; font-size:14.5px; }
#doc-text .doc-lede{ font-size:17.5px; line-height:1.6; color:#3a3a35; }

#doc-text h3{
  margin:34px 0 10px;
  font-size:13px;
  font-weight:800;
  letter-spacing:.14em;
  color:#9a7420;
  border-top:1px solid #e6e2d6;
  padding-top:16px;
}

#doc-text pre{
  margin:0;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  font-family:ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:14.5px;
  line-height:1.7;
  color:#26261f;
}

#doc-text a{ color:#1a1a1d; text-decoration:underline; }

#doc-text table{ display:block; max-width:100%; overflow-x:auto; border-collapse:collapse; }
#doc-text img{ max-width:100%; height:auto; }

/* ---------- PDF panel ---------- */

.doc-pdf-actions{
  padding:14px 22px;
  border-bottom:1px solid #e6e2d6;
  background:#faf8f2;
}

.doc-pdf-actions__msg{
  color:#4a4a46;
  font-size:14px;
  margin-bottom:10px;
}

.doc-pdf-actions__buttons{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}

.doc-pdf-actions__buttons a,
.doc-modal__print{
  border:2px solid #1a1a1d;
  background:#fff;
  color:#1a1a1d;
  padding:8px 18px;
  border-radius:3px;
  cursor:pointer;
  font:inherit;
  font-size:13px;
  font-weight:800;
  letter-spacing:.05em;
  text-decoration:none;
}

.doc-pdf-actions__buttons a:hover,
.doc-modal__print:hover{ background:#1a1a1d; color:#f4d99a; }

.doc-pdf-actions__buttons a:focus-visible,
.doc-modal__print:focus-visible{ outline:3px solid #c89a3c; outline-offset:2px; }

#doc-pdf-frame{
  width:100%;
  height:100%;
  border:0;
  display:block;
  max-width:100%;
  background:#fff;
}

#doc-panel-pdf,
#doc-pdf-frame{ touch-action:pan-y pinch-zoom; }

.doc-modal__note{
  flex:0 0 auto;
  padding:12px 22px;
  border-top:1px solid #e6e2d6;
  background:#fff;
  color:#6b695f;
  font-size:13.5px;
}

@media (max-width: 760px){
  .doc-modal__dialog{ margin:0; width:100%; height:100vh; border-radius:0; }
  .doc-modal__title{ font-size:16px; }
  .doc-modal__tabs{ padding:0 14px; gap:18px; }
  .doc-tab{ font-size:13.5px; }
  #doc-text{ padding:20px 14px 32px; }
  #doc-text h2{ font-size:22px; }
  .doc-pdf-actions,
  .doc-modal__note{ padding:12px 14px; }
}
