/*
Theme Name: Hampstead Academy
Theme URI: https://hampsteadacademy.org
Description: A modern, responsive WordPress theme designed specifically for Hampstead Academy elementary school. Features full Gutenberg support, custom blocks, tour scheduling, and comprehensive theme options.
Author: Custom Development
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hampstead-academy
Tags: education, school, full-site-editing, block-patterns, custom-colors, custom-logo, editor-style, featured-images, threaded-comments, translation-ready, wide-blocks, accessibility-ready
*/

/* 
=== Hampstead Academy Theme Styles ===
This file contains the theme header and imports for the main stylesheet.
The actual styles are compiled from SCSS files in the assets/css directory.
*/

/* Import Google Fonts - Lexend */
@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

/* CSS Custom Properties - Brand Colors */
:root {
  /* Brand Colors */
  --ha-primary-blue: #07074E;
  --ha-secondary-blue: #3984AD;
  --ha-primary-accent: #50A684;
  --ha-accent-orange: #AA4F10;
  --ha-accent-yellow: #E0B03C;
  
  /* Typography */
  --ha-font-family: 'Lexend', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  
  /* Spacing */
  --ha-spacing-xs: 0.5rem;
  --ha-spacing-sm: 1rem;
  --ha-spacing-md: 1.5rem;
  --ha-spacing-lg: 2rem;
  --ha-spacing-xl: 3rem;
  --ha-spacing-xxl: 4rem;
  
  /* Border Radius */
  --ha-border-radius-sm: 4px;
  --ha-border-radius-md: 8px;
  --ha-border-radius-lg: 12px;
  
  /* Shadows */
  --ha-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --ha-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --ha-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
  
  /* Transitions */
  --ha-transition: all 0.3s ease;
}

/* Base Typography */
body {
  font-family: var(--ha-font-family);
  line-height: 1.6;
  color: var(--ha-primary-blue);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--ha-font-family);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--ha-spacing-sm);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

/* Links */
a {
  color: var(--ha-secondary-blue);
  text-decoration: none;
  transition: var(--ha-transition);
}

a:hover {
  color: var(--ha-primary-accent);
  text-decoration: underline;
}

/* Buttons */
.wp-block-button__link,
.ha-button {
  background-color: var(--ha-primary-accent);
  color: white;
  padding: var(--ha-spacing-sm) var(--ha-spacing-lg);
  border-radius: var(--ha-border-radius-md);
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: var(--ha-transition);
  border: none;
  cursor: pointer;
}

.wp-block-button__link:hover,
.ha-button:hover {
  background-color: var(--ha-secondary-blue);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--ha-shadow-md);
}

/* Secondary Button Style */
.ha-button--secondary {
  background-color: transparent;
  color: var(--ha-primary-blue);
  border: 2px solid var(--ha-primary-blue);
}

.ha-button--secondary:hover {
  background-color: var(--ha-primary-blue);
  color: white;
}

/* Accent Button Style */
.ha-button--accent {
  background-color: var(--ha-accent-orange);
}

.ha-button--accent:hover {
  background-color: var(--ha-accent-yellow);
  color: var(--ha-primary-blue);
}

/* Focus Styles for Accessibility */
:focus {
  outline: 2px solid var(--ha-primary-accent);
  outline-offset: 2px;
}

/* Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 999999;
  padding: var(--ha-spacing-sm) var(--ha-spacing-md);
  background-color: var(--ha-primary-blue);
  color: white;
  text-decoration: none;
}

.skip-link:focus {
  left: 6px;
  top: 7px;
}

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
}

/* WordPress Block Editor Styles */
.wp-site-blocks {
  padding-top: 0;
  padding-bottom: 0;
}

/* Front Page Specific - Remove gap between header and content */
.home .wp-site-blocks,
.front-page .wp-site-blocks {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.home .homepage-content,
.front-page .homepage-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.home .homepage-content > *:first-child,
.front-page .homepage-content > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Remove default WordPress block spacing that might cause gaps */
.home .wp-block-group:first-child,
.front-page .wp-block-group:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Ensure template parts don't add spacing */
.home .wp-block-template-part + .wp-block-group,
.front-page .wp-block-template-part + .wp-block-group {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Target the main content area specifically */
.home main.homepage-content,
.front-page main.homepage-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Remove any inherited spacing from WordPress core */
.home .wp-block-post-content > *:first-child,
.front-page .wp-block-post-content > *:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Container Styles */
.wp-block-group__inner-container,
.wp-block-cover__inner-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--ha-spacing-md);
}

/* Wide and Full Width Blocks */
.alignwide {
  max-width: 1400px;
}

.alignfull {
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

/* Responsive Design */
@media (max-width: 768px) {
  :root {
    --ha-spacing-xl: 2rem;
    --ha-spacing-xxl: 2.5rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.5rem; }
  
  .wp-block-group__inner-container,
  .wp-block-cover__inner-container {
    padding: 0 var(--ha-spacing-sm);
  }
  
  /* Prevent horizontal overflow on mobile */
  body {
    overflow-x: hidden;
  }
  
  /* Ensure all content blocks stay within viewport */
  .wp-site-blocks,
  .homepage-content {
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  /* Fix for alignwide blocks on mobile */
  .alignwide {
    max-width: calc(100vw - 10px);
    margin-left: 5px;
    margin-right: 5px;
  }
  
  .alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
  }
}

/* Print Styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }
  
  a, a:visited {
    text-decoration: underline;
  }
  
  .ha-no-print {
    display: none !important;
  }
}

/* Template-specific styles */

/* Header Styles */
.site-header {
  box-shadow: var(--ha-shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar {
  font-size: 0.9rem;
}

.header-social .wp-block-social-links {
  gap: 0.5rem;
}

/* Navigation Styles */
.main-navigation .wp-block-navigation__container {
  gap: 2rem;
}

.main-navigation .wp-block-navigation-item a {
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
}

.main-navigation .wp-block-navigation-item a:hover {
  text-decoration: none;
}

.main-navigation .wp-block-navigation-item a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--ha-primary-accent);
  transition: width 0.3s ease;
}

.main-navigation .wp-block-navigation-item a:hover::after {
  width: 100%;
}

/* Homepage Styles */
.hero-section {
  background: linear-gradient(135deg, var(--ha-primary-blue) 0%, var(--ha-secondary-blue) 100%);
}

.stats-section .wp-block-heading {
  margin-bottom: 0.5rem;
}

.program-card {
  transition: var(--ha-transition);
  border: 1px solid #e0e0e0;
}

.program-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--ha-shadow-lg);
}

