/**
 * AroundManchester.com Main Stylesheet
 * Static website CSS following BEM methodology and modular design principles
 * Includes responsive design, accessibility features, and consistent naming conventions
 */

/* ===== CSS CUSTOM PROPERTIES (VARIABLES) ===== */
:root {
  /* Color Variables */
  --color-primary: #4a6bb5;
  --color-secondary: #3a5a95;
  --color-tertiary: #2a4a85;
  --color-white: #ffffff;
  --color-text-primary: #333333;
  --color-text-secondary: #555555;
  --color-text-muted: #777777;
  --color-medium-gray: #cccccc;

  /* Background Variables */
  --bg-section-light: #f8f9fa;
  --bg-section-medium: #eef2f7;
  --bg-section-card: #ffffff;

  /* Gradient Variables */
  --gradient-primary: linear-gradient(135deg, #4a6bb5, #3a5a95);
  --gradient-secondary: linear-gradient(135deg, #3a5a95, #2a4a85);

  /* Spacing Variables */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Font Size Variables */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;

  /* Border Radius Variables */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 50%;

  /* Shadow Variables */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.2);

  /* Transition Variables */
  --transition-base: all 0.3s ease;
  --transition-fast: all 0.2s ease;
}

/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: #e8e8e8;
}

/* Container utility */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ===== SITE HEADER BLOCK ===== */
.site-header {
  background: var(--bg-section-light, #e9edf5);
  padding: 20px 12px 10px;
  border-bottom: 1px solid rgba(42,74,145,.25);
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4a6bb5, #3a5a95, #2a4a85, #3a5a95, #4a6bb5);
  background-size: 200% 100%;
  animation: gradientShift 4s ease-in-out infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.site-header__branding {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  max-width:1200px;
  margin:0 auto;
}

.site-header__brand-text {
  font-size: 2.4rem;
  line-height: 1;
  margin: 0;
  color: #2a4a91;
  text-shadow: 0 2px 4px rgba(0,0,0,.15);
  letter-spacing: -1px;
  background: linear-gradient(135deg, #2c3e50, #34495e, #4a6bb5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}

.site-header__brand-subtitle {
  font-size: .8rem;
  color: #496fb7;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: .06em;
  margin-top: 6px;
}

.site-header__brand-domain {
  font-size: .85rem;
  color: #777;
  margin-top: 2px;
  font-style: italic;
}

/* Enhanced Brand circle with logo */
.site-header__brand-circle {
  width: 68px;
  height: 68px;
  background-image: url('https://www.aroundmanchester.com/resources/AroundManchesterLoGo001.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border-radius: 50%;
  border: 4px solid #3f61a8;
  box-shadow: 0 10px 24px rgba(66,96,170,.3) inset, 0 2px 16px rgba(66,96,170,.2);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.site-header__brand-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 28px rgba(74, 107, 181, 0.4);
}

.site-header__breadcrumb {
  margin-bottom: 5px;
  font-size: 1.2rem;
  color: #495057;
  font-weight: 500;
  padding: 6px 20px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 25px;
  border-left: 4px solid #4a6bb5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.site-header__description {
  font-size: 1.1rem;
  color: #495057;
  max-width: 900px;
  line-height: 1.7;
  padding: 15px 25px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(74, 107, 181, 0.2);
  margin: 0 auto;
  text-align: center;
}

/* ===== BREADCRUMB NAVIGATION ===== */
.breadcrumb-nav {
  background: #eef2f7;
  border-top: 1px solid rgba(66,96,170,.2);
  border-bottom: 1px solid rgba(66,96,170,.2);
  padding: 10px 12px;
}

.breadcrumb-nav a {
  color: #4a6bb5;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.breadcrumb-nav a:hover {
  color: #3a5a95;
  text-decoration: underline;
}

.breadcrumb-nav__separator {
  margin: 0 6px;
  color: #6b7a90;
  font-weight: bold;
}

.breadcrumb-nav__current {
  color: #333;
  font-weight: 600;
}

/* ===== REGION HEADER SECTION (used by regions-renderer.js) ===== */
.region-header {
  background: linear-gradient(135deg, #b8b8b8, #c8c8c8);
  padding: 30px 20px;
  text-align: center;
  border-bottom: 1px solid #aaa;
}

.region-header__title {
  margin: 0 0 6px 0;
  font-size: 2.5rem;
  color: #333;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.region-header__description {
  font-size: 1.2rem;
  color: #555;
  margin-bottom: 25px;
  font-weight: 500;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.region-header__stats {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.region-stat {
  background: #f6f8fb;
  border: 1px solid #dfe6f3;
  border-radius: 10px;
  padding: 8px 12px;
  text-align: center;
}

.region-stat__number {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: #2a4a91;
  margin-bottom: 5px;
}

.region-stat__label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== BUSINESS DIRECTORY LISTS BLOCK ===== */
.business-directory__lists {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 12px;
}

.business-directory__lists h3 {
  font-size: 1.8rem;
  color: #333;
  margin-bottom: 25px;
  text-align: center;
  font-weight: 600;
}

/* Custom List Styles */
.business-directory__list {
  max-width: 700px;
  margin: 0 auto 16px;
  padding: 0;
  background: #fff;
  border: 1px solid #dfe6f3;
  border-radius: 12px;
  box-shadow: 0 3px 10px rgba(0,0,0,.04);
  overflow: hidden;
}

.business-directory__list-header {
  padding: 10px 12px;
  background: #eef2f7;
  border-bottom: 1px solid #dfe6f3;
  color: #2a4a91;
  font-weight: 800;
}

.business-directory__list li {
  padding: 10px 12px;
  border-top: 1px solid #eef2f7;
}

.business-directory__list li a {
  color: #2a4a91;
  text-decoration: none;
}

.site-footer {
  background: #131a27;
  color: #cfd7e6;
  padding: 30px 12px 18px;
}

.site-footer__content {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.site-footer__links {
  margin-top: 15px;
  margin-bottom: 10px;
}

.site-footer__link {
  color: #cfd7e6;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.3s ease;
}

.site-footer__link:hover {
  color: #ffffff;
  text-decoration: underline;
}

.site-footer__separator {
  margin: 0 10px;
  color: #cfd7e6;
}

.site-footer__copyright-text {
  margin-top: 20px;
}

/* ===== DIVIDER STYLES ===== */
.divider {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg,transparent,#cbd6ea,transparent);
  margin: 14px 0;
}

/* ===== REGION PAGE STYLES ===== */
.region-page-utf8-fix {
  /* Force UTF-8 encoding for list icons */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .site-header {
    padding: 8px 15px;
  }

  .site-header__brand-text {
    font-size: 2.5rem;
  }

  .site-header__brand-circle {
    width: 80px;
    height: 80px;
  }

  .business-directory__lists {
    padding: 20px 15px;
  }

  .business-directory__list {
    padding: 15px;
    margin-bottom: 20px;
  }

  .business-directory__list li {
    padding: 10px 0;
    font-size: 0.9rem;
  }

  .business-directory__list-header {
    font-size: 1rem;
    padding: 8px 15px;
  }
}

@media (max-width: 480px) {
  .site-header__brand-text {
    font-size: 2rem;
  }

  .site-header__brand-circle {
    width: 70px;
    height: 70px;
  }

  .business-directory__list {
    padding: 12px;
  }
}

/* ===== GALLERY SECTION STYLES ===== */
.gallery-section {
  background: #d3d3d3;
  padding: 40px 20px;
  text-align: center;
}

.gallery-section h3 {
  color: #333;
  font-size: 2rem;
  margin-bottom: 15px;
  font-weight: 700;
}

.gallery-section p {
  color: #555;
  font-size: 1.1rem;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== PHOTO GALLERY STYLES ===== */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.photo-gallery__item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.photo-gallery__item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.photo-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-gallery__item:hover img {
  transform: scale(1.05);
}

.photo-gallery__item-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  color: #ffffff;
  padding: 20px;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.photo-gallery__item:hover .photo-gallery__item-overlay {
  transform: translateY(0);
}

.photo-gallery__item-overlay h4 {
  margin: 0 0 8px 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
}

.photo-gallery__item-overlay p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.9;
  color: #ffffff;
}

/* Mobile adjustments for photo gallery */
@media (max-width: 768px) {
  .photo-gallery {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
  }
  
  .gallery-section {
    padding: 30px 15px;
  }
  
  .gallery-section h3 {
    font-size: 1.5rem;
  }
}

/* ===== BUSINESS TEMPLATE STYLES ===== */

/* Gallery Modal Styles */
.gallery-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

.gallery-modal__content {
  position: relative;
  width: 90%;
  height: 90%;
  margin: 5% auto;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.gallery-modal__close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-base);
  z-index: 1001;
}

.gallery-modal__close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-modal__image {
  max-width: 100%;
  max-height: 80%;
  object-fit: contain;
  border-radius: var(--radius-lg);
}

.gallery-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  font-size: 2rem;
  padding: var(--spacing-md);
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition-base);
  z-index: 1001;
}

.gallery-modal__nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.gallery-modal__nav--prev {
  left: 20px;
}

.gallery-modal__nav--next {
  right: 20px;
}

.gallery-modal__counter {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  z-index: 1001;
}

.gallery-modal__caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  background: rgba(0, 0, 0, 0.7);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  max-width: 80%;
  text-align: center;
  z-index: 1001;
}

/* Mobile adjustments for gallery modal */
@media (max-width: 768px) {
  .gallery-modal__content {
    width: 95%;
    height: 95%;
    margin: 2.5% auto;
  }

  .gallery-modal__image {
    max-height: 70%;
  }

  .gallery-modal__close {
    top: 10px;
    right: 10px;
    font-size: 1.5rem;
    width: 35px;
    height: 35px;
  }

  /* Move navigation arrows below the image on mobile */
  .gallery-modal__nav {
    position: fixed;
    top: auto;
    bottom: 120px;
    transform: translateY(0);
    font-size: 1.5rem;
    padding: 12px 16px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .gallery-modal__nav--prev {
    left: 20px;
  }

  .gallery-modal__nav--next {
    right: 20px;
  }

  .gallery-modal__counter {
    bottom: 70px;
    font-size: 0.9rem;
    padding: 6px 12px;
  }

  .gallery-modal__caption {
    bottom: 20px;
    max-width: 90%;
    font-size: 0.85rem;
    padding: 8px 12px;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}