/* https://coolors.co/palette/faebd7-daa520-2f4f4f */
:root {
  --background-color: rgb(47, 79, 79);
  --border-color: rgb(250, 235, 215);
  --highlight-color: rgb(218, 165, 32);
}


body {
  background-color: var(--background-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  margin: 0px;
  overflow: hidden;
}

* {
  box-sizing: border-box;
}

h1, h2, h3, a, p, span, strong {
  font-family: "Rubik", sans-serif;
  font-weight: 400;
  color: white;
  margin: 0px;
}

strong {
    font-weight: 600
}

a {
  text-decoration: none;
}

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

nav {
  display: flex;
  width: 100%;
  border-bottom: 1px solid var(--border-color);
}

nav .nav-section {
  padding: 3rem 2rem;
  display: flex;
  gap: 1rem;
  border-left: 1px solid var(--border-color);
  align-items: center;
  justify-content: center;
}

#nav-mobile-section {
  display: flex;
  flex-basis: calc(100% * (2 / 3));
  z-index: 2;
}

#nav-toggle-button { 
  align-items: center;
  background-color: transparent;
  border: none;
  border-left: 1px solid var(--border-color);
  color: white;
  cursor: pointer;
  display: none;
  gap: 0.8rem;
  height: 100%;
  justify-content: center;
  outline: none;
  padding: 0rem 3rem;
  position: relative;
  z-index: 3;
}

#nav-toggle-button:hover,
#nav-toggle-button:hover > span {
  color: var(--highlight-color);
}

#nav-toggle-button > span,
#nav-toggle-button > i { 
  display: inline-block;
  height: 1rem;
  line-height: 1rem;
}

#nav-social-section,
#nav-contact-section {
  flex-grow: 1;
}

#nav-logo-section {
  flex-basis: calc(100% / 3);
  justify-content: flex-start;
}

#nav-logo-section > a > i {
  font-size: 2.5rem;
}

#nav-link-section {
  flex-basis: 50%;
  gap: 6rem; 
}

#nav-social-section {
  gap: 3rem;
}

main {
  flex-grow: 1;
  position: relative;
  overflow: hidden;
  min-height: 70vh; /* reserve viewport space to reduce CLS when media loads */
}

main > article {
  height: 100%;
  width: 100%;
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: minmax(300px, 2fr) minmax(200px, 1fr);
  position: absolute;
  left: 0px;
  top: 0px;
  transition: transform 400ms ease;  
  overflow: hidden; /* prevent content spillover during resize */
}

main > article[data-status="inactive"] {
  transform: translateX(-100%);
  transition: none;
}

main > article[data-status="active"] {
  transform: translateX(0%);
}

main > article[data-status="before"] {
  transform: translateX(-100%);
}

main > article[data-status="after"] {
  transform: translateX(100%);
}

main > article[data-status="becoming-active-from-before"] {
  transform: translateX(-100%);
  transition: none;
}

main > article[data-status="becoming-active-from-after"] {
  transform: translateX(100%);
  transition: none;
}

main > article > .article-section {
  height: 100%;
  display: flex;
}

main > article > .article-description-section,
main > article > .article-nav-section {
  border-left: 1px solid var(--border-color);
  overflow: hidden; /* prevent overflow during resize */
}

main > article > .article-title-section,
main > article > .article-nav-section {
  border-top: 1px solid var(--border-color);
}


.article-image-section {
  overflow: hidden;
  /* Reserve a consistent media box so images/videos don't change the grid shape */
  aspect-ratio: 16 / 9;
  min-height: 360px;          /* reasonable minimum for desktop */
  max-height: 70vh;          /* won't exceed most viewports */
  width: 100%;
  display: block;
}

.article-image-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-image-section video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

main > article > .article-description-section {
  flex-direction: column;
  justify-content: flex-end;
  padding: 4rem; 
  min-height: 220px;
  overflow-y: auto;
  max-height: 100%;
}

