/* English Teacher Portfolio — optimized stylesheet */

:root {
  --bg: #f7f1e8;
  --card: #fffdfa;
  --ink: #0b2f52;
  --text: #253545;
  --muted: #607086;
  --line: #d8e6f2;
  --accent: #2f6f9f;
  --gold: #f4b942;
  --link: #0b63f6;
  --link-hover: #003ea8;
  --shadow: 0 18px 42px rgba(11, 47, 82, 0.08);
}

/* ===== Base ===== */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #eef7ff, var(--bg) 55%, #ffffff);
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video {
  max-width: 100%;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

/* ===== Header and navigation ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 253, 250, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.nav {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 900;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--ink);
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.nav-links a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.nav-links a:hover,
.nav-links a.active {
  border-color: var(--gold);
}

/* ===== Layout ===== */

.section {
  padding: 64px 0;
}

.hero {
  padding-top: 86px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.6fr 0.7fr;
  align-items: stretch;
  gap: 24px;
}

.hero-photo-card {
  height: 100%;
}

.hero-photo-card img {
  width: 100%;
  max-width: 100%;
  border-radius: 24px;
}

/* ===== Typography ===== */

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
}

h1 {
  max-width: 760px;
  margin-top: 18px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1;
  letter-spacing: -2px;
}

h2 {
  margin-bottom: 12px;
  font-size: 34px;
}

.lead {
  max-width: 760px;
  color: #435363;
  font-size: 19px;
  line-height: 1.65;
}

/* ===== Buttons and labels ===== */

.badge,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 700;
}

.badge {
  padding: 12px 16px;
}

.button {
  padding: 12px 18px;
  transition: transform 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #ffffff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* ===== Shared cards ===== */

.card,
.portrait-card,
.table-box,
.publication-card,
.video-card {
  background: rgba(255, 253, 250, 0.92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.card,
.publication-card,
.video-card {
  padding: 24px;
}

.card p,
.publication-card li,
.video-card p {
  line-height: 1.6;
}

/* ===== Hero portrait ===== */

.portrait-card {
  padding: 22px;
}

.portrait {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 22px;
  object-fit: cover;
}

.quote {
  margin-top: 16px;
  padding: 16px;
  border-left: 5px solid var(--gold);
  border-radius: 16px;
  background: #fff8e8;
  font-style: italic;
}

/* ===== Generic grids ===== */

.stats-grid,
.cards-grid,
.publications-grid,
.videos-grid {
  display: grid;
  gap: 22px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 26px;
  padding-right: 16px;
}

.cards-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.publications-grid,
.videos-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* ===== Tables ===== */

.table-box {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--ink);
  color: #ffffff;
}

td:first-child {
  width: 90px;
  color: var(--accent);
  font-weight: 800;
}

/* ===== Publications ===== */

.publication-card h3 {
  margin-bottom: 12px;
  color: var(--accent);
}

.publication-card ul {
  margin: 0;
  padding-left: 20px;
}

.publication-card a,
.publication-card a:visited,
.pdf-link {
  color: var(--link);
  font-weight: 700;
  text-decoration: underline;
}

.publication-card a:hover,
.pdf-link:hover {
  color: var(--link-hover);
}

.publication-card a:hover {
  border-radius: 4px;
  background: rgba(11, 99, 246, 0.1);
}

/* ===== Videos ===== */

.video-card video {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: 18px;
  background: var(--ink);
}

.video-card p {
  color: var(--muted);
}

/* ===== Competitions and awards ===== */

.awards-card {
  margin-top: 24px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 253, 250, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.gallery-grid a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.gallery-grid a:hover {
  transform: translateY(-4px);
}

.gallery-grid img {
  display: block;
  width: 100%;
  height: 320px;
  padding: 12px;
  background: #ffffff;
  object-fit: contain;
}

/* ===== Materials ===== */

.materials-card {
  margin-top: 40px;
  padding: 32px;
}

.materials-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.materials-video-block {
  display: flex;
  justify-content: center;
  margin-bottom: 40px;
}

.video-main-card {
  width: 100%;
  max-width: 900px;
}

.video-main-card .video-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.video-main-card video {
  width: 100%;
  border-radius: 18px;
}

.materials-pdf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 420px));
  justify-content: center;
  gap: 30px;
}

.materials-pdf-grid .card {
  text-align: center;
}

.materials-pdf-grid .button {
  margin-top: 15px;
}

/* ===== Photo album ===== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.photo-grid a {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.photo-grid a:hover {
  transform: translateY(-4px);
}

.photo-grid img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
}

/* ===== Photo modal ===== */

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 30px;
  background: rgba(0, 0, 0, 0.88);
}

.image-modal.active {
  display: flex;
}

.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  object-fit: contain;
}

.modal-close,
.modal-arrow {
  position: fixed;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  cursor: pointer;
  font-size: 44px;
  line-height: 1;
  transition: background-color 0.2s ease;
}

.modal-close:hover,
.modal-arrow:hover {
  background: rgba(255, 255, 255, 0.28);
}

.modal-close {
  top: 24px;
  right: 32px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
}

.modal-arrow {
  top: 50%;
  width: 58px;
  height: 76px;
  border-radius: 18px;
  transform: translateY(-50%);
}

.modal-prev {
  left: 30px;
}

.modal-next {
  right: 30px;
}

/* ===== Footer ===== */

.site-footer {
  padding: 32px 0;
  background: var(--ink);
  color: #eaf4ff;
  text-align: center;
}

/* ===== Accessibility ===== */

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

/* ===== Responsive ===== */

@media (max-width: 860px) {
  .hero-grid,
  .stats-grid,
  .cards-grid,
  .publications-grid,
  .videos-grid,
  .materials-pdf-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    padding-right: 0;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 0;
  }

  .section {
    padding: 46px 0;
  }

  .gallery-grid,
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

@media (max-width: 560px) {
  .hero {
    padding-top: 54px;
  }

  h1 {
    font-size: clamp(36px, 12vw, 54px);
  }

  h2 {
    font-size: 29px;
  }

  .lead {
    font-size: 17px;
  }

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

  .modal-arrow {
    width: 48px;
    height: 64px;
    font-size: 38px;
  }

  .modal-prev {
    left: 12px;
  }

  .modal-next {
    right: 12px;
  }

  .modal-close {
    top: 14px;
    right: 14px;
  }
}