/* --- Styles for Main Grammar Menu Page --- */

/* --- Grammar Hero Section --- */
.grammar-hero {
  padding: 4rem 1rem;
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url('https://placehold.co/1200x400/A00000/ffffff?text=இலக்கணம்');
  background-size: cover;
  background-position: center;
  color: var(--text-light);
  text-align: center;
  border-radius: var(--border-radius);
  margin-bottom: 2.5rem;
}

.grammar-hero h1 {
  margin: 0;
  font-size: 3rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.grammar-hero p {
  margin-top: 0.5rem;
  font-size: 1.2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* --- Introduction Section --- */
.page-intro-section {
  margin: 0 0 2.5rem 0;
  text-align: justify;
  line-height: 1.8;
  background-color: var(--secondary-color);
  padding: 1.5rem 2rem;
  border-radius: var(--border-radius);
}

.page-intro-section h2 {
  text-align: center;
  color: var(--primary-color);
  margin-top: 0;
}

.page-intro-section p:last-child {
  margin-bottom: 0;
}

/* --- Grammar Menu Grid (Mobile-First & Fixed) --- */
.grammar-menu {
  display: grid;
  /* Default to 1 column on small screens */
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

/* For small tablets (e.g., portrait mode), use 2 equal columns */
@media (min-width: 576px) {
  .grammar-menu {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* For tablets, use 3 equal columns */
@media (min-width: 768px) {
  .grammar-menu {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* For desktops, use 4 equal columns */
@media (min-width: 992px) {
  .grammar-menu {
    grid-template-columns: repeat(4, 1fr);
  }
}

.menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--text-light);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: 2rem;
  text-align: center;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-size: 1.3rem;
  font-family: var(--tamil-font);
  font-weight: bold;
  transition: transform 0.3s ease, background-color 0.3s ease, color 0.3s ease,
    box-shadow 0.3s ease;
}

.menu-item:hover {
  transform: translateY(-5px) scale(1.02);
  background-color: var(--primary-color);
  color: var(--text-light);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

/* --- Mobile Adjustments for Padding & Scrolling --- */
@media (max-width: 576px) {
  .grammar-hero {
    padding: 3rem 1rem;
  }
  .grammar-hero h1 {
    font-size: 2.2rem;
  }
  .page-intro-section {
    padding: 1.5rem 1rem;
  }
  .menu-item {
    padding: 1.5rem;
    font-size: 1.2rem;
  }
}
