/* ===================================================================
   Page Layout Structure
   Sequoia and Kings Canyon National Parks - Ranger Resources
   Modern Heritage Design - Textures, Gradients, & Shadows
   =================================================================== */

/* ===================================================================
   BODY - Textured Background
   =================================================================== */

body {
  background-color: var(--color-bg-primary);
  background-image:
    url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZGVmcz48cGF0dGVybiBpZD0iZ3JpZCIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIHBhdHRlcm5Vbml0cz0idXNlclNwYWNlT25Vc2UiPjxwYXRoIGQ9Ik0gMTAwIDAgTCAwIDAgMCAxMDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0icmdiYSg0NCw3Niw1OSwwLjAzKSIgc3Ryb2tlLXdpZHRoPSIxIi8+PC9wYXR0ZXJuPjwvZGVmcz48cmVjdCB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiBmaWxsPSJ1cmwoI2dyaWQpIi8+PC9zdmc+');
  background-size: 100px 100px;
  background-attachment: fixed;
}

/* ===================================================================
   SITE CONTAINER
   =================================================================== */

.site-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  position: relative;
}

/* Remove grain overlay for cleaner modern look */
.site-container::before {
  display: none;
}

.site-container__inner {
  background: transparent; /* Remove old box background */
  padding: 0;
  position: relative;
  z-index: 1;
}

/* Hide old decorative borders */
.site-container__top-border,
.site-container__bottom-border {
  display: none;
}

/* ===================================================================
   HEADER
   =================================================================== */

.site-header__top-bar {
  background: var(--color-deep-forest);
  padding: var(--spacing-3) var(--spacing-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-header {
  background:
    linear-gradient(
      to bottom,
      rgba(44, 76, 59, 0) 0%,
      rgba(44, 76, 59, 0) 40%,
      rgba(44, 76, 59, 0.9) 70%,
      rgba(44, 76, 59, 1) 100%
    ),
    url('../images/seq.jpg') center center / cover no-repeat;
  box-shadow: var(--shadow-xl);
  position: relative;
  min-height: 400px;
}

.site-header__content {
  height: var(--height-header-content);
}

.site-header__nav-container {
  background: transparent;
  height: auto;
  width: 100%;
  margin: auto;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}

/* ===================================================================
   SITE BRAND (Formerly #sitename)
   =================================================================== */

.site-brand {
  font-family: var(--font-family-heading);
  color: var(--color-text-inverse);
  font-size: var(--font-size-3xl);
  font-weight: 400;
  letter-spacing: var(--letter-spacing-tight);
  font-style: italic;
  display: block;
  flex: 0 0 auto;
}

.site-brand a {
  color: var(--color-text-inverse);
  background: none;
}

.site-brand a:hover {
  color: var(--color-sequoia-red);
  background: none;
}

.site-brand__tagline {
  display: block;
  color: var(--color-text-inverse);
  font-family: var(--font-family-heading);
  font-size: var(--font-size-brand-desc);
  font-style: italic;
  font-weight: 400;
  font-variant: normal;
}

/* ===================================================================
   SEARCH BAR - Modern Glass Effect
   =================================================================== */

.search-bar {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  width: 320px;
  height: 40px;
  flex: 0 0 320px;
  align-self: center;
  margin-right: var(--spacing-md);
  padding: 0;
  display: flex;
  align-items: center;
}

.search-form {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-text-inverse);
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  padding: 0;
  outline: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.1);
}

/* ===================================================================
   MAIN CONTENT AREA
   Converted from float-based (#left float:left, #sidebar margin-left:658px)
   to Flexbox with explicit 8px gap
   =================================================================== */

.site-main {
  background: transparent;
  padding: var(--spacing-4);
  display: flex;
  flex-wrap: nowrap;
  gap: var(--spacing-4);
  max-width: 1400px;
  margin: 0 auto;
}

.site-main__content {
  width: 100%;
  flex: 1 1 auto;
  /* Grid removed - back to single column for clarity */
}

