* {
  box-sizing: border-box;
}

:root {
  --bg: #f6efe6;
  --surface: rgba(255, 250, 244, 0.92);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --line: rgba(29, 49, 73, 0.10);
  --text: #1d2b3d;
  --muted: #6e7887;
  --accent: #b86e46;
  --accent-soft: rgba(184, 110, 70, 0.12);
  --gold: #cf9b49;
  --shadow: 0 20px 44px rgba(53, 68, 89, 0.12);
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(232, 184, 138, 0.26), transparent 24%),
    radial-gradient(circle at top right, rgba(148, 187, 219, 0.24), transparent 22%),
    linear-gradient(180deg, #fffaf4 0%, #f6efe6 48%, #efe5d7 100%);
}

.students-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
}

.students-header {
  padding: 20px 0 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #9e5e39;
  text-decoration: none;
  font-weight: 700;
}

.students-page {
  padding: 18px 0 72px;
}

.students-hero {
  padding: 20px 0 30px;
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 22px;
  align-items: stretch;
}

.hero-copy,
.hero-stats,
.toolbar-card,
.directory-panel,
.gallery-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-stats,
.toolbar-card,
.directory-panel,
.gallery-panel,
.student-poster-card,
.directory-item {
  border-radius: 24px;
}

.hero-copy {
  padding: 34px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(2.3rem, 4vw, 4.2rem);
  line-height: 1.03;
  font-family: Georgia, "Times New Roman", serif;
}

.hero-text {
  margin: 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-stats {
  padding: 22px;
  display: grid;
  gap: 14px;
}

.stat-card {
  padding: 20px;
  border-radius: 20px;
  background:
    linear-gradient(135deg, #f2d7be 0%, #e6bf9a 100%);
  color: #5a3522;
  border: 1px solid rgba(164, 103, 70, 0.14);
}

.stat-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.78;
}

.stat-card strong {
  font-size: 1.9rem;
  line-height: 1.1;
}

.students-content {
  padding-top: 8px;
}

.toolbar-card {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 24px 26px;
  margin-bottom: 24px;
}

.toolbar-card h2,
.panel-heading h3 {
  margin: 0;
}

.toolbar-card h2 {
  font-size: clamp(1.45rem, 2.5vw, 2rem);
}

.search-box {
  min-width: min(100%, 340px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 15px;
}

.students-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.directory-panel,
.gallery-panel {
  padding: 22px;
}

.directory-panel {
  position: sticky;
  top: 18px;
}

.panel-heading {
  margin-bottom: 18px;
}

.directory-list {
  display: grid;
  gap: 12px;
  max-height: 1100px;
  overflow: auto;
  padding-right: 4px;
}

.directory-item {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid rgba(29, 49, 73, 0.08);
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.directory-item:hover,
.directory-item.is-active {
  transform: translateY(-2px);
  border-color: rgba(184, 110, 70, 0.32);
  box-shadow: 0 14px 28px rgba(72, 88, 111, 0.14);
}

.directory-item strong,
.directory-item span {
  display: block;
}

.directory-item-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.directory-copy {
  min-width: 0;
}

.directory-flag {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(29, 49, 73, 0.08);
}

.directory-item strong {
  margin-bottom: 5px;
  font-size: 1rem;
  font-family: Georgia, "Times New Roman", serif;
}

.directory-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.student-poster-card {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  box-shadow: 0 18px 38px rgba(62, 78, 99, 0.12);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.student-poster-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 44px rgba(62, 78, 99, 0.18);
}

.student-poster-card.hidden,
.directory-item.hidden,
.empty-state[hidden] {
  display: none;
}

.poster-frame {
  aspect-ratio: 904 / 1280;
  background: #efe4d7;
}

.poster-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.poster-body {
  padding: 16px 16px 18px;
}

.poster-body h4 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-family: Georgia, "Times New Roman", serif;
}

.poster-meta {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.poster-country {
  display: inline-flex;
  margin-top: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(184, 110, 70, 0.12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-state {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.footer-bottom {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto 24px;
  padding: 12px 16px;
  border-radius: 16px;
  text-align: center;
  background: linear-gradient(135deg, #f0d3b4 0%, #e7c09c 100%);
  color: #5a3522;
  font-size: 12px;
  box-shadow: var(--shadow);
}

@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .hero-layout,
  .students-layout,
  .toolbar-card {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .toolbar-card {
    align-items: stretch;
  }

  .directory-panel {
    position: static;
  }

  .directory-list {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .students-shell {
    width: min(100% - 24px, 1200px);
  }

  .hero-copy,
  .hero-stats,
  .toolbar-card,
  .directory-panel,
  .gallery-panel {
    padding: 20px;
    border-radius: 20px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 2.15rem;
  }

  .hero-text {
    font-size: 15px;
  }

  .footer-bottom {
    width: min(100% - 24px, 1200px);
    font-size: 12px;
  }
}
