/* ==================================================
   Base Styles
================================================== */
body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  background: #f8f8f8;
  color: #333;
}

/* ==================================================
   Header
================================================== */
.site-header,
header {
  background: #2c3e50;
  color: #fff;
  padding: 1rem;
  text-align: center;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header h1 {
  font-size: 2.5rem;
  margin: 0 auto;
  max-width: 90%;
  word-wrap: break-word;
  white-space: normal;
}

header p {
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

/* ==================================================
   Layout
================================================== */
.container {
  display: flex;
  flex-direction: column;
  max-width: 1100px;
  margin: auto;
  padding: 2rem 1rem;
}

@media (min-width: 768px) {
  .main-content {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
  }
}

/* ==================================================
   Article & Sidebar
================================================== */
article {
  background: #fff;
  padding: 2rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
}

.sidebar {
  background: #fffefc;
  padding: 1rem;
  border: 1px solid #f0e8d9;
  border-radius: 0.5rem;
}

.sidebar ul {
  padding-left: 1rem;
  margin-top: 1rem;
}

.sidebar li {
  margin-bottom: 0.5rem;
}

.meta-info {
  list-style: none;
  padding-left: 0;
  line-height: 1.6;
}

.meta-info > li {
  margin-bottom: 1rem;
  border-bottom: 1px dashed #ddd;
  padding-bottom: 0.5rem;
}

.meta-info ul {
  list-style: disc;
  margin-left: 1.2rem;
  margin-top: 0.5rem;
  padding-left: 1rem;
}


/* ==================================================
   Nearby Section
================================================== */
.nearby {
  margin-top: 3rem;
  padding: 1.5rem;
  background: #eef5ec;
  border-left: 4px solid #27ae60;
  border-radius: 0.5rem;
}

.nearby h3 {
  margin-top: 0;
}

.nearby ul {
  padding-left: 1rem;
}

/* ==================================================
   Section Titles
================================================== */
.section-title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* ==================================================
   Tile & Gem Grid
================================================== */
.gems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.provinces {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.provinces .tile {
  flex: 0 1 auto;
  min-width: 120px;
  text-align: center;
}

.tile {
  background: #f9f9f9;
  padding: 1rem;
  text-decoration: none;
  color: #222;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.1);
  text-align: center;
}

.tile-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.tile strong {
  font-size: 1.1rem;
}

.tile .location {
  font-size: 0.85rem;
  color: #666;
  margin-top: 1rem;
}

.tile:hover {
  background: #f8fff8;
  border-color: #27ae60;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tile-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

/* ==================================================
   Navbar
================================================== */
.navbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 999;
  background: rgba(255,255,255,0.9);
  padding: 0.5rem 1rem;
  box-sizing: border-box;
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.logo img {
  height: 40px;
}

.navbar ul {
  display: flex;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar a {
  color: #333;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
}

.navbar a.active {
  font-weight: bold;
  text-decoration: underline;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #333;
  font-size: 2.2rem;
  position: absolute;
  right: 2.5rem;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .navbar ul {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    flex-direction: column;
    background: rgba(255,255,255,0.9);
    width: 200px;
    border-radius: 6px;
    padding: 1rem;
  }
  .navbar ul.show { display: flex; }
}

/* ==================================================
   Town Menu
================================================== */
.town-menu {
  margin-bottom: 2rem;
}

.town-menu h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.town-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.town-link {
  background: #e8f0fe;
  color: #0056b3;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.95rem;
  white-space: nowrap;
  border: 1px solid #d0dcea;
  transition: background 0.2s;
}

.town-link:hover {
  background: #d0e2ff;
}

/* ==================================================
   Search Autocomplete
================================================== */
form.search-form {
  position: relative;
  max-width: 600px;
  margin: 0 auto 2rem;
}

#search-input {
  width: 100%;
  padding: 0.5rem;
  font-size: 1rem;
}

.autocomplete-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  display: none;
  z-index: 1000;
}

.autocomplete-item {
  padding: 0.5rem;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}

.autocomplete-item:last-child { border-bottom: none; }

.autocomplete-item:hover { background: #f0f0f0; }

/* ==================================================
   Featured Image & Gallery
================================================== */
.featured-image {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.image-gallery {
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  max-width: 100%;
}
.gallery-slide-wrap {
  display: flex;
  transition: transform 0.4s ease;
  width: 100%;
}
.image-gallery img {
  width: calc(33.333% - 0.5rem);
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.2s;
}
.gallery-thumb {
  flex: 0 0 calc(100% / 3); /* 3 per slide */
  height: 240px;
  object-fit: cover;
  box-sizing: border-box;
  padding: 0 0.5rem;
}

.gallery-thumb.last-slide {
  flex: 0 0 50%; /* two images fill row */
}

.gallery-thumb.single-thumb {
  flex: 0 0 100%; /* single image fills full width */
}

.image-gallery.single-image {
  display: block;
  text-align: center;
  margin-bottom: 1rem;
}
.image-gallery.single-image img {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: inline-block;
  object-fit: cover;
}
.image-gallery.multi-image .gallery-slide-wrap {
  overflow: hidden !important;
  flex-wrap: nowrap;
}
.image-gallery.multi-image {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.image-gallery.multi-image img {

  height: 200px;
  object-fit: cover;
  border-radius: 6px;
}

@media (max-width: 600px) {
  .image-gallery.multi-image img {
    flex: none;
    width: 100%;
    height: auto;
  }
}


.image-gallery img:hover { transform: scale(1.05); }

/* ==================================================
   Gallery Slider (Scoped to .slideshow-mode)
================================================== */
.slideshow-mode {
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  max-width: 100%;
}

.slideshow-mode .gallery-slide-wrap {
  display: flex;
  flex-wrap: nowrap;
  transition: transform 0.5s ease;
  width: 100%;
  overflow: hidden;
}

.slideshow-mode .gallery-thumb {
  flex: 0 0 33.3333%;
  max-width: 33.3333%;
  height: 240px;
  object-fit: cover;
  padding: 0 5px;
  box-sizing: border-box;
}
.slideshow-mode .gallery-thumb:last-child {
  margin-right: 0;
}
.slideshow-mode .gallery-thumb.active {
  display: block;
}

.slideshow-mode .slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  padding: 0.5em 1em;
  cursor: pointer;
  font-size: 1.5em;
  z-index: 10;
}

.slideshow-mode .prev-slide { left: 10px; }
.slideshow-mode .next-slide { right: 10px; }

@media (max-width: 768px) {
  .slideshow-mode .gallery-thumb {
    width: calc(50% - 5px);
    max-height: 140px;
  }
}

@media (max-width: 480px) {
  .slideshow-mode .gallery-thumb {
    width: 100%;
    max-height: 200px;
    border-radius: 0;
  }
}


/* ==================================================
   Modal Viewer
================================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 9999;
  padding-top: 60px;
}

.modal-content {
  display: block;
  margin: auto;
  max-width: 80%;
  max-height: 80%;
}

.close {
  position: absolute;
  top: 15px;
  right: 25px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
}

.prev,
.next {
  position: absolute;
  top: 50%;
  font-size: 2rem;
  color: #fff;
  padding: 16px;
  cursor: pointer;
  user-select: none;
}

.prev { left: 0; }
.next { right: 0; }

/* ==================================================
   Content Columns
================================================== */
.content-columns {
  display: block;
  /* display: flex;
  flex-wrap: wrap;
  gap: 2rem; */
}

/* .content-columns article {
  flex: 2 1 60%;
}

.content-columns .image-gallery {
  flex: 1 1 35%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
} */

.content-columns .image-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem; /* 👈 add spacing below gallery */
}

.content-columns article {
  margin-bottom: 2rem;
}

/* ==================================================
   Footer
================================================== */
footer {
  margin-top: 4rem;
  padding: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #888;
}

/* ==================================================
   Top Navigation Bar
================================================== */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: white;
  z-index: 1000;
}

.top-nav .nav-inner {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
}

.top-nav .nav-inner .logo + a {
  margin-left: auto;
}

.top-nav .nav-inner a {
  margin-left: 1rem;
  text-decoration: none;
  color: #1e66ac;
  font-weight: 500;
  line-height: 1;
}

/* ==================================================
   Gem Hero Section
================================================== */
.gem-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 6rem 1rem;
  min-height: 300px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.gem-hero-overlay {
  background: rgba(0,0,0,0.4);
  padding: 2rem;
  max-width: 900px;
  border-radius: 8px;
  margin: 0 auto;
}

.breadcrumb {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}

.breadcrumb a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
}

.breadcrumb .current {
  color: #fff;
  font-weight: bold;
}

.gem-title {
  font-size: 2.5rem;
  margin: 0.5rem 0;
}

.gem-location {
  font-size: 1.1rem;
  opacity: 0.9;
}

@media (max-width: 600px) {
  .gem-hero {
    padding: 4rem 1rem;
  }
  .gem-title {
    font-size: 2rem;
  }
}

/* ==================================================
   Google Map Styling
================================================== */
.gem-map-section {
  margin-top: 2rem;
}

.gem-map-section h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.acf-map {
  width: 100%;
  height: 350px;
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

.acf-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.marker {
  display: none; /* Prevent raw markers from rendering visibly */
}

.map-link {
  margin-top: 0.5rem;
  text-align: right;
}

.map-link a {
  color: #1e66ac;
  text-decoration: underline;
  font-size: 0.95rem;
}

.map-link a:hover {
  text-decoration: none;
  color: #144d8b;
}

/* ==================================================
   Nearby Gems Section
================================================== */

.nearby-gems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

/* ==================================================
   Loading Spinner
================================================== */

#page-loader {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  opacity: 1;
  transition: opacity 0.4s ease;
}

body.loading {
  overflow: hidden;
}


#loader-logo {
  width: 150px;
  max-width: 80%;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* ==================================================
   Search Results
================================================== */

.search-hero {
  background-color: #2c3e50;
  color: #fff;
  padding: 4rem 1rem 1rem; /* ⬅️ reduce bottom padding from 6rem to 2rem */
  text-align: center;
}

.search-form {
      position: relative;
    }

    .search-form input[type="text"] {
      width: 100%;
      padding: 0.8rem 1rem;
      font-size: 1rem;
      border: none;
      border-radius: 6px;
    }

    .autocomplete-box {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: #fff;
      color: #000;
      border: 1px solid #ccc;
      border-top: none;
      max-height: 200px;
      overflow-y: auto;
      z-index: 10;
    }

/* ===================================================
   Spotlight Section
================================================== */
.spotlight-gem {
  text-align: center;
  background: #f4f4f4;
}

.spotlight-gem h2 {
  font-size: 2rem;
  margin-bottom: 2rem;
}

.spotlight-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 600px;
  margin: auto;
  background: #fff;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.spotlight-card img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin-bottom: 1rem;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.spotlight-info h3 {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.5rem;
}

.spotlight-info p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1rem;
}

