/*
 * Main stylesheet for the AADHRIT Lab website.
 *
 * Implements a compact, high-contrast header, responsive navigation
 * patterns, useful hero sections and consistent imagery for the lab's
 * marketing site. Existing section and card styles are preserved to
 * maintain the overall visual language.
 */

:root {
  --primary: #0a214d;
  --secondary: #f18a1b;
  --light: #f5f7fa;
  --dark: #0a1322;
  --accent: #2a73cc;
  --text: #2d2d2d;
  --heading: #0a214d;
  --header-bg: #0a214d;
  --header-fg: #ffffff;
  font-family: 'Lato', sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--light);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

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

figure {
  margin: 0 0 1.5rem;
}

figcaption {
  font-size: 0.9rem;
  color: #475569;
  margin-top: 0.5rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 16px;
}

/* Header and navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--header-bg);
  background-color: var(--header-bg);
  color: var(--header-fg);
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.site-header.is-stuck {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  min-height: 64px;
  padding-block: 10px;
  gap: clamp(12px, 2.5vw, 28px);
}

@media (min-width: 768px) {
  .site-header .container {
    min-height: 72px;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: inherit;
  flex-shrink: 0;
  text-decoration: none;
}

.brand__logo {
  display: block;
  height: clamp(40px, 3vw + 24px, 56px);
  width: auto;
  max-width: min(220px, 45vw);
  object-fit: contain;
}

.brand__text {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--header-fg);
  white-space: nowrap;
  line-height: 1.2;
}

.brand__logo--backplate {
  background: rgba(10, 33, 77, 0.85);
  padding: 4px 8px;
  border-radius: 6px;
}

.menu-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  color: var(--header-fg);
  margin-left: auto;
}

.menu-toggle span {
  position: absolute;
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 999px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle span:nth-child(1) {
  transform: translateY(-6px);
}

.menu-toggle span:nth-child(2) {
  transform: translateY(0);
}

.menu-toggle span:nth-child(3) {
  transform: translateY(6px);
}

body.nav-open .menu-toggle span:nth-child(1) {
  transform: rotate(45deg);
}

body.nav-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

body.nav-open .menu-toggle span:nth-child(3) {
  transform: rotate(-45deg);
}

.site-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

.site-nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 18px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--header-fg);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.site-nav a:hover,
.site-nav a:focus,
.site-nav a[aria-current="page"] {
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

body.light-header {
  --header-bg: #ffffff;
  --header-fg: #0a214d;
}

body.light-header .site-nav a {
  color: var(--header-fg);
}

body.light-header .site-nav a:hover,
body.light-header .site-nav a:focus,
body.light-header .site-nav a[aria-current="page"] {
  background-color: rgba(10, 33, 77, 0.12);
  color: var(--primary);
}

body.light-header .menu-toggle {
  border-color: rgba(10, 33, 77, 0.35);
  color: var(--primary);
}

body.light-header .menu-toggle span {
  background: var(--primary);
}

body.light-header .site-search form {
  background-color: rgba(10, 33, 77, 0.08);
}

body.light-header .site-search input[type="search"] {
  color: var(--primary);
}

body.light-header .site-search input[type="search"]::placeholder {
  color: rgba(15, 23, 42, 0.7);
}

.site-nav a:focus-visible,
.menu-toggle:focus-visible,
.btn:focus-visible {
  outline: 3px solid rgba(241, 138, 27, 0.5);
  outline-offset: 3px;
}

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 33, 77, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
  z-index: 998;
}

body.nav-open .backdrop {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 767px) {
  .site-header .container {
    gap: 12px;
    min-height: 60px;
  }

  .brand__text {
    font-size: 0.85rem;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    margin-left: 0;
    position: fixed;
    inset: 0 0 0 auto;
    top: 0;
    right: 0;
    height: 100dvh;
    width: min(80vw, 320px);
    background: #ffffff;
    color: #1f2937;
    flex-direction: column;
    padding: 96px 24px 32px;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.15);
    z-index: 999;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .site-nav a {
    color: #111827;
    font-size: 1rem;
    padding: 10px 14px;
  }

  body.nav-open .site-nav {
    transform: translateX(0);
  }
}

body.nav-open {
  overflow: hidden;
}

/* Hero section */
.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(320px, 50vh, 520px);
  padding: clamp(56px, 8vw, 88px) 0;
  color: #ffffff;
  background-size: cover;
  background-position: center;
  isolation: isolate;
}

