/**
 * Bentham School Theme Styles
 * Design tokens + component styles for the school theme
 *
 * Reset & base utilities provided by parent theme (school-base)
 */

/* --- Design Tokens --- */
:root {
  --color-green-dark: #2d5016;
  --color-green: #3a6b1e;
  --color-green-light: #4a8428;
  --color-green-pale: #e8f0e0;
  --color-orange: #e87a2e;
  --color-orange-dark: #d06820;
  --color-cream: #faf8f4;
  --color-white: #ffffff;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-border: #e0ddd8;

  --font-heading: 'Google Sans Flex', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'Google Sans Flex', 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body-weight: 420;
  --font-body-wdth: 100;
  --font-body-grad: 0;
  --font-body-rond: 0;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.12);
  --transition: 0.25s ease;
}

/* --- Global --- */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  font-style: normal;
  font-weight: var(--font-body-weight);
  font-optical-sizing: auto;
  font-variation-settings:
    "slnt" 0,
    "wdth" var(--font-body-wdth),
    "GRAD" var(--font-body-grad),
    "ROND" var(--font-body-rond);
  color: var(--color-text);
  background: var(--color-white);
}

/* Optional utility for forcing variable font on specific elements */
.google-sans-flex {
  font-family: var(--font-body);
  font-optical-sizing: auto;
  font-style: normal;
  font-weight: 400;
  font-variation-settings:
    "slnt" 0,
    "wdth" 100,
    "GRAD" 0,
    "ROND" 0;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
}