@media (min-width:1201px) {
    main > article {
    /* Constrain the description row to match the cap */
    grid-template-rows: minmax(300px, 2fr) minmax(120px, 0.75fr);
  }


  main > article > .article-description-section{
  flex-direction: column;
  justify-content: flex-start;
  padding: 4rem;

  /* 🔧 NEW: make it scrollable when content overflows */
  max-height: 100vh; /* cap height; adjust as needed */
  overflow-y: auto;
  overflow-x: hidden;
  align-items: flex-start; /* start from top */
}}



main > article > .article-description-section > p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.25em;
}

main > article > .article-description-section > p  > a:hover {
  text-decoration: underline;
}

main > article > .article-title-section {
  align-items: center; 
  justify-content: space-between;
  padding: 2rem 4rem;
  min-height: 120px; /* keep title area stable between slides */
  overflow: hidden; /* prevent overflow during resize */
}

main > article > .article-title-section * {
  color: white;
}

main > article > .article-title-section > h2 {
  flex-basis: 50%;
  font-family: "Montserrat", sans-serif;
  font-size: 3.5rem;
  line-height: 3rem;
  margin: 0px;
  text-transform: uppercase;
}

main > article > .article-title-section > i {
  color: rgba(255, 255, 255, 0.75);
  font-size:  4rem;
}

main > article > .article-nav-section > .article-nav-button {
  background-color: transparent;
  flex-grow: 1;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, 0.75);
  font-size: 3rem;
  cursor: pointer;
}

main > article > .article-nav-section > .article-nav-button:hover {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--highlight-color);
}

main > article > .article-nav-section > .article-nav-button:nth-child(2) {
  border-left: 1px solid var(--border-color);
}

@media(max-width: 1200px) {    
  #nav-mobile-section {
    flex-basis: calc(100% * 0.75);
  }

  #nav-logo-section {
    flex-basis: calc(100% * 0.25);
  }
  
  #nav-link-section {
    flex-basis: calc(100% / 3);
    gap: 3rem;
  }

  main {
    overflow-y: auto;
  }
  
  main > article {
    grid-template-columns: none;
    grid-template-rows: minmax(300px, 1.5fr) minmax(200px, 0.75fr) minmax(150px, 0.75fr) minmax(100px, 0.25fr);
    height: max(800px, 100%);
  }
   
  main > article > .article-title-section > h2 {
    font-size: 3rem; 
    line-height: 2.6rem;
  }
  
  main > article > .article-title-section > i {
    font-size: 3rem; 
  }
  
  main > article > .article-description-section,
  main > article > .article-nav-section {
    border-left: none;
  }

  main > article > .article-image-section {
    order: 1;
  }
  
  main > article > .article-title-section {
    border-bottom: 1px solid var(--border-color);
    order: 2;
  }
  
  main > article > .article-description-section {
    justify-content: center;
    order: 3;
  }
  
  main > article > .article-nav-section {
    border-bottom: 1px solid var(--border-color);
    order: 4;
  }
}

