/*
 * Base Styles
 * Contains core styles, resets, fonts, and default desktop (1920px) styling
 * This file is loaded first and provides the foundation for all breakpoints
 */

/* Import Fonts */
@font-face {
  font-family: "Resist Mono Variable Upright Light";
  src: url("../assets/fonts/resist-mono-variable-upright-light.otf")
    format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Resist Mono Variable Upright Thin";
  src: url("../assets/fonts/resist-mono-variable-upright-thin.otf")
    format("opentype");
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

/* Reset and Base Styles */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Disable focus-visible outline for all links */
a:focus-visible {
  outline: none;
}

html {
  scroll-behavior: smooth;
  /* CRITICAL: DO NOT set overflow-x or overflow-y on html element
       This breaks position: sticky by creating a new scroll container */
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  /* Fallback for older browsers (Safari < 16, iOS < 16) */
  overflow-x: hidden;
  /* Modern browsers: clip prevents horizontal scroll without breaking sticky */
  overflow-x: clip;
}

/* Background Image - Default (Desktop) */
.background-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background-image: url("../assets/1920px/bg.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Sticky Stack Container - wraps all sections after hero */
.stack-container {
  position: relative;
  width: 100%;
  /* Height = number of sections × 100vh (1 about + 9 gallery + 1 contact = 11) */
  height: calc(11 * 100vh);
}

/* Base section styles (for sections NOT in the stack) */
section {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* Sticky stacking ONLY for sections inside the stack-container */
.stack-container > section {
  /* Fallback for browsers without sticky support (IE 11, older Safari) */
  position: relative;
  /* Safari 6.1-12.1 requires -webkit- prefix */
  position: -webkit-sticky;
  /* Modern browsers */
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 100vh;
  /* Prevent transforms that would break sticky */
  transform: none !important;
  will-change: auto;
  /* Ensure content is vertically centered */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
}

/* Section inner wrapper for content positioning */
.section-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Main Container (Hero Section) */
.main-container {
  position: relative;
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 1;
}

/* Site Name - RENAS Logo */
.site-name {
  display: inline-block;
  animation: fadeIn 1.5s ease-out;
  /* Default size for 1920px (Desktop) */
  width: 468px;
  height: 77px;
}

/* Home Logo (top-left, outside menu) */
.home-logo {
  position: fixed;
  top: 25px;
  left: 50px;
  z-index: 150;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  pointer-events: none;
}

.home-logo.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.home-logo.visible:hover {
  opacity: 0.8;
}

.home-logo-img {
  display: block;
  width: 121px;
  height: 30px;
}

/* Navigation Links Container */
.nav-links {
  position: fixed;
  top: 25px;
  right: 20px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  z-index: 100;
}

/* Link Styles */
.nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.nav-link:hover {
  opacity: 1;
}

.nav-link img {
  display: block;
  height: auto;
}

/* Menu link sizing */
.menu-link-img {
  width: 95px;
  height: 22px;
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #772510;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.menu-overlay.active {
  transform: translateX(0);
}

/* Menu Close Button */
.menu-close {
  position: fixed;
  top: 25px;
  right: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 201;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.menu-close:hover {
  opacity: 0.8;
}

.close-img {
  display: block;
  width: 95px;
  height: 22px;
}

/* Menu Logo (top-left) */
.menu-logo {
  position: fixed;
  top: 25px;
  left: 20px;
  z-index: 201;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
}

.menu-logo:hover {
  opacity: 0.8;
}

.menu-logo-img {
  display: block;
  width: 121px;
  height: 30px;
}

/* Menu Content */
.menu-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Menu Navigation Items */
.menu-nav-link {
  font-family: "Resist Mono Variable Upright Light", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 30px;
  font-weight: 300;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.3s ease;
  line-height: 48px;
}

.menu-nav-link:hover {
  opacity: 0.7;
}

/* About Section */
#about {
  background-color: #38261c;
  color: #ffffff;
  text-align: center;
  z-index: 10;
}

.sign-up {
  width: 124px;
  height: 37px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.sign-up:hover {
  opacity: 0.7;
}

/* Contact Section */
#contact {
  background-color: #463335;
  color: #ffffff;
  text-align: center;
  z-index: 20;
}

#about p,
#contact p {
  font-family: "Resist Mono Variable Upright Thin", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 24px;
  line-height: 32px;
}

#about p {
  width: 1080px;
  margin-bottom: 30px;
}

/* Responsive line breaks */
.mobile-break {
  display: none;
}
.desktop-break {
  display: none;
}

/* Mobile and tablet portrait: show mobile breaks */
@media screen and (max-width: 1023px) and (orientation: portrait) {
  .mobile-break {
    display: block;
  }
}

/* Desktop and tablet landscape: show desktop breaks */
@media screen and (min-width: 1024px), screen and (max-width: 1023px) and (orientation: landscape) {
  .desktop-break {
    display: block;
  }
}

.contact-address {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-lower {
  margin-top: 30px;
}

#contact a {
  color: #ffffff;
  text-decoration: none;
  transition: opacity 0.3s ease;
}

#contact a:hover {
  opacity: 0.7;
}

/* Gallery Sections */
.gallery-section {
  background-color: #000000;
  justify-content: flex-start;
}

/* Gallery wrapper - applies to all breakpoints */
.gallery-wrapper {
  width: 100%;
  padding-top: 72px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.gallery-wrapper picture {
  display: block;
  width: 100%;
  flex-shrink: 0;
}

.gallery-wrapper img {
  width: 100%;
  height: auto;
  display: block;
}

/* Apply z-index layering for stacking effect */
#gallery-1 {
  z-index: 11;
}
#gallery-2 {
  z-index: 12;
}
#gallery-3 {
  z-index: 13;
}
#gallery-4 {
  z-index: 14;
}
#gallery-5 {
  z-index: 15;
}
#gallery-6 {
  z-index: 16;
}
#gallery-7 {
  z-index: 17;
}
#gallery-8 {
  z-index: 18;
}
#gallery-9 {
  z-index: 19;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

  .menu-overlay {
    transition-duration: 0.01ms !important;
  }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .nav-link {
    opacity: 1;
  }
}

/* Mailchimp Modal Popup */
.mailchimp-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 300;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mailchimp-modal-overlay.active {
  display: flex;
  opacity: 1;
}

.mailchimp-modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.mailchimp-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: #38261c;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
  z-index: 301;
}

.mailchimp-close:hover {
  opacity: 0.7;
}

/* Print Styles */
@media print {
  .background-container {
    display: none;
  }

  .nav-links {
    position: static;
    margin-top: 2rem;
  }

  .mailchimp-modal-overlay {
    display: none !important;
  }
}
