/* =======================================
   This is the main css file for the 
   layout and other things
   ======================================= */
:root{
  /* Palette */
  --bg:#ffffff;
  --surface:#ffffff;
  --text:#0a2540;
  --muted:#536579;
  --line:#e6edf5;
  --brand:#1d71b8;
  --brand-dark:#0b5494;
  --panel:#eaf3ff;           
  --panel-strong:#d7e6fb;   
  --people-photo-w: 101px;
  --people-photo-h: 130px;  

  /* Shape & depth */
  --radius:20px;              
  --radius-sm:14px;
  --shadow:0 2px 10px rgba(2,6,23,.03); 
  --shadow-hover:0 6px 20px rgba(2,6,23,.06);

  /* Type scale */
  --h1: clamp(28px, 3.2vw, 40px);
  --h2: clamp(20px, 2.2vw, 26px);
  --h3: 20px;
  --footer-h2: clamp(18px, 2.2vw, 22px);

  /* Spacing */
  --space-1:8px; --space-2:12px; --space-3:16px; --space-4:20px; --space-5:24px; --space-6:28px; --space-7:32px;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: var(--bg); color: var(--text); line-height: 1.65; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover{ text-decoration: underline; }
:focus-visible{ outline: 3px solid rgba(29,113,184,.3); outline-offset: 2px; border-radius: 8px; }
p {font-size: 18px; text-align: justify;}
.course-li {font-size: 17px;}

/* ===== Page Container ===== */
.page { max-width: 1250px; margin: var(--space-6) auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: clip; }
.inner { padding: var(--space-6); }

/* ===== Header & Nav ===== */

/* ==== Header with explicit grid areas ==== */
.header{
  display:grid;
  grid-template-columns:auto 1fr auto;   /* logo | brand | toggler */
  grid-template-rows:auto auto;
  grid-template-areas:
    "logo brand toggler"
    "nav  nav   nav";
  align-items:center;
  gap:12px;
  padding: var(--space-6);
  padding-bottom:0;
}

.header .logo{
  grid-area: logo;
  justify-self: start !important;   /* overrides any previous right align */
  margin: 0;
}

/* Place each item in the grid */
.logo         { grid-area: logo; justify-self: start; }
.brand-center { grid-area: brand; justify-self: center; text-align: center; line-height: 1.1; white-space: nowrap; }
.menu-btn,
.menu-toggle  { grid-area: toggler; justify-self: end; }
.menu-overlay { grid-area: toggler; } /* overlay is fixed later; area just keeps DOM near control */
.navbar       { grid-area: nav; }

/* Brand styles */
.brand-center .brand-main {
  font-weight: 800;
  letter-spacing: .2px;
  font-size: clamp(20px, 4.2vw, 26px);
  color: var(--brand-dark);
}
.brand-center .brand-sub {
  margin-top: 2px;
  font-weight: 700;
  letter-spacing: .2px;
  font-size: clamp(14px, 3.6vw, 16px);
  color: var(--muted);
}

/* Logo sizing (keeps it visible across breakpoints) */
.logo-img {
  height: clamp(36px, 7vw, 48px);
  width: auto;
  display: block;
}

/* Navbar centered under the header */
.navbar { margin-top: var(--space-3); border-top: 0; }
.navbar .nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;          /* <-- center the menu */
  gap: 10px 16px;
  padding: 12px 0;
}

/* Make sure overlays don't hide the logo/brand */
.menu-overlay { position: fixed; inset: 0; display: none; }





.logo { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 700; letter-spacing:.2px; color: var(--brand-dark); }
/* .logo-mark { width: 44px; height: 44px; border-radius: 10px; background: var(--brand); } */
/* .logo-mark { width: 20%; height: 32%;} */

.navbar { margin-top: var(--space-3); border-top: 0px solid var(--line);}



/* === Carousel (JS-driven, robust) === */
.carousel {
  width: 100%;
  aspect-ratio: 945 / 354;      
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.slides {
  display: flex;
  height: 100%;
  transform: translateX(0);
  transition: transform .6s ease-in-out; 
  will-change: transform;
}

.slide {
  flex: 0 0 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #f4f7fb;        
}

.slide img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;          
  object-position: center;
  display: block;
}

