/* This file is for custom styles that override the default styles provided by the theme. */
/* Site title link styles */
.site-title-link,
.site-title-link:visited,
.site-title-link:hover,
.site-title-link:active {
  text-decoration: none;
  color: inherit;
}

/* === MOBILE STYLES (below 992px for navbar-expand-lg) === */
@media (max-width: 991.98px) {
  /* Move navbar toggler to the right */
  .navbar-toggler {
    margin-left: auto;
    order: 1;
  }

  /* Ensure navbar container uses flexbox properly */
  .navbar > .container,
  .navbar > .container-fluid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  /* Keep brand stack on the left */
  .brand-stack {
    order: 0;
    margin-right: auto;
  }

  /* Right-side slide-in panel */
  #navbarNav.navbar-collapse {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    padding: 1rem;
    background-color: var(--panel, #050b19);
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    z-index: 1050;
    display: block !important;
    flex-basis: auto;
    flex-grow: 0;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  #navbarNav.navbar-collapse.show {
    transform: translateX(0);
  }

  /* Close button styling */
  #navbarNav .menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1051;
    padding: 0.5rem;
    background-color: transparent;
    border: none;
    cursor: pointer;
    filter: invert(1) grayscale(100%) brightness(200%);
  }

  /* Backdrop overlay */
  #navbarNav.navbar-collapse::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    z-index: -2;
    pointer-events: none;
  }

  #navbarNav.navbar-collapse.show::before {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  /* Mobile navigation styling - vertical layout */
  #navbarNav .navbar-nav {
    flex-direction: column;
    padding-top: 3.5rem;
    margin-top: 0;
    width: 100%;
  }

  #navbarNav .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  #navbarNav .nav-item:last-child {
    border-bottom: none;
  }

  #navbarNav .nav-link {
    padding: 1rem 0;
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.85rem;
    font-weight: 500;
  }

  #navbarNav .nav-link:hover,
  #navbarNav .nav-link.active {
    color: #fff;
    text-decoration: none;
  }
}

/* === DESKTOP STYLES (992px and above) === */
@media (min-width: 992px) {
  /* Restore default Bootstrap collapse behavior */
  #navbarNav.navbar-collapse {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    background-color: transparent;
    transform: none;
    transition: none;
    display: flex !important;
    flex-basis: auto;
    flex-grow: 1;
    z-index: auto;
    box-shadow: none;
    overflow-y: visible;
  }

  #navbarNav.navbar-collapse::before {
    display: none;
  }

  #navbarNav .menu-close {
    display: none;
  }

  /* Restore horizontal layout */
  #navbarNav .navbar-nav {
    flex-direction: row;
    padding-top: 0;
    margin-left: auto !important;
  }

  #navbarNav .nav-item {
    width: auto;
    border-bottom: none;
  }

  /* Let your existing .nav-links styles apply */
  #navbarNav .nav-link {
    padding: 0.5rem 1rem;
    /* Your styles.min.css .nav-links rules will apply via the class on the ul */
  }
}

/* Hero section responsive fixes - overrides styles.min.css */

/* Base improvements for all screen sizes */
.hero-section {
    position: relative;
}

.hero-media {
    position: relative;
    overflow: hidden;
    /* Ensure container expands with content */
    display: flex;
    flex-direction: column;
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
    /* Prevent image from shrinking too small */
    min-height: 300px;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(1,2,7,.98), rgba(5,13,30,.7) 45%, rgba(5,10,22,.2) 70%, transparent 100%);
    padding: 3rem;
    display: flex;
    /* Change from flex-end to center for better content containment */
    align-items: center;
    /* Allow overlay to scroll if content overflows */
    overflow-y: auto;
}

.hero-copy {
    max-width: 540px;
    /* Ensure copy doesn't overflow */
    width: 100%;
}

/* Mobile and small screens - stack layout */
@media (max-width: 767px) {
    .hero-media {
        display: flex;
        flex-direction: column;
    }

    .hero-image {
        position: relative;
        width: 100%;
        height: auto;
        min-height: 200px;
        max-height: 40vh;
        object-fit: cover;
    }

    .hero-overlay {
        position: relative;
        inset: auto;
        /* Darker gradient for readability when stacked */
        background: linear-gradient(180deg, rgba(1,2,7,.95), rgba(5,13,30,.98));
        padding: 2rem 1.5rem;
        align-items: flex-start;
        min-height: auto;
        overflow-y: visible;
    }

    .hero-copy h1 {
        font-size: clamp(1.8rem, 5vw, 2.4rem);
    }

    .hero-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .hero-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-overlay {
        padding: 2rem;
        align-items: center;
    }

    .hero-copy h1 {
        font-size: clamp(2rem, 4vw, 2.8rem);
    }
}

/* Large screens - restore original overlay behavior */
@media (min-width: 1025px) {
    .hero-overlay {
        align-items: flex-end;
        padding: 3rem;
    }
}
