@import url('https://fonts.googleapis.com/css?family=Merriweather:700,900&display=swap');
@import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap');

/* General Styling */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #150739;
    overflow-x: hidden;
}

.container {
    display: flex;
    justify-content: space-between;
    margin: 20px auto;
    padding: 15px;
    background-image: url('../Images/Misc/Background.png'); /* Update the path to your PNG image */
    background-size: cover; /* Optional: Ensures the image covers the entire container */
    background-position: center; /* Optional: Centers the image within the container */
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
}

.oval-title {
    display: inline-block;
    padding: 10px 30px;
    background-color: #f3bc47; /* Oval background color */
    border-radius: 25px; /* Creates the oval shape */
    font-size: 2rem;
    margin-bottom: 20px;
    max-width: 300px; /* Adjusted for better fit */
    width: 300px; /* Ensures the title is centered and has a consistent width */
    text-align: center;
}

/* Header */
header {
    position: relative;
    text-align: center;
    background-color: #150739;
    color: white;
    overflow: hidden;
}

header img {
    width: 100%;
    height: auto;
    max-height: 25vh;
    object-fit: cover;
}

/* Footer */
footer {
    text-align: left;
    background-color: #150739;
    color: #f3bc47;
    padding: 15px;
    position: relative;
    bottom: 0;
    width: 100%;
}

.title-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    background-size: 130% 130%;
    flex-direction: row;
    gap: 12px; /* bring nav buttons closer to logo */
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Add a banner image behind everything in the header */
.header-banner-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
    opacity: 1;
}

.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    z-index: 2;
}

.title-banner {
    pointer-events: none;
    width: 260px;
    height: auto;
    max-width: 50vw;
    max-height: 180px;
    object-fit: contain;
    z-index: 0;
    position: static;
    transform: none;
}

.nav-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 18px;
    z-index: 2;
}

.nav-row-left {
    margin-right: 0;
}
.nav-row-right {
    margin-left: 0;
}

.nav-row .nav-button {
    width: 70px;
    height: 70px;
    max-width: 90px;
    margin: 0;
    background-size: contain;
}

/* Hide old nav-container and nav ul for this layout */
.nav-container,
.nav-container ul,
nav ul {
    display: none !important;
}

/* Navigation Styling */

nav ul {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: center;
}

nav ul li {
    margin: 0 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}



.nav-container ul {
    position: relative;
    display: flex;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 2;
}

.nav-button {
    display: block;
    width: 120px;
    height: 120px;
    max-width: 160px;
    margin: 0 16px;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    display: block;
    transition: transform 0.2s;
    position: relative;
    z-index: 2;
}

.nav-button.stories {
    background-image: url('../Images/Misc/Storiesnh.png');
}

.nav-button.gallery {
    background-image: url('../Images/Misc/Gallerynh.png');
}

.nav-button.calendar {
    background-image: url('../Images/Misc/Calendarnh.png');
}

.nav-button.about {
    background-image: url('../Images/Misc/Aboutnh.png');
}

.nav-button:hover {
    transform: scale(1.1);
}

.nav-button.stories:hover {
    background-image: url('../Images/Misc/Storiesh.png');
}

.nav-button.gallery:hover {
    background-image: url('../Images/Misc/Galleryh.png');
}

.nav-button.calendar:hover {
    background-image: url('../Images/Misc/Calendarh.png');
}

.nav-button.about:hover {
    background-image: url('../Images/Misc/Abouth.png');
}

nav ul li a {
    display: block;
    text-align: center;
}

nav ul li a span {
    display: block;
    font-size: 0.8rem;
    color: white;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Merriweather', serif;
}

/* Paragraphs */
p {
  font-family: 'Open Sans', Arial, sans-serif;
}

/* Remove underline and set color for all links */
a {
  text-decoration: none;
  color: inherit;
}

/* Optionally, add a hover effect for clarity */
a:hover {
  text-decoration: underline; /* or keep none if you don't want any effect */
  color: inherit;
}

/* --- Mobile Header --- */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  width: 100vw;
  min-height: 44px;
  height: 44px;
  background: #150739;
  display: none;
}

