/* Reset-ish */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { overflow: hidden; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

/* Page split: 35 / 65 */
.page{
  height: 100vh;
  display: grid;
  grid-template-columns: 35% 65%;
}

/* LEFT SIDEBAR split: 50 / 50 */
.sidebar{
  height: 100vh;
  display: grid;
  grid-template-rows: 55% 45%;
  padding: 24px;
  background: #fff;
}

/* Top half content */
.sidebar-top{
  overflow: hidden; /* keeps the whole page from scrolling */
}


.site-title{
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 500;
}

.meta{
  margin: 0 0 12px 0;
  font-size: 14px;
  line-height: 1.3;
}

.meta a{
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blurb, .bio-text{
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
}

/* Bottom half navigation */
.sidebar-bottom{
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* nav starts at top of bottom half */
  gap: 10px;
  padding-top: 8px;
  overflow: hidden;
}

.nav-link{
  font-size: 14px;
  color: inherit;
  text-decoration: none;
}

.nav-link:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}

.index-main{
  height: 100vh;
  overflow: hidden;
  background: #fff;

  padding: 24px;      
  display: flex;
  align-items: start;
  justify-content: center;
}



.main-top{
  overflow: hidden; 
  justify-self: center;
} 


.main{
  padding: 24px;          /* keep this */
  display: grid;
  grid-template-rows: 60% 40%;
  height: 100vh;
  overflow: hidden;

  align-content: stretch;
  justify-content: stretch;
}

.main-top,
.main-bottom{
  min-height: 0;
  min-width: 0;
}

.main-bottom{
  
  min-height: 0;
  min-width: 0;
  padding-top: 24px;
  overflow-y: auto;

 
  scrollbar-width: none;         
  -ms-overflow-style: none;       
}

.main-bottom::-webkit-scrollbar{
  display: none;                
}

/* THIS is the key */
.main-top{
  overflow: hidden;
  display: flex;
  align-items: center;     /* vertical alignment inside the 40% row */
  justify-content: center; /* horizontal alignment */
}




.hero-image{
  width: 100%;
  height: 100%;
  object-fit: scale-down;
  display: block;
}

.resident-portrait{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: 100%;
  object-fit: contain;
  display: block;
}

.site-title-link{
  color: inherit;
  text-decoration: none;
}

.site-title-link:hover,
.site-title-link:visited,
.site-title-link:active,
.site-title-link:focus{
  color: inherit;
  text-decoration: none;
}



/* Group wrapper */
.nav-group{
  margin-bottom: 0;
}

/* Top-level link (Residentes) */
.nav-link{
  font-size: 14px;
  color: inherit;
  text-decoration: none;
}

.nav-link:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Sublist */
.nav-panel{
  margin-top: 10px;
  padding-left: 12px;

  display: none;
}

.nav-group.is-open .nav-panel{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Resident links */
.nav-sublink{
  font-size: 14px;
  color: inherit;
  text-decoration: none;
}

.nav-sublink:hover{
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Active resident */
.is-active{
  font-weight: 600;
}


@media (max-width: 700px){
  /* Let the page scroll on phones */
  body{
    overflow: auto;
  }

  /* Stack layout: sidebar on top, content below */
  .page{
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  /* Sidebar becomes a normal block, not 55/45 split */
  .sidebar{
    height: auto;
    grid-template-rows: auto auto;
    padding: 18px;
  }

  /* Don’t clip text on mobile */
  .sidebar-top{
    overflow: visible;
  }

  /* Navigation: keep as a column, but make it breathe */
  .sidebar-bottom{
    overflow: visible;
    padding-top: 16px;
    gap: 8px;
  }

  /* Optional: make resident list 2 columns to save vertical space */
  .nav-panel{
    padding-left: 12px;
  }

  /* .nav-group.is-open .nav-panel{
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
    row-gap: 8px;
  } */

   .nav-group.is-open .nav-panel{
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* Main content: follow below, natural scrolling */
  .main{
    height: auto;
    overflow: visible;
    padding: 18px;
    grid-template-rows: auto auto;
    row-gap: 16px;
  }

   .index-main{
    height: auto;
    overflow: visible;
    padding: 12px;
    grid-template-rows: auto auto;
    row-gap: 16px;
  }

  /* Image: responsive, not forced into 40% of viewport */
  .main-top{
    overflow: visible;
    display: block;
  }

  .resident-portrait,
  .hero-image{
    width: 100%;
    height: auto;
  
    object-fit: contain;
  }

 .resident-portrait {
    max-height: 70vh;   
 }

  /* Bio text should not be trapped in a scroll box on mobile */
  .main-bottom{
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 700px){
  .meta, .blurb{ font-size: 12px; line-height: 1.35; }
}