/* General Styling */
html {
  height: 100%;
  background: linear-gradient(-70deg, #000200, #400101, #1d0606, #E82422, #D92414);
  background-size: 400% 800%;
  animation: gradientBG 20s ease infinite;
  color: #ffffff;
}

body {
  margin: 0;
  font-size: 20px;
  font-family: Arial, sans-serif;
  color: #ffffff;
}

/* Ensure sections center and provide safe padding */
section {
  width: 100%;
  box-sizing: border-box;
  padding: 40px 24px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Introduction Section */
.intro-section {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 100px);
  padding: 20px;
  margin-top: -50px;
}

.intro-content {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: -30px;
}

.intro-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.intro-photo:hover {
  transform: scale(1.02);
}

.intro-box {
  max-width: 600px;
  position: relative;
}

.intro-box h1 {
  font-size: 36px;
  margin-bottom: 10px;
}

.intro-box p {
  font-size: 18px;
  line-height: 1.6;
}

/* Learning Outcomes Section */
.learning-outcomes-section {
  text-align: center;
  padding: 50px 20px;
}

.learning-outcomes-section h2 {
  font-size: 28px;
  margin-bottom: 20px;
}

.section-learning-outcomes {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.section-learning-outcomes a {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 150px;
  height: 100px;
  background-color: #333;
  color: white;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
  text-align: center;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.section-learning-outcomes a:hover {
  transform: scale(1.1);
  background-color: #555;
  color: red;
}

.projects-section h2 {
  font-size: 28px;
  margin-bottom: 20px;
}

/* Simple 2-column info-box: text left, media middle-right, responsive stack */
.info-box {
  display: flex;
  gap: 28px;
  align-items: center;
  background: rgba(51,51,51,0.92);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(232,36,34,0.06);
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  max-width: 1200px;
  width: calc(100% - 48px);
  margin: 20px auto;
  color: #eaeaea;
  box-sizing: border-box;
  min-width: 0;
}

/* left content column */
.info-box__content {
  flex: 1 1 auto;
  min-width: 0; /* allows children to shrink */
}

/* title and summary */
.info-box__title {
  margin: 0 0 8px 0;
  font-size: 22px;
  color: #fff;
}
.info-box__summary {
  margin: 0 0 12px 0;
  color: #d3d3d3;
  line-height: 1.6;
}

/* expandable content */
.info-box__more {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 380ms ease, opacity 260ms ease;
  color: #cfcfcf;
  margin-top: 6px;
}
.info-box.expanded .info-box__more {
  opacity: 1;
  /* JS sets exact max-height for animation; fallback prevents huge overflow */
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

/* show more button */
.info-box__toggle {
  display: inline-block;
  margin-top: 12px;
  background: linear-gradient(90deg, rgba(232,36,34,0.95), rgba(220,80,80,0.9));
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

/* media column */
.info-box__media {
  width: 420px;
  max-width: 40%;
  flex: 0 0 420px;
  height: 260px;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  position: relative;
}

.info-box__media img {
  max-width: 100% !important;;
  max-height: 100% !important;;
  width: auto !important;;
  height: auto;
  display: block;
}

/* Fullscreen button overlay for info-box media */
.info-box__fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  z-index: 50;
  transition: transform .12s ease, background .12s ease;
}
.info-box__fullscreen-btn:hover { transform: translateY(-2px); background: rgba(0,0,0,0.65); }

/* Close button shown in fallback overlay */
.info-box__fullscreen-close {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  z-index: 51;
}

/* Fallback overlay class for media when native fullscreen isn't available */
.info-box__media.media-fullscreen-active {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  border-radius: 0 !important;
  padding: 24px !important;
  z-index: 1400 !important;
  background: rgba(0,0,0,0.92) !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
}

/* Make inner image fit inside overlay (fallback) */
.info-box__media.media-fullscreen-active img,
.info-box__media.media-fullscreen-active picture,
.info-box__media.media-fullscreen-active iframe,
.info-box__media.media-fullscreen-active video {
  width: auto !important;
  height: auto !important;
  max-width: calc(100% - 56px) !important;
  max-height: calc(100% - 56px) !important;
  object-fit: contain !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7) !important;
}

/* Subtle close hint in fallback */
.info-box__media.media-fullscreen-active::after {
  content: "Press ESC or click outside to close";
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  z-index: 1401;
}

/* interactive cursors for zoom & pan */
.media-interactive { cursor: grab; touch-action: none; user-select: none; -webkit-user-drag: none; }
.media-interactive.grabbing { cursor: grabbing; }

/* body no-scroll to avoid layout shift on overlay/fullscreen */
body.no-scroll { overflow: hidden; }

/* keep transforms responsive */
.info-box__media img, 
.info-box__media video, 
.info-box__media iframe {
  transition: transform 0.05s linear;
  will-change: transform;
}

/* optional: make the fullscreen button slightly larger on hover */
.info-box__fullscreen-btn:hover { transform: scale(1.05); }

/* images & iframes scale safely */
.info-box__media img,
.info-box__media iframe,
.info-box__media picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: 100%;
}

/* ensure text wraps inside column */
.info-box__title,
.info-box__summary,
.info-box__more p,
.info-box__content * {
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

/* Responsive: stack columns on smaller screens */
@media (max-width: 900px) {
  .info-box {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 18px;
    width: calc(100% - 36px);
  }
  .info-box__media {
    width: 100%;
    max-width: 100%;
    height: 220px;
    flex: none;
  }
  .info-box__toggle { width: 100%; text-align: center; }
}

/* Very small screens: keep everything readable */
@media (max-width: 480px) {
  section { padding: 20px 12px; }
  .info-box { padding: 16px; gap: 12px; }
  .info-box__media { height: 200px; }
  .info-box__toggle { padding: 12px; }
}

/* Navigation & Sidebar */
nav ul,
ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 15px;
}

a {
  text-decoration: none;
  color: inherit;
}

li {
  transition: font-size 0.3s ease;
}

li:hover {
  color: rgb(255, 0, 0);
  font-size: 24px;
}

/* Sidebar styling */
.sidebar {
  height: 100%;
  width: 250px;
  position: fixed;
  top: 0;
  right: 0;
  background-color: #333;
  overflow-x: hidden;
  transition: transform 0.3s ease;
  transform: translateX(250px);
  z-index: 1000;
}

.sidebar a {
  padding: 10px 15px;
  font-size: 18px;
  color: white;
  display: block;
  transition: 0.3s;
}

.sidebar a:hover {
  background-color: #575757;
  color: #ff0000;
}

.close-btn {
  position: absolute;
  top: 0;
  left: 10px;
  background-color: transparent;
  color: white;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.open-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #333;
  color: white;
  border-radius: 10px;
  padding: 10px 15px;
  transition: transform 0.3s ease, background-color 0.3s ease;
  cursor: pointer;
  z-index: 1001;
}

.open-btn:hover {
  background-color: #575757;
  transform: scale(1.1);
}

main {
  transition: margin-right 0.3s ease;
  margin-right: 0;
}

.title-sidebar {
  font-family: 'Arial', sans-serif;
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ffffff;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 20px;
  background-color: #333;
  color: white;
}

/* Home Button Styling */
.home-btn {
  position: fixed;
  top: 20px;
  left: 20px;
  background-color: #333;
  color: white;
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, background-color 0.3s ease;
  z-index: 1001;
}

.home-btn:hover {
  background-color: #575757;
  transform: scale(1.1);
}

/* Dropdown Styles */
.dropdown-toggle {
  background-color: #E82422;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-top: 10px;
}

.dropdown-toggle:hover {
  background-color: #D92414;
  transform: scale(1.05);
}

.dropdown-content {
  display: none; /* hidden by default */
  position: fixed;
  z-index: 1200; /* above other page elements */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%); /* center vertically & horizontally */
  width: min(900px, 90vw); /* adapt to screen size */
  max-width: 900px;
  max-height: 80vh; /* avoid off-screen vertical overflow */
  overflow-y: auto;
  box-sizing: border-box;
  background-color: rgba(34,34,34,0.96);
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(.22,.9,.28,1);
}

/* Prevent page jump while dropdown open */
body.no-scroll {
  overflow: hidden;
  /* don't change width/height: padding-right toggled in JS to account for scrollbar width */
}

/* On smaller screens, pin near top and give appropriate spacing */
@media (max-width: 900px) {
  .dropdown-content {
    left: 50%;
    top: 12vh;
    transform: translateX(-50%); /* don't center vertically on narrow screens */
    width: calc(100% - 40px);
    max-width: calc(100% - 40px);
    max-height: calc(100vh - 20vh);
    padding: 18px;
  }
}

/* On very small screens make it full width with small margins */
@media (max-width: 480px) {
  .dropdown-content {
    left: 10px;
    right: 10px;
    transform: none;
    top: 10vh;
    width: calc(100% - 20px);
    max-width: none;
    border-radius: 8px;
    padding: 14px;
  }
}

.dropdown-content p {
  font-size: 18px;
  line-height: 1.6;
  color: #ffffff;
  margin: 10px 0;
}

.dropdown-content.open {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1); /* center + stable scale */
}

