/* ========================================
   SOLID STATE IONICS LAB — MAIN STYLESHEET
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ── */
:root {
  --primary-blue: #003366;
  --primary-blue-dark: #002244;
  --accent-gold: #D4AF37;
  --text-dark: #1a202c;
  --text-body: #4a5568;
  --text-muted: #64748b;
  --text-maroon: #6F0202;
  --text-green: #1a7a04;
  --border-light: #e2e8f0;
  --bg-white: #ffffff;
  --bg-light: #f8fafc;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,51,102,0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  background-color: var(--bg-white);
  color: var(--text-body);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-blue); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-blue-dark); }

img { max-width: 100%; height: auto; display: block; }

p { margin-bottom: 1rem; color: var(--text-body); font-size: 1rem; line-height: 1.8; }
p:last-child { margin-bottom: 0; }

/* ── Layout ── */
.wrapper { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── HEADER / NAV ── */
.site-header {
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

/* Row 1: brand centred */
.header-brand-row {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 24px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Branding (logo + text) */
.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.header-brand:hover { opacity: 0.85; }
.header-brand svg   { flex-shrink: 0; }

.brand-text { line-height: 1.2; }

.brand-text .brand-title {
  display: block;
  color: var(--primary-blue);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-text .brand-sub {
  display: block;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 400;
}

/* Hamburger — hidden on desktop */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
  flex-shrink: 0;
}

.nav-toggle:hover { background: var(--bg-light); }

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary-blue);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Row 2: Nav strip (desktop) */
#siteNav {
  border-top: 1px solid var(--border-light);
  background: var(--bg-light);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  list-style: none;
  padding: 6px 0;
  margin: 0;
  flex-wrap: nowrap;
}

.nav-links li { display: inline-flex; }

.nav-links a {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 5px 10px;
  border-radius: 20px;
  white-space: nowrap;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-blue);
  background: rgba(0,51,102,0.08);
}

.nav-links a.active { font-weight: 700; }

/* ── MAIN CONTENT ── */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── SECTION HEADING ── */
.section-heading {
  color: var(--primary-blue);
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--primary-blue);
  padding-bottom: 10px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading i { color: var(--primary-blue); font-size: 1rem; }

/* ── CARD ── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 28px;
  margin-bottom: 24px;
  transition: box-shadow 0.25s ease;
  height: 100%;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-header-title {
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 12px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header-title i { color: inherit; }

/* ── UPDATES LIST ── */
.updates-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.updates-list li {
  position: relative;
  padding: 12px 0 12px 38px;
  border-bottom: 1px solid var(--bg-light);
  color: var(--text-body);
  font-size: 0.92rem;
  line-height: 1.6;
}

.updates-list li:last-child { border-bottom: none; }

.updates-list .item-icon {
  position: absolute;
  left: 4px;
  top: 14px;
  font-size: 0.9rem;
  width: 22px;
  text-align: center;
}

.icon-gold { color: var(--accent-gold); }
.icon-blue { color: var(--primary-blue); }

/* ── ARCHIVE LIST ── */
.archive-list {
  list-style: none;
  padding: 0;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.archive-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 0.91rem;
  color: var(--text-body);
  line-height: 1.65;
}

.archive-list li:last-child { border-bottom: none; }

/* Custom scrollbar */
.archive-list::-webkit-scrollbar { width: 5px; }
.archive-list::-webkit-scrollbar-track { background: var(--bg-light); border-radius: 10px; }
.archive-list::-webkit-scrollbar-thumb { background: var(--primary-blue); border-radius: 10px; opacity: 0.5; }

/* ── TYPOGRAPHY UTILITIES ── */
.text-maroon { color: var(--text-maroon) !important; font-weight: 600; }
.text-green { color: var(--text-green) !important; font-weight: 600; }
.text-blue { color: var(--primary-blue) !important; font-weight: 700; }

