/* ============================================================
   TTP — LAYOUT
   The Travel Place | layout.css
   ============================================================ */

/* ── Container ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.container--wide {
  max-width: var(--container-wide);
}

.container--sm {
  max-width: var(--container-sm);
}

.container--flush {
  max-width: 100%;
}

/* ── Section ─────────────────────────────────────────────── */
.section {
  position: relative;
  padding-top: var(--section-pad-v);
  padding-bottom: var(--section-pad-v);
}

.section--sm {
  padding-top: var(--section-pad-v-sm);
  padding-bottom: var(--section-pad-v-sm);
}

.section--flush {
  padding-top: 0;
  padding-bottom: 0;
}

/* Viewport-height sections — desktop only */
@media (min-width: 1024px) {
  .section--vh {
    min-height: calc(100svh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* ── Section Header ──────────────────────────────────────── */
.section-header {
  margin-bottom: clamp(40px, 5vw, 72px);
}

.section-header--center {
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--ttp-red);
  margin-bottom: var(--space-4);
}

.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ttp-red);
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.section-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-snug);
  color: var(--color-text);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-5);
}

.section-subtitle {
  font-size: var(--text-md);
  color: var(--color-muted);
  line-height: var(--leading-relaxed);
  max-width: 560px;
}

.section-header--center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* ── Grid ────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
.grid--auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── Flex Utilities ──────────────────────────────────────── */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between{ display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-2  { gap: var(--space-2); }
.gap-3  { gap: var(--space-3); }
.gap-4  { gap: var(--space-4); }
.gap-6  { gap: var(--space-6); }
.gap-8  { gap: var(--space-8); }

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: var(--header-bg-initial);
  transition: background var(--duration-slow) var(--ease-in-out),
              height var(--duration-slow) var(--ease-in-out),
              box-shadow var(--duration-slow) var(--ease-in-out),
              backdrop-filter var(--duration-slow) var(--ease-in-out);
}

.site-header.is-scrolled {
  background: var(--header-bg-scrolled);
  box-shadow: var(--header-shadow-scrolled);
  height: var(--header-height-scrolled);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.site-header.hero-light .nav-link,
.site-header.hero-light .nav-logo-text {
  color: #fff;
}

.site-header.is-scrolled .nav-link,
.site-header.is-scrolled .nav-logo-text {
  color: var(--color-text);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-pad);
}

/* ── Logo ────────────────────────────────────────────────── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-mark {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform var(--duration-base) var(--ease-spring);
  background: transparent;
}

.nav-logo:hover .nav-logo-mark {
  transform: scale(1.05);
}

.nav-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Fallback text if logo image fails */
.nav-logo-mark span {
  font-size: 15px;
  font-weight: var(--weight-extra);
  color: #fff;
  letter-spacing: -0.04em;
  display: none; /* hidden when image loads */
}

.nav-logo-mark img.logo-failed + span {
  display: block;
}

/* Loader logo mark (keeps red bg for branded loader) */
.loader-logo-mark {
  background: var(--ttp-red) !important;
  border-radius: var(--radius-sm);
}
.loader-logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1;
  transition: color var(--duration-slow) var(--ease-in-out);
}

.nav-logo-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-normal);
  color: inherit;
}

.nav-logo-sub {
  font-size: 9px;
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: var(--ttp-red);
}

/* ── Main Nav ────────────────────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  position: relative;
  transition: color var(--duration-fast), background var(--duration-fast);
  white-space: nowrap;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--ttp-red);
  border-radius: var(--radius-full);
  transform: translateX(-50%);
  transition: width var(--duration-base) var(--ease-out-expo);
}

.nav-link:hover {
  color: var(--ttp-red);
  background: var(--color-primary-faint);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  width: calc(100% - 24px);
}

.nav-link.is-active {
  color: var(--ttp-red);
}

/* ── Nav Actions ─────────────────────────────────────────── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.nav-theme-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted);
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.nav-theme-btn:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
}

/* ── Mobile Nav ──────────────────────────────────────────── */
.nav-mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text);
  transition: var(--transition-fast);
}

.nav-mobile-toggle:hover {
  background: var(--color-surface-2);
}

.mobile-menu {
  position: fixed;
  inset: 0;
  background: var(--color-surface);
  z-index: calc(var(--z-header) - 1);
  display: flex;
  flex-direction: column;
  padding: calc(var(--header-height) + var(--space-8)) var(--container-pad) var(--space-8);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-out-expo);
  overflow-y: auto;
}