.mobile-header .title-banner {
  width: 100vw;
  max-width: 100vw;
  min-width: 100vw;
  height: 44px;
  object-fit: cover;
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  transform: none;
  display: block;
  margin: 0;
  padding: 0;
  z-index: 0;
}

.mobile-header .nav-button {
  position: relative;
  z-index: 1;
}

.mobile-header .nav-button.stories {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  margin: 0 8px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  box-shadow: none;
}

/* --- Fan-out nav overlay for mobile menu --- */
@media (max-width: 900px) {
  .mobile-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 1001;
    /* Ensure full width for absolute positioning */
    width: 100vw;
  }

  /* Hide desktop header/nav */
  /* .title-container { */
  /* display: none !important; */
  /* } */

  /* Fan-out nav overlay */
  .mobile-nav-fan {
    display: none;
    position: absolute;
    top: 0;
    left: 52px;
    height: 44px;
    width: calc(100vw - 52px);
    z-index: 2;
    align-items: center;
    background: transparent;
    pointer-events: none;
    overflow-x: hidden;
    box-sizing: border-box;
    min-width: 0;
    /* Fix: Ensure children are visible and not collapsed */
    flex-direction: row;
    justify-content: stretch;
    gap: 0; /* Remove any default gap between buttons */
  }
  header.menu-open .mobile-nav-fan {
    display: flex !important;
    flex-direction: row;
    justify-content: stretch;
    align-items: stretch;
    pointer-events: auto;
    width: calc(100vw - 52px);
    overflow-x: hidden;
    min-width: 0;
    gap: 0;
  }
  .mobile-nav-fan .nav-button {
    flex: 1 1 0;
    min-width: 0 !important;
    max-width: none;
    width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    margin: 0; /* No margin between buttons */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    box-shadow: none;
    opacity: 0;
    transform: translateX(0) scale(0.8);
    transition: 
      opacity 0.25s cubic-bezier(.4,2,.6,1),
      transform 0.35s cubic-bezier(.4,2,.6,1);
    pointer-events: auto;
    /* Fix: Ensure buttons are not collapsed */
    display: flex;
    align-items: center;
    justify-content: center;
  }
  header.menu-open .mobile-nav-fan .nav-button {
    opacity: 1;
  }
  /* Fanning motion: bring buttons as close as possible */
  header.menu-open .mobile-nav-fan .nav-button:nth-child(1) {
    transform: translateX(0%) scale(1.03);
    transition-delay: 0.05s;
  }
  header.menu-open .mobile-nav-fan .nav-button:nth-child(2) {
    transform: translateX(5%) scale(1.06);
    transition-delay: 0.10s;
  }
  header.menu-open .mobile-nav-fan .nav-button:nth-child(3) {
    transform: translateX(10%) scale(1.09);
    transition-delay: 0.15s;
  }
  header.menu-open .mobile-nav-fan .nav-button:nth-child(4) {
    transform: translateX(15%) scale(1.12);
    transition-delay: 0.20s;
  }
  /* Position the menu button at the absolute far left */
  .mobile-header .menu-toggle {
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    z-index: 3;
  }

  /* Adjust mobile-nav-fan to start after the menu button */
  .mobile-nav-fan {
    left: 52px; /* menu button width (44px) + 8px gap */
  }

  /* Stories button at the far right */
  .mobile-header .nav-button.stories {
    position: relative;
    right: 0;
    left: auto;
    margin-left: auto;
    margin-right: 8px;
    z-index: 1;
  }

  .mobile-header .title-banner {
    /* ...existing code... */
  }

  .title-container {
    /* ...existing code... */
    gap: 0px; /* Reduce gap between elements in the title-container */
  }

  .logo-container {
    /* Optionally shrink logo a bit for more space */
    width: 140px !important;
    min-width: 100px !important;
    max-width: 150px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .mobile-nav-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0; /* No vertical gap between stacked buttons */
    margin: 0 16px !important; /* Increase horizontal margin */
    padding: 0 !important;
    width: 48px; /* Make nav columns as narrow as possible */
    min-width: 44px;
    max-width: 52px;
  }

  .mobile-nav-left {
    margin-right: 16px !important;
  }
  .mobile-nav-right {
    margin-left: 16px !important;
  }

  .nav-button.mobile-nav {
    margin: 0 !important; /* No margin for stacked buttons */
    padding: 0 !important;
  }
}