a {
  color: var(--color-green-dark);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus-visible {
  color: var(--color-green);
}

.nav-menu,
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.logo,
.nav-menu a,
.footer-col a,
.btn,
.feature-card,
.news-card,
.section-link,
.read-more {
  text-decoration: none;
  color: inherit;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--color-green-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.site-header.is-scrolled {
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
}

.logo img {
  height: 44px;
  width: auto;
}

/* Nav */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-menu a {
  color: var(--color-white);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: background var(--transition), opacity var(--transition);
}

.nav-menu a:hover {
  opacity: 0.85;
}

.nav-btn {
  font-size: 0.85rem !important;
  padding: 0.5rem 1.25rem !important;
}

.nav-btn--contact {
  background: var(--color-green-light);
}

.nav-btn--contact:hover {
  background: var(--color-green) !important;
  opacity: 1 !important;
}

.nav-btn--portal {
  background: var(--color-orange);
}

.nav-btn--portal:hover {
  background: var(--color-orange-dark) !important;
  opacity: 1 !important;
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform var(--transition);
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before {
  top: -7px;
}

.hamburger::after {
  top: 7px;
}

.nav-toggle[aria-expanded="true"] .hamburger {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .hamburger::before {
  top: 0;
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .hamburger::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ============================================
   HERO
   ============================================ */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('../images/hero.jpg') center/cover no-repeat;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(30, 60, 10, 0.75) 0%,
    rgba(30, 60, 10, 0.45) 50%,
    transparent 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4rem 0 3.5rem;
  max-width: 600px;
}

.hero h1 {
  font-size: clamp(2.8rem, 5vw, 4rem);
  color: var(--color-white);
  margin-bottom: 1rem;
  line-height: 1.05;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.85rem 2rem;
  border-radius: 50px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.btn--primary {
  background: var(--color-orange);
  color: var(--color-white);
  border-color: var(--color-orange);
}

.btn--primary:hover {
  background: var(--color-orange-dark);
  border-color: var(--color-orange-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(232, 122, 46, 0.35);
}

.btn--outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.btn--outline:hover {
  background: var(--color-white);
  color: var(--color-green-dark);
  transform: translateY(-1px);
}

/* ============================================
   FEATURE CARDS
   ============================================ */
.features {
  padding: 3.5rem 0 3rem;
  background: var(--color-white);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.feature-card {
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-card__image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.feature-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.feature-card:hover .feature-card__image img {
  transform: scale(1.05);
}

.feature-card__body {
  padding: 1.25rem 1.25rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.feature-card__body h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}

.feature-card__link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-green);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap var(--transition);
}

.feature-card:hover .feature-card__link {
  gap: 0.6rem;
}

/* ============================================
   NEWS & CALENDAR
   ============================================ */
.news-calendar {
  padding: 3rem 0 3.5rem;
  background: var(--color-cream);
}

.news-calendar__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border);
}

.section-header h2 {
  font-size: 1.35rem;
  color: var(--color-text);
}

.section-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-green);
  transition: color var(--transition);
}

.section-link:hover {
  color: var(--color-green-dark);
}

/* News Cards */
.news-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.news-card {
  display: flex;
  gap: 1rem;
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  padding: 0.85rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.news-card__image {
  width: 120px;
  min-height: 90px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
}

.news-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.news-card__body h3 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.35;
}

.news-card__body time {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* Calendar */
.calendar-list {
  display: flex;
  flex-direction: column;
}

.calendar-item {
  display: flex;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

.calendar-item:last-child {
  border-bottom: none;
}

.calendar-item__date {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  background: var(--color-green);
  color: var(--color-white);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.calendar-item__day {
  font-size: 1.35rem;
  font-weight: 700;
}

.calendar-item__month {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-item__body h3 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.15rem;
}

.calendar-item__body p {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

/* ============================================
   HEADTEACHER'S WELCOME
   ============================================ */
.welcome {
  position: relative;
  padding: 4rem 0;
  overflow: hidden;
}

.welcome-bg {
  position: absolute;
  inset: 0;
  background: url('../images/welcome-bg.jpg') center/cover no-repeat;
  z-index: 0;
}

.welcome-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(30, 60, 10, 0.8),
    rgba(30, 60, 10, 0.65)
  );
}

.welcome-heading {
  position: relative;
  z-index: 1;
  color: var(--color-white);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.welcome-card {
  position: relative;
  z-index: 1;
  display: flex;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.welcome-card__photo {
  width: 280px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.welcome-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.welcome-card__name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: var(--color-white);
  padding: 2rem 1.25rem 1rem;
}

.welcome-card__name strong {
  display: block;
  font-size: 1rem;
}

.welcome-card__name span {
  font-size: 0.8rem;
  opacity: 0.85;
}

.welcome-card__content {
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.welcome-card__content h3 {
  font-size: 1.2rem;
  color: var(--color-green-dark);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.welcome-card__content p {
  font-size: 0.92rem;
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}

.read-more {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--color-green);
  transition: color var(--transition);
}

.read-more:hover {
  color: var(--color-green-dark);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--color-green-dark);
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-col p {
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.8);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--color-white);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  font-size: 0.88rem;
}

.footer-col--logo {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.footer-col--logo img {
  height: 60px;
  width: auto;
  opacity: 0.9;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .nav-menu {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--color-green-dark);
    flex-direction: column;
    padding: 1rem var(--layout-padding) 1.5rem;
    gap: 0.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }

  .nav-menu.is-open {
    display: flex;
  }

  .nav-menu a {
    display: block;
    padding: 0.75rem 1rem;
  }

  .nav-btn {
    text-align: center;
    margin-top: 0.5rem;
  }

  /* Hero */
  .hero {
    min-height: 420px;
  }

  .hero h1 {
    font-size: 2.4rem;
  }

  .hero-content {
    padding: 3rem 0 2.5rem;
  }

  /* News & Calendar */
  .news-calendar__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Welcome */
  .welcome-card {
    flex-direction: column;
  }

  .welcome-card__photo {
    width: 100%;
    height: 240px;
  }

  .welcome-card__content {
    padding: 1.5rem;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .footer-col--logo {
    justify-content: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2rem;
  }

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

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    text-align: center;
  }

  .news-card {
    flex-direction: column;
  }

  .news-card__image {
    width: 100%;
    height: 160px;
  }
}
