/* --- Grid styles: only active when .show-grid is present on body --- */
.show-grid .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.show-grid .stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    width: 100%;
    max-width: 1100px;
}

/* Support both .story and .story-card for grid items */
.show-grid .story,
.show-grid .story-card {
    background: #f5bf4a;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    cursor: pointer;
}

.show-grid .story img,
.show-grid .story-card img {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 5px;
    /* Prevent image dragging in grid */
    user-drag: none;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

/* --- Story styles: only active when .show-story is present on body --- */
.show-story .container {
  display: block;
  margin: 20px auto;
  padding: 15px;
  background-image: url('../Images/Misc/Background.png');
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  max-width: 1100px;
}

.show-story h1, 
.show-story h2, 
.show-story h3, 
.show-story h4, 
.show-story h5, 
.show-story h6 {
  font-family: 'Merriweather', serif;
}

.show-story p {
  font-family: 'Open Sans', Arial, sans-serif;
}

.show-story .story-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2em;
  background-color: #f3bc47;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  line-height: 1.6;
  position: relative;
  box-sizing: border-box;
}

/* Only keep the .story-content-scoped title row styles */
.show-story .story-content .story-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  width: 100%;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
  margin: 1.2em 0 0.2em 0; /* reduce bottom margin for overlap */
  flex-wrap: nowrap;
  position: relative;
  z-index: 1;
}

.show-story .story-content .story-title-row h2 {
  flex: 1 1 auto;
  margin: 0 0.2em;
  font-size: 2em; /* Change this value to your desired size */
  font-family: 'Merriweather', serif;
  font-weight: bold;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  display: block;
  max-width: 100%;
}

/* Absolutely position nav arrows relative to .story-title */
.show-story .story-content .story-title .story-nav-arrow,
.show-story .story-content .story-title .story-nav-arrow-placeholder {
  position: absolute;
  top: 0;
  bottom: 0;
  margin: auto 0;
  height: 3.5em;
  width: 3.5em;
  font-size: 2.5em;
  min-width: 3.5em;
  min-height: 3.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 50%;
  color: #d0812d;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  z-index: 2;
  line-height: 1;
  /* Remove margin from previous rules */
  margin: 0;
  padding: 0;
}

.show-story .story-content .story-title .story-nav-arrow.prev-arrow,
.show-story .story-content .story-title .story-nav-arrow-placeholder:first-child {
  left: -1.8em;
}

.show-story .story-content .story-title .story-nav-arrow.next-arrow,
.show-story .story-content .story-title .story-nav-arrow-placeholder:last-child {
  right: -1.8em;
}

.show-story .story-content .story-title .story-nav-arrow:hover {
  color: #f3bc47;
  background: rgba(37,10,62,0.08);
  text-decoration: none;
}