/* On desktop, always show header/nav, hide mobile header and menu button */
@media (min-width: 901px) {
  .mobile-header {
    display: none !important;
  }
  .title-container,
  .nav-container {
    display: flex !important;
  }
  .menu-toggle {
    display: none !important;
  }
}

/* Desktop: show nav-container, hide nav-stacks */
.nav-container,
.nav-container ul,
nav ul {
    display: flex !important;
}
.nav-stack {
    display: none;
}

/* Desktop: keep original nav layout */
.title-container {
    /* ...existing code... */
    flex-direction: row;
    gap: 12px; /* bring nav buttons closer to logo */
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Hide nav-stacks by default (desktop) */
.nav-stack {
    display: none;
}

/* Show nav-container (desktop) */
.nav-container,
.nav-container ul,
nav ul {
    display: flex !important;
}

/* Only style nav-button inside nav-container for desktop */
.nav-container .nav-button {
    width: 200px;
    height: 150px;
    max-width: none;
    margin: 0 10px;
    background-size: cover;
}

/* --- Responsive Design for Mobile --- */
@media (max-width: 900px) {
  html, body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
    padding-right: 0 !important;
    margin-right: 0 !important;
  }
  body {
    box-sizing: border-box;
  }
  .container {
    display: flex;
    justify-content: space-between;
    margin: 20px auto;
    padding: 15px;
    background-image: url('../Images/Misc/Background.png'); /* Update the path to your PNG image */
    background-size: cover; /* Optional: Ensures the image covers the entire container */
    background-position: center; /* Optional: Centers the image within the container */
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    max-width: 1100px;
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
  }
  main, header, footer {
    box-sizing: border-box;
    width: 100vw;
    max-width: 100vw;
    margin-left: 0;
    margin-right: 0;
    overflow-x: hidden;
  }
  .oval-title {
    display: inline-block;
    padding: 10px 30px;
    background-color: #f3bc47; /* Oval background color */
    border-radius: 25px; /* Creates the oval shape */
    font-size: 2rem;
    margin-bottom: 20px;
    max-width: 300px; /* Adjusted for better fit */
    width: 300px; /* Ensures the title is centered and has a consistent width */
    text-align: center;
  }
  /* --- Mobile Header --- */
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    background: #150739;
    position: relative;
    min-height: 60px;
    z-index: 1001;
    height: 44px;
  }

  .mobile-header .title-banner {
    width: 100vw;
    max-width: 100vw;
    min-width: 100vw;
    height: 44px;
    object-fit: cover;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    transform: none;
    display: block;
    margin: 0;
    padding: 0;
    z-index: 0;
  }

  .mobile-header .nav-button {
    position: relative;
    z-index: 1;
  }

  .mobile-header .nav-button.stories {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    margin: 0 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    box-shadow: none;
  }

  .title-container {
    /* ...existing code... */
    gap: 0px; /* Reduce gap between elements in the title-container */
  }

  .logo-container {
    /* Optionally shrink logo a bit for more space */
    width: 140px !important;
    min-width: 100px !important;
    max-width: 150px !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .mobile-nav-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0; /* No vertical gap between stacked buttons */
    margin: 0 16px !important; /* Increase horizontal margin */
    padding: 0 !important;
    width: 48px; /* Make nav columns as narrow as possible */
    min-width: 44px;
    max-width: 52px;
  }

  .mobile-nav-left {
    margin-right: 16px !important;
  }
  .mobile-nav-right {
    margin-left: 16px !important;
  }

  .nav-button.mobile-nav {
    margin: 0 !important; /* No margin for stacked buttons */
    padding: 0 !important;
  }
}

/* On desktop, hide mobile nav columns */
@media (min-width: 901px) {
  .mobile-nav-col {
    display: none !important;
  }
  .desktop-nav {
    display: inline-flex !important;
  }
}