:root {
    --yellow:#eeaf61;
    --orange: #E77500;
    --red: #ee5d6c;
    --pink:#ce4993;
    --purple:#6a0d83;
    --tan: #f2b46f;
}
#Academics {
    background: #3d424a url(images/academics.jpg);
    background: image-set(url(images/academics.webp) type("image/webp"), url(images/academics.jpg) type("image/jpeg")) #3d424a;
    display: flex;
    width: 30.67vw;
    height: 57.33vh;
    position: absolute;
    bottom: 2vh;
    left: 34.6vw;
    background-size: cover;
    transition: transform 0.3s ease-in-out;
    border-radius: 15px; /* Rounds the corners */
    overflow: hidden;
    justify-content: center;
    align-items: center;
    background-position: center;
    will-change: transform;
}
#Demographics {
    background: #2b2f30 url(images/demographics.jpg);
    background: image-set(url(images/demographics.webp) type("image/webp"), url(images/demographics.jpg) type("image/jpeg")) #2b2f30;
    display: flex;
    position: absolute;
    top: 2vh;
    left: 2vw;
    width: 30.67vw;
    height: 61.33vh;
    background-size: cover;
    transition: transform 0.3s ease-in-out;
    border-radius: 15px; /* Rounds the corners */
    overflow: hidden;
    justify-content: center;
    align-items: center;
    background-position: center;
    will-change: transform;
}
#About {
    background: #3b3b36 url(images/about.jpg);
    background: image-set(url(images/about.webp) type("image/webp"), url(images/about.jpg) type("image/jpeg")) #3b3b36;
    display: flex;
    position: absolute;
    background-position: center;
    bottom: 2vh;
    right: 2vw;
    width: 30.67vw;
    height: 30.67vh;
    background-size: cover;
    transition: transform 0.3s ease-in-out;
    border-radius: 15px; /* Rounds the corners */
    overflow: hidden;
    justify-content: center;
    align-items: center;
    will-change: transform;
}
#Views {
    background: #383935 url(images/views.jpg);
    background: image-set(url(images/views.webp) type("image/webp"), url(images/views.jpg) type("image/jpeg")) #383935;
    position: absolute;
    display: flex;
    top: 2vh;
    right: 2vw;
    width: 30.67vw;
    height: 61.33vh;
    background-size: cover;
    transition: transform 0.3s ease-in-out;
    border-radius: 15px; /* Rounds the corners */
    overflow: hidden;
    justify-content: center;
    align-items: center;
    background-position: center;
    will-change: transform;
}
#After-Princeton {
    background: #2f2c26 url(images/after-princeton.jpg);
    background: image-set(url(images/after-princeton.webp) type("image/webp"), url(images/after-princeton.jpg) type("image/jpeg")) #2f2c26;
    display: flex;
    position: absolute;
    bottom: 2vh;
    left: 2vw;
    width: 30.67vw;
    height: 30.67vh;
    background-size: cover;
    transition: transform 0.3s ease-in-out;
    border-radius: 15px; /* Rounds the corners */
    overflow: hidden;
    justify-content: center;
    align-items: center;
    background-position: center;
    will-change: transform;
}
#College-Life {
  background: #484644 url(images/campus-life.jpg);
  background: image-set(url(images/campus-life.webp) type("image/webp"), url(images/campus-life.jpg) type("image/jpeg")) #484644;
  position: absolute;
  display: flex;
  top: 2vh;
  left: 34.6vw;
  width: 30.67vw;
  height: 34.67vh;
  background-size: cover;
  transition: transform 0.3s ease-in-out;
  border-radius: 15px; /* Rounds the corners */
  overflow: hidden;
  justify-content: center;
  align-items: center;
  background-position: center;
  will-change: transform;
}

/* Keep top-row landing cards below the fixed site nav */
body:has(#top-nav) #College-Life,
body:has(#top-nav) #Demographics,
body:has(#top-nav) #Views {
  top: calc(2vh + 2.75rem);
}

.card-container:hover .card {
  opacity: 0.6;
}

/* only hovered card is full opacity */
.card-container .card:hover {
  opacity: 1;
  z-index: 1;
}

#Academics:hover {
  transform: scale(1.06);
}
#Demographics:hover {
  transform: scale(1.06);
}
#About:hover {
  transform: scale(1.06);
}
#Views:hover {
  transform: scale(1.06);
}
#After-Princeton:hover {
  transform: scale(1.06);
}
#College-Life:hover {
  transform: scale(1.06);
}
#Academics h1, #Demographics h1, #About h1, #Views h1, #After-Princeton h1, #College-Life h1 {
    color: white;
    text-align: center;
    font-size: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Adds a shadow to the text */

}
@media screen and (max-width: 920px) {
  #College-Life, #Academics, #Views, #Demographics, #After-Princeton, #About {
      position: absolute;
      width: 94%;
      height: 30vh;
      left: 3%;
      right: 3%;
  }
}
@media screen and (max-width: 920px) {
  #welcome-text{
    position: absolute;
    top: 194vh;
  }
  
}
@media screen and (max-width: 920px) {
  #College-Life {
      top: 2vh;
  }
}
@media screen and (max-width: 920px) {
  #Academics {
      top: 34vh;
  }
}
@media screen and (max-width: 920px) {
  #Views {
      top: 66vh;
  }
}
@media screen and (max-width: 920px) {
  #Demographics {
      top: 98vh;
  }
}
@media screen and (max-width: 920px) {
  #After-Princeton {
      top: 130vh;
  }
}
@media screen and (max-width: 920px) {
  #About {
      top: 162vh;
  }
}
footer {

  background-color: #EFE5DA;
  color: black;
  text-align: center;
  padding: 0rem;
  font-size: large;
  z-index: 50;
  margin-top: 0;
}

