/* ==========================================================================
   Village Magpies - Hugo Theme
   Optimized for Performance & SEO
   Colors: Primary Green #699026, Dark Brown #331803
   ========================================================================== */

/* CSS Custom Properties for easy theming */
:root {
  --color-primary: #699026;
  --color-primary-dark: #557a1e;
  --color-dark: #331803;
  --color-text: #444444;
  --color-text-light: #666666;
  --color-bg: #ffffff;
  --color-bg-alt: #f7fbfe;
  --color-border: #eeeeee;
  --font-body: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --max-width: 1140px;
  --header-height: 80px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-dark);
  margin: 0 0 1rem;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; font-weight: 700; }
h2 { font-size: 2rem; font-weight: 700; }
h3 { font-size: 1.5rem; font-weight: 600; }
h4 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1rem; }

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

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

ul, ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

li { margin-bottom: 0.5rem; }

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--color-bg);
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
  height: var(--header-height);
}

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

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

/* Navigation */
.nav-menu ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.5rem;
}

.nav-menu a {
  display: block;
  padding: 0.5rem 1rem;
  color: #555555;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu .active a {
  color: var(--color-primary);
}

.nav-menu .get-started a {
  background: var(--color-primary);
  color: #fff;
  border-radius: 50px;
  padding: 0.625rem 1.5rem;
  margin-left: 1rem;
}

.nav-menu .get-started a:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

/* Mobile Navigation Toggle */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.mobile-nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background: var(--color-dark);
  border-radius: 2px;
  transition: 0.3s;
}

@media (max-width: 991px) {
  .mobile-nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    padding: 1rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: none;
  }

  .nav-menu.active {
    display: block;
  }

  .nav-menu ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-menu a {
    padding: 0.5rem 1rem;
  }

  .nav-menu .get-started {
    margin-top: 0.25rem;
  }

  .nav-menu .get-started a {
    display: block;
    text-align: center;
    margin-left: 0;
  }
}

/* ==========================================================================
   Main Content
   ========================================================================== */
#main {
  margin-top: var(--header-height);
}

/* Section Titles */
.section-title {
  text-align: center;
  padding-bottom: 2rem;
}

.section-title h1,
.section-title h2 {
  position: relative;
  display: inline-block;
}

.section-title h1::before,
.section-title h1::after,
.section-title h2::before,
.section-title h2::after {
  content: '';
  width: 50px;
  height: 2px;
  background: var(--color-primary);
  display: inline-block;
  vertical-align: middle;
}

.section-title h1::before,
.section-title h2::before {
  margin-right: 15px;
}

.section-title h1::after,
.section-title h2::after {
  margin-left: 15px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 2rem 0;
  min-height: auto;
  display: flex;
  align-items: center;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-text h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--color-dark);
}

.hero-subtitle {
  font-size: 1.5rem;
  color: #484848;
  margin-bottom: 2rem;
}

.hero-image img {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (max-width: 991px) {
  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-image {
    order: -1;
  }

  .hero-image img {
    max-width: 300px;
    margin: 0 auto;
  }

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

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

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  border-radius: 50px;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

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

.btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ==========================================================================
   Quick Info Section
   ========================================================================== */
.quick-info {
  padding: 4rem 0;
  background: var(--color-bg-alt);
}

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

.info-card {
  background: var(--color-bg);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(68, 88, 144, 0.1);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(68, 88, 144, 0.15);
}

.info-card h3 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.info-card p {
  color: var(--color-text-light);
  margin-bottom: 1rem;
}

.info-card a {
  font-weight: 600;
}

/* ==========================================================================
   About Preview Section
   ========================================================================== */
.about-preview {
  padding: 4rem 0;
  text-align: center;
}

.about-preview h2 {
  margin-bottom: 1.5rem;
}

.about-preview p {
  max-width: 800px;
  margin: 0 auto 1.5rem;
}

.about-preview .btn {
  margin-top: 1rem;
}

/* ==========================================================================
   Featured Programmes Section
   ========================================================================== */
.featured-programmes {
  padding: 4rem 0;
  background: var(--color-bg-alt);
  text-align: center;
}

.featured-programmes h2 {
  margin-bottom: 2rem;
}

.programme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.programme-item {
  display: block;
  padding: 1.25rem 1rem;
  background: var(--color-bg);
  border-radius: 8px;
  font-weight: 600;
  color: var(--color-dark);
  transition: all 0.3s ease;
}

.programme-item:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ==========================================================================
   How It Works Section
   ========================================================================== */
.how-it-works {
  padding: 4rem 0;
  text-align: center;
}

.how-it-works h2 {
  margin-bottom: 3rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.step {
  padding: 1.5rem;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.step h3 {
  margin-bottom: 0.5rem;
}

.step p {
  color: var(--color-text-light);
  margin: 0;
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */
.breadcrumbs {
  margin-bottom: 1.5rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.breadcrumbs li {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  color: var(--color-text-light);
}

.breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin: 0 0.5rem;
  color: var(--color-text-light);
}

.breadcrumbs a {
  color: var(--color-primary);
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs li[aria-current="page"] {
  color: var(--color-dark);
  font-weight: 600;
}

/* ==========================================================================
   Page Content
   ========================================================================== */
.page-content {
  padding: 4rem 0;
}

.page-content .content {
  max-width: 800px;
  margin: 0 auto;
}

.page-content .content h2 {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.page-content .content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.page-content .content h3 {
  margin-top: 1.5rem;
  color: var(--color-primary);
}

.page-content .content img {
  border-radius: 8px;
  margin: 1.5rem 0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.page-content .content hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1.5rem 0;
}

.page-content .content strong {
  color: var(--color-dark);
}

/* ==========================================================================
   Footer
   ========================================================================== */
#footer {
  background: var(--color-bg);
  box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.05);
  padding: 2rem 0;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-copyright p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-light);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--color-text);
  font-size: 0.875rem;
}

.footer-links a:hover {
  color: var(--color-primary);
}

@media (max-width: 767px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
}

/* ==========================================================================
   Back to Top
   ========================================================================== */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--color-primary-dark);
  color: #fff;
  transform: translateY(-3px);
}

/* ==========================================================================
   Accessibility
   ========================================================================== */
:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 8px;
  z-index: 10000;
}

.skip-link:focus {
  top: 0;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
  .header,
  .back-to-top,
  .mobile-nav-toggle {
    display: none !important;
  }

  #main {
    margin-top: 0;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }
}