.spotlight-info .btn-primary {
  background: #0073aa;
  color: #fff;
  padding: 0.6rem 1.4rem;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
}

.spotlight-info .btn-primary:hover {
  background: #005f8c;
}

@media (max-width: 768px) {
  .spotlight-card {
    max-width: 100%;
    margin: 0 auto;
  }
}

/* ===================================================
   Pagination
================================================== */

.pagination {
  text-align: center;
  margin: 2rem 0;
}

.page-link {
  display: inline-block;
  margin: 0 5px;
  padding: 6px 12px;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  color: #333;
}

.page-link.active {
  background: #333;
  color: #fff;
  font-weight: bold;
}

.gem-count {
  font-size: 1rem;
  margin-bottom: 1.5rem;
  text-align: right;
  color: #555;
}

/* ===================================================
   Contact Form
================================================== */

.contact-form {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.contact-form label {
  display: block;
  margin: 1rem 0 0.5rem;
  font-weight: bold;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.contact-form button {
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  background: #2c3e50;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

input.invalid,
textarea.invalid,
select.invalid {
  border-color: red;
  background-color: #ffe6e6;
}

@keyframes fadeSuccess {
  0%   { opacity: 0; transform: scale(0.95); }
  50%  { opacity: 1; transform: scale(1.02); }
  100% { opacity: 1; transform: scale(1); }
}

.success-animated {
  animation: fadeSuccess 0.6s ease-out forwards;
  background: #e6ffec;
  padding: 1rem;
  border: 2px solid #3bbf64;
  border-radius: 6px;
  color: #2d6a4f;
  margin-top: 1rem;
}

#submitBtn.sending {
  background-color: #888;
  cursor: not-allowed;
  animation: pulse 1s infinite ease-in-out;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.6; }
  100% { opacity: 1; }
}