/* Footer Styles */
.site-footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #cccccc;
  transition: var(--ha-transition);
}

.footer-links a:hover {
  color: var(--ha-primary-accent);
  text-decoration: none;
}

.footer-legal-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0;
}

.footer-legal-links li {
  margin: 0;
}

.newsletter-form input:focus,
.newsletter-form button:focus {
  outline: 2px solid var(--ha-primary-accent);
  outline-offset: 2px;
}

/* Post and Page Styles */
.page-header,
.post-header,
.archive-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.archive-post-card,
.related-post-card {
  transition: var(--ha-transition);
  border: 1px solid #e0e0e0;
}

.archive-post-card:hover,
.related-post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ha-shadow-md);
}

.sidebar-widget {
  border: 1px solid #e0e0e0;
  transition: var(--ha-transition);
}

.sidebar-widget:hover {
  box-shadow: var(--ha-shadow-sm);
}

.sidebar-cta {
  background: linear-gradient(135deg, var(--ha-primary-blue) 0%, var(--ha-secondary-blue) 100%);
}

/* 404 Page Styles */
.error-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.popular-links {
  list-style: none;
}

.popular-links li {
  margin-bottom: 0.75rem;
  padding-left: 1rem;
  position: relative;
}

.popular-links li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--ha-primary-accent);
  font-weight: bold;
}

.error-cta {
  background: linear-gradient(135deg, var(--ha-primary-blue) 0%, var(--ha-secondary-blue) 100%);
}

/* Custom Block Styles */
.hampstead-academy-blocks .wp-block {
  margin-bottom: var(--ha-spacing-lg);
}

/* Modal Styles - Removed to prevent conflicts with modal-system.css */
/* All modal styles are now handled in assets/css/modal-system.css */

/* Slide-out Panel Styles */
.ha-slideout {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100%;
  background: white;
  z-index: 9998;
  transition: right 0.3s ease;
  box-shadow: var(--ha-shadow-lg);
  overflow-y: auto;
}

.ha-slideout.active {
  right: 0;
}

.ha-slideout-content {
  padding: var(--ha-spacing-xl);
}

/* Form Styles */
.ha-form-group {
  margin-bottom: var(--ha-spacing-md);
}

.ha-form-label {
  display: block;
  margin-bottom: var(--ha-spacing-xs);
  font-weight: 500;
  color: var(--ha-primary-blue);
}

.ha-form-input,
.ha-form-textarea,
.ha-form-select {
  width: 100%;
  padding: var(--ha-spacing-sm);
  border: 2px solid #e0e0e0;
  border-radius: var(--ha-border-radius-sm);
  font-family: var(--ha-font-family);
  transition: var(--ha-transition);
}

.ha-form-input:focus,
.ha-form-textarea:focus,
.ha-form-select:focus {
  border-color: var(--ha-primary-accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(80, 166, 132, 0.1);
}

/* Loading Spinner */
.ha-loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid var(--ha-primary-accent);
  border-radius: 50%;
  animation: ha-spin 1s linear infinite;
}

@keyframes ha-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utility Classes */
.ha-text-center { text-align: center; }
.ha-text-left { text-align: left; }
.ha-text-right { text-align: right; }

.ha-mb-0 { margin-bottom: 0; }
.ha-mb-sm { margin-bottom: var(--ha-spacing-sm); }
.ha-mb-md { margin-bottom: var(--ha-spacing-md); }
.ha-mb-lg { margin-bottom: var(--ha-spacing-lg); }

.ha-mt-0 { margin-top: 0; }
.ha-mt-sm { margin-top: var(--ha-spacing-sm); }
.ha-mt-md { margin-top: var(--ha-spacing-md); }
.ha-mt-lg { margin-top: var(--ha-spacing-lg); }

.ha-hidden { display: none; }
.ha-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .ha-hide-mobile { display: none; }
  .ha-show-mobile { display: block; }
  
  .ha-modal-content {
    margin: var(--ha-spacing-sm);
    padding: var(--ha-spacing-md);
  }
  
  .ha-slideout {
    width: 100%;
    right: -100%;
  }
  
  .main-navigation .wp-block-navigation__container {
    gap: 1rem;
  }
  
  .footer-legal-links {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (min-width: 769px) {
  .ha-hide-desktop { display: none; }
  .ha-show-desktop { display: block; }
}

/* Animation Classes */
.ha-fade-in {
  animation: ha-fadeIn 0.5s ease-in;
}

.ha-slide-up {
  animation: ha-slideUp 0.5s ease-out;
}

@keyframes ha-fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ha-slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  :root {
    --ha-primary-blue: #000000;
    --ha-secondary-blue: #0066cc;
    --ha-primary-accent: #008800;
  }
  
  .wp-block-button__link,
  .ha-button {
    border: 2px solid currentColor;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
