/* Design 4: Elegant, smooth, and pleasant visual experience */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=Montserrat:wght@400;500;600&display=swap');

/* Global styles */
body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  line-height: 1.6;
  background-color: #f9f9fb;
  color: #2d3748;
}

header {
  background-color: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  padding: 20px 0;
  text-align: center;
}

header h1 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: 2.4em;
  color: #2d3748;
}

header p {
  margin-top: 5px;
  margin-bottom: 0;
  color: #4a5568;
  font-size: 1.1em;
  font-weight: 400;
}

/* NAV */
nav ul {
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
  display: flex;               /* ✅ more robust than inline-block */
  flex-wrap: wrap;             /* ✅ wraps nicely on small screens */
  justify-content: center;
  gap: 10px 18px;              /* ✅ consistent spacing */
}

nav li {
  display: block;              /* ✅ don’t fight flexbox */
  margin: 0;                   /* handled by gap */
}

nav a {
  color: #5a67d8;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 5px 0;
}

/* underline animation */
nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0%;
  height: 2px;
  background-color: #5a67d8;
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* ✅ active page state (safe across pages) */
nav a[aria-current="page"] {
  color: #2d3748;
  font-weight: 600;
}
nav a[aria-current="page"]::after {
  width: 100%;
}

/* MAIN panel */
main {
  max-width: 1100px;
  margin: 30px auto;
  padding: 40px 30px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* Hero section for the home page */
.hero {
  text-align: center;
  padding: 80px 20px;
  margin-bottom: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #ffffff;
}

.hero img {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.6);
  object-fit: cover;
  margin-bottom: 20px;
}

.hero h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.6em;
  margin: 0;
}

.hero p {
  font-size: 1.2em;
  margin-top: 12px;
  color: #f7fafc;
}

/* Section headings */
h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2em;
  margin: 0 0 20px;
  color: #2d3748;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0.5em;
}

/* Categories grid on the home page */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.category-card {
  background-color: #ffffff;
  border-radius: 12px;
  padding: 30px 25px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
}

.category-card a {
  text-decoration: none;
  color: #5a67d8;
  font-weight: 600;
  font-size: 1.3em;
}

.category-card a:hover {
  text-decoration: none;
}

/* =========================================
   EDUCATION (scoped: will not affect pages)
   ========================================= */

.edu-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

/* Card */
.edu-card {
  background: #ffffff;
  border: 1px solid #e6ebf2;
  border-radius: 16px;
  padding: 18px 18px 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.05);
}

/* Top row */
.edu-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.edu-card__degree {
  margin: 0 0 6px;
  font-family: 'Playfair Display', serif;
  font-size: 1.25em;
  line-height: 1.25;
  color: #1f2937;
}

.edu-card__inst {
  margin: 0;
  color: #4a5568;
  font-size: 1.05em;
  line-height: 1.6;
}

/* Dates pill */
.edu-card__dates {
  white-space: nowrap;
  font-size: 0.98em;
  color: #2d3748;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(90,103,216,0.22);
  background: rgba(90,103,216,0.07);
}

/* Meta grid */
.edu-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 22px;
}

.edu-card__label {
  font-size: 0.95em;
  color: #718096;
  margin-bottom: 4px;
}

.edu-card__value {
  font-size: 1.05em;
  color: #2d3748;
  line-height: 1.75;
}

/* Compact card */
.edu-card--compact .edu-card__top {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 820px) {
  main {
    margin: 18px 12px;
    padding: 26px 18px;
  }
}

@media (max-width: 760px) {
  .edu-card__grid { grid-template-columns: 1fr; }
  .edu-card__top { flex-direction: column; }
  .edu-card__dates { align-self: flex-start; }
}


/* === Posters grid === */

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

.poster-item img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #ddd;
  display: block;
}

.poster-thumb {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.poster-item figcaption {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  line-height: 1.4;
}

/* === Modal === */

.poster-modal {
  display: none;
}

.poster-modal.is-open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.poster-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
}

.poster-modal__content {
  position: relative;
  margin: 4vh auto;
  max-width: 95vw;
  max-height: 92vh;
  background: white;
  border-radius: 10px;
  overflow: auto;
  padding: 1rem;
}

.poster-modal__content img {
  width: 100%;
  height: auto;
}

.poster-modal__close {
  position: sticky;
  top: 0;
  float: right;
  border: none;
  background: #eee;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

.poster-modal__links {
  margin-top: 0.8rem;
  font-size: 0.95rem;
}
