/*
  CRE ARTE - Global Responsive Design System
  This file handles responsiveness across all pages to maintain a premium editorial feel.
*/



:root {
  --mobile-nav-bg: #f9f7f2;
  --accent-color: #6a1a1c;
  --transition-speed: 0.4s;
}

/* --- Global Accessibility Styles --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: #000;
  color: #fff;
  padding: 12px 24px;
  z-index: 99999;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom-right-radius: 4px;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--accent-color);
  outline-offset: 3px;
  border-radius: 2px;
}

main:focus {
  outline: none;
}

/* --- Mobile Navigation --- */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 3000;
}

.mobile-nav-toggle span {
  width: 100%;
  height: 2px;
  background-color: #111;
  transition: all var(--transition-speed) ease-in-out;
}

/* White bars for pages with dark backgrounds */
.nav-light .mobile-nav-toggle span {
  background-color: #fff;
}

.mobile-nav-toggle.active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.mobile-nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: var(--mobile-nav-bg);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: right var(--transition-speed) cubic-bezier(0.77, 0, 0.175, 1);
  padding: 2rem;
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-links {
  list-style: none;
  padding: 0;
  text-align: center;
}

.mobile-menu-links li {
  margin: 1.5rem 0;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease forwards;
}

.mobile-menu.active .mobile-menu-links li {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu.active .mobile-menu-links li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-menu-links li:nth-child(2) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-menu-links li:nth-child(3) { transition-delay: 0.3s; }
.mobile-menu.active .mobile-menu-links li:nth-child(4) { transition-delay: 0.4s; }

.mobile-menu-links a {
  font-family: 'Inter', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #111;
  text-decoration: none;
  transition: color 0.3s;
}

.mobile-menu-links a:hover {
  color: var(--accent-color);
}

/* --- Global Media Queries --- */

.scrap-postal {
  display: none !important;
}

@media (max-width: 1024px) {
  * {
    box-sizing: border-box !important;
  }

  html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
  }

  img, video {
    max-width: 100% !important;
    height: auto;
  }

  .t-nav-links {
    display: none !important;
  }
  
  .t-nav {
    padding: 20px 5% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    left: 0 !important;
    box-sizing: border-box !important;
  }
  
  .mobile-nav-toggle {
    display: flex !important;
    margin-left: auto !important; /* Pushes to the right even if alone */
    position: relative;
    z-index: 3500;
  }
  
  .top-logo img, .t-nav-logo img, .floating-logo img {
    height: 60px !important;
  }

  /* Padding adjustments */
  section {
    padding: 60px 4% !important;
  }

  /* Fluid headings */
  h1, .uk-heading-medium {
    font-size: 3rem !important;
  }
  
  h2, .uk-h2 {
    font-size: 2.2rem !important;
  }
}

@media (max-width: 768px) {
  h1, .uk-heading-medium {
    font-size: 2.5rem !important;
  }

  .mag-divider {
    max-width: 100% !important;
    margin: 40px 0 !important;
  }
  
  .footer-links {
    flex-direction: column !important;
    gap: 15px !important;
  }
}

/* Index Specific Fixes */
@media (max-width: 768px) {
  .cta-hero .uk-grid-large {
    flex-direction: column;
    text-align: center;
  }
  
  .cta-hero .uk-width-auto {
    margin-top: 20px;
  }

  .social-headline {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
  }

  .social-section {
    padding: 60px 0 40px 0 !important; /* Adjust padding nicely */
  }

  section.steps-section {
    margin-top: 120px !important; /* Increased for better separation */
    padding-top: 50px !important; /* Extra inner gap */
  }

  .step-card {
    margin-top: 0 !important; /* Reset staggered offsets from desktop */
  }
}

/* Layout adjustments for absolute positioned elements and fixed widths */
@media (max-width: 768px) {
  /* Common for Quienes Somos / Puertas */
  .about-spread, .where-split, .steps-grid, .workshop-split, .ed-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 30px !important;
    height: auto !important; /* Reset fixed heights */
  }

  .ed-card {
    height: auto !important;
    padding: 40px 5% !important; /* Standardize padding on mobile */
  }

  .scrapbook-gallery {
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .scrapbook-gallery img {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    margin-bottom: 20px !important;
    aspect-ratio: 4/3 !important;
    order: 1 !important;
  }
  
  /* Reset fixed widths to flexible percentages globally */
  div[style*="width:"] {
    max-width: 100% !important;
  }
  
  .spread-photo, .scattered-photo, .mag-scatter-img, [class^="scrap-"], [class^="sp-"], [class^="ms-"], [class^="photo-"] {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-bottom: 30px !important;
    aspect-ratio: auto !important;
    /* Img on top */
    order: 1 !important; 
  }
  
  .about-spread-title, .about-spread-text, .about-spread-body, .scrap-text-box, .where-text-details {
    width: 100% !important;
    max-width: 100% !important;
    text-align: center !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    order: 2 !important; /* Text below image */
  }
  
  .staff-mosaic {
    grid-template-columns: repeat(2, 1fr) !important; /* Switch to 2 cols in mobile instead of 1 */
  }
  
  .mosaic-text-box {
    display: none !important; /* Hide the text box on mobile as per user request */
  }
  
  .scrapbook-container {
    height: auto !important;
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100% !important;
  }

  .sticker-container {
    width: 45% !important; /* Smaller size as requested */
    margin: 80px auto -60px auto !important; /* Lower position, negative margin to float over the next section */
    position: relative !important;
    z-index: 50 !important; /* Ensure it stays on top of the image below */
  }

  .stationary-sticker {
    transform: none !important;
    width: 100% !important;
  }

  .festival-note {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    margin-top: 30px !important;
    pointer-events: auto !important;
  }
  
  .festival-banner {
    width: 100% !important;
    margin-left: 0 !important;
    min-height: auto !important;
    padding: 60px 0 !important;
  }

  /* Reset spacing between sections */
  .editorial-section, section[style*="margin-bottom"] {
    margin-top: 20px !important;
    margin-bottom: 20px !important;
    padding: 40px 5% !important;
  }
  
  .t-card {
     display: flex !important;
     flex-direction: column !important;
  }
  .t-card-text {
     order: 2 !important; /* text below image */
     padding: 40px 5% !important;
  }
  .t-card-img {
     order: 1 !important; /* image on top */
  }

  /* Specific fix for Where/Map Section on mobile */
  .where-headline {
    transform: none !important;
    margin-top: 0 !important;
    margin-bottom: 15px !important;
    text-align: center !important;
  }

  .where-highlight {
    margin-bottom: 5px !important;
  }

  .where-text-details {
    margin-bottom: 25px !important;
    order: 2 !important;
  }

  .where-map-container {
    order: 3 !important;
    z-index: 10 !important;
    width: 100% !important;
  }
}

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

@media (max-width: 320px) {
  .t-card-title {
    font-size: 1.8rem !important;
  }
  h1, .uk-heading-medium {
    font-size: 2rem !important;
  }
}