/* Optional: smaller heights on narrow screens if you want to override ratio */
@media (max-width: 900px) { .carousel { aspect-ratio: 16 / 6; } }
@media (max-width: 560px) { .carousel { aspect-ratio: 16 / 8; } }




/* ===== Hero Title ===== */
.title-block { text-align: center; padding: var(--space-7) 10px var(--space-4); }
.title-block h2 { font-size: var(--h1); margin: 0; color: var(--brand-dark); letter-spacing:.2px; }
.title-block p { color: var(--muted); margin-top: 8px; font-size: 18px; }

/* ===== Two-Column Layout ===== */
.two-col { display: grid; grid-template-columns: 1.65fr 1fr; gap: var(--space-5); align-items: start; }

/* ===== Card System (polished) ===== */
.card { background: var(--panel); border: 1px solid var(--panel-strong); border-radius: var(--radius); padding: var(--space-5); transition: box-shadow .2s ease, transform .16s ease; }
.card:hover{ box-shadow: var(--shadow-hover); transform: translateY(-1px); }

/* Header pill that sits inside the card like a tab */
.card h3 {
  --pill-pad-x: 14px; --pill-pad-y: 8px;
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 var(--space-3);
  padding: var(--pill-pad-y) var(--pill-pad-x);
  background: #f5faff; border: 1px solid var(--panel-strong);
  border-radius: 999px; color: var(--brand-dark); font-size: var(--h3); font-weight: 700;
}
.card h3::before{ content:""; width: 8px; height: 8px; border-radius: 999px; background: var(--brand); }

.card > p, .card > ul, .card > div { color: var(--text); opacity: .9; }
.muted { color: var(--muted); }
.stack { display: grid; gap: var(--space-5); }

/* Elegant list styling */
.list { margin:12px 0 0 0; padding-left: 0; list-style: none; }
.list li{ position: relative; padding-left: 22px; margin: 8px 0; }
.list li::before{ content:""; position:absolute; left:0; top:10px; width: 8px; height: 8px; border-radius: 2px; background: var(--brand); }

/* News column links with chevrons */
.news h3 { margin-bottom: var(--space-2); }
.news-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.news-list a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--panel-strong); background: #f7fbff; color: var(--brand-dark); transition: background .18s ease, transform .12s ease; }
.news-list a::after{ content:"›"; font-size: 18px; line-height: 1; color: var(--brand-dark); opacity:.7; }
.news-list a:hover { background:#eff6ff; transform: translateY(-1px); text-decoration: none; }

/* ===== Footer ===== */
.footer { margin-top: var(--space-6); padding: var(--space-6); border-top: 1px solid var(--line); background: var(--surface); }
.footgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-5); }
.footgrid h4 { margin: 0 0 10px; font-size: var(--footer-h2); color: var(--brand-dark); }
.footgrid a { display:block; color: var(--muted); padding: 6px 0; }
.footgrid a:hover{ color: var(--brand-dark); text-decoration: underline; }
.copyright { margin-top: var(--space-4); color:#6a7b8a; font-size: 14px; text-align: center; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .inner{ padding: var(--space-5); }
  .two-col { grid-template-columns: 1fr; }
  .carousel{ height: 300px; }
}
@media (max-width: 600px) {
  .nav { gap: 10px; }
  .carousel{ height: 220px; }
  .footgrid { grid-template-columns: 1fr; }
}


/* contact_us page css */
.contact-block { margin-top: 8px; }
.ph { border: 1px dashed var(--line); border-radius: 12px; padding: 12px; }
.map-placeholder { height: 220px; display: grid; place-items: center; color: var(--muted); }

/* [styles.css] — base contact layout */
.contact-dl { display: grid; gap: 12px; margin-top: 8px; }
.contact-dl .row { display: grid; grid-template-columns: 200px 1fr; gap: 12px; align-items: start; }
.contact-dl dt { font-weight: 600; font-size: 18px; }
.contact-dl dd { margin: 0; font-size: 17px; }
.addr { font-style: normal; line-height: 1.6; }
.small-note { margin-top: 12px; }
@media (max-width: 700px){
  .contact-dl .row { grid-template-columns: 1fr; }
}


