/**
 * TravelESpain Homepage Styles
 *
 * Ported from mockup/frontpage.html. All classes prefixed with `te-` to
 * avoid collisions with Kadence parent theme styles.
 */

/* ── Variables ── */
:root {
  --te-terracotta: #C45A3C;
  --te-terracotta-dark: #A8462D;
  --te-sun: #E8A838;
  --te-sun-light: #FFF3DC;
  --te-sky: #2980B9;
  --te-sky-dark: #1F6694;
  --te-olive: #5B7D3A;
  --te-sand: #F5EDE0;
  --te-text: #2D2926;
  --te-text-light: #6B6560;
  --te-bg-warm: #FBF8F4;
  --te-white: #FFFFFF;
  --te-radius: 12px;
  --te-radius-sm: 8px;
  --te-shadow: 0 2px 8px rgba(45,41,38,0.08);
  --te-shadow-lg: 0 8px 24px rgba(45,41,38,0.12);
  --te-max-width: 1200px;
  --te-header-h: 64px;
}

/* ── Hide Kadence header & footer on custom homepage ── */
body.te-homepage .site-header,
body.te-homepage .site-footer {
  display: none !important;
}

/* ── Base overrides for homepage ── */
.te-homepage a { color: inherit; text-decoration: none; }
.te-homepage img { max-width: 100%; display: block; }
.te-homepage h1,
.te-homepage h2,
.te-homepage h3,
.te-homepage h4 {
  font-family: 'Montserrat', sans-serif;
  line-height: 1.2;
  margin: 0;
  padding: 0;
}

/* ── 1. Header (transparent over hero) ── */
.te-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--te-header-h);
  background: transparent;
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.te-header-scrolled {
  position: fixed;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.te-header-scrolled .te-logo { color: var(--te-terracotta); }
.te-header-scrolled .te-logo .te-logo-e { color: var(--te-sun); }
.te-header-scrolled .te-nav-desktop a { color: var(--te-text); }
.te-header-scrolled .te-nav-desktop a:hover { color: var(--te-terracotta); }
.te-header-scrolled .te-hamburger span { background: var(--te-text); }
.te-header-scrolled .te-lang-toggle { background: var(--te-sand); }
.te-header-scrolled .te-lang-toggle a { color: var(--te-text-light); }
.te-header-scrolled .te-lang-toggle a.active { background: var(--te-terracotta); color: white; }
.te-header-inner {
  width: 100%;
  max-width: var(--te-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.te-logo {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--te-white);
  display: flex;
  align-items: center;
  gap: 2px;
  letter-spacing: -0.3px;
}
.te-logo .te-logo-e { color: var(--te-sun); font-weight: 800; }
.te-nav-desktop {
  display: none;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.te-nav-desktop > li { position: relative; list-style: none; }
.te-nav-desktop > li > a {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  transition: color 0.2s;
  padding: 20px 0;
  display: block;
}
.te-nav-desktop > li > a:hover { color: var(--te-white); }
.te-nav-desktop > li > a::after {
  content: ' \25BE';
  font-size: 10px;
  opacity: 0.6;
  margin-left: 4px;
}

/* ── Desktop dropdown / mega menu ── */
.te-nav-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 280px;
  background: var(--te-white);
  border-radius: var(--te-radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
  z-index: 200;
}
.te-nav-desktop > li:hover > .te-nav-dropdown,
.te-nav-desktop > li:focus-within > .te-nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.te-nav-dropdown::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}
.te-nav-dropdown.te-mega { min-width: 760px; left: -200px; }
.te-nav-dropdown.te-mega-3 { min-width: 720px; left: -180px; }
.te-nav-dropdown h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--te-text-light);
  margin-bottom: 8px;
  padding: 0 10px;
}
.te-nav-dropdown a {
  display: block;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--te-text);
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.te-nav-dropdown a:hover {
  background: var(--te-sand);
  color: var(--te-terracotta);
}
.te-nav-dropdown a.te-featured {
  font-weight: 700;
  color: var(--te-terracotta);
}
.te-nav-dropdown a.te-money::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--te-sun);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}
.te-nav-dropdown .te-dest-group {
  margin-bottom: 14px;
}
.te-nav-dropdown .te-dest-group:last-child { margin-bottom: 0; }
.te-nav-dropdown .te-more-link {
  display: block;
  margin-top: 10px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--te-terracotta);
  border-top: 1px solid #eee;
}
.te-nav-dropdown.te-mega .te-mega-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px 24px;
}
.te-nav-dropdown .te-more-row {
  grid-column: 1 / -1;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
  align-items: center;
}
.te-nav-dropdown .te-more-row .te-more-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--te-text-light);
  padding: 0 10px;
}
.te-nav-dropdown .te-more-row a {
  padding: 6px 10px;
  font-size: 13px;
}

/* ── Mobile drawer ── */
.te-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 998;
}
.te-drawer-overlay.open { opacity: 1; visibility: visible; }
.te-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 88%;
  max-width: 360px;
  background: var(--te-white);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.te-drawer.open { transform: translateX(0); }
