/* Base and Typography */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --link-color: #000000;
  --link-hover: #ff0000;
  --nav-width: 320px;
  --font-family: sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 12px;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
}

/* Layout System */
.layout {
  display: flex;
  min-height: 100vh;
}

/* Navigation / Sidebar */
.sidebar {
  width: var(--nav-width);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  padding: 20px 15px;
  background: var(--bg-color);
  overflow-y: auto;
  z-index: 100;
}

.logo img {
  max-width: 150px;
  margin-bottom: 20px;
}

.intro p {
  color: #666;
  margin-bottom: 40px;
  font-size: 12px;
}

.nav-links {
  list-style: none;
}

.nav-header {
  font-weight: bold;
  margin-bottom: 10px;
  font-size: 14px;
}

.nav-item {
  margin-bottom: 2px;
}

.nav-item a {
  font-size: 12px;
  color: #888888;
  transition: color 0.2s ease;
}

.nav-item a:hover {
  color: #000000;
}

.nav-item a.active {
  color: #ff0000;
}

.info-link {
  margin-top: 40px;
}

/* Main Content Area */
.content {
  margin-left: var(--nav-width);
  /* 
     Padding Setup for "Vertical Imaginary Line":
     Top: 40px
     Right: 0px (Allowing video to span to absolute right edge)
     Bottom: 60px
     Left: 60px (Creating the flush-left imaginary line)
  */
  padding: 20px 0 30px 30px;
  width: calc(100% - var(--nav-width));
  max-width: none;
}

.project-detail,
.info-detail {
  width: 100%;
}

.project-detail h2 {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 20px;
  padding-right: 60px;
  /* Keep title from touching right edge */
}

.home-container,
.info-detail {
  padding-right: 60px;
}

.info-detail h2 {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 20px;
}

.info-section {
  margin-bottom: 60px;
  padding-right: 60px;
}

.info-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  width: 100%;
}

.layout-large-laurels .info-col2 {
  flex: 0 0 500px;
}

.layout-large-laurels .info-col3 {
  flex: 1;
}

.layout-large-laurels .laurels-container {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 30px;
}

.layout-large-laurels .laurels-col img {
  transform: scale(1.75);
  transform-origin: left top;
}

.layout-large-laurels .laurels-container img {
  height: 140px;
  width: auto;
}

.info-col1 {
  flex: 0 1 320px;
  min-width: 250px;
  color: #444;
}

.info-col2 {
  flex: 1 1 250px;
  min-width: 250px;
  color: #444;
}

.info-col3 {
  flex: 0 0 120px;
}

.info-col2 p {
  margin-bottom: 1em;
}

.contact-single-column {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
  max-width: 600px;
}

.contact-block {
  width: 100%;
}

.contact-block h3 {
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 1em;
}

.laurels-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 0;
}

.laurels-container img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding-right: 60px;
  margin-bottom: 60px;
}

.gallery-grid.cols-4 {
  grid-template-columns: repeat(4, 1fr);
  align-items: start;
}

h2+.gallery-grid {
  margin-top: 20px;
}

.gallery-grid img {
  width: 100%;
  height: auto;
  display: block;
}

/* Gallery Justified */
.gallery-justified {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-right: 60px;
  margin-bottom: 60px;
}

h2+.gallery-justified {
  margin-top: 20px;
}

.gallery-item {
  /* wrapper flex properties set inline via Python */
  box-sizing: border-box;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-unscaled {
  margin-top: 20px;
}

.gallery-unscaled img {
  max-width: 100%;
  height: auto;
  display: block;
}

.gallery-fade {
  position: relative;
  width: 100%;
  margin-top: 20px;
  margin-bottom: 40px;
  overflow: hidden;
}

/* 
 * The 'ghost' element sits in the normal document flow and purely dictates the container height 
 * perfectly matching the aspect ratio of the slideshow without collapsing to 0 height.
 */
.gallery-fade .gallery-ghost {
  position: relative;
  width: 100%;
  height: auto;
  display: block;
  visibility: hidden;
}

.gallery-fade .gallery-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
}

/* Video */
.video-container {
  position: relative;
  width: 100%;
  /* Spans to absolute right edge */
  padding-bottom: 56.25%;
  /* 16:9 Aspect Ratio */
  height: 0;
  margin-bottom: 40px;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Responsive Mobile Layout */
@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
    padding: 20px;
    padding-bottom: 30px;
    z-index: 100;
  }

  /* Mobile Hamburger Wrapper overrides */
  nav ul {
    display: none;
    /* Hidden by default on mobile */
  }

  nav.mobile-open ul {
    display: block;
    /* Shown when toggled */
    margin-top: 20px;
  }

  .mobile-menu-btn {
    display: block;
    cursor: pointer;
    font-size: 14px;
    margin-top: 15px;
    color: var(--link-color);
  }

  .mobile-menu-btn:hover {
    color: var(--link-hover);
  }

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

  .project-detail h2,
  .info-section,
  .gallery-justified,
  .gallery-grid,
  .home-container,
  .info-detail {
    padding-right: 0;
  }

  .info-columns {
    flex-direction: column;
    gap: 30px;
  }

  /* Collapse grids to single column */
  .gallery-grid,
  .gallery-grid.cols-4 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Override precise text column widening */
  .info-col1,
  .info-col2,
  .info-col3 {
    flex: none;
    width: 100%;
    max-width: 100%;
  }
}

/* Hide mobile button natively on desktop */
@media (min-width: 769px) {
  .mobile-menu-btn {
    display: none;
  }
}