@media(max-width: 1200px) {  
  main {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
  }
  nav {
    justify-content: space-between;  
  }
  
  nav[data-toggled="true"] > #nav-mobile-section {  
    transform: translateY(0%);
  }

  nav[data-toggled="true"] > #nav-toggle-button {
    border-left: none;
  }

  nav[data-transitionable="true"] > #nav-mobile-section {
    transition: transform 400ms ease;
  }
  
  nav .nav-section {
    border-left: none;
    padding: 1.5rem 1rem;
  }
  
  #nav-logo-section > a > i {
    font-size: 1.5rem;
    margin-left: 1rem;
  }
  
  #nav-mobile-section {
    background-color: var(--background-color);
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: fixed;
    transform: translateY(-100%);
  } 
  
  #nav-toggle-button {
    display: flex;
  }  
  
  #nav-link-section {
    flex-basis: 60%;
    flex-direction: column;
    gap: 4rem;
  }
  
  #nav-link-section > a {
    font-size: 3rem; 
  }
  
  #nav-social-section > a {
    font-size: 2rem; 
  }  
  
  #nav-contact-section {
    padding-bottom: 4rem;
  }
  
  main > article {
    /* grid-template-rows: 1fr repeat(4, 0.5fr); */
    grid-template-rows: auto auto auto auto;
    height: max(700px, 100%);
    display: grid;
    min-height: 100vh;
    top: 0;
    height: auto;
    overflow-y: auto;
    scroll-snap-align: none;
  }
  
  main > article > .article-title-section {
    padding: 2rem;
  }
  
  main > article > .article-title-section > h2 {
    flex-basis: 60%;
    font-size: 1.5em; 
    line-height: 1.5;
  }
  
  main > article > .article-title-section > i {
    font-size: 2rem; 
  }
  
  main > article > .article-description-section {
    padding: 2rem;
  }
  
  main > article > .article-description-section > p {
    font-size: 1rem;
  }

  main > article > .article-nav-section {
    flex-grow: 0;
    flex-shrink: 0;
    min-height: 5rem; /* minimum vertical tap target area */
    position: sticky;
    bottom: 0;
    background-color: var(--background-color); /* match page bg to hide overlap */
    border-top: 1px solid var(--border-color);
  }

  main > article > .article-nav-section > .article-nav-button {
    font-size: 2.5rem;
    padding: 0.75rem;
    min-width: 5rem;
    min-height: 5rem;
  }
}

main > article > .article-description-section > p  > .source-link {
  color: var(--highlight-color);
  display: inline;
}

main > article .yt-link,
main > article .yt-link > i {
  color: var(--yt-color);
  display: inline;
}

.tools {
  margin-top: 1.5rem;
}

.tools strong {
  display: block;
  margin-bottom: 0.75rem;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #888;
}

.tools-logos {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.tools-logos img {
  height: 32px;
  width: auto;
  opacity: 0.75;
  transition: opacity 200ms ease, transform 200ms ease;
}

.tools-logos a:hover img {
  opacity: 1;
  transform: translateY(-2px);
}


.references {
  margin-top: 1.5rem;
}

.references ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.references li::marker {
  content: "→ ";
  color: #888
}

.video-wrapper {
  position: relative; /* establishes positioning context */
  display: inline-block; /* shrink-wrap to video size */
  overflow: hidden;
  width: 100%;
  height: 100%;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-wrapper a.video-copyright {
  position: absolute;
  bottom: 5px;   
  right: 5px; 
  color: rgba(200, 200, 200, 0.8);
  font-size: 14px;
  text-decoration: none;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
}

.video-wrapper a.video-copyright:hover {
  color: #fff;
}

.image-wrapper {
  position: relative;  /* overlay context for the copyright */
  width: 100%;
  height: 100%;
  display: inline-block;
  overflow: hidden;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* fill container, crop as needed */
  display: block;
}

.image-wrapper a.image-copyright {
  position: absolute;
  bottom: 5px;        /* distance from bottom */
  right: 5px;         /* distance from right */
  color: rgba(200,200,200,0.8);
  font-size: 14px;
  text-decoration: none;
  background-color: rgba(0,0,0,0.3); /* optional readability */
  padding: 2px 6px;
  border-radius: 3px;
}

.image-wrapper a.image-copyright:hover {
  color: #fff;
}


.tooltip {
  position: relative;
  display: inline-block;
  cursor: pointer;
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: max-content;
  background-color: rgba(0,0,0,0.8);
  color: #fff;
  text-align: center;
  padding: 4px 8px;
  border-radius: 4px;
  position: absolute;
  bottom: 125%; /* above the link */
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
  white-space: nowrap;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}


.article-description-section::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1.5rem;
  background: linear-gradient(to bottom, transparent, var(--background-color));
  pointer-events: none;
}