/* Sticky header that shrinks on scroll */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #06d001;
  transition: padding 200ms ease, box-shadow 200ms ease;
  padding: 18px 16px;
}
.site-header.shrink {
  padding: 8px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Slight visual shrink for nav items */
.main-nav .nav-list {
  display: flex;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  justify-content: center; /* center the nav items horizontally */
  align-items: center; /* vertically center within header */
}
.main-nav a {
  display: inline-block;
  width: auto; /* allow natural width for link text */
  height: auto;
  padding: 8px 12px; /* clickable area and visual spacing */
  background: transparent; /* remove block placeholder background */
  text-align: center;
  text-decoration: none;
  color: #000b58;
  font-size: 20px;
  line-height: 1;
  transition: font-size 200ms ease, padding 200ms ease,
    background-color 200ms ease;
  border-radius: 20px;
}
.main-nav a:hover {
  background-color: rgba(22, 255, 0, 0.3);
}
.main-nav a.active,
.main-nav a:hover {
  background-color: rgba(22, 255, 0, 0.3);
}
.site-header.shrink .main-nav a {
  font-size: 16px;
  padding: 6px 10px;
  /* keep any existing visual shrink behavior but applied to text */
}

/* Give each nav item a distinct font (no HTML changes required) */
.main-nav .nav-list li:nth-child(1) a {
  font-family: "Arial", "Helvetica", sans-serif;
}
.main-nav .nav-list li:nth-child(2) a {
  font-family: "Georgia", "Times New Roman", serif;
}
.main-nav .nav-list li:nth-child(3) a {
  font-family: "Courier New", Courier, monospace;
}
.main-nav .nav-list li:nth-child(4) a {
  font-family: "Palatino Linotype", "Book Antiqua", serif;
}

/* Keep layout stable */
body {
  margin: 0;
  font-family: "Courier New", Courier, monospace;
  /* prevent horizontal scrolling on mobile */
  overflow-x: hidden;
}

/* make all images safe to scale inside their containers */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ensure long URLs or words wrap instead of forcing horizontal scroll */
.block-text,
.top-block-content,
.footer-content,
.bio-content,
.text-content {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Top block above header (non-sticky); hides by sliding up */
.top-block {
  /* make visible and measurable */
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 200px;
  width: 100%;
  background: #f3ff90;
  padding: 10px 16px;
  padding-top: 32px;
  box-sizing: border-box;
  transition: transform 800ms cubic-bezier(0.4, 0, 0.2, 1),
    opacity 800ms cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
  opacity: 1;
  will-change: transform, opacity;
  /* ensure it sits above page content but below sticky header z-index */
  position: relative;
  z-index: 900;
  border-bottom: 1px solid #dde7ef;
  text-align: left;
}

.top-block-content {
  max-width: 800px;
  text-align: left;
  margin-top: 0;
}

.top-title {
  margin: 0 0 16px;
  font-size: 2.5em;
  color: #000b58;
  font-family: "Noto Sans", sans-serif;
}

.top-text {
  margin: 0;
  font-size: 1.2em;
  color: #333;
}

.block-text .divider {
  border: none;
  height: 2px;
  background: #000;
  margin: 1rem 0;
  width: 100%;
}

/* Hidden state: slide up and fade */
.top-block.hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Content blocks */
.content-block {
  min-height: 400px;
  padding: 60px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: left;
}

/* Layout for blocks: text + image with optional reverse order */
.content-block .block-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.content-block .block-text {
  flex: 1 1 0;
  order: 1;
  text-align: left;
}

.content-block .block-image {
  max-width: 40%;
  height: auto;
  order: 2;
  display: block;
}

/* Flip image/text when .reverse is present (image on left) */
.content-block .block-inner.reverse .block-text {
  order: 2;
  text-align: left;
}

.content-block .block-inner.reverse .block-image {
  order: 1;
}

/* Responsive: stack on mobile and tablet - images always after text */
@media (max-width: 1024px) {
  .content-block .block-inner {
    flex-direction: column;
    align-items: flex-start;
    /* ensure the inner wrapper respects the container padding and prevents images from touching edges */
    width: 100%;
    box-sizing: border-box;
    padding-left: 12px;
    padding-right: 12px;
  }
  .content-block .block-image {
    max-width: 100%;
    order: 2 !important; /* Always appear after text on mobile/tablet */
  }
  .content-block .block-text {
    text-align: left;
    order: 1 !important; /* Always appear first on mobile/tablet */
  }
  /* Override reverse order for mobile/tablet */
  .content-block .block-inner.reverse .block-text {
    order: 1 !important;
  }
  .content-block .block-inner.reverse .block-image {
    order: 2 !important;
  }
  /* make sure the overall block keeps side padding on smaller screens */
  .content-block {
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
  }
}

/* Add an extra small-screen rule to increase side padding for very narrow devices */
@media (max-width: 480px) {
  .content-block {
    padding-left: 22px;
    padding-right: 22px;
  }
  /* extra safe padding for blocks that felt flush to the edge */
  #block5 .block-inner,
  #block6 .block-inner {
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* Alternate background colors */
.content-block:nth-child(odd) {
  background: #f8f8f8;
}

.content-block:nth-child(even) {
  background: #ffffff;
}

/* Footer styles */
.site-footer {
  background: #333;
  color: white;
  padding: 40px 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.social-links {
  display: flex;
  gap: 16px;
}

.email-link,
.instagram-link {
  color: white;
  text-decoration: none;
  transition: color 0.3s ease;
}

.email-link:hover {
  color: #007bff;
}

.instagram-link:hover {
  color: #e1306c;
}

.email-link svg,
.instagram-link svg {
  width: 24px;
  height: 24px;
}

/* Make images larger for all content blocks */
#block1 .block-image,
#block2 .block-image,
#block3 .block-image,
#block4 .block-image,
#block5 .block-image,
#block6 .block-image {
  max-width: 60%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Ensure images stack to full width on mobile and tablet */
@media (max-width: 1024px) {
  #block1 .block-image,
  #block2 .block-image,
  #block3 .block-image,
  #block4 .block-image,
  #block5 .block-image,
  #block6 .block-image,
  #block7 .block-image {
    max-width: 100%;
  }
}

/* Lightbox styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2001;
}

#lightbox-image {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  cursor: pointer; /* indicate image is interactive (click to navigate) */
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: transparent;
  border: none;
  color: white;
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 200ms ease;
  z-index: 2002;
}

.lightbox-close:hover {
  opacity: 0.7;
}

/* Lightbox navigation arrows */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 48px;
  line-height: 1;
  cursor: pointer;
  padding: 20px 15px;
  width: auto;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 200ms ease, opacity 200ms ease;
  z-index: 2002;
  border-radius: 4px;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-nav:active {
  opacity: 0.7;
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

/* Responsive navigation buttons */
@media (max-width: 768px) {
  .lightbox-nav {
    font-size: 36px;
    padding: 15px 10px;
  }

  .lightbox-prev {
    left: 10px;
  }

  .lightbox-next {
    right: 10px;
  }
}

/* Make block images clickable */
.block-image {
  cursor: pointer;
  transition: opacity 200ms ease;
}

.block-image:hover {
  opacity: 0.9;
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
  overflow: hidden;
}

/* Biography page styles */
.bio-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

.biography {
  background: #fff;
  padding: 40px;
  border-radius: 4px;
}

.biography h3 {
  margin-top: 0;
  color: #000b58;
  font-size: 1.8em;
  margin-bottom: 1em;
}

.biography dl {
  margin: 0;
}

.biography dt {
  font-weight: bold;
  margin-top: 1em;
}

.biography dd {
  margin-left: 20px;
  margin-bottom: 0.5em;
}

/* Make box-sizing consistent so padding doesn't increase element width */
html,
body,
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Prevent any content block from producing horizontal overflow */
.content-block {
  max-width: 100%;
  overflow-x: hidden; /* guard against child elements that might overflow */
}

/* Ensure the inner wrapper never exceeds its container */
.content-block .block-inner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Allow flex children to shrink (prevents long text/images forcing overflow) */
.content-block .block-inner > * {
  min-width: 0;
}

/* Ensure block images never exceed their container and can shrink on narrow screens */
.content-block .block-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  min-width: 0;
}

/* Prevent horizontal touch panning on mobile (vertical scroll only) */
html,
body {
  touch-action: pan-y;
}

/* On small screens make block images explicitly full width */
@media (max-width: 480px) {
  .content-block .block-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
  }
}