.hero > .container {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.25) 40%, rgba(0, 0, 0, 0) 100%);
  z-index: -1;
}

.hero__content {
  position: relative;
  max-width: 680px;
  padding-inline: 16px;
}

.hero__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  color: rgba(255, 255, 255, 0.85);
}

.hero__title {
  font-size: clamp(2rem, 2.4vw + 1rem, 3rem);
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.hero__subtitle {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

@media (max-width: 599px) {
  .hero {
    padding: 56px 0;
    min-height: 50vh;
  }
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--secondary);
  color: #ffffff;
  border-radius: 999px;
  padding: 0.85rem 1.75rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hero__cta:hover,
.hero__cta:focus-visible {
  background: #d9780f;
  text-decoration: none;
  transform: translateY(-1px);
}

.hero--home {
  background-image: url('images/hero-home-microgrid.svg');
}

.hero--about {
  background-image: url('images/hero-about-lab.svg');
}

.hero--research {
  background-image: url('images/hero-research-digital.svg');
}

.hero--collaborations {
  background-image: url('images/hero-collaborations-network.svg');
}

.hero--people {
  background-image: url('images/hero-people-team.svg');
}

.hero--publications {
  background-image: url('images/hero-publications-journals.svg');
}

.hero--events {
  background-image: url('images/hero-events-training.svg');
}

.hero--gallery {
  background-image: url('images/hero-gallery-equipment.svg');
}

.hero--contact {
  background-image: url('images/hero-contact-campus.svg');
}

.hero--error {
  background-image: url('images/hero-error-grid.svg');
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--secondary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  transition: background-color 0.3s, transform 0.2s;
}

.btn:hover,
.btn:focus-visible {
  background-color: #d9780f;
  text-decoration: none;
  transform: translateY(-1px);
}

section {
  padding: 4rem 0;
}

section h2 {
  color: var(--heading);
  font-size: 2rem;
  margin-bottom: 1.5rem;
  text-align: center;
}

section .intro {
  max-width: 800px;
  margin: 0 auto 2rem;
  text-align: center;
  font-size: 1.1rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.07);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
}

.card img,
.img-card {
  aspect-ratio: 16 / 9;
  width: 100%;
  object-fit: cover;
  border: none;
  border-radius: 0;
}

.card-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.card-content h3 {
  margin: 0;
  font-size: 1.3rem;
  color: var(--heading);
}

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
}

.tag-list li {
  background: rgba(10, 33, 77, 0.08);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
}

.partner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.partner-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  text-align: left;
}

.partner-card h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--heading);
}

.partner-card p {
  margin: 0;
  color: #475569;
}

.objective-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.objective-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.objective-card h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.objective-card ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
}

.two-column {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.pill-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0;
  padding: 0;
}

.pill-list li {
  background: rgba(10, 33, 77, 0.12);
  color: var(--primary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.people-group {
  margin-bottom: 3rem;
}

.people-group h2 {
  text-align: left;
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}

.people-list {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.person {
  background: #fff;
  border-radius: 18px;
  padding: 1.5rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.person img {
  width: 100%;
  border-radius: 12px;
}

.person h3 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--heading);
}

.person .role {
  font-weight: 600;
  color: #1f2937;
}

.person ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.links a {
  font-weight: 600;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: #fff;
  padding: 2rem;
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.08);
  display: grid;
  gap: 1rem;
}

.form-field {
  display: grid;
  gap: 0.5rem;
}

.form-field label {
  font-weight: 600;
  color: var(--heading);
}

.contact-form input,
.contact-form textarea,
.newsletter input {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.15);
  font-size: 1rem;
}

.contact-form textarea {
  resize: vertical;
  min-height: 150px;
}

