/*
 * PeachyMango site styles — matches peachymango.org look and feel
 * Layout: fixed-width container, dark top nav, primary blue accent
 */

:root {
  --pm-primary: #2830a6;
  --pm-primary-hover: #242b95;
  /* Topbar: primary blue to match buttons (use #93554a for terracotta/header style) */
  --pm-nav-bg: #2830a6;
  --pm-nav-text: #f8f9fa;
  --pm-body-bg: #fff;
  --pm-text: #212529;
  --pm-muted: #6c757d;
  --pm-border: #dee2e6;
  --pm-card-bg: #fff;
  --pm-max-width: 980px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--pm-text);
  background-color: #e6f3f6;
  background-image: url("/images/FM-background.jpg");
  background-position: center top;
  background-repeat: repeat;
}

.container {
  width: 100%;
  max-width: var(--pm-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 15px;
  padding-right: 15px;
}

/* Central content column: whitish background (matches live theme .col1) */
.col1,
main.col1 {
  padding-top: 0;
  background: #ffffff url("/images/page.jpg") repeat-x;
  padding-left: 15px;
  padding-right: 15px;
  padding-bottom: 1rem;
}

/* Page header: logo area */
.page-header {
  padding: 1rem 0;
}

.sitelogo a {
  display: inline-block;
}

.sitelogo img {
  max-width: 100%;
  height: auto;
}

/* Top bar: dark nav (matches live site navbar-dark bg-dark) */
.topbar {
  background-color: var(--pm-nav-bg);
  padding: 0.5rem 0;
  margin-bottom: 0;
}

.navbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 2.5rem;
}

.navbar-nav {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
}

.navbar-nav .nav-item {
  display: inline-block;
}

.navbar-nav .nav-link {
  color: var(--pm-nav-text);
  text-decoration: none;
  padding: 0.5rem 0.75rem;
  border-radius: 0.25rem;
  display: inline-block;
}

.navbar-nav .nav-link:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.navbar-nav .nav-item.active .nav-link {
  color: #fff;
  font-weight: 500;
}

/* Main content */
main {
  padding-bottom: 0;
}

.wikitext,
.content-area {
  max-width: 100%;
}

/* All images and iframes in main content: fit within column width (no overflow) */
.wikitext img,
.col1 img,
main img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Match Bootstrap .img-fluid so templates using it are constrained */
.img-fluid {
  max-width: 100%;
  height: auto;
}

.wikitext iframe,
.col1 iframe,
main iframe {
  max-width: 100%;
}

/* Optional wrapper for extra constraint (e.g. thumbnails) */
.content-img-wrap {
  max-width: 100%;
  overflow: hidden;
}
.content-img-wrap img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Headings: theme color #93554a (terracotta), bold */
.wikitext h1, .wikitext h2, .wikitext h3, .wikitext h4, .wikitext h5, .wikitext h6,
.content-area h1, .content-area h2, .content-area h3, .content-area h4, .content-area h5, .content-area h6,
.col1 h1, .col1 h2, .col1 h3, .col1 h4, .col1 h5, .col1 h6,
.showhide_heading {
  color: #93554a;
  font-weight: 700;
  clear: both;
}

.wikitext h1,
.content-area h1 {
  font-size: 1.75rem;
  margin-top: 0;
  margin-bottom: 1rem;
}

.wikitext h2,
.content-area h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--pm-border);
  padding-bottom: 0.25rem;
}

.wikitext h3,
.content-area h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.wikitext p,
.content-area p {
  margin-top: 0;
  margin-bottom: 1rem;
}

.wikitext a,
.content-area a {
  color: var(--pm-primary);
  text-decoration: none;
}

.wikitext a:hover,
.content-area a:hover {
  color: var(--pm-primary-hover);
  text-decoration: underline;
}

/* Cards (Patreon block, streaming links sections on live site) */
.card {
  background-color: var(--pm-card-bg);
  border: 1px solid var(--pm-border);
  border-radius: 0.25rem;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-body {
  padding: 1.25rem;
}

.card-body p:last-child {
  margin-bottom: 0;
}

/* Buttons */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease-in-out;
}

