
/* Modal close button for image overlay */
#modal-close-btn.modal-close {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 10001;
  background: rgba(255,255,255,0.98);
  color: #092859;
  font-size: 2.5rem;
  font-weight: bold;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  cursor: pointer;
  user-select: none;
  border: 1px solid #e5e7eb;
  pointer-events: auto;
  opacity: 1;
  transition: background 0.15s;
}

/* Modal enlarged image: preserve proportions and fit in viewport */
#modal-enlarged-image {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  margin: auto;
  z-index: 10000;
  display: block;
}
#modal-close-btn.modal-close:hover {
  background: #ffe066;
  color: #092859;
}


/* Rotate cue for mobile image magnifier */
.rotate-cue {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255,255,255,0.92);
  color: #092859;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: 1.5em;
  padding: 0.35em 1.2em 0.35em 1.2em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  letter-spacing: 0.02em;
  pointer-events: auto;
  z-index: 100000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s;
  cursor: pointer;
  user-select: none;
  display: block;
}
.rotate-cue.visible {
  display: block;
  opacity: 1;
  visibility: visible;
}

/* Fullscreen landscape image for mobile magnifier */
.fullscreen-landscape-img {
  /* Remove fixed/fullscreen, let overlay handle centering */
  position: static !important;
  margin: 0 !important;
  z-index: 99998;
  /* background: #fff;  Remove white bg for black overlay */
  object-fit: contain;
  /* Remove box-shadow trick, overlay handles bg */
  border-radius: 0 !important;
  max-width: 100%;
  max-height: 100%;
  width: auto !important;
  height: auto !important;
  transition: transform 0.2s, width 0.2s, height 0.2s;
  display: block;
}

.fullscreen-landscape-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 99999;
  background: rgba(255,255,255,0.98);
  color: #092859;
  font-size: 2.2rem;
  font-weight: bold;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  user-select: none;
  border: 1px solid #e5e7eb;
  /* Always visible on top regardless of orientation */
  pointer-events: auto;
  opacity: 1;
}

/* Reminder: For proper viewport scaling on mobile, ensure your HTML includes:
   <meta name="viewport" content="width=device-width, initial-scale=1">
   (CSS cannot set viewport, but this reminder enforces mobile scaling best practices.)
*/


/* Base styles */
body {
  font-family: 'Roboto', sans-serif;
  font-size: clamp(1rem, 1vw + 0.6rem, 1.125rem);
  line-height: 1.6;
}

/* Section text defaults */
section p {
  font-size: clamp(1.125rem, 1vw + 0.5rem, 1.25rem);
  line-height: 1.6;
}

/* Medium screens (tablets) */
@media (max-width: 1024px) {
  .grid.md\:grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

/* Small screens (mobiles) */
@media (max-width: 768px) {
  /* Force stacking of image and text */
  .grid, .md\:grid-cols-2 {
    display: block !important;
  }
  .order-1, .order-2 {
    order: unset !important;
  }

  /* Minimum readable font sizes for mobile */
  body {
    font-size: 1.08rem !important;
  }
  h1 { font-size: 2rem !important; }
  h2 { font-size: 1.75rem !important; }
  h3 { font-size: 1.375rem !important; }
  section p, p, li, a { font-size: 1.125rem !important; }
}

/* Paragraphs and inline text */
p, li, a {
  font-size: clamp(1.125rem, 1vw + 0.5rem, 1.25rem);
  line-height: 1.6;
}

/* Headings — stronger overrides, always after body defaults */
h3 {
  font-size: clamp(1.375rem, 2vw + 0.5rem, 1.5rem) !important;
  line-height: 1.3;
  font-weight: 600;
}
h2 {
  font-size: clamp(1.75rem, 3vw + 0.5rem, 2rem) !important;
  line-height: 1.25;
  font-weight: 600;
}
h1 {
  font-size: clamp(2rem, 4vw + 0.5rem, 2.75rem) !important;
  line-height: 1.2;
  font-weight: 700;
}

/* Sophia goddess visibility controlled by document direction */
#sophia-ltr, #sophia-rtl { display: none; }
html[dir="ltr"] #sophia-ltr { display: block; }
html[dir="rtl"] #sophia-rtl { display: block; }

/* Always hide goddess on very small screens */
@media (max-width: 639px) {
  html[dir="ltr"] #sophia-ltr,
  html[dir="rtl"] #sophia-rtl { display: none !important; }
}



/* Mobile magnifier fullscreen overlay container */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}