/* Ensure the button group is lower z-index than dropdown */
.button-group {
  position: relative;
  z-index: 1100;
  transition: transform .35s cubic-bezier(.22,.9,.28,1), opacity .25s ease, filter .25s ease;
}

/* When a dropdown is open, hide/move the buttons so they don't obstruct content */
.button-group.buttons-hidden {
  transform: translateY(80px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  filter: blur(3px) saturate(.9);
}

/* Slightly reduce dropdown width for very small screens to avoid overflow */
.dropdown-content p {
  word-wrap: break-word;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Page Title */
.page-title {
  font-family: 'Arial', sans-serif;
  text-align: center;
  font-size: 36px;
  font-weight: bold;
  margin-top: 20px;
  margin-bottom: 30px;
  color: #ffffff;
}

.glowing-title {
  text-align: center;
  font-size: 70px;
  font-weight: bold;
  color: #ffffff;
  margin: 40px 0 20px 0;
}

/* Remove the zoom-in cursors from info-box__more images (no inline zoom) */
.info-box__more img {
  cursor: pointer; /* open fullscreen overlay instead */
  max-width: 100%;
  height: auto;
  display: block;
  margin: 12px 0;
  transition: transform 160ms ease;
}

/* overlay for full-screen image view (reused by movies/iframes) */
.image-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
  z-index: 2200;
  padding: 24px;
}
.image-overlay.open { display: flex; }
.image-overlay__img {
  max-width: calc(100% - 56px);
  max-height: calc(100% - 56px);
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: grab;
  transition: transform 0.05s linear;
}
.image-overlay__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2201;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

/* make figure media's fullscreen icon style consistent */
.info-box__fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.06);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  z-index: 50;
}

