/* layout.css
   Clean, unified layout for the fixed sidebar + main content.
   
   IMPORTANT: This file NO LONGER defines CSS variables in :root!
   All variables are now centrally managed in theme.json and applied by theme.js.
   This prevents conflicts and ensures consistent variable resolution.
*/

/* Minimal base */
*{box-sizing:border-box}
html,body{
  height:100%;
  margin:0;
  padding:0;
  font-family:Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background:var(--bg, #ffffff);
  color:var(--text,#111827);
}


/* ---------- Layout structure ---------- */

/* Fixed left sidebar */
#navigation {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--nav-width);
  height: 100vh;
  background: var(--surface, #f3f4f6);
  border-right: 1px solid var(--border, rgba(0,0,0,0.04));
  padding: 10px 5px 10px 5px; 
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* To start buttons at the top */
  align-items: center; /* flex-start; */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  z-index: 100;
}

/* Main content wrapper */
main {
  padding-left: var(--nav-width);
  width: 100%;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Container limits width and centers content */
.container {
  min-height: 100vh;
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-right: var(--section-padding, 28px);
  padding-top: var(--section-padding, 28px);
  z-index: 1;
}

/* Page sections */
.page-section {
  max-width: var(--content-max-width);
  margin-left: auto;
  margin-right: auto;
  padding: var(--section-padding, 28px);
  margin-bottom: var(--section-gap, 48px);
}


/* ---------- Language switcher ---------- */
.language-switcher {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 999;  /* Always on top */
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.language-switcher button {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, rgba(0,0,0,0.06));
  background: var(--bg, white);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all var(--transition, 200ms ease-out);
}

.language-switcher button:hover {
  background: var(--primary, #0072B2);
  color: white;
  transform: translateY(-1px);
}

.language-switcher button:active {
  transform: translateY(0);
}


/* ---------- Hex navigation container ---------- */
.hex-list {
  width: 100%;
  display: block;
  position: relative;
  padding: 1px 1px 1px 1px;
}

/* Accessibility: Keep focus outlines visible */
.hex-btn:focus { 
  outline: 3px solid rgba(0,114,178,0.5);
  outline-offset: 2px;
}


/* ---------- Content Styling ---------- */

/* Project grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.project-card {
  background: var(--surface, #f3f4f6);
  border: 1px solid var(--border, rgba(0,0,0,0.08));
  border-radius: 8px;
  padding: 20px;
  transition: all var(--transition, 200ms ease-out);
}

.project-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.project-card strong {
  display: block;
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text, #111827);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  background: var(--primary, #0072B2);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Publications list */
.pub-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 20px;
}

.pub-item {
  padding: 16px;
  background: var(--surface, #f3f4f6);
  border-left: 3px solid var(--primary, #0072B2);
  border-radius: 4px;
}

.pub-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.pub-title a {
  color: var(--text, #111827);
  text-decoration: none;
  transition: color var(--transition, 200ms ease-out);
}

.pub-title a:hover {
  color: var(--primary, #0072B2);
}

.pub-meta {
  font-size: 0.9rem;
  color: var(--text-secondary, #6b7280);
}


/* ---------- Responsive - Mobile ---------- */
@media (max-width: 720px) {
  #navigation {
    position: static;
    width: 100%;
    height: auto;
    display: block;
    border-right: none;
    border-bottom: 1px solid var(--border, rgba(0,0,0,0.04));
    padding: 8px;
    overflow-x: auto;
    white-space: nowrap;
  }
  
  main { 
    padding-left: 0;
    padding-top: 12px; 
  }
  
  .container {
    margin-left: 0;
  }
  
  .hex-list { 
    display: flex; 
    flex-direction: row; 
    /* gap: 10px;  */
    align-items: center; 
    padding: 1px 1px 1px 1px;
  }
  
  .hex-item { 
    margin-bottom: 0; 
    margin-left: 0 !important;
    transform: none !important; 
  }

  .language-switcher {
    margin-top: 0;
    padding-top: 0;
  }
  
  .project-grid {
    grid-template-columns: 1fr;
  }
}