/* ── BUTTONS ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-blue);
  color: #fff !important;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(0,51,102,0.25);
  text-transform: none;
  letter-spacing: 0;
}

.btn-primary:hover {
  background: var(--primary-blue-dark);
  color: var(--accent-gold) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,51,102,0.35);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--primary-blue) !important;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary-blue);
  cursor: pointer;
  transition: var(--transition);
}

.btn-outline:hover {
  background: var(--primary-blue);
  color: #fff !important;
}

.btn-archive {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-white);
  color: var(--primary-blue);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-archive:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-blue);
}

/* ── GRID SYSTEM ── */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── RESEARCH PAGE ── */
.research-area-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 28px;
  border-top: 4px solid var(--primary-blue);
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.research-area-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.research-area-card h3 {
  color: var(--primary-blue);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.research-area-card .icon-wrapper {
  width: 52px;
  height: 52px;
  background: rgba(0,51,102,0.08);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.research-area-card .icon-wrapper i {
  color: var(--primary-blue);
  font-size: 1.3rem;
}

/* ── PUBLICATIONS PAGE ── */
.pub-entry {
  border-left: 3px solid var(--primary-blue);
  padding: 14px 18px;
  margin-bottom: 16px;
  background: var(--bg-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.93rem;
  transition: border-color 0.2s;
}

.pub-entry:hover { border-left-color: var(--accent-gold); }

.pub-year-badge {
  display: inline-block;
  background: var(--primary-blue);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 8px;
}

/* ── TEAM MEMBERS ── */
.member-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.member-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.member-avatar {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-blue), #1a56a0);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 2rem;
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,51,102,0.2);
}

.member-card h4 {
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.member-card .designation {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
  margin-bottom: 8px;
}

.member-card .research-topic {
  font-size: 0.8rem;
  color: var(--text-body);
  line-height: 1.5;
}

/* ── PHOTO PLACEHOLDER (shared across all member cards) ── */
.photo-placeholder {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 2px dashed var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.4;
}

/* ── ALUMNI CARD ── */
.alumni-card {
  border-top: 4px solid var(--accent-gold);
}

.alumni-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(212,175,55,0.12);
  color: #9a7d10;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.alumni-position {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--primary-blue);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ── GROUP LEADER / SK PAGE ── */
.profile-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
}

.profile-photo {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: linear-gradient(145deg, #e8f0fe, #c7d9f5);
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-photo-icon {
  font-size: 5rem;
  color: var(--primary-blue);
  opacity: 0.4;
}

.profile-name {
  color: var(--primary-blue);
  font-size: 1.9rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-title {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 20px;
  font-weight: 400;
}

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 0.93rem;
}

.info-row:last-child { border-bottom: none; }

.info-row .info-label {
  color: var(--primary-blue);
  font-weight: 600;
  min-width: 120px;
  flex-shrink: 0;
}

/* ── TEACHING PAGE ── */
.course-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 16px;
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.course-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary-blue); }

.course-number {
  background: var(--primary-blue);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 3px;
}

.course-info h4 {
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

/* ── FACILITIES PAGE ── */
.facility-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.facility-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.facility-icon-wrap {
  background: linear-gradient(135deg, var(--primary-blue), #1a4a8a);
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.facility-icon-wrap i {
  font-size: 2.5rem;
  color: rgba(255,255,255,0.9);
}

.facility-body { padding: 20px; }

.facility-body h4 {
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 8px;
}

/* ── OPENINGS PAGE ── */
.opening-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 20px;
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-left: 4px solid var(--accent-gold);
}

.opening-card:hover { box-shadow: var(--shadow-md); }

.opening-card h3 {
  color: var(--primary-blue);
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 12px;
}

.tag {
  display: inline-block;
  background: rgba(0,51,102,0.08);
  color: var(--primary-blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  margin-right: 6px;
  margin-bottom: 8px;
}

/* ── CONTACT PAGE ── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.contact-info-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border-light);
}

.contact-info-item:last-child { border-bottom: none; }

.contact-icon {
  width: 44px;
  height: 44px;
  background: rgba(0,51,102,0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon i { color: var(--primary-blue); font-size: 1.1rem; }

.contact-info-item .label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.contact-info-item .value {
  font-size: 0.93rem;
  color: var(--text-dark);
  line-height: 1.5;
}

/* Map placeholder */
.map-placeholder {
  height: 300px;
  background: linear-gradient(135deg, #e8f0fe, #c7d9f5);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--primary-blue);
  border: 2px dashed var(--primary-blue);
  gap: 12px;
}

.map-placeholder i { font-size: 3rem; opacity: 0.5; }
.map-placeholder p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

/* ── ARCHIVE TOGGLE ── */
.archive-section {
  text-align: center;
  margin: 24px 0;
}

.archive-panel {
  display: none;
  margin-top: 16px;
}

.archive-panel.open { display: block; }

/* ── FOOTER ── */
.site-footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border-light);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.site-footer a { color: var(--primary-blue); }
.site-footer a:hover { color: var(--accent-gold); }
.footer-logo { color: var(--primary-blue); font-weight: 700; font-size: 1rem; margin-bottom: 6px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
}

/* Collapse nav at tablet and below */
@media (max-width: 900px) {
  .header-brand-row { padding: 10px 16px 8px; }
  .brand-text .brand-title { font-size: 1.05rem; }
  .brand-text .brand-sub   { font-size: 0.68rem; }

  /* Show hamburger */
  .nav-toggle { display: flex; }

  /* Collapse the nav strip — overflow hidden, max-height 0 */
  #siteNav {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
    border-top: none;
    background: var(--bg-white);
    border-bottom: 2px solid var(--border-light);
    box-shadow: 0 8px 24px rgba(0,0,0,0.09);
  }

  /* Expanded state */
  #siteNav.nav-open { max-height: 560px; }

  .nav-inner {
    padding: 6px 16px 10px;
  }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding: 0;
    gap: 0;
  }

  .nav-links li { display: block; }

  .nav-links a {
    display: block;
    font-size: 0.85rem;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--border-light);
    white-space: normal;
  }

  .nav-links li:last-child a { border-bottom: none; }
}

@media (max-width: 480px) {
  .header-brand-row { padding: 8px 14px 6px; }
  .brand-text .brand-title { font-size: 0.92rem; }
  .brand-text .brand-sub   { font-size: 0.62rem; }
  .main-content { padding: 20px 14px 56px; }
  .card { padding: 16px; }
}

/* ── IMAGE MODAL ── */
.image-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  padding-top: 50px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
  backdrop-filter: blur(5px);
}

.image-modal .modal-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {transform:scale(0.8); opacity:0;}
  to {transform:scale(1); opacity:1;}
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.close-modal:hover,
.close-modal:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* Square image utility */
.sq-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sq-img:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-hover);
}

.clickable-image {
  cursor: zoom-in;
}

/* ── ANIMATIONS ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in { animation: fadeInUp 0.5s ease forwards; }
.fade-in-delay-1 { animation: fadeInUp 0.5s ease 0.1s both; }
.fade-in-delay-2 { animation: fadeInUp 0.5s ease 0.2s both; }
.fade-in-delay-3 { animation: fadeInUp 0.5s ease 0.3s both; }