.te-drawer-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #eee;
}
.te-drawer-close {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--te-text);
  line-height: 1;
  cursor: pointer;
}
.te-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.te-drawer-section {
  border-bottom: 1px solid #eee;
}
.te-drawer-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 18px 20px;
  background: none;
  border: none;
  font-size: 17px;
  font-weight: 600;
  color: var(--te-text);
  text-align: left;
  cursor: pointer;
  min-height: 56px;
  font-family: inherit;
}
.te-drawer-chevron {
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--te-text-light);
  border-bottom: 2px solid var(--te-text-light);
  transform: rotate(45deg);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-right: 4px;
}
.te-drawer-section.open .te-drawer-chevron {
  transform: rotate(-135deg);
  margin-top: 6px;
}
.te-drawer-section-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: var(--te-bg-warm);
}
.te-drawer-section.open .te-drawer-section-content {
  max-height: 800px;
}
.te-drawer-item {
  display: block;
  padding: 14px 20px 14px 32px;
  font-size: 15px;
  font-weight: 500;
  color: var(--te-text);
  min-height: 48px;
  border-top: 1px solid rgba(0,0,0,0.04);
}
.te-drawer-item:first-child { border-top: none; }
.te-drawer-item.te-money::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--te-sun);
  border-radius: 50%;
  margin-left: 6px;
  vertical-align: middle;
}
.te-drawer-more {
  display: block;
  padding: 14px 20px 14px 32px;
  font-size: 14px;
  font-weight: 600;
  color: var(--te-terracotta);
  border-top: 1px solid rgba(0,0,0,0.04);
}
.te-drawer-simple-link {
  display: block;
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 600;
  color: var(--te-text);
  border-bottom: 1px solid #eee;
  min-height: 56px;
}
.te-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.te-lang-toggle {
  display: flex;
  background: rgba(255,255,255,0.15);
  border-radius: 20px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
}
.te-lang-toggle a {
  padding: 5px 12px;
  color: rgba(255,255,255,0.7);
  transition: all 0.2s;
}
.te-lang-toggle a.active {
  background: var(--te-white);
  color: var(--te-terracotta);
  border-radius: 20px;
}
.te-hamburger {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.te-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--te-white);
  border-radius: 2px;
}

@media (min-width: 768px) {
  .te-header { padding: 0 24px; }
  .te-nav-desktop { display: flex; }
  .te-hamburger { display: none; }
}

/* ── 2. Hero ── */
.te-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #1a1410;
}
.te-hero-bg {
  position: absolute;
  inset: 0;
  background-position: center 55%;
  background-size: cover;
}
.te-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(20,15,10,0.45) 0%,
      rgba(20,15,10,0.15) 25%,
      rgba(20,15,10,0.05) 45%,
      rgba(20,15,10,0.35) 75%,
      rgba(20,15,10,0.7) 100%);
}
.te-hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 100px 20px 48px;
  max-width: 680px;
  width: 100%;
}
.te-hero h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--te-white);
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.te-hero p {
  font-size: 17px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 32px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.25);
}
.te-search-wrap {
  position: relative;
  max-width: 500px;
  margin: 0 auto 28px;
}
.te-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--te-text-light);
  font-size: 18px;
  pointer-events: none;
}
.te-search-input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 48px;
  border: 2px solid transparent;
  border-radius: 28px;
  font-size: 16px;
  font-family: 'Open Sans', sans-serif;
  background: var(--te-white);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.te-search-input::placeholder { color: #A0A0A0; }
.te-search-input:focus {
  border-color: var(--te-terracotta);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 0 3px rgba(196,90,60,0.2);
}
.te-popular-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  align-items: center;
}
.te-popular-links span {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}
.te-popular-links a {
  display: inline-block;
  padding: 7px 16px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--te-white);
  transition: all 0.2s;
}
.te-popular-links a:hover {
  background: rgba(255,255,255,0.3);
  border-color: rgba(255,255,255,0.4);
}

@media (min-width: 768px) {
  .te-hero h1 { font-size: 48px; }
  .te-hero p { font-size: 19px; }
}

/* ── 3. Destination Cards ── */
.te-section { padding: 48px 16px; }
.te-section-inner { max-width: var(--te-max-width); margin: 0 auto; }
.te-section-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--te-text);
}

.te-destinations-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.te-destinations-scroll::-webkit-scrollbar { display: none; }

.te-dest-card {
  flex: 0 0 calc(43% - 7px);
  scroll-snap-align: start;
  border-radius: var(--te-radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 3/4;
  min-height: 220px;
  cursor: pointer;
  transition: transform 0.2s;
  display: block;
}
.te-dest-card:hover { transform: translateY(-4px); }
.te-dest-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.te-dest-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 50%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}
.te-dest-overlay h3 {
  color: var(--te-white);
  font-size: 18px;
  font-weight: 700;
}
.te-dest-overlay span {
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  margin-top: 2px;
}