.btn-primary {
  color: #fff;
  background-color: var(--pm-primary);
  border-color: var(--pm-primary);
}

.btn-primary:hover {
  color: #fff;
  background-color: var(--pm-primary-hover);
  border-color: var(--pm-primary-hover);
  text-decoration: none;
}

/* Keep button text visible when buttons are links inside .wikitext (override .wikitext a color) */
.wikitext a.btn-primary,
.content-area a.btn-primary,
.wikitext a.btn-primary:hover,
.content-area a.btn-primary:hover {
  color: #fff;
  text-decoration: none;
}

/* Social / streaming link blocks */
.social-links a,
.music-streaming-links a {
  margin-right: 1rem;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.social-links nav,
.music-streaming-links nav {
  margin-bottom: 1rem;
}

/* Footer: same style as topbar, no gap above, space below for background */
.site-footer {
  margin-top: 0;
  padding: 0.5rem 15px;
  margin-bottom: 4rem;
  font-size: 1rem;
  color: var(--pm-nav-text);
  background-color: var(--pm-nav-bg);
}

.site-footer a {
  color: var(--pm-nav-text);
  text-decoration: none;
  padding: 0.15em 0.35em;
  margin: -0.15em -0.35em;
  border-radius: 0.25rem;
}

.site-footer a:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
}

.site-footer-copyright {
  margin: 0;
  text-align: center;
}

/* Utility */
.text-center {
  text-align: center;
}

/* Center block images inside .text-center (block ignores text-align) */
.text-center img {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mr-2 { margin-right: 0.5rem; }
.ms-2 { margin-left: 0.5rem; }
.float-left { float: left; }

/* FAQ section (SEO- and AI-friendly: semantic dl + Schema.org FAQPage) */
.faq-section .faq-list { margin: 0; padding: 0; list-style: none; }
.faq-section .faq-question { font-weight: 700; color: var(--pm-primary); margin-top: 1rem; margin-bottom: 0.25rem; }
.faq-section .faq-question:first-of-type { margin-top: 0; }
.faq-section .faq-answer { margin: 0 0 0 1rem; padding: 0; }

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}

/* Carousel (matches live site swiper-container) */
.carousel {
  width: 100%;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}

.carousel-inner {
  position: relative;
  width: 100%;
}

.carousel-slide {
  display: none;
  width: 100%;
  text-align: center;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.carousel-pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 0;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--pm-muted);
  cursor: pointer;
  transition: background-color 0.2s;
}

.carousel-dot:hover,
.carousel-dot.active {
  background-color: var(--pm-primary);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  padding: 0.5rem 0;
  margin: 0;
  list-style: none;
  background-color: #fff;
  border: 1px solid var(--pm-border);
  border-radius: 0.25rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  z-index: 100;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  display: block;
  padding: 0.5rem 1rem;
  color: var(--pm-text);
  text-decoration: none;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
  color: var(--pm-primary);
}

.dropdown-toggle::after {
  content: " ▾";
  font-size: 0.95em;
  margin-left: 0.2em;
  opacity: 1;
  font-weight: 700;
}

/* Embed (Apple Music, YouTube) */
.embed-responsive {
  margin-bottom: 1.5rem;
}

.embed-responsive iframe {
  max-width: 100%;
}

/* Generic 16:9 wrapper (legacy, used by some non-YouTube embeds) */
.embed-responsive-16by9 {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.embed-responsive-16by9 iframe {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 660px;
  height: 100%;
}

/* Dedicated wrapper for YouTube embeds */
.youtube-embed {
  position: relative;
  width: 100%;
  max-width: 660px;
  margin-left: auto;
  margin-right: auto;
  aspect-ratio: 16 / 9;
}

.youtube-embed iframe {
  width: 100%;
  height: 100%;
}

/* Streaming logos */
.music-streaming-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.music-streaming-links a {
  margin: 0;
}

.streaming-logo {
  max-width: 102px;
  width: 102px;
  height: auto;
  display: block;
}

/* Social icons */
.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.social-links a {
  margin: 0;
}

.social-icon {
  display: block;
}

/* Photo gallery section (in base layout, part of main content) */
.photo-gallery-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
}

