/* ==========================================================================
   Monolith General Construction — PDF viewer page
   Extends gc-legal.css (header, hero, footer, buttons).
   ========================================================================== */

.gc-doc-sec { padding: 72px 0 96px; background: #fff; }
.gc-doc-wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---------- Viewer frame ---------- */
.gc-viewer {
  display: flex;
  flex-direction: column;
  background: var(--gc-dark);
  border-top: 4px solid var(--gc-accent);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .18);
}
.gc-viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 10px 14px 10px 20px;
  border-bottom: 1px solid #2a2a2a;
  color: #fff;
}
.gc-viewer__file { display: flex; align-items: center; gap: 14px; min-width: 0; }
.gc-viewer__file svg { flex: 0 0 auto; width: 22px; height: 22px; fill: none; stroke: var(--gc-accent); stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.gc-viewer__name { font-family: var(--gc-font-head); font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-viewer__pageinfo { font-family: var(--gc-font-head); font-size: 15px; color: #a3a3a3; white-space: nowrap; padding-left: 14px; border-left: 1px solid #2a2a2a; }
.gc-viewer__pageinfo b { color: #fff; font-weight: 600; }

.gc-viewer__tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.gc-tool {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  min-width: 40px; height: 40px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid #2f2f2f; border-radius: 0;
  color: #fff; font-family: var(--gc-font-head); font-size: 14px; font-weight: 600;
  transition: background-color .2s, color .2s, border-color .2s;
}
.gc-tool svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: square; stroke-linejoin: miter; }
.gc-tool:hover:not(:disabled) { background: var(--gc-accent); border-color: var(--gc-accent); color: var(--gc-ink); }
.gc-tool:disabled { opacity: .35; cursor: default; }
.gc-tool--zoom { min-width: 64px; }
.gc-viewer button:focus-visible { outline: 3px solid var(--gc-accent); outline-offset: 2px; }

/* ---------- Stage ---------- */
.gc-viewer__stage {
  position: relative;
  height: clamp(460px, 78vh, 920px);
  overflow: auto;
  background: #262626;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.gc-viewer__stage:focus-visible { outline: 3px solid var(--gc-accent); outline-offset: -3px; }
.gc-viewer__pages {
  display: flex; flex-direction: column; align-items: center;
  width: max-content; min-width: 100%;
  padding: 28px 18px 8px;
}
.gc-sheet {
  position: relative;
  flex: 0 0 auto;
  margin: 0 0 22px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .12);
}
.gc-sheet canvas { display: block; }
.gc-sheet__n {
  position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px;
  text-align: center; font-family: var(--gc-font-head); font-size: 12px; color: #7d7d7d; pointer-events: none;
}

/* Loading + error state */
.gc-viewer__state {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px; text-align: center; color: #d5dade; background: #262626;
  font-size: 16px; line-height: 1.7;
}
.gc-viewer__state[hidden] { display: none; }
.gc-viewer__state p { margin: 0; max-width: 420px; }
.gc-viewer__state a { color: #fff; border-bottom: 2px solid var(--gc-accent); }
.gc-viewer__state a:hover { color: var(--gc-accent); }
.gc-spin { width: 34px; height: 34px; border: 3px solid #3a3a3a; border-top-color: var(--gc-accent); animation: gc-spin .9s linear infinite; }
@keyframes gc-spin { to { transform: rotate(360deg); } }

/* Fullscreen */
.gc-viewer:fullscreen { height: 100%; border-top-width: 3px; }
.gc-viewer:fullscreen .gc-viewer__stage { flex: 1 1 auto; height: auto; }
.gc-viewer:-webkit-full-screen { height: 100%; }
.gc-viewer:-webkit-full-screen .gc-viewer__stage { flex: 1 1 auto; height: auto; }

/* ---------- Download block ---------- */
.gc-dl { margin: 56px auto 0; max-width: 640px; text-align: center; }
.gc-dl h2 { margin: 0 0 10px; font-family: var(--gc-font-head); font-size: 32px; font-weight: 600; line-height: 1.2; color: var(--gc-ink); }
.gc-dl p { margin: 0 0 28px; }
.gc-dl__row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.gc-btn--accent { background: var(--gc-accent); border-color: var(--gc-accent); color: var(--gc-ink); }
.gc-btn--accent:hover { background: var(--gc-ink); border-color: var(--gc-ink); color: #fff; }
.gc-btn .gc-ico { display: inline-block; width: 18px; height: 18px; margin: -4px 12px 0 0; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: square; stroke-linejoin: miter; }
.gc-dl__meta { margin: 22px 0 0 !important; font-family: var(--gc-font-head); font-size: 15px; color: #777; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .gc-doc-sec { padding: 40px 0 64px; }
  .gc-doc-wrap { padding: 0 12px; }
  .gc-viewer__bar { padding: 8px 8px 8px 14px; min-height: 56px; }
  .gc-viewer__name { display: none; }
  .gc-viewer__pageinfo { padding-left: 0; border-left: 0; }
  .gc-viewer__stage { height: 72vh; }
  .gc-viewer__pages { padding: 16px 10px 4px; }
  .gc-tool--zoom { min-width: 54px; }
  .gc-dl { margin-top: 40px; padding: 0 12px; }
  .gc-dl h2 { font-size: 26px; }
  .gc-dl__row .gc-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .gc-spin { animation-duration: 3s; }
}
@media print {
  .gc-viewer { display: none; }
}