@media (min-width: 768px) {
  .te-section { padding: 56px 24px; }
  .te-destinations-scroll {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    overflow: visible;
  }
  .te-dest-card {
    flex: none;
    aspect-ratio: 4/5;
  }
}

/* ── 4. Topics ── */
.te-topics-section { background: var(--te-bg-warm); }
.te-topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.te-topic-card {
  background: var(--te-white);
  border-radius: var(--te-radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--te-shadow);
  transition: box-shadow 0.2s, transform 0.2s;
  cursor: pointer;
}
.te-topic-card:hover {
  box-shadow: var(--te-shadow-lg);
  transform: translateY(-2px);
}
.te-topic-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 4px;
}
.te-topic-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--te-text);
}
.te-topic-desc {
  font-size: 13px;
  color: var(--te-text-light);
  display: none;
}
.te-topic-count {
  font-size: 13px;
  color: var(--te-terracotta);
  font-weight: 600;
}

@media (min-width: 768px) {
  .te-topics-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .te-topic-card { padding: 24px 20px; }
  .te-topic-card h3 { font-size: 17px; }
  .te-topic-desc { display: block; }
}

/* Topic color accents */
.te-topic-weather .te-topic-icon { background: #FFF3DC; }
.te-topic-when .te-topic-icon { background: #E8F4F8; }
.te-topic-hotels .te-topic-icon { background: #F3E8F0; }
.te-topic-food .te-topic-icon { background: #FCEAE6; }
.te-topic-activities .te-topic-icon { background: #E8F0E6; }
.te-topic-planning .te-topic-icon { background: #E6EDF5; }

/* ── 5. Trending ── */
.te-trending-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.te-trending-featured {
  border-radius: var(--te-radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/10;
  cursor: pointer;
  display: block;
}
.te-trending-featured img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.te-trending-featured .te-trending-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
}
.te-trending-featured .te-trending-overlay .te-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  width: fit-content;
}
.te-tag-weather { background: var(--te-sun); color: #3D2E10; }
.te-tag-planning { background: var(--te-sky); color: white; }
.te-tag-destinations { background: var(--te-olive); color: white; }
.te-trending-featured .te-trending-overlay h3 {
  color: white;
  font-size: 20px;
  font-weight: 700;
}
.te-trending-list { display: flex; flex-direction: column; gap: 12px; }
.te-trending-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: var(--te-white);
  border-radius: var(--te-radius-sm);
  box-shadow: var(--te-shadow);
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.te-trending-item:hover { box-shadow: var(--te-shadow-lg); }
.te-trending-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--te-radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.te-trending-item-text { flex: 1; min-width: 0; }
.te-trending-item-text .te-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.te-trending-item-text h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--te-text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 768px) {
  .te-trending-grid {
    flex-direction: row;
    gap: 20px;
    height: 360px;
  }
  .te-trending-featured {
    flex: 1.3;
    aspect-ratio: auto;
    height: 100%;
    min-height: 0;
  }
  .te-trending-list {
    flex: 1;
    height: 100%;
    gap: 14px;
    justify-content: space-between;
  }
  .te-trending-item { padding: 14px; flex: 1; min-height: 0; }
  .te-trending-thumb { width: 80px; height: 80px; }
  .te-trending-featured .te-trending-overlay h3 { font-size: 22px; }
}

/* ── 6. Seasonal Banner ── */
.te-seasonal {
  background: var(--te-terracotta);
  color: var(--te-white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.te-seasonal:hover { background: var(--te-terracotta-dark); color: var(--te-white); }
.te-seasonal-icon { font-size: 20px; }
.te-seasonal-arrow {
  margin-left: 4px;
  font-size: 18px;
  transition: transform 0.2s;
}
.te-seasonal:hover .te-seasonal-arrow { transform: translateX(4px); }

/* ── 7. Footer ── */
.te-footer {
  background: #1E1A17;
  color: rgba(255,255,255,0.7);
  padding: 48px 16px 24px;
}
.te-footer-inner {
  max-width: var(--te-max-width);
  margin: 0 auto;
}
.te-footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.te-footer-col h4 {
  color: var(--te-white);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.te-footer-col a {
  display: block;
  font-size: 14px;
  padding: 4px 0;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}
.te-footer-col a:hover { color: var(--te-white); }
.te-footer-brand {
  margin-bottom: 32px;
}
.te-footer-brand .te-logo {
  font-size: 22px;
  color: var(--te-white);
  margin-bottom: 8px;
}
.te-footer-brand p {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  max-width: 300px;
}
.te-footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
}
.te-footer-bottom .te-lang-toggle a {
  color: rgba(255,255,255,0.5);
}
.te-footer-bottom .te-lang-toggle a.active {
  color: var(--te-white);
  background: var(--te-terracotta);
}
.te-footer-bottom .te-lang-toggle {
  background: rgba(255,255,255,0.08);
}
.te-footer .te-logo { color: var(--te-white); }
.te-footer .te-logo .te-logo-e { color: var(--te-sun); }

@media (min-width: 768px) {
  .te-footer { padding: 56px 24px 24px; }
  .te-footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
  }
}