.site-main__sidebar {
  flex: 0 0 320px;
  min-width: 320px;
  position: sticky;
  top: 2rem;
  align-self: flex-start;
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
  padding: var(--spacing-3);
  background: var(--color-bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Custom scrollbar for sidebar */
.site-main__sidebar::-webkit-scrollbar {
  width: 6px;
}

.site-main__sidebar::-webkit-scrollbar-track {
  background: rgba(44, 76, 59, 0.05);
  border-radius: 3px;
}

.site-main__sidebar::-webkit-scrollbar-thumb {
  background: var(--color-sequoia-red);
  border-radius: 3px;
}

/* ===================================================================
   FOOTER
   =================================================================== */

.site-footer {
  background: var(--color-deep-forest);
  background-image: var(--overlay-grain);
  color: var(--color-text-inverse);
  padding: var(--spacing-4);
  margin-top: var(--spacing-8);
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.1);
}

.site-footer__copyright {
  text-align: left;
}

.site-footer__credit {
  padding: var(--spacing-sm);
  font: var(--font-size-small) var(--font-family-serif);
}

.site-footer__credit div {
  text-align: left;
}

.site-footer__credit a {
  font-family: var(--font-family-heading);
}

/* ===================================================================
   RESPONSIVE MEDIA QUERIES
   Desktop-first approach
   =================================================================== */

/* Tablet: 768px - 972px */
@media (max-width: 972px) {
  .site-container {
    width: 100%;
    max-width: 768px;
    padding: 0 10px;
  }

  .site-main {
    gap: 10px;
  }

  .site-main__content {
    flex: 0 0 65%;
    width: 65%;
    grid-template-columns: 1fr; /* Single column on tablet */
  }

  .site-main__sidebar {
    flex: 0 0 33%;
  }

  .site-brand {
    font-size: 20px;
  }

  .site-brand__tagline {
    font-size: 18px;
  }

  .search-bar {
    width: 350px;
    flex: 0 0 350px;
  }

  .search-bar__input {
    width: 250px;
  }
}

/* Mobile Landscape: 480px - 767px */
@media (max-width: 767px) {
  .site-container {
    width: 100%;
    padding: 0 5px;
  }

  .site-container__inner {
    background: var(--color-bg-white);
  }

  /* Stack layout vertically */
  .site-main {
    flex-direction: column;
    gap: 20px;
    background: var(--color-bg-white);
    padding: var(--spacing-md);
  }

  .site-main__content {
    flex: 1 1 100%;
    width: 100%;
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: var(--spacing-3);
  }

  .site-main__sidebar {
    flex: 1 1 100%;
    width: 100%;
    order: 2;
  }

  /* Header becomes stacked */
  .site-header__top-bar {
    flex-direction: column;
    height: auto;
    align-items: center;
    text-align: center;
    padding: var(--spacing-md) var(--spacing-sm);
  }

  .site-brand {
    font-size: 18px;
    margin-bottom: var(--spacing-lg);
    padding-top: var(--spacing-sm);
    text-align: center;
  }

  .site-brand__tagline {
    font-size: 16px;
  }

  .search-bar {
    margin: 0 0 var(--spacing-md) 0;
    width: 100%;
    max-width: 400px;
    flex: 1 1 100%;
  }

  .search-bar__form {
    padding-left: 60px;
  }

  .search-bar__input {
    width: 220px;
  }

  .site-footer {
    width: 100%;
    padding: var(--spacing-sm);
    font-size: 0.9em;
  }
}

/* Mobile Portrait: < 480px */
@media (max-width: 479px) {
  .site-brand {
    font-size: 16px;
  }

  .site-brand__tagline {
    font-size: 14px;
  }

  .search-bar {
    max-width: 100%;
  }

  .search-bar__form {
    padding-left: 40px;
  }

  .search-bar__input {
    width: 180px;
  }

  .site-footer {
    font-size: 0.8em;
    padding: var(--spacing-xs);
  }

  .site-footer__copyright,
  .site-footer__credit {
    font-size: 0.85em;
  }
}