/* [styles.css] — minimal base defaults for nav block */
.has-sub { margin: 0; }
.submenu { margin: 0; }




/* [styles.css] — grid fix + mobile stacking */
.layout-sidebar {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr); /* allow content to shrink */
  gap: 20px;
  align-items: start;
}

/* ensure grid children can shrink and not clip text */
.layout-sidebar > * { min-width: 0; }
.content { min-width: 0; }

/* MOBILE: stack sidebar above content, both full-width */
@media (max-width: 1000px) {
  .layout-sidebar {
    grid-template-columns: 1fr;   
  }
  .sidebar-slot {                 
    order: 0;
    grid-column: 1 / -1;         
  }
  .content {
    order: 1;
    grid-column: 1 / -1;         
  }
}

/* [styles.css] Fixed-header, scrollable table for colloquiums */
.table-wrap.fixed-head {
  max-height: 480px;         
  overflow: auto;             
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

/* Table layout */
.colloq-table {
  width: 100%;
  min-width: 720px;          
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;        
}

.colloq-table th,
.colloq-table td {
  padding: 10px 12px;
  vertical-align: top;
  text-align: left;
  background: #fff;
  word-wrap: break-word;
}

/* Sticky header (the 2-cell group row) */
.colloq-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Column widths */
.colloq-table .col-date   { width: 140px; }
.colloq-table .col-speaker{ width: 24%;   }
.colloq-table .col-title  { width: 20%;   }
.colloq-table .col-meta   { width: 40%;   }

.colloq-table .col-date-seminar-pre  { width: 12%; }
.colloq-table .col-speaker-seminar-pre{ width: 25%;   }
.colloq-table .col-title-seminar-pre { width: 50%;   }

/* Row stripes */
.colloq-table tbody tr:nth-child(even) td { background: #f9fbff; }

/* Make sure grid column can shrink (prevents clipping) */
.layout-sidebar > * { min-width: 0; }
.content { min-width: 0; }

/* [styles.css] — Modal base layout */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none;                 
}
.modal.is-open { display: block; }

.modal__overlay {
  position: absolute; inset: 0;
  background: rgba(6,16,31,0.45);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.modal__panel {
  position: relative;
  margin: 40px auto;
  max-width: 860px;
  width: calc(100% - 32px);
  max-height: calc(100% - 80px);
  overflow: hidden;
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.modal__content {
  display: grid; gap: 10px;
  padding: 18px 20px;
  overflow: hidden;
}

.modal__title { margin: 0 0 4px; font-size: 20px; }

.modal__body {
  overflow: auto;                
  padding-right: 4px;           
  max-height: 65vh;              
}

.modal__close {
  position: absolute; top: 10px; right: 10px;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff;
  cursor: pointer; font-size: 18px; line-height: 1;
}

/* Mobile tweaks */
@media (max-width: 640px) {
  .modal__panel { margin: 16px auto; max-height: calc(100% - 32px); }
  .modal__content { padding: 14px 14px 16px; }
  .modal__title { font-size: 18px; }
}

/* [styles.css] — People list base layout */
.people-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.person-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.person-photo {
  width: var(--people-photo-w);
  height: var(--people-photo-h);
  object-fit: contain;          /* ← no cropping */
  object-position: center;      /* center within the frame */
  background: #fff;             /* looks clean behind white studio photos */
  border-radius: 12px;
  display: block;
}


/* Utilities */
.photo--cover { object-fit: cover; }
.photo--top   { object-position: 50% 20%; }  /* slight top bias if needed */
.photo--center{ object-position: center;   } /* default */

.person-meta { min-width: 0; }

.person-name { margin: 0 0 6px; font-size: 20px; }
.person-name a { text-decoration: none; }

/* Definition list for fields */
.person-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr; /* office, ext, user on one row */
  gap: 10px 14px;
  margin: 6px 0 0 0;
}
.person-fields > div { display: grid; gap: 4px; min-width: 0; }
.person-fields dt { font-weight: 600; font-size: 15px; color: var(--muted); }
.person-fields dd { margin: 0; word-break: break-word; }

/* Full-width rows (research, homepage) */
.person-fields .full {
  grid-column: 1 / -1;
}

/* Research tags (unstyled; polish in pro-styles) */
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }

/* Responsive */
@media (max-width: 900px) {
  .person-card { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .person-photo { width: 96px; height: 96px; border-radius: 10px; }
  .person-fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) {
  .person-card { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
  .person-photo { width: 72px; height: 72px; border-radius: 9px; }
  .person-fields { grid-template-columns: 1fr; }
}

/* Visitors table column sizing (inherits colloq-table look) */
.visitors-table { min-width: 760px; }   /* enables horizontal scroll on small screens */
.visitors-table .col-name   { width: 28%; }
.visitors-table .col-affil  { width: 18%; }
.visitors-table .col-period { width: 18%; }
.visitors-table .col-host   { width: 20%; }

/* Fix table resposiveness */
/* Regular tables: keep them inside the card and enable horizontal scroll on small screens */
.table-wrap {
  display: block;          /* ensures it can scroll */
  width: 100%;
  overflow: visible;       /* default on desktop */
}

/* Table base: keep a sensible min width so columns don't crush */
.colloq-table,
.visitors-table,
.table-wrap > table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;     /* tidy truncation/wrapping */
}

/* Mobile: allow sideways scroll if the table is wider than the card */
@media (max-width: 900px) {
  .table-wrap {
    overflow-x: auto;              /* ← horizontal scroll within the card */
    -webkit-overflow-scrolling: touch;
  }
  .colloq-table,
  .visitors-table,
  .table-wrap > table {
    min-width: 720px;              /* adjust to your content (680–760 works too) */
  }
}
/* Publications → Studies table sizing */
.studies-table { min-width: 680px; }         /* keeps columns readable; your mobile patch will allow horizontal scroll */
.studies-table .col-title { width: 62%; }
.studies-table .col-meta  { width: 38%; }


/* Publications → Lectures table sizing */
.lectures-table { min-width: 920px; }   /* wider than others due to 5 cols */
.lectures-table .col-sn     { width: 64px; }   /* small serial number */
.lectures-table .col-title  { width: 40%; }
.lectures-table .col-author { width: 20%; }
.lectures-table .col-dist-in{ width: 18%; }
.lectures-table .col-dist-out{ width: 18%; }

.table-wrap--scroll{
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap--scroll > table{ max-width: 100%; }


/* Optional: make sure the card itself doesn't clip the scrolling area */
.content.card { overflow: visible; }   /* safe for non-sticky tables */

/* Desktop defaults (prevents mobile drawer styles from leaking) */
@media (min-width: 901px){
  .navbar{ position: static; inset: auto; width: auto; pointer-events:auto; z-index:auto; }
  .navbar .nav{
    display:flex !important;
    flex-direction: row !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .menu-overlay{ display:none !important; }
}


.header{ position: relative; z-index: 100; }
.menu-btn{ z-index: 70; }
.menu-overlay{ z-index: 40; }
.navbar{ z-index: 60; }



.header .logo{ grid-area: logo; justify-self:start !important; }
.brand-center{ grid-area: brand; justify-self:center; text-align:center; }
.menu-btn,.menu-toggle{ grid-area: toggler; justify-self:end; }
.navbar{ grid-area: nav; }

/* === DESKTOP (>=901px) reset to inline nav === */
@media (min-width: 901px){
  .navbar{ position:static !important; inset:auto !important; width:auto !important;
           pointer-events:auto !important; z-index:auto !important; }
  .navbar .nav{
    display:flex !important;
    flex-direction:row !important;
    flex-wrap:wrap !important;
    justify-content:center !important;
    align-items:center !important;
    gap:10px 16px !important;
    padding:12px 0 !important;
    transform:none !important;
    opacity:1 !important;
    height:auto !important;
    box-shadow:none !important;
    background:transparent !important;
    border:none !important;
    border-radius:0 !important;
  }
  .menu-overlay{ display:none !important; }
}