html,body{
  margin: 0;
  padding: 0;
  font-family: franklin-gothic-urw, sans-serif, serif !important;
  scroll-behavior: smooth;
}

/* ---------------------------------------------------------------- */
/* Anti-flicker rules                                               */
/* ---------------------------------------------------------------- */

/* `<html class="preload">` is set by an inline <head> script on every
   page. We strip it once the page is settled. Both rules below only
   apply during that brief window and gracefully no-op for users with
   JS disabled. */

/* Suppress all transitions until the page has hydrated. Without this,
   some browsers replay an element's transitions from default state on
   first paint (the landing-page cards visibly "snap" into position). */
html.preload *,
html.preload *::before,
html.preload *::after {
    transition: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
}

/* Hide the section-container until the JS masonry pass runs. The CSS
   columns initial layout differs from the JS-driven flex layout, and
   each masonry rebuild after iframe loads moves nodes (which reloads
   any iframe inside them) — visibly flashing the charts. We just keep
   the container invisible until the first stable assignment is done. */
html.preload .section-container:not(.has-masonry):not(.masonry-bypass) {
    visibility: hidden;
}
@media screen and (max-width: 920px) {
    /* On mobile we render as a single column, so masonry never kicks
       in. Don't hide it on those viewports. */
    html.preload .section-container:not(.has-masonry):not(.masonry-bypass) {
        visibility: visible;
    }
}

.intro-buttons {
  display: flex;
  justify-content: center;
  align-items: center; 
  flex-direction: row; 
  gap: .4rem; 
  flex-wrap: wrap;
}
intro {
    width: 100%;
    min-height: 40vh;
    background-size: cover;
    background-position: center;
    text-align: center;
    color: white;
    font-size: 2rem;
   display:flex;
   flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 5%;
    margin: 0;
    overflow: hidden;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); /* Adds a shadow to the text */
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    
}
* {
  box-sizing: border-box;
}
#demo-intro {
  background-color: #2b2f30;
  background-image:
    linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    image-set(url('images/demographics.webp') type('image/webp'), url('images/demographics.jpg') type('image/jpeg'));
}
#life-intro {
  background-color: #484644;
  background-image:
    linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    image-set(url('images/campus-life.webp') type('image/webp'), url('images/campus-life.jpg') type('image/jpeg'));
}
#after-intro {
  background-color: #2f2c26;
  background-image:
    linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    image-set(url('images/after-princeton.webp') type('image/webp'), url('images/after-princeton.jpg') type('image/jpeg'));
}
#academics-intro {
  background-color: #3d424a;
  background-image:
    linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    image-set(url('images/academics.webp') type('image/webp'), url('images/academics.jpg') type('image/jpeg'));
}
#views-intro {
  background-color: #383935;
  background-image:
    linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
    image-set(url('images/views.webp') type('image/webp'), url('images/views.jpg') type('image/jpeg'));
}
#about-intro {
  background-color: #3b3b36;
  background-image:
    linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)),
    image-set(url('images/about.webp') type('image/webp'), url('images/about.jpg') type('image/jpeg'));
}

.credits-list {
  padding: 1rem 1.5rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #1a1a1a;
  text-align: left;
}

.credits-list strong {
  display: block;
  margin-top: 1rem;
  font-size: 1.05rem;
  color: var(--orange);
}

.credits-list ul {
  list-style-type: none;
  padding-left: 0;
  margin: 0.25rem 0 0.5rem 0;
}

.credits-list li {
  padding: 0.1rem 0;
}


section {
    margin: 0 0 1.5rem;
    background-color: #F5EAD9;
    color: black;
    padding: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}

.section-container.has-masonry section {
    margin: 0;
}

section > h2 {
    text-align: center;
    font-size: 1.75rem;
    margin: 0;
    padding: 1.25rem 1rem 0.75rem;
    color: #1a1a1a;
    background-color: #FBF6EC;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
    font-family: sofia-pro, sans-serif;
}

section > p {
    padding: 1rem 1.5rem;
    margin: 0;
    font-size: 1rem;
    line-height: 1.55;
    text-align: left;
    color: #1a1a1a;
}