/* interactive classes for overlay */
.media-interactive { cursor: grab; touch-action: none; user-select: none; }
.media-interactive.grabbing { cursor: grabbing; }

/* Keep body from scrolling while overlay is open */
body.no-scroll { overflow: hidden !important; }


 /* Make only #readingGuide look like a centered larger overlay when opened */
        .dropdown-content#readingGuide {
          /* hidden by default — your JS toggle should add/remove .open */
          display: none;
          position: fixed !important;
          left: 50% !important;
          top: 6vh !important;
          transform: translateX(-50%) !important;
          width: min(1200px, 96vw) !important;   /* larger width */
          max-width: 1400px !important;
          height: calc(88vh) !important;         /* tall for PDFs */
          padding: 18px !important;
          z-index: 2200 !important;
          overflow: hidden !important;
          background: rgba(34,34,34,0.96) !important;
          border-radius: 12px !important;
          box-shadow: 0 18px 48px rgba(0,0,0,0.55) !important;
          box-sizing: border-box !important;
        }

        /* Show as overlay when open */
        .dropdown-content#readingGuide.open {
          display: block;
        }

        /* Make iframe fill the overlay area */
        .dropdown-content#readingGuide .reading-guide-inner {
          width: 100%;
          height: 100%;
          box-sizing: border-box;
          display: flex;
          flex-direction: column;
          gap: 8px;
        }

        .dropdown-content#readingGuide iframe {
          width: 100%;
          height: 100%;
          border: 0;
          display: block;
          border-radius: 8px;
          background: #000;
        }

        /* Close button stays visible */
        .dropdown-content#readingGuide .close-dropdown-btn {
          position: absolute;
          top: 12px;
          right: 12px;
          z-index: 2221;
        }

        /* Prevent background scroll while reading guide is open */
        body.reading-guide-open {
          overflow: hidden;
          padding-right: calc(var(--scrollbar-width, 0px));
        }

        /* Small screens: make it almost full screen but still padded */
        @media (max-width: 900px) {
          .dropdown-content#readingGuide {
            left: 50% !important;
            transform: translateX(-50%) !important;
            top: 2vh !important;
            width: calc(100vw - 24px) !important;
            height: calc(96vh) !important;
            padding: 12px !important;
          }
        }