/* === GLOBAL STYLES === */
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
  background-color:  #FCFAF9;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden; /* prevents side-scrolling */
}

img {
  max-width: 100%;
  display: block;
  object-fit: contain;
}

.container {
  max-width: 1200px;
  padding: 0 1 rem;
  align-items: center;
  margin: 0 auto;
  width: 100%;
  text-align: center;
  display: flex;
  flex-direction: column;
}

/* === FONT STYLES === */
h1 {
  font-family: "Vidaloka", Arial, Helvetica, sans-serif;
  font-size: clamp(0.5rem, 3.5vw, 2rem);
  font-weight: 400;
  margin-top: 0;
}

p {
  font-size: clamp(0.5rem, 1.3vw, 2rem);
  font-family: 'Alegreya Sans', Helvetica, sans-serif;
  line-height: 1.6; 
}

sub {
  font-family: 'Alegreya Sans SC', Arial, Helvetica, sans-serif;
  font-size: clamp(0.5rem, 1.3vw, 2rem);
  padding-bottom: 1.5rem;
}

/* === SECTIONS === */
#main {
  padding: 5vw 12vw;
  background-color: #FCFAF9;
  color: #FCFAF9;
  text-align: center;
  font-size: 24px;
}

#work {
  padding: 9vw 6vw 5vw 6vw;
  background-color: #04AA6D;
  color: #FCFAF9;
  text-align: center;
}

.WorkTitle {
  padding-bottom: 2vw;
}

.work-spacer {
  padding-top: 5vw;
}

.work-section {
  display: none;
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
}

.work-section.active {
  display: block;
}

#About {
  padding: 5vw 10vw;
  background-color: #FCFAF9;
  color: #333;
  max-width: 900px;       /* constrain width */
  margin: 0 auto;         /* center horizontally */
  text-align: center;     /* center text */
}

#About img {
  display: block;        /* remove inline behavior */
  max-width: 80%;       /* scale down if needed */
  height: auto;          /* keep aspect ratio */
  margin: 0 auto;        /* center horizontally */
  object-fit: contain;   /* prevent cropping */
}

#documentary, #scripted, #socialmedia, #podcasts, #multimedia {
  font-size: 12px;
  text-align: left;
  color: #FCFAF9;
}

/* === NAVIGATION BAR === */
.nav-outer {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.nav-inner {
  background-color: #fff;
  opacity: 97%;
  border-bottom: 2px solid #333;
  padding: 20px;
}

.nav-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-title a {
  font-size: clamp(1rem, 3vw, 2rem);
  color: #333;
  text-decoration: none;
}

.nav-title a:hover,
.nav-links a:hover {
  color: #04AA6D;
}

.nav-subtitle,
.nav-links a {
  font-size: clamp(0.5rem, 1.1vw, 2rem);
  font-family: 'Alegreya Sans SC', Arial, Helvetica, sans-serif;
  color: #333;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-divider {
  width: 100%;
  height: 1.5px;
  background-color: #333;
  margin: 3.5px 0;
}

/* === Tabs === */
.tab-container {
  display: flex;
  position: relative;
}

.tab {
  font-family: 'Alegreya Sans SC', Arial, Helvetica, sans-serif;
  font-size: clamp(0.5rem, 1.1vw, 2rem);
  padding: 0.9rem 1rem;
  margin-right: -.2rem;
  border: 1px solid #333;
  border-radius: 10px 10px 0 0;
  background-color: #dddbdb;
  color: #333;
  cursor: pointer;
  transition: 0.3s ease;
}

.tab:hover,
.tab.active {
  background-color: #FCFAF9;
}

.tab.active {
  border-bottom: 1px solid #FCFAF9;
  color: #333;
  z-index: 2;
}

.tab-content {
  padding: 2rem;
  background-color: #FCFAF9;
  border: 1px solid #333;
  margin-top: -1px;
  border-radius: 0 0 10px 10px;
  width: 100%;           /* fill parent container */
  max-width: 1500px;     /* optional, matches .work-section */
  box-sizing: border-box; 
}

/* === GRID SECTIONS === */

/* Title and subtitle under each media item */
.grid-item .media-text {
  padding: 0.5rem 0;
  text-align: center;
  width: 100%;
}

.grid-item .media-title {
  font-family: 'Alegreya Sans', Arial, Helvetica, sans-serif;
  font-size: clamp(0.7rem, 1.5vw, 1.2rem);
  margin: 0;
  color: #333;
}

.grid-item .media-subtitle {
  font-family: 'Alegreya Sans', Arial, Helvetica, sans-serif;
  font-size: clamp(0.5rem, 1.1vw, 1rem);
  margin: 0;
  color: #333;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%; /* add this */
}

.grid-item {
  display: flex;
  flex-direction: column;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  grid-auto-rows: auto; /* let rows adjust to content */
}

.grid-item .responsive-video.portrait {
  width: 100%;        /* fill grid column width */
  height: auto;       /* height scales with aspect ratio */
  max-height: 500px;  /* optional: prevents extreme tall videos */
  position: relative; /* ensures absolute child stays inside */
}

/* Iframes inside portrait wrapper */
.grid-item .responsive-video.portrait iframe {
  width: 100% !important;
  height: 100% !important;
  position: relative !important; /* prevent spilling out */
  object-fit: contain;
}

/* === VIDEO / MEDIA STYLES === */
.responsive-video {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #000;
}

.responsive-video:not(.portrait) {
  aspect-ratio: 16 / 9;
}

.responsive-video.portrait {
  aspect-ratio: 9 / 16; /* vertical videos */
  position: relative;    /* keep relative for non-absolute children */
  height: auto;          /* allow natural height */
}

.responsive-video iframe,
.responsive-video video,
.responsive-video img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  object-fit: cover;
}

.responsive-video.portrait iframe,
.responsive-video.portrait video {
  position: relative; /* remove absolute */
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.responsive-video.portrait iframe,
.responsive-video.portrait video,
.responsive-video.portrait img {
  object-fit: contain;
  background: #000;
}

/* === LIGHTBOX === */
#lightbox {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 1000;
}

#lightbox-content {
  max-width: 90%;
  max-height: 70%;
  margin-bottom: 20px;
}

#lightbox-content video,
#lightbox-content img,
#lightbox-content iframe {
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
}

#lightbox-description {
  text-align: center;
  color: #ddd;
  max-width: 80%;
}

#lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 32px;
  color: #FCFAF9;
  background: none;
  border: none;
  cursor: pointer;
}

/* === CONTACT === */
#contact {
  padding: 8vw 12.5vw;
  background-color: #df5a25;
  color: #FCFAF9;
  border-top: 2px solid #333;
}

.contact-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 20px;
  flex-wrap: wrap;
}

.contact-content img {
  width: 170px;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}

/* === MEDIA QUERIES === */
@media (max-width: 900px) {
  .section-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  #contact {
    padding: 40px 5vw;
  }

  .contact-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .contact-text {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .section-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .section-grid {
    grid-template-columns: 1fr;
  }
}

/* Optional: adjust for smaller screens */
@media (max-width: 900px) {
  .grid-item.portrait {
    grid-row: span 1; /* let them behave like normal items on smaller screens */
  }
}