/* =========================
   GLOBAL STYLES
========================= */
body {
  display: flex;
  justify-content: center;
  background-color: #f7f5f0;
  color: #222;
  font-family: Helvetica, Arial, sans-serif;
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
  display: flex;
  max-width: 1200px;
  width: 100%;
  gap: 40px;
  box-sizing: border-box;
}

/* =========================
   SIDEBAR
========================= */
.sidebar {
  width: 260px;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 20px;
  background-color: inherit;
  align-items: flex-start;
}

.site-title {
  font-weight: bold;
  margin-top: 5px;
  margin-bottom: 25px;
  text-align: right;
  width: 240px;
}

.portrait {
  width: 240px;
  height: 240px;
  object-fit: cover;
  border-radius: 0px;
  margin-top: -20px;
  margin-bottom: 5px;
  align-self: flex-start;
}

.nav ul {
  list-style: none;
  padding: 0;
  margin: 30px 0 0 0;
  width: 100%;
}

.nav li {
  margin-bottom: 10px;
}

.nav a {
  text-decoration: none;
  color: inherit;
  font-size: 1.5rem;
}

.nav a.active {
  font-weight: bold;
  text-decoration: underline;
}

/* =========================
   LIGHT/DARK MODE TOGGLE
========================= */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: none;
  border: 1px solid #222;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 2px;
  z-index: 1000;
  font-weight: bold;
}
body.dark-mode .theme-toggle {
  border-color: #f7f5f0;
  color: #f7f5f0; /* makes the "Dark Mode" text white */
}

/* =========================
   MAIN CONTENT
========================= */
.content {
  flex: 1;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  gap: 80px;
}

.entry {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
}

.entry.left img.entry-image {
  width: 580px;   
  max-width: 100%; 
  height: auto;    
  border-radius: 0px;
}

.entry-text {
  flex: 1;
  max-width: 45%;
}

.entry-title {
  font-weight: bold;
  font-size: 1.3rem;
  margin: 0 0 5px 0;
}

.entry-year {
  font-weight: bold;
  margin: 0 0 10px 0;
}

.entry-description {
  font-weight: normal;
  line-height: 1.4;
}

.entry-video {
  width: 580px;
  height: auto;
  border-radius: 0px;
  display: block;
  margin: 0 auto 20px auto;
  flex-shrink: 0;
}

/* =========================
   MODAL OVERLAY
========================= */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(255, 255, 255, 0.3); /* light mode transparent overlay */
  transition: background-color 0.3s ease;
}

body.dark-mode .modal {
  background-color: rgba(32, 32, 32, 0.8); /* dark mode transparent overlay */
}

/* =========================
   MODAL CONTENT
========================= */
.modal-content {
  background-color: rgba(255, 255, 255, 0.95); /* slightly transparent white box */
  border-radius: 0px;
  margin: 60px auto;
  padding: 20px;
  width: 80%;
  max-width: 900px;
  position: relative;
  transition: background-color 0.3s ease;
}

body.dark-mode .modal-content {
  background-color: rgba(40, 40, 40, 0.95); /* slightly transparent dark grey box */
}

/* =========================
   CLOSE BUTTON
========================= */
.close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 20; /* ensures it's above images */
  color: #222;
}

body.dark-mode .close {
  color: #f7f5f0;
}

/* =========================
   CAROUSEL
========================= */
.carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Main image */
#carousel-main {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 10px;
  display: block;
}

/* Arrows */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.arrow:hover {
  background-color: rgba(255, 255, 255, 0.8);
  color: rgba(0, 0, 0, 0.9);
}

.left-arrow { left: 10px; }
.right-arrow { right: 10px; }

/* =========================
   THUMBNAILS
========================= */
#carousel-thumbnails {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

#carousel-thumbnails img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 0px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#carousel-thumbnails img.active {
  opacity: 1;
  transform: scale(1.05);
}

/* Close button on top of everything */
.close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  z-index: 20; /* above arrows and main image */
}

.gallery {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* =========================
   DARK MODE
========================= */
body.dark-mode {
  background-color: #1f1f1f;
  color: #f7f5f0;
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
  .container {
    flex-direction: column;
    max-width: 100%;
    gap: 0;
    align-items: center;
  }

  .sidebar {
    position: relative;
    width: 100%;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    top: 0;
    padding: 10px 20px;
  }

  .portrait {
    width: 80px;
    height: 80px;
    margin-bottom: 0;
  }

  .content {
    margin-left: 0;
    padding: 20px;
  }

  .entry {
    flex-direction: column;
    align-items: center;
  }

  .entry-text, .entry img.entry-image {
    max-width: 100%;
  }
}

/* =========================
   MODAL CAROUSEL
========================= */
.carousel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Main image */
#carousel-main {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  border-radius: 0px;
  margin-bottom: 10px;
  display: block;
  position: relative;
  z-index: 5; /* below close button */
}

/* Arrows */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  background: rgba(0,0,0,0.4); 
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10; /* below close button */
}

.left-arrow { left: 10px; }
.right-arrow { right: 10px; }

.arrow:hover {
  background-color: rgba(255,255,255,0.8);
  color: rgba(0,0,0,0.9);
}

/* Thumbnails */
#carousel-thumbnails {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

#carousel-thumbnails img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 0px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#carousel-thumbnails img.active {
  opacity: 1;
  transform: scale(1.05);
}
/* Match arrow style from Home / Animation pages */
#prev, #next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  background: rgba(0,0,0,0.4);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

/* Specific positions */
#prev { left: 10px; }
#next { right: 10px; }

#prev:hover, #next:hover {
  background-color: rgba(255,255,255,0.8);
  color: rgba(0,0,0,0.9);
}

/* Simple lightbox */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.6); /* light transparent overlay */
  backdrop-filter: blur(2px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.lightbox-img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  cursor: pointer;
  color: black;
  font-weight: bold;
}

/* Hover scale for illustration images */
.entry-image {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: zoom-in;
}

.entry-image:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

.about-text {
  font-size: 1rem;           /* text size */
  line-height: 1.5;          /* space between lines */
  color: #222;               /* text color */
  max-width: 500px;          /* limit paragraph width */
  margin: -7 auto;            /* center on the page */
}

/* Hide profile portrait on screens 768px and smaller */
@media (max-width: 768px) {
  .sidebar img.portrait,
  .sidebar > img {
    display: none !important;
  }
}
img {
  border-radius: 0 !important;
}
