/* === LAYOUT & FILTERS === */
.tta-layout {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  margin: 2rem auto;
  max-width: 1200px;
  padding: 0 1rem;
}

.tta-filter-sidebar {
  flex: 0 0 260px;
  background: var(--tta-bg);
  padding: 1.5rem;
  border-radius: var(--tta-radius);
  border: 1px solid #eee;
  box-shadow: var(--tta-shadow);
  position: sticky;
  top: 90px;
  height: fit-content;
}

.tta-filter-sidebar h3 {
  font-size: 1.1rem;
  color: var(--tta-forest);
  border-bottom: 2px solid var(--tta-savanna);
  padding-bottom: 0.3em;
  margin-bottom: 0.7em;
}

.filter-group {
  margin-bottom: 1.5rem;
}
.filter-group label {
  display: block;
  font-size: 0.95rem;
  color: var(--tta-text);
  margin-bottom: 0.3em;
  cursor: pointer;
}
.filter-group input {
  accent-color: var(--tta-sunset);
  margin-right: 0.4em;
}

.tta-filter-sidebar .btn.primary {
  width: 100%;
  background: var(--tta-forest);
  font-weight: 600;
}
.tta-filter-sidebar .btn.primary:hover {
  background: var(--tta-sunset);
}

/* === RESULTS GRID === */
#tta-destination-results {
  flex: 1;
}
.tta-destination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.5rem;
}
#tta-destination-results.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* === DESTINATION CARDS === */
.destination-card {
  background: var(--tta-bg);
  border-radius: var(--tta-radius);
  box-shadow: var(--tta-shadow);
  overflow: hidden;
  transition: transform var(--tta-transition), box-shadow var(--tta-transition);
  display: flex;
  flex-direction: column;
}
.destination-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.destination-card a {
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.destination-card .thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--tta-transition);
}
.destination-card:hover .thumb img {
  transform: scale(1.05);
}

.destination-card .title {
  font-size: 1.2rem;
  margin: 0.8em 1em 0 1em;
  color: var(--tta-earth);
}

.destination-card .excerpt {
  font-size: 0.95rem;
  color: var(--tta-muted);
  margin: 0.5em 1em 1.2em 1em;
  flex-grow: 1;
}

/* === RESPONSIVE === */
@media (max-width: 992px) {
  .tta-layout {
    flex-direction: column;
  }
  .tta-filter-sidebar {
    flex: 1;
    width: 100%;
    position: relative;
    top: 0;
    order: -1;
  }
  .tta-filter-sidebar h3 {
    cursor: pointer;
    position: relative;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 15px;
  }
  h1 {
    font-size: 1.6rem;
  }
  .destination-card .thumb img {
    height: 180px;
  }
  .tta-filter-sidebar {
    padding: 1rem;
  }
}

/* === SINGLE DESTINATION STYLING === */
.tta-destination h1 {
  font-size: 2rem;
  margin-top: 0;
  color: var(--tta-forest);
}

.hero-gallery {
  margin: 2rem auto;
  max-width: 1200px;
}
.hero-gallery .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}
.hero-gallery figure {
  position: relative;
  border-radius: var(--tta-radius);
  overflow: hidden;
}
.hero-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--tta-transition);
}
.hero-gallery figure:hover img {
  transform: scale(1.05);
}
.hero-gallery figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  color: #fff;
  padding: 0.8em;
  font-size: 0.9rem;
}

#tta-destination-results.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  border: 3px solid var(--tta-sunset);
  border-top-color: transparent;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: tta-spin 0.8s linear infinite;
}

@keyframes tta-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* === MOBILE FILTER DRAWER === */
.tta-filter-toggle {
  display: none;
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: var(--tta-sunset);
  color: #fff;
  border: none;
  padding: 0.75rem 1.2rem;
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 999;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background var(--tta-transition);
}
.tta-filter-toggle:hover {
  background: var(--tta-forest);
}

/* Sidebar defaults */
.tta-filter-sidebar {
  transition: transform 0.4s ease, opacity 0.3s ease;
}

/* Mobile overlay behavior */
@media (max-width: 992px) {
  .tta-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.4em;
  }

  .tta-layout {
    position: relative;
  }

  .tta-filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    overflow-y: auto;
    background: var(--tta-bg);
    border-right: 1px solid #ddd;
    box-shadow: 2px 0 10px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 2rem 1.5rem;
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
  }

  .tta-filter-sidebar.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
  }

  /* Overlay background when open */
  body.filter-open::before {
    content: "";
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 900;
  }
}


/* === DESTINATION HEADER HERO === */
.destination-header {
  position: relative;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: #fff;
  padding: 6rem 1rem;
  overflow: hidden;
}
header.destination-header {
	height: 75vh;
	min-height: 70vh;
}
.destination-header .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4), rgba(0,0,0,0.6));
  z-index: 0;
}

.destination-header-inner {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  text-align: center;
}

.destination-header .destination-title {
  font-size: 2.4rem;
  color: #fff;
  margin-bottom: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.destination-header .destination-icon svg {
  width: 32px;
  height: 32px;
  fill: var(--tta-accent);
}

.destination-header .destination-subtitle {
  font-size: 1.1rem;
  color: #f5f0e6;
  max-width: 700px;
  margin: 0.5rem auto 0;
}

/* === BREADCRUMBS === */
.tta-breadcrumbs {
  font-size: 0.9rem;
  color: #f2e8d0;
  margin-bottom: 1rem;
}
.tta-breadcrumbs a {
  color: var(--tta-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}
.tta-breadcrumbs a:hover {
  color: #fff;
}
.tta-breadcrumbs .current {
  color: #fff;
}

/* === RESPONSIVE HEADER === */
@media (max-width: 768px) {
  .destination-header {
    padding: 4rem 1rem;
  }
  .destination-header .destination-title {
    font-size: 1.8rem;
  }
  .destination-header .destination-subtitle {
    font-size: 1rem;
  }
}


/* === INTERNAL STICKY TOC === */
.tta-toc {
  position: sticky;
  top: 70px;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #eee;
  padding: 0.75rem 1rem;
  margin-bottom: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.tta-toc ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.tta-toc a {
  text-decoration: none;
  color: var(--tta-forest, #2f3d2c);
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.3s, border-color 0.3s;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
}

.tta-toc a:hover {
  color: var(--tta-sunset, #d26c22);
  border-color: var(--tta-sunset, #d26c22);
}

.tta-toc a.active {
  color: var(--tta-sunset, #d26c22);
  border-color: var(--tta-sunset, #d26c22);
}

/* === Responsive === */
@media (max-width: 768px) {
  .tta-toc {
    overflow-x: auto;
    white-space: nowrap;
  }
  .tta-toc ul {
    justify-content: flex-start;
    gap: 1rem;
  }
}

/* Apply to all destination sections with an ID */
.tta-destination section[id] {
  scroll-margin-top: 121px; /* 70 + 51 */
}
