* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body, html {
  height: 100%;
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
}

/* ---------- Navigation Bar ---------- */
.navbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 40px;
  background-color: #ededed;
  border-bottom: 1px solid #d0d0d0;
  min-height: 130px;
  gap: 20px;
}

.navbar .logo {
  position: absolute;
  left: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
}

.navbar .logo img {
  height: 110px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  gap: 16px;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  display: inline-block;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: #000;
  text-decoration: none;
  border: 2px solid #000;
  border-radius: 4px;
  background-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background-color: #02407a;
  color: #fff;
  border-color: #02407a;
}

/* ---------- Main Content ---------- */
.container {
  min-height: calc(100vh - 131px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  text-align: center;
}

.content {
  max-width: 700px;
}

p {
  font-size: 1.2rem;
  color: black;
  margin-bottom: 30px;
  line-height: 1.6;
}

/* ---------- Page Heading ---------- */
.page-title {
  font-size: 2rem;
  color: #02407a;
  margin-bottom: 24px;
  text-align: center;
}

/* ---------- PDF Viewer / Book Pages ---------- */
.pdf-container {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
}

.pdf-viewer {
  width: 100%;
  height: 80vh;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: #fff;
}

.pdf-download {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 24px;
  background-color: #02407a;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.pdf-download:hover {
  background-color: #71b4fa;
}

/* ---------- Card Catalog ---------- */
.resources-list {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 32px;
}

.card {
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  border-color: #02407a;
  box-shadow: 0 4px 16px rgba(2, 64, 122, 0.15);
  transform: translateY(-4px);
}

.card-thumbnail {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: #f0f0f0;
  position: relative;
}

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

/* Play-button overlay for video cards */
.card-thumbnail.video::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 64px;
  background-color: rgba(2, 64, 122, 0.85);
  border-radius: 50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'><path d='M8 5v14l11-7z'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 32px 32px;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.card:hover .card-thumbnail.video::after {
  background-color: #02407a;
  transform: translate(-50%, -50%) scale(1.08);
}

.card-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #02407a;
  margin-bottom: 8px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #000;
  line-height: 1.35;
  margin: 0;
}

@media (max-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 560px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
}

/* ---------- Mobile Responsive ---------- */

/* Tablet and below */
@media (max-width: 900px) {
  .navbar {
    flex-direction: column;
    justify-content: center;
    padding: 20px 20px;
    min-height: 0;
    gap: 16px;
  }

  /* Unposition logo so it stacks on top of nav links */
  .navbar .logo {
    position: static;
    transform: none;
  }

  .navbar .logo img {
    height: 90px;
  }

  .nav-links {
    gap: 10px;
    width: 100%;
  }

  .container {
    min-height: auto;
    padding: 30px 20px;
  }

  .pdf-container {
    margin: 24px auto;
  }

  .pdf-viewer {
    height: 70vh;
  }
}

/* Small tablets / large phones */
@media (max-width: 600px) {
  .navbar {
    padding: 16px 16px;
    gap: 14px;
  }

  .navbar .logo img {
    height: 75px;
  }

  .nav-links {
    gap: 8px;
  }

  .nav-links a {
    padding: 9px 14px;
    font-size: 0.9rem;
    border-width: 2px;
  }

  p {
    font-size: 1rem;
  }

  .page-title {
    font-size: 1.5rem;
    margin-bottom: 18px;
  }

  .container {
    padding: 24px 16px;
  }

  .pdf-container {
    padding: 0 12px;
  }

  .pdf-viewer {
    height: 65vh;
  }

  .resources-list {
    padding: 0 12px;
  }

  .card-body {
    padding: 14px 16px 18px;
  }

  .card-title {
    font-size: 1rem;
  }
}

/* Phones */
@media (max-width: 420px) {
  .navbar .logo img {
    height: 65px;
  }

  .nav-links {
    gap: 6px;
  }

  .nav-links a {
    padding: 8px 12px;
    font-size: 0.82rem;
  }

  p {
    font-size: 0.95rem;
  }

  .page-title {
    font-size: 1.35rem;
  }

  .pdf-viewer {
    height: 60vh;
  }

  .pdf-download {
    padding: 11px 20px;
    font-size: 0.95rem;
  }
}
