/* Article page base styles (page-specific only) */

/* Let header/footer span full width; constrain content via article container */
body {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: #333;
  background-color: #fafafa;
}

/* Content container */
article {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Content header (article top section) */
.header,
.article-header {
  text-align: left;
  margin-bottom: 10px;
  background: transparent;
  color: inherit;
  padding: 40px 20px 10px;
  border-radius: 10px;
}

.header > p:last-child,
.article-header > p:last-child { margin-bottom: 0; }

@media (min-width: 1024px) {
  .header,
  .article-header { padding-left: 260px; }
}

h1 {
  font-size: 2.5em;
  margin-bottom: 20px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.7), 0 2px 8px rgba(0,0,0,0.12);
}

h2 { color: #8B4513; border-bottom: 3px solid #DAA520; padding-bottom: 10px; margin-top: 40px; }
h3 { color: #B8860B; margin-top: 30px; }

/* Offset anchor jumps so headings sit ~220px below viewport top */
h2, h3 { scroll-margin-top: 220px; }

.image-container {
  margin: 30px 0;
  text-align: center;
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-container img { max-width: 100%; height: auto; border-radius: 8px; margin-bottom: 10px; }
.caption { font-style: italic; color: #666; font-size: 0.9em; margin-top: 10px; line-height: 1.4; }

.intro-image { width: 100%; max-height: 500px; object-fit: cover; }
.diagram-image { max-height: 600px; }
.equipment-image { max-height: 400px; }
.endoscopic-image { max-height: 450px; }

/* Embedded panorama viewer container */
.panorama-container {
  position: relative;
  aspect-ratio: 21 / 9; /* adjust if your panorama needs another ratio */
  width: 100%;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.panorama-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.two-column { display: flex; gap: 20px; margin: 30px 0; }
.two-column .image-container { flex: 1; }

.highlight-box {
  background: linear-gradient(135deg, #F4F4F4 0%, #E8E8E8 100%);
  border-left: 5px solid #DAA520;
  padding: 20px;
  margin: 20px 0;
  border-radius: 5px;
}

.references { background: #f8f8f8; padding: 20px; border-radius: 10px; margin-top: 40px; border: 1px solid #ddd; }

/* Header differences for article page only */
.brand-logo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  left: 28px;
  top: -20px;
  border: 14px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 48px rgba(21, 57, 68, 0.25);
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0) 58%, rgba(255,255,255,0.95) 80%);
}

footer {
  padding: 32px 28px 40px;
  text-align: center;
  color: rgba(21, 57, 68, 0.6);
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(21, 57, 68, 0.12);
}

footer p { margin: 6px 0; text-align: center; }

@media (max-width: 768px) {
  .two-column { flex-direction: column; }
  h1 { font-size: 2em; }
}

/* Shared image modal (mirrors home page) */
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 14, 26, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  z-index: 2000;
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.image-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.image-modal img {
  max-width: min(90vw, 1400px);
  max-height: min(90vh, 900px);
  border-radius: 28px;
  box-shadow: 0 40px 90px rgba(5, 8, 16, 0.6);
  border: 10px solid rgba(255, 255, 255, 0.92);
}

.image-modal button {
  position: absolute;
  top: 28px;
  right: 40px;
  background: rgba(255, 255, 255, 0.85);
  color: #0e2d34;
  border: none;
  font-size: 1.2rem;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 18px 36px rgba(5, 8, 16, 0.25);
}

/* Wikipedia preview modal (bottom third) */
.preview-modal {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 20px;
  height: 33vh;
  z-index: 3000;
  background: #ffffff;
  color: #0e2d34;
  border: 1px solid rgba(21, 57, 68, 0.12);
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(5, 8, 16, 0.25);
  display: none;
  overflow: auto;
}
.preview-modal.visible { display: block; }
.preview-close { position: absolute; top: 8px; right: 12px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: inherit; }
.preview-head { display: flex; gap: 12px; align-items: center; padding: 14px 16px 0; }
.preview-head img.preview-thumb { width: 60px; height: 60px; object-fit: cover; border-radius: 8px; }
.preview-title { font-weight: 700; }
.preview-desc { opacity: 0.85; }
.preview-body { padding: 8px 16px 8px; line-height: 1.45; }
.preview-foot { padding: 8px 16px 7px; font-size: 0.85em; color: #576b75; border-top: 1px solid rgba(21,57,68,0.08); }
.preview-foot a { color: inherit; text-decoration: underline; }

/* Dark mode variant */
body.dark-mode .preview-modal {
  background: var(--dm-surface-1);
  color: var(--dm-text-1);
  border-color: var(--dm-border);
  box-shadow: 0 22px 60px rgba(8, 15, 30, 0.5);
}
body.dark-mode .preview-foot { color: var(--dm-text-3); border-top-color: var(--dm-border); }

/* Compact pill link (matches About button style) */
.pill-link {
  display: inline-block;
  padding: 2px 10px; /* reduce height by 4px */
  border-radius: 999px;
  background: #DBEEF7;
  color: #0e2d34;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 20px rgba(86, 147, 212, 0.25);
}
.pill-link:hover { filter: brightness(0.98); }