.newsletter form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.newsletter button {
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  cursor: pointer;
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.footer-social a {
  color: rgba(255, 255, 255, 0.9);
}

.accordion {
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.accordion summary {
  font-weight: 600;
  cursor: pointer;
}

.callout {
  margin-top: 2rem;
  background: rgba(241, 138, 27, 0.08);
  border-radius: 12px;
  padding: 1.5rem;
  font-size: 0.95rem;
}

.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.filter-controls button {
  border: 1px solid rgba(10, 33, 77, 0.25);
  background: #fff;
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-controls button:hover,
.filter-controls button:focus-visible,
.filter-controls button.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.tab-nav {
  display: inline-flex;
  gap: 0.75rem;
  margin: 2rem 0 1.5rem;
  flex-wrap: wrap;
}

.tab-nav button {
  border: 1px solid rgba(10, 33, 77, 0.25);
  background: #fff;
  color: var(--primary);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-nav button:hover,
.tab-nav button:focus-visible,
.tab-nav button.active {
  background: var(--primary);
  color: #fff;
}

.media-section {
  display: none;
}

.media-section.active {
  display: block;
}

.publication-list {
  display: grid;
  gap: 1.25rem;
}

.publication-card {
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
}

.publication-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: var(--heading);
}

.publication-card p {
  margin: 0.35rem 0;
}

.publication-card .meta {
  color: #475569;
  font-size: 0.9rem;
}

.event-grid {
  display: grid;
  gap: 1.75rem;
}

.event-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 10px 32px rgba(15, 23, 42, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.event-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.event-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.event-body h3 {
  margin: 0;
  color: var(--heading);
}

.event-meta {
  font-size: 0.9rem;
  color: #475569;
  font-weight: 600;
}

.event-body ul {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.5rem;
}

.event-footer {
  margin-top: 0.5rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.gallery-item {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.gallery-item img {
  border-radius: 16px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.gallery-caption {
  font-size: 0.9rem;
  color: #475569;
}

.responsive-video {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.responsive-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 16px;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 1000;
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-content {
  background: #fff;
  border-radius: 16px;
  max-width: 860px;
  width: 100%;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lightbox-content img {
  width: 100%;
  border-radius: 12px;
}

.lightbox-close {
  align-self: flex-end;
  border: none;
  background: var(--secondary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  cursor: pointer;
}

.table-scroll {
  overflow-x: auto;
  margin-top: 1.5rem;
}

.project-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.project-table th,
.project-table td {
  padding: 0.85rem 1.1rem;
  text-align: left;
  border-bottom: 1px solid rgba(10, 33, 77, 0.1);
  vertical-align: top;
}

.project-table th {
  background: rgba(10, 33, 77, 0.08);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
}

.project-table tbody tr:last-child td {
  border-bottom: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.status-ongoing {
  background: rgba(56, 189, 248, 0.2);
  color: #0369a1;
}

.status-completed {
  background: rgba(34, 197, 94, 0.2);
  color: #047857;
}

.status-planned {
  background: rgba(251, 191, 36, 0.2);
  color: #a16207;
}

.breadcrumbs {
  background-color: rgba(10, 33, 77, 0.06);
  border-radius: 999px;
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  margin: 1rem 0 2rem;
}

.breadcrumbs a {
  color: var(--primary);
  font-weight: 600;
}

.site-search {
  margin-left: clamp(16px, 4vw, 48px);
  display: none;
  flex: 0 1 320px;
}

.site-search form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.5rem;
  border-radius: 999px;
}

.site-search label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.site-search input[type="search"] {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 0.95rem;
  width: 180px;
}

.site-search input[type="search"]::placeholder {
  color: #f1f5ff;
  opacity: 0.85;
}

.site-search button {
  border: none;
  background-color: var(--secondary);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.site-search button:hover,
.site-search button:focus-visible {
  background-color: #d9780f;
}

@media (min-width: 992px) {
  .site-search {
    display: block;
  }
}

footer {
  background: var(--dark);
  color: #fff;
  padding: 3rem 0;
}

footer .container {
  display: block;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

footer h4 {
  margin-bottom: 1rem;
}

footer a {
  color: rgba(255, 255, 255, 0.9);
  display: block;
  margin-bottom: 0.5rem;
}

footer p {
  margin: 0 0 0.5rem;
}

footer a:hover,
footer a:focus-visible {
  color: #fff;
}

.footer-bottom {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

@media (max-width: 767px) {
  section {
    padding: 3rem 0;
  }

  .hero {
    padding: 72px 0;
  }

  .card-content {
    padding: 1.25rem;
  }
}