/* Gallery: grid of squares filling section width; thumb = image fitted in square; hover = expand to landscape ratio at ~2× size */
.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  width: 100%;
  position: relative;
}

.gallery-item-cell {
  position: relative;
  overflow: visible;
}

.gallery-item-cell::before {
  content: '';
  display: block;
  padding-bottom: 100%;
}

.gallery-thumbs a.gallery-item {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 0.25rem;
  z-index: 1;
  transition: z-index 0.2s, box-shadow 0.2s ease-out;
}

.gallery-thumbs a.gallery-item:hover {
  z-index: 10;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

.gallery-thumbs a.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.25rem;
  border: 1px solid var(--pm-border);
  transition: border-color 0.2s, object-fit 0.2s ease-out;
}

.gallery-thumbs a.gallery-item:hover img {
  border-color: var(--pm-primary);
}

.gallery-thumbs a.gallery-item.gallery-item-hover {
  inset: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.gallery-thumbs a.gallery-item.gallery-item-hover img {
  object-fit: contain;
}

/* Photo gallery lightbox (overlay like cboxOverlay) */
.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.9);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.gallery-overlay[hidden] {
  display: none !important;
}

.gallery-lightbox {
  position: relative;
  max-width: 95vw;
  max-height: 90vh;
  cursor: default;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gallery-lightbox img {
  max-width: 100%;
  max-height: 75vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.25rem;
}

.gallery-lightbox-close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.9;
}

.gallery-lightbox-close:hover {
  opacity: 1;
}

.gallery-lightbox-prev,
.gallery-lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  border: 0;
  color: #fff;
  font-size: 2rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  z-index: 10001;
}

.gallery-lightbox-prev:hover,
.gallery-lightbox-next:hover {
  background: rgba(255, 255, 255, 0.35);
}

.gallery-lightbox-prev {
  left: 1rem;
}

.gallery-lightbox-next {
  right: 1rem;
}

.gallery-lightbox-caption {
  color: #fff;
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 0.25rem;
  max-width: 90vw;
  font-size: 0.95rem;
}

.gallery-lightbox-counter {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  margin: 0;
}

/* Button outline */
.btn-outline {
  color: var(--pm-primary);
  background-color: transparent;
  border: 1px solid var(--pm-primary);
}

.btn-outline:hover {
  color: #fff;
  background-color: var(--pm-primary);
  text-decoration: none;
}

/* Cookie consent banner: fixed at bottom of viewport */
#cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background-color: var(--pm-nav-bg);
  color: var(--pm-nav-text);
  padding: 1rem 15px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
}

#cookie-banner[hidden] {
  display: none !important;
}

#cookie-banner .cookie-banner-text {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.95rem;
  max-width: var(--pm-max-width);
  text-align: center;
}

@media (min-width: 640px) {
  #cookie-banner {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 1rem;
  }
  #cookie-banner .cookie-banner-text {
    flex: 1 1 auto;
    text-align: left;
    margin: 0;
  }
}

#cookie-banner a {
  color: var(--pm-nav-text);
  text-decoration: underline;
}

#cookie-banner a:hover {
  color: #fff;
}

#cookie-banner .cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

#cookie-banner .btn {
  margin: 0;
}

#cookie-banner .btn-primary {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
}

#cookie-banner .btn-primary:hover {
  background-color: rgba(255, 255, 255, 0.35);
  border-color: rgba(255, 255, 255, 0.7);
}

#cookie-banner .btn-outline {
  color: var(--pm-nav-text);
  border-color: rgba(255, 255, 255, 0.6);
}

#cookie-banner .btn-outline:hover {
  color: var(--pm-nav-bg);
  background-color: var(--pm-nav-text);
  border-color: var(--pm-nav-text);
}