/* Collapsible blurb (only applied to sections that have a graph-button-container) */
.blurb {
    position: relative;
    max-height: calc(1.55em * 3 + 1rem);
    overflow: hidden;
    padding-bottom: 0 !important;
    transition: max-height 0.35s ease;
}

.blurb::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.2em;
    background: linear-gradient(to bottom, rgba(245, 234, 217, 0), #F5EAD9 85%);
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.blurb.expanded {
    max-height: 200em;
    padding-bottom: 1rem !important;
}

.blurb.expanded::after {
    opacity: 0;
}

.blurb-toggle {
    align-self: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0.5rem auto 0.75rem;
    padding: 0;
    background-color: var(--orange);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
}

.blurb-toggle:hover {
    background-color: rgb(255, 160, 37);
}

.blurb-toggle.expanded {
    transform: rotate(180deg);
}

.button-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-direction: row;
    gap: 0.4rem;
    flex-wrap: wrap;
    width: 100%;
    height: auto;
}

.graph-display {
    width: 100%;
}

.graph {
    height: 100%;
    display: none;
}


.section-container {
    column-count: 2;
    column-gap: 3rem;
    padding: 1.5rem 4%;
    background-size: cover;
    background-position: center;
    text-align: left;
    color: black;
    background-color: #EFE5DA;
    width: 100%;
}

/* When JS upgrades to true masonry: switch from CSS columns to flex columns. */
.section-container.has-masonry {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    column-count: unset;
    column-gap: 1rem;
    align-items: flex-start;
}

.masonry-column {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media screen and (max-width: 920px) {
    .section-container.has-masonry {
        flex-direction: column;
    }
}
button {
  font-family: sofia-pro, sans-serif;
  border-width: 0px;
  border-radius: 1.5rem;
  width: fit-content;
  height: fit-content;
  padding-top: .3rem;
  padding-bottom: .3rem;
  background-color: var(--orange);
  padding-left: 1rem;
  padding-right: 1rem;
  font-size: large;

  cursor: pointer;
  color: black;
}


.graph-button-container {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem 1.25rem;
    width: 100%;
    height: auto;
}


.graph-button {
    background-color: #F4D9B1;
    color: #1a1a1a;
    font-size: 0.8rem;
    padding: 0.3rem 0.75rem;
    border-radius: 1.25rem;
}

.graph-button:hover {
    background-color: #EFC992;
}

.graph-button.active {
    background-color: var(--orange);
    color: #000;
}

.graph-button.active:hover {
    background-color: rgb(255, 160, 37);
}

@media screen and (max-width: 920px) {
    .section-container {
        column-count: 1;
        column-gap: 0;
        padding: 1rem;
    }
}
a {
  color: var(--orange);
  text-decoration: none;
}
button:hover {
  background-color: rgb(255, 160, 37);
}
/* Collapsible Nav Container */
.collapsible-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 50px; /* Collapsed width */
  background-color: transparent; /* Make background transparent when collapsed */
  border-right: none; /* Remove border when collapsed */
  transition: width 0.3s ease-in-out, background-color 0.3s ease-in-out, border-right 0.3s ease-in-out;
  overflow: hidden;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center; /* Center the arrow vertically */
  align-items: center;
}

/* Expanded state */
.collapsible-nav.expanded {
  background-color: var(--tan); /* Add background when expanded */
  border-right: 1px solid black; /* Add border when expanded */
  color: black;
}

/* Toggle Button */
.nav-toggle {
  position: relative;
  color:black;
 
   /* Centered within the container */
  width: 40px;
  height: 40px;
  background-color: var(--orange);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease-in-out;
}

/* Rotate the arrow when expanded */
.nav-toggle.expanded {
  transform: rotate(180deg);
}

/* Nav Content */
.nav-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
  gap: 1rem;
  opacity: 0; /* Hidden by default */
  transition: opacity 0.3s ease-in-out;
}

/* Show content when expanded */
.collapsible-nav.expanded .nav-content {
  opacity: 1;
}



/* for demo.html */
#hero {
  height: 80vh;
  margin: 0;
  padding: 0;
  background: url('https://www.princeton.edu//sites/default/files/images/2017/06/20060425_NassauHall_JJ_IMG_5973.jpg') center/cover no-repeat;
  background-color: transparent;
  transition: background-color 2s ease;
  border-radius: 0 !important;
}

#hero h1 {
  margin-bottom: 1rem;
}

#textBlock {
  font-size: 145%;
  text-align: center;
}

#intro-overlay {
    position: fixed;
    z-index: 9999;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #EFE5DA;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s ease;
    opacity: 1;
    pointer-events: all;
}

#intro-overlay h1 {
    font-size: 3rem;
    color: var(--orange, #e67e22);
    font-family: sofia-pro, sans-serif;
    letter-spacing: 2px;
}

body.intro-hidden #intro-overlay {
    opacity: 0;
    pointer-events: none;
}

body.intro-hidden #main-content {
    opacity: 1;
    transition: opacity 1s ease;
}

#main-content {
    opacity: 0;
    transition: opacity 1s ease;
}