@font-face {
  font-family: Barlow;
  src: url("fonts/barlow-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: Barlow;
  src: url("fonts/barlow-bold.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: Barlow;
  src: url("fonts/barlow-extrabold.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --navy: #081d2d;
  --blue: #10384e;
  --cyan: #4cc3ef;
  --pale: #edf7fb;
  --line: #c8dce7;
  --text: #153247;
  --muted: #405b6c;
  --canvas: #e2edf4;
  --white: #fff;
  --frame: 1416px;
  --gutter: clamp(14px, 3vw, 44px);
  --radius: 9px;
  --shadow: 0 10px 24px #0d395415;
  font: 400 16px/1.5 Barlow, Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--text); background: #f2f7fa; }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .43; }
img { max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible { outline: 3px solid #077aab; outline-offset: 3px; }

.sr-only, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

.skip:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 5;
  padding: 8px 14px;
  color: var(--navy);
  background: var(--cyan);
  border-radius: 5px;
}

.masthead {
  color: var(--white);
  background: linear-gradient(106deg, var(--navy) 0%, #0a283c 72%, #103d55 100%);
  border-bottom: 4px solid var(--cyan);
}

.masthead-inner, .layout, .site-footer-inner {
  max-width: var(--frame);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 34px);
  min-height: 96px;
  padding-block: 14px;
}

.brand {
  display: flex;
  align-items: center;
  flex: none;
}

.brand img { display: block; width: clamp(108px, 13vw, 174px); height: auto; }

.masthead-title {
  flex: 1 1 auto;
  min-width: 0;
  padding-inline-start: clamp(16px, 2.7vw, 34px);
  border-inline-start: 1px solid #557787;
}

.masthead-title p {
  margin-bottom: 3px;
  color: #a8e7fb;
  font-weight: 700;
  font-size: clamp(.64rem, 1vw, .76rem);
  letter-spacing: .08em;
}

.masthead h1 {
  font-size: clamp(1.6rem, 2.7vw, 2.28rem);
  font-weight: 800;
  line-height: 1.07;
}

.masthead-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 14px;
  font-size: .93rem;
  font-weight: 700;
  border: 1px solid #86bad0;
  border-radius: 5px;
  text-decoration: none;
}

.action.quote { color: var(--navy); background: var(--cyan); border-color: var(--cyan); }
.action.whatsapp { color: var(--white); }
.action.quote:hover { background: #83daf8; }
.action.whatsapp:hover { background: #17455e; }
.masthead :focus-visible, .site-footer :focus-visible { outline-color: var(--cyan); }

.layout {
  display: grid;
  grid-template-columns: minmax(230px, 278px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(16px, 2.4vw, 34px);
  padding-block: 24px 36px;
}

.sidebar { min-width: 0; position: sticky; top: 16px; }

.index {
  border: 1px solid var(--line);
  border-top: 3px solid #34a9d6;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.index summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 13px;
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.index summary::-webkit-details-marker { display: none; }

.index summary::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-inline-start: auto;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.index[open] summary::after { transform: rotate(225deg) translate(-1px, -2px); }

.index-count {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 400;
  white-space: nowrap;
}

.index-inner { border-top: 1px solid var(--line); }
.index-search { padding: 12px 13px 4px; }
.index-search label { display: block; font-size: .86rem; font-weight: 700; margin-bottom: 5px; }
.search-field { position: relative; }

.search-field svg {
  position: absolute;
  top: 50%;
  left: 9px;
  transform: translateY(-50%);
  color: #225c78;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  min-height: 41px;
  padding: 8px 8px 8px 33px;
  border: 1px solid #a7c6d6;
  border-radius: 5px;
  color: var(--navy);
  background: #f8fbfd;
  font-size: .93rem;
}

.search-field input::placeholder { color: #456173; }
.search-status:not(:empty) { margin-block: 5px; font-size: .82rem; color: var(--muted); }
.page-list {
  max-height: min(65vh, 670px);
  overflow: auto;
  scrollbar-color: #a2bdcc #f1f7fa;
  overscroll-behavior-y: contain;
  padding: 7px 9px 12px;
}

.index-group + .index-group { margin-top: 8px; }
.index-group h3 {
  padding: 7px 6px 3px;
  color: #265976;
  font-size: .71rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.index-group a {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px;
  border-radius: 5px;
  font-size: .91rem;
  line-height: 1.23;
  text-decoration: none;
}

.index-group a:hover { background: var(--pale); }
.index-group a[aria-current="page"] { background: var(--blue); color: var(--white); font-weight: 700; }
.index-num { font-size: .77rem; font-weight: 700; color: #235e7b; }
.index-group a[aria-current="page"] .index-num { color: #9fdef4; }

.reader {
  min-width: 0;
  scroll-margin-top: 12px;
  border: 1px solid #bed2df;
  border-radius: var(--radius);
  background: var(--canvas);
  box-shadow: var(--shadow);
}

.toolbar {
  position: sticky;
  z-index: 3;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px 16px;
  padding: 11px 15px;
  border-bottom: 1px solid #bdd2df;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--white);
}

.reader-heading { min-width: 0; flex: 1 1 auto; }

.reader-heading p {
  font-size: .73rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #265d78;
}

.reader-heading h2 {
  font-size: clamp(1.19rem, 2vw, 1.47rem);
  line-height: 1.18;
  color: var(--navy);
}

.reader-tools, .page-controls, .mode-controls, .zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.reader-tools { flex-wrap: wrap; gap: 7px 10px; }

.reader-tools button, .reader-tools select {
  min-height: 42px;
  border: 1px solid #a9c5d4;
  border-radius: 5px;
  color: var(--navy);
  background: #f5fafc;
  font-size: .86rem;
  font-weight: 700;
}

.reader-tools button { padding: 5px 8px; }
.reader-tools select { padding: 4px 6px; }
.reader-tools button:hover:not(:disabled) { background: #e0f1f8; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 37px;
}

#zoom-in, #zoom-out { font-size: 1.14rem; }
#zoom-reset { min-width: 53px; }
.mode-controls button[aria-pressed="true"] {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.mode-controls button[aria-pressed="true"]:hover:not(:disabled) { background: #195772; }

.chapters { min-width: 0; }
.chapter { min-width: 0; scroll-margin-top: 12px; }
.chapter + .chapter { margin-top: 30px; }
.enhanced .chapter { margin-top: 0; }
.enhanced .chapter-heading { display: none; }
.chapter-heading {
  padding: 12px 16px;
  font-size: 1.16rem;
  color: var(--navy);
}
.chapter-heading span { color: #276686; margin-right: 6px; }

.visual-viewport {
  overflow: auto;
  overscroll-behavior-inline: contain;
  padding: clamp(8px, 1.55vw, 22px);
  scrollbar-color: #89abbe #e2edf4;
}

.artwork {
  position: relative;
  width: calc(100% * var(--zoom, 1));
  max-width: calc(780px * var(--zoom, 1));
  margin-inline: auto;
  background: var(--white);
  box-shadow: 0 3px 16px #112e4260;
}

.sheet { display: block; width: 100%; height: auto; }

.hotspot {
  position: absolute;
  display: block;
  border-radius: 3px;
}

.hotspot:hover, .hotspot:focus-visible {
  background: #d5f3ff38;
  outline: 2px solid #1276aa;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #ffffffb0;
}

.reading {
  margin: clamp(8px, 1.55vw, 22px);
  padding: clamp(14px, 2.8vw, 29px);
  min-width: 0;
  border: 1px solid var(--line);
  border-top: 4px solid var(--cyan);
  border-radius: 6px;
  background: var(--white);
}

.reading > summary { font-weight: 700; cursor: pointer; }
.enhanced .reading > summary { display: none; }
.reading-content { min-width: 0; overflow-wrap: anywhere; }

.reading-content h3 {
  margin-bottom: .55rem;
  color: var(--navy);
  font-size: clamp(1.55rem, 3.2vw, 2.45rem);
  font-weight: 800;
  line-height: 1.12;
}

.reading-content h4 {
  margin: 1.1rem 0 .3rem;
  color: var(--navy);
  font-size: 1.08rem;
}

.reading-content h4[data-folder-topic] { scroll-margin-top: 16px; }

.reading-content h4[data-folder-topic]:target {
  padding: .42rem .6rem;
  border-inline-start: 3px solid #287d9e;
  background: #e9f5fa;
}

.reading-content p { margin: .34rem 0; line-height: 1.55; }

.reading-figure { max-width: 100%; margin: 12px 0; }
.reading-figure img { display: block; height: auto; border: 1px solid #d5e5ed; border-radius: 4px; }

.data-table { margin: 14px 0 20px; }
.data-table h4 { margin-top: 0; }
.reading-content .table-hint { margin-bottom: 7px; font-size: .85rem; color: var(--muted); }
.table-scroll {
  max-width: 100%;
  overflow: auto;
  border: 1px solid #b4d3e3;
  border-radius: 5px;
  scrollbar-color: #7ea7bd #edf7fb;
}

.table-scroll table { width: 100%; border-collapse: collapse; }
.table-scroll th, .table-scroll td {
  min-width: 48px;
  padding: 7px 9px;
  text-align: left;
  font-size: .92rem;
  line-height: 1.3;
  overflow-wrap: normal;
  border-bottom: 1px solid #dbeaf2;
}
.table-scroll th { color: var(--navy); font-weight: 700; }
.table-scroll thead th { background: var(--cyan); }
.table-scroll tbody tr:nth-child(odd) { background: var(--pale); }
.table-scroll td { font-variant-numeric: tabular-nums; }

.swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 9px;
  margin: 10px 0 14px;
}

.swatches li { color: var(--navy); font-size: .81rem; }
.swatches span {
  display: block;
  min-height: 32px;
  margin-bottom: 4px;
  border: 1px solid #7795a4;
  border-radius: 4px;
  background: var(--swatch);
}

.reading-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.inline-link, .reader-bottom a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 7px 10px;
  border: 1px solid #9cbccc;
  border-radius: 5px;
  background: var(--white);
  color: #0d405a;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 700;
}

.inline-link:hover, .reader-bottom a:hover { background: var(--pale); }
.reader-bottom {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 0 clamp(8px, 1.55vw, 22px) 16px;
}
#bottom-previous { justify-self: start; grid-column: 1; }
.bottom-index { grid-column: 2; }
#bottom-next { justify-self: end; grid-column: 3; }

.noscript { padding: 12px 16px 0; color: var(--navy); font-size: .91rem; }

.site-footer {
  border-top: 3px solid var(--cyan);
  background: var(--navy);
  color: #d3eaf4;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 20px;
  padding-block: 16px;
  font-size: .89rem;
}

.site-footer strong { color: var(--white); }

@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(210px, 235px) minmax(0, 1fr); }
  .index-count { display: none; }
}

@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 13px; padding-block: 14px 24px; }
  .sidebar { position: static; }
  .index-count { display: inline; }
  .page-list { max-height: 49vh; }
  .masthead-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 11px 15px; }
  .masthead-actions { grid-column: 1 / -1; }
  .masthead-title { padding-inline-start: 14px; }
  .action { flex: 1 1 auto; }
  .toolbar { padding: 8px; gap: 7px; }
  .reader-tools { gap: 6px; }
  .reader-tools button, .reader-tools select { min-height: 42px; }
  .reader-tools button { padding-inline: 7px; }
  .reader-bottom { padding-bottom: 10px; }
}

@media (max-height: 560px) {
  .toolbar { position: static; }
}

@media (max-width: 480px) {
  .reader-tools { flex: 1 1 100%; gap: 6px; }
  .page-controls, .zoom-controls { gap: 3px; }
  .zoom-controls { margin-inline-start: auto; }
  .reader-tools .icon-button { min-width: 34px; }
  .reader-tools select { min-width: 44px; }
  #zoom-reset { min-width: 47px; }
  .mode-controls {
    flex-basis: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reader-bottom { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .reader-bottom :is(#bottom-previous, .bottom-index, #bottom-next) {
    justify-self: stretch;
    min-width: 0;
    padding-inline: 4px;
    gap: 3px;
    font-size: .83rem;
  }
  .reader-bottom a svg { width: 15px; flex: none; }
}

@media (max-width: 360px) {
  .action { padding-inline: 8px; gap: 5px; font-size: .85rem; }
}
