/* Reset some default browser styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  /* font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; */
  font-family: 'DM Serif Display', serif;
  line-height: 1.6;
  color: #222;
  background: #f9f9f9;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Container */
.container {
  width: 90%;
  max-width: 1100px;
  margin-inline: auto;
  padding: 1rem 0;
}

/* Header (Navbar) */
header {
  background: #283e4a;
  color: #fff;
  position: sticky;
  max-height: 77px;
  top: 0;
  z-index: 999;
  box-shadow: 0 2px 5px rgb(0 0 0 / 0.1);
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  cursor: default;
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Navigation */
.nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.nav-links li a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  transition: background-color 0.3s ease, color 0.3s ease;
  border-radius: 4px;
}

.nav-links li a:hover,
.nav-links li a:focus {
  background-color: #417690;
  outline: none;
}

/* Hamburger Menu Button */
.menu-toggle {
  display: none;
  font-size: 2rem;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
}

/* Hero Section */
.hero {
  position: relative;
  background: url('public/images/education.jpg') no-repeat center center/cover;
  color: #d0e6f2;
  height: 100vh;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(40, 62, 74, 0.75);
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h2 {
  font-size: 2.8rem;
  margin-bottom: 1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: inherit;
}

.hero p {
  font-size: 1.25rem;
  max-width: 600px;
  margin: 1em 0;
  line-height: 1.5;
  color: inherit;
}

.btn-primary {
  background-color: #fff;
  color: #417690;
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s ease, color 0.3s ease;
  box-shadow: 0 3px 6px rgb(0 0 0 / 0.2);
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #e0f0f6;
  color: #2c5268;
  outline: none;
  box-shadow: 0 5px 10px rgb(0 0 0 / 0.3);
}

/* Section Titles */
h2 {
  font-size: 2rem;
  color: #283e4a;
  margin-bottom: 1rem;
  border-bottom: 3px solid #417690;
  padding-bottom: 0.5rem;
}

/* About Section */
.about,
.services,
.testimonials,
.contact {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 1rem;
}

.about {
  margin-top: 3rem;
  /* Remove center text */
  text-align: left;
}

/* New flex container for about content */
.about-content {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
}

/* Justify text paragraphs */
.about-content p {
  text-align: left;
  font-size: 1.1rem;
  max-width: 700px;
  color: #333;
  margin-bottom: 1rem;
  flex: 1 1 400px;
  min-width: 280px;
}

/* Image flexed with text */
.about-content img {
  max-width: 350px;
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  flex: 1 1 300px;
  min-width: 280px;
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.15);
}

/* Services Section */
.services {
  margin-top: 3rem;
}

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

.service-card {
  background: #fff;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.1);
  transition: transform 0.3s ease;
}

.service-card:hover,
.service-card:focus-within {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.15);
}

.service-card h3 {
  color: #417690;
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.service-card p {
  color: #555;
  line-height: 1.5;
  font-size: 1rem;
}

.service-card ul {
  margin-top: 1rem;
}

/* Testimonials Section */
.testimonials {
  margin-top: 3rem;
  background: #f0f4f7;
  padding: 2rem 1rem;
  border-radius: 10px;
}

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

blockquote {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.1);
  font-style: normal;
  color: #2c3e50;
  position: relative;
  font-size: 1rem;
  line-height: 1.5;
}

/* FIXED FOOTER IN TESTIMONIAL */
blockquote footer {
  margin-top: 1rem;
  text-align: right;
  font-weight: 600;
  color: #283e4a;
  background: transparent !important;
  display: inline;
  padding: 0;
  width: auto;
  box-shadow: none;
}

/* Contact Section */
.contact {
  margin: 3rem auto auto auto;
  background: #fff;
  padding: 2rem 2rem;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgb(0 0 0 / 0.1);
  max-width: 600px;
  max-height: 600px;
}

.contact form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 1em;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
  color: #283e4a;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  font-family: inherit;
  resize: vertical;
  min-height: 100px;
}

.form-group input[type="text"],
.form-group input[type="email"] {
  min-height: auto;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #417690;
  outline: none;
  box-shadow: 0 0 6px #a3c6d6;
}

#contactForm button {
  max-width: 200px;
  margin: 0 auto;
}

.error-msg {
  color: #d93025;
  font-size: 0.9rem;
  min-height: 1.2rem;
}

.success-msg {
  color: #2e7d32;
  font-weight: 600;
  font-size: 1rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}

/* Footer */
footer {
  background: #283e4a;
  color: #cfd8dc;
  padding: 1rem 0;
  margin-top: 3rem;
  font-size: 0.9rem;
}

/* Responsive */

/* Mobile menu toggle */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: absolute;
    top: 60px;
    right: 0;
    padding: 1em;
    background: #283e4a;
    flex-direction: column;
    width: 200px;
    display: none;
    border-radius: 0 0 0 8px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.3);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li a {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #417690;
  }

  /* About content stacks on smaller screens */
  .about-content {
    flex-direction: column;
    align-items: center;
  }

  .about-content p,
  .about-content img {
    flex: none;
    max-width: 100%;
    min-width: auto;
  }
}

/* Smaller phones */
@media (max-width: 400px) {
  .hero h2 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .btn-primary {
    font-size: 1rem;
    padding: 0.6rem 1.5rem;
  }

  .about p {
    padding: 0 0.5rem;
  }
}

.books {
  margin-top: 3rem;
  padding: 2rem 1rem;
  background-color: #f0f4f7;
  border-radius: 10px;
  text-align: center;
}

.books-intro {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.book-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.book-item {
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
}

.book-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.book-item img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  max-height: 260px;
  object-fit: cover;
}

.book-item figcaption {
  margin-top: 0.75rem;
  font-weight: 600;
  color: #283e4a;
  font-size: 1rem;
}

/* Offset anchor scroll for fixed header */
section {
  scroll-margin-top: 80px;
}