.mobile-menu.is-open {
  transform: translateX(0);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-8);
}

.mobile-nav-link {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color var(--duration-fast);
}

.mobile-nav-link:hover {
  color: var(--ttp-red);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.7);
  padding-top: clamp(60px, 8vw, 100px);
}

[data-theme="dark"] .site-footer {
  background: #060608;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: var(--space-10);
  padding-bottom: var(--space-16);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: rgba(255,255,255,0.55);
  margin-top: var(--space-4);
  margin-bottom: var(--space-6);
  max-width: 300px;
}

.footer-col-title {
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  margin-bottom: var(--space-5);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  transition: color var(--duration-fast);
}

.footer-links a:hover {
  color: #fff;
}

.footer-contact-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-3);
}

.footer-contact-item .material-symbols-outlined {
  font-size: 18px;
  color: var(--ttp-red);
  flex-shrink: 0;
  margin-top: 1px;
}

.footer-socials {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.footer-social-link {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.55);
  font-size: 16px;
  transition: var(--transition-fast);
}

.footer-social-link:hover {
  background: var(--ttp-red);
  border-color: var(--ttp-red);
  color: #fff;
  transform: translateY(-2px);
}

.footer-newsletter {
  margin-top: var(--space-6);
}

.footer-newsletter p {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.55);
  margin-bottom: var(--space-4);
  line-height: var(--leading-relaxed);
}

.newsletter-form {
  display: flex;
  gap: var(--space-2);
}

.newsletter-input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: #fff;
  font-size: var(--text-sm);
  transition: border-color var(--duration-fast);
}

.newsletter-input::placeholder { color: rgba(255,255,255,0.3); }

.newsletter-input:focus {
  border-color: var(--ttp-red);
  background: rgba(255,255,255,0.1);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-6) 0;
  gap: var(--space-6);
  flex-wrap: wrap;
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
}

.footer-legal-links {
  display: flex;
  gap: var(--space-6);
}

.footer-legal-links a {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.35);
  transition: color var(--duration-fast);
}

.footer-legal-links a:hover {
  color: rgba(255,255,255,0.7);
}

/* ── Breadcrumb ──────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-bottom: var(--space-6);
}

.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--ttp-red); }
.breadcrumb .sep { color: var(--color-subtle); }
.breadcrumb .current { color: var(--color-text); }

/* ── Overflow Track (horizontal scroll) ──────────────────── */
.overflow-track {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  user-select: none;
}

.overflow-track::-webkit-scrollbar { display: none; }
.overflow-track.is-dragging { cursor: grabbing; }

/* ── Tag / Badge ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--weight-semi);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: var(--tracking-wide);
}

.badge--red    { background: var(--ttp-red); color: #fff; }
.badge--silver { background: var(--color-surface-2); color: var(--color-text-2); }
.badge--outline{ border: 1px solid var(--color-border-2); color: var(--color-text-2); }
.badge--success{ background: rgba(5,150,105,0.1); color: var(--color-success); }
.badge--popular{ background: var(--ttp-red); color: #fff; }
.badge--new    { background: #2563EB; color: #fff; }
.badge--flex   { background: rgba(37,99,235,0.1); color: #2563EB; }

/* ── Horizontal Scroll Track ─────────────────────────────── */
.h-scroll-track {
  display: flex;
  gap: var(--space-6);
  padding-bottom: var(--space-4);
  padding-right: var(--container-pad);
}

/* Cards viewport wrapper */
.cards-viewport {
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  cursor: grab;
}

.cards-viewport::-webkit-scrollbar { display: none; }
.cards-viewport.is-dragging { cursor: grabbing; }

/* Fade-out right edge */
.cards-viewport-wrap {
  position: relative;
  overflow: hidden;
}

.cards-viewport-wrap::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 100px;
  background: linear-gradient(to right, transparent, var(--color-bg));
  pointer-events: none;
  z-index: 2;
}

/* Mobile snap scrolling */
@media (max-width: 768px) {
  .h-scroll-track {
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .h-scroll-track > * {
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* ── Section CTA Row ─────────────────────────────────────── */
.section-cta-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.section-cta-row .section-title {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .section-cta-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