.show-story .story-content .story-date {
  width: 100%;
  text-align: center;
  margin-top: 0.2em;
  margin-bottom: 1em;
  color: #f3bc47;
  font-size: 1.1em;
  font-weight: bold;
  letter-spacing: 0.01em;
  display: block;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.show-story .story-image {
  display: block;
  max-width: 100%;
  margin: 1.5em auto;
  border-radius: 5px;
}

.show-story .image-caption {
  text-align: center;
  font-size: 0.85em;
  color: #000000;
  margin-top: -1em;
  margin-bottom: 2em;
  font-style: italic;
}

.show-story .back-link {
  display: inline-block;
  margin-top: 2em;
  text-decoration: none;
  color: #f3bc47;
  font-weight: bold;
}

.show-story .back-link:hover {
  text-decoration: underline;
}

.show-story .section-title {
  font-size: 1.5em;
  margin-bottom: 0.3em;
  color: #250a3e;
}

.show-story .story-section {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 2em;
  margin: -1.5em 0 1.2em 0;
  width: 100%;
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
  overflow: visible;
}

.show-story .story-section:only-child,
.show-story .story-section:has(> .story-video-block:only-child) {
  justify-content: center;
  width: 100%;
  overflow: visible;
}

.show-story .story-section > .story-video-block:only-child {
  margin-top: 2.5em !important;
  margin-bottom: 1em !important;
  width: 100%;
  max-width: 100%;
  margin: 2.5em 0;
  border-radius: 10px;
  align-items: center;
  border-left: 1.5px solid #d6a35c;
  border-right: 1.5px solid #d6a35c;
  background: rgba(255,255,255,0.13);
  box-sizing: border-box;
  padding-left: 0;
  padding-right: 0;
}

.show-story .story-video-block {
  width: 100%;
  max-width: 900px;
  margin: 2.5em auto 1em auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1.5px solid #d6a35c;
  border-radius: 10px;
  background: rgba(255,255,255,0.13);
  box-sizing: border-box;
  padding: 1.5em 1em 1.2em 1em;
  box-shadow: 0 4px 18px rgba(214,163,92,0.10);
  overflow: hidden;
}

.show-story .story-video-block video {
  display: block;
  margin: 0 auto 0.8em auto;
  width: 100%;
  max-width: 800px;
  height: auto;
  border-radius: 12px;
  background: #000;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}

.show-story .text-block {
  flex: 1 1 200px;
  min-width: 200px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.show-story .gallery-block {
  flex: 0 1 500px;
  width: 500px;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

.show-story .gallery-block .story-gallery {
  position: relative;
  width: 100%;
  max-width: 600px;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1.5px solid #d6a35c;
  border-radius: 10px;
  background: rgba(255,255,255,0.10);
  padding: 1em 1.5em;
  box-sizing: border-box;
  overflow: hidden; /* Prevent image overflow */
}

.show-story .gallery-image-wrapper {
  position: relative;
  width: 100%;
  max-width: 600px;
  aspect-ratio: 915 / 513;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  overflow: hidden;
}

.show-story .gallery-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 915 / 513;
  object-fit: contain;
  border-radius: 5px;
  display: block;
  background: transparent;
}

/* Gallery navigation buttons on the side, more discrete */
.show-story .gallery-controls {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
  padding: 0 0.2em;
}

.show-story .gallery-controls button {
  pointer-events: auto;
  background: none;
  color: #250a3e;
  border: none;
  padding: 0;
  font-size: 1.5em;
  font-weight: bold;
  cursor: pointer;
  border-radius: 0;
  box-shadow: none;
  transition: color 0.2s, background 0.2s, border 0.2s, transform 0.15s;
  outline: none;
  margin: 0;
  min-width: 1.5em;
  min-height: 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  opacity: 0.7;
}

.show-story .gallery-controls button:hover,
.show-story .gallery-controls button:focus {
  background: none;
  color: #d0812d;
  border: none;
  opacity: 1;
  transform: scale(1.08);
}

.show-story .gallery-controls button:active {
  background: none;
  color: #250a3e;
  border: none;
  opacity: 1;
  transform: none;
}

.show-story .gallery-controls button:focus {
  outline: 2px solid #f3bc47;
  outline-offset: 2px;
}

/* --- Story header box for title, date, and nav buttons --- */
.show-story .story-content .story-header-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #250a3e;
  color: #f3bc47;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(37,10,62,0.08);
  padding: 1.2em 2em 1.2em 2em;
  margin: 1.5em auto 2em auto;
  max-width: 700px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  gap: 1.2em;
}

.show-story .story-content .story-header-box .story-nav-arrow,
.show-story .story-content .story-header-box .story-nav-arrow-placeholder {
  flex: 0 0 auto;
  font-size: 2.2em;
  min-width: 1.5em;
  min-height: 1.5em;
  color: #d0812d;
  background: none;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  padding: 0.1em 0.2em;
  margin: 0;
  text-decoration: none;
}

.show-story .story-content .story-header-box .story-nav-arrow:hover {
  color: #fffbe9;
  background: #d0812d;
  text-decoration: none;
}

.show-story .story-content .story-header-main {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
}

.show-story .story-content .story-header-main h2 {
  font-size: 2em;
  font-family: 'Merriweather', serif;
  font-weight: bold;
  margin: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  /* Responsive font size for long titles */
  font-size: clamp(1.1em, 4vw, 2em);
}

.show-story .story-content .story-header-main .story-date {
  font-size: 1.1em;
  color: #f3bc47;
  font-weight: bold;
  margin: 0.3em 0 0 0;
  text-align: center;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* --- FIX: Mobile header on story page (show-story) --- */
@media (max-width: 900px) {
  body.show-story .mobile-header {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    z-index: 1001;
    width: 100vw;
    min-height: 44px;
    height: 44px;
    background: #150739;
  }
  body.show-story .mobile-header .title-banner {
    display: block;
    width: 100vw;
    max-width: 100vw;
    min-width: 100vw;
    height: 44px;
    object-fit: cover;
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    margin: 0;
    padding: 0;
    z-index: 0;
  }
  body.show-story .mobile-header .nav-button.stories {
    display: block;
    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;
    position: relative;
    right: 0;
    left: auto;
    margin-left: auto;
    margin-right: 8px;
    z-index: 1;
  }
  body.show-story .mobile-header .menu-toggle {
    display: flex;
    position: absolute;
    left: 0;
    top: 0;
    margin: 0;
    z-index: 3;
    width: 44px;
    height: 44px;
    align-items: center;
    background: #f3bc47;
  }
  body.show-story .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;
    flex-direction: row;
    justify-content: stretch;
    gap: 0;
  }
  body.show_story 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;
  }
  body.show-story .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;
    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;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  body.show-story header.menu-open .mobile-nav-fan .nav-button {
    opacity: 1;
  }
  body.show-story header.menu-open .mobile-nav-fan .nav-button:nth-child(1) {
    transform: translateX(0%) scale(1.03);
    transition-delay: 0.05s;
  }
  body.show-story header.menu-open .mobile-nav-fan .nav-button:nth-child(2) {
    transform: translateX(5%) scale(1.06);
    transition-delay: 0.10s;
  }
  body.show_story header.menu-open .mobile-nav-fan .nav-button:nth-child(3) {
    transform: translateX(10%) scale(1.09);
    transition-delay: 0.15s;
  }
  body.show_story header.menu-open .mobile-nav-fan .nav-button:nth-child(4) {
    transform: translateX(15%) scale(1.12);
    transition-delay: 0.20s;
  }
}

/* Responsive adjustments */
@media (max-width: 800px) {
  .show-story .story-content .story-header-box {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 1em 0.7em;
    max-width: 98vw;
    gap: 0.5em;
  }
  .show-story .story-content .story-header-box .story-nav-arrow,
  .show-story .story-content .story-header-box .story-nav-arrow-placeholder {
    align-self: center;
    font-size: 1.5em;
    min-width: 1.5em;
    min-height: 1.5em;
    margin: 0;
    /* Ensure arrows stay at the sides */
    position: static;
  }
  .show-story .story-content .story-header-main {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2em;
  }
  .show-story .story-content .story-header-main h2 {
    font-size: clamp(1em, 5vw, 1.2em);
    padding: 0 0.1em;
    max-width: 100%;
  }
  .show-story .story-content .story-header-main .story-date {
    font-size: 1em;
    padding: 0 0.1em;
  }
}

/* Responsive: stack vertically on small screens */
@media (max-width: 800px) {
  .show-story .story-section {
    flex-direction: column;
    gap: 0.6em; /* Reduced vertical gap */
  }
  .show_story .gallery-block,
  .show_story .text-block {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }
  .show-story .story-content .story-title {
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
  }
  .show-story .story-content .story-title-row {
    gap: 0.2em;
    padding-top: 1em;
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
  }
  .show-story .story-content .story-title-row h2 {
    font-size: 1.2em;
    padding: 0 0.1em;
    max-width: 60vw;
  }
  .show-story .story-content .story-title .story-nav-arrow,
  .show-story .story-content .story-title .story-nav-arrow-placeholder {
    height: 2.5em;
    width: 2.5em;
    font-size: 1.7em;
    min-width: 2.5em;
    min-height: 2.5em;
  }
  .show-story .story-content .story-title .story-nav-arrow.prev-arrow,
  .show-story .story-content .story-title .story-nav-arrow-placeholder:first-child {
    left: -1.2em;
  }
  .show-story .story-content .story-title .story-nav-arrow.next-arrow,
  .show-story .story-content .story-title .story-nav-arrow-placeholder:last-child {
    right: -1.2em;
  }
  .show-story .story-content .story-date {
    max-width: 90vw;
    margin-left: auto;
    margin-right: auto;
  }
  .show-story .gallery-controls button {
    font-size: 1.3em;
    min-width: 1.5em;
    min-height: 1.5em;
    padding: 0.3em 0.7em;
  }
  .show-story .gallery-controls {
    padding: 0 0.1em;
    /* Optionally, bring controls closer to the image */
    top: 48%;
  }
  .show-story .gallery-block .story-gallery {
    margin-bottom: 0 !important;
    padding-bottom: 0.2em !important;
  }
  .show-story .gallery-block {
    margin-top: -1em !important;
    margin-bottom: -12em !important;
    padding-bottom: -12em !important;
  }
  .show-story .story-section {
    gap: 0.3em;
  }
}

.oval-title.center-title {
  display: block;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  background-color: #f3bc47;
  padding: 10px 30px;
  border-radius: 25px;
  font-size: 2rem;
  margin-bottom: 20px;
  max-width: 300px;
  width: 100%;
  position: relative;
  left: 0;
  right: 0;
}