/* ============================================
   Warmland Learning Resources — Main Stylesheet
   Color Scheme: Blue + White
   ============================================ */

/* --- Variables --- */
:root {
  --blue-dark:    #1a3a5c;
  --blue-mid:     #2563a8;
  --blue-light:   #4a90d9;
  --blue-pale:    #e8f0fb;
  --white:        #ffffff;
  --text-dark:    #1a1a2e;
  --text-mid:     #4a5568;
  --border:       #d0dff0;
  --shadow:       rgba(26, 58, 92, 0.12);

  --font-heading: 'Merriweather', Georgia, serif;
  --font-body:    'Open Sans', Arial, sans-serif;

  --max-width: 1100px;
  --radius: 8px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--white);
  line-height: 1.7;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--blue-dark);
  line-height: 1.3;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.9rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

section { padding: 4rem 0; }

/* --- Navigation --- */
header {
  background: var(--blue-dark);
  box-shadow: 0 2px 8px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Logo banner sits below header — not sticky */
.logo-banner {
  position: relative;
  z-index: 99;
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Logo banner — white bar below nav */
.logo-banner {
  background: var(--white);
  padding: 0.5rem 1.5rem;
  text-align: center;
  border-bottom: 2px solid var(--border);
}

.logo-banner a {
  display: inline-block;
}

.logo-banner img {
  width: 100%;
  max-width: 700px;
  height: auto;
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: var(--white);
  text-decoration: none;
}

.nav-cta {
  background: var(--blue-light);
  color: var(--white) !important;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius);
  transition: background 0.2s !important;
}

.nav-cta:hover { background: var(--blue-mid) !important; }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: 0.3s;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
  color: var(--white);
  padding: 5rem 1.5rem;
  text-align: center;
}

.hero h1 {
  color: var(--white);
  font-size: 2.8rem;
  margin-bottom: 1.2rem;
  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.88);
  max-width: 620px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.2s;
  border: none;
}

.btn-primary {
  background: var(--white);
  color: var(--blue-dark);
}

.btn-primary:hover {
  background: var(--blue-pale);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255,255,255,0.6);
  margin-left: 1rem;
}

.btn-secondary:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

/* --- Mission Section --- */
.mission {
  background: var(--blue-pale);
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2.5rem;
}

.mission-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: 0 2px 12px var(--shadow);
  border-top: 4px solid var(--blue-light);
}

.mission-card h3 { margin-bottom: 0.75rem; }

/* --- Subject Categories --- */
.subjects { background: var(--white); }

.subjects h2 { text-align: center; margin-bottom: 0.5rem; }
.subjects .subtitle {
  text-align: center;
  color: var(--text-mid);
  margin-bottom: 2.5rem;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.subject-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--blue-pale);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  color: var(--text-dark);
}

.subject-card:hover {
  border-color: var(--blue-mid);
  box-shadow: 0 4px 16px var(--shadow);
  transform: translateY(-3px);
  text-decoration: none;
}

.subject-icon { font-size: 2.2rem; }
.subject-card h3 { font-size: 1rem; color: var(--blue-dark); }

/* --- About Page --- */
.about-hero {
  background: var(--blue-pale);
  padding: 4rem 1.5rem;
}

.about-profile {
  display: flex;
  gap: 3rem;
  align-items: flex-start;
  max-width: var(--max-width);
  margin: 0 auto;
}

.about-photo {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid var(--blue-light);
  box-shadow: 0 4px 20px var(--shadow);
}

.about-photo-placeholder {
  flex-shrink: 0;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: var(--blue-pale);
  border: 5px solid var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-mid);
  font-size: 0.9rem;
  text-align: center;
}

.about-text h1 { margin-bottom: 0.5rem; }
.about-credentials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.badge {
  background: var(--blue-mid);
  color: var(--white);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* --- Auth Section --- */
.auth-section {
  background: var(--blue-pale);
  padding: 4rem 1.5rem;
}

.auth-box {
  max-width: 440px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 4px 24px var(--shadow);
  overflow: hidden;
}

.auth-tabs {
  display: flex;
}

.auth-tab {
  flex: 1;
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  cursor: pointer;
  background: var(--blue-pale);
  border: none;
  color: var(--text-mid);
  font-size: 0.95rem;
  transition: 0.2s;
}

.auth-tab.active {
  background: var(--white);
  color: var(--blue-dark);
  border-bottom: 3px solid var(--blue-mid);
}

.auth-form {
  padding: 2rem;
  display: none;
}

.auth-form.active { display: block; }

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  color: var(--text-dark);
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color 0.2s;
  background: var(--white);
}

.form-group input:focus {
  outline: none;
  border-color: var(--blue-mid);
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.12);
}

.btn-full {
  width: 100%;
  padding: 0.8rem;
  background: var(--blue-mid);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-full:hover { background: var(--blue-dark); }

.auth-footer {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--text-mid);
}

/* --- Footer --- */
footer {
  background: var(--blue-dark);
  color: rgba(255,255,255,0.75);
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

footer a { color: var(--blue-light); }
footer a:hover { color: var(--white); }

/* --- Subject Page Hero --- */
.subject-hero {
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 100%);
  color: var(--white);
  padding: 3.5rem 1.5rem;
  text-align: center;
}

.subject-hero h1 {
  color: var(--white);
  margin-bottom: 0.5rem;
}

.subject-hero p {
  color: rgba(255,255,255,0.85);
  font-size: 1.1rem;
}

.subject-hero-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 0.75rem;
}

/* --- Grade Filters --- */
.filter-section {
  background: var(--white);
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 50;
}

.grade-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.grade-btn {
  padding: 0.4rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  color: var(--text-mid);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s;
}

.grade-btn:hover {
  border-color: var(--blue-mid);
  color: var(--blue-mid);
}

.grade-btn.active {
  background: var(--blue-mid);
  color: var(--white);
  border-color: var(--blue-mid);
}

/* --- Product Grid --- */
.products-section {
  padding: 3rem 0;
  min-height: 300px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.product-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.15s;
}

.product-card:hover {
  box-shadow: 0 6px 24px var(--shadow);
  transform: translateY(-2px);
}

.product-card.hidden {
  display: none;
}

.product-image {
  background: var(--blue-pale);
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-icon {
  font-size: 4rem;
}

.product-info {
  padding: 1.25rem;
}

.product-info h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.product-info p {
  font-size: 0.9rem;
  color: var(--text-mid);
  margin-bottom: 1rem;
}

.product-grades {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.grade-tag {
  background: var(--blue-pale);
  color: var(--blue-mid);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--blue-dark);
  font-family: var(--font-heading);
}

.btn-cart {
  padding: 0.55rem 1.25rem;
  background: var(--blue-mid);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  transition: background 0.2s;
}

.btn-cart:hover {
  background: var(--blue-dark);
}

.no-products {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-mid);
  font-size: 1.05rem;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.section-title { text-align: center; margin-bottom: 2.5rem; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  h1 { font-size: 1.9rem; }
  h2 { font-size: 1.5rem; }
  .hero h1 { font-size: 2rem; }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--blue-dark);
    padding: 1rem 1.5rem 1.5rem;
    gap: 1rem;
  }

  .nav-links.open { display: flex; }
  .nav-toggle { display: flex; }

  header { position: relative; }

  .about-profile {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-credentials { justify-content: center; }

  .btn-secondary { margin-left: 0; margin-top: 0.75rem; }
  .hero .btn-group { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
}

@media (max-width: 480px) {
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
}

@media print {
  header, footer, .btn { display: none; }
  body { color: #000; }
}
