/* =========================================================
   Travelmore.wiki Brand Palette (Light Mode Refresh v2)
========================================================= */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
}

body {
  min-height: 60vh;          /* täyttää viewportin */
  font-family: "Inter", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial;
  background: #FFFFFF;
  color: #0A1128;
  line-height: 1.65;
}



/* =========================================================
   HEADER — mobile-first
========================================================= */

.tm-header {
  background: #FFFFFF;
  border-bottom: 1px solid rgba(0,0,0,0.3);

  position: sticky;
  top: 0;
  z-index: 2500;
}

.tm-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.tm-logo a {
  text-decoration: none;
  color: #0A1128;
  font-size: 28px;
  font-weight: 800;

  display: flex;
  align-items: center;
  gap: 10px; /* ✅ vain SVG ↔ teksti */
}


/* Compass */
.tm-compass {
  width: 26px;
  height: 26px;
  color: #000000;
  flex-shrink: 0;
  position: relative;
  top: 2px; 
}

.tm-compass-arrow {
  fill: #000000;
  stroke: #000000;
  stroke-width: 1;
}

/* =========================================================
   NAV (mobile hidden by default)
========================================================= */

.tm-nav {
  display: none;
  position: absolute;
  top: 72px;
  right: 24px;
  background: #FFFFFF;
  border: 1px solid #E9EBEE;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 14px 18px;
  z-index: 2000;
}

.tm-nav.is-open {
  display: block;
}

.tm-nav a {
  display: block;
  color: #0A1128;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 6px;
  opacity: 0.9;
}

.tm-nav a:hover {
    color: #55C1BD;
}

/* =========================================================
   HAMBURGER — FIXED (MINIMAL)
========================================================= */

.tm-menu-toggle {
  position: relative;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 2100;
}

/* Yhteinen tyyli viivoille */
.tm-menu-toggle span {
  position: absolute;
  left: 50%;
  width: 24px;
  height: 2px;
  background: #0A1128;
  transform: translateX(-50%);
  transition: 0.25s ease;
}

/* Yläviiva */
.tm-menu-toggle span:nth-child(1) {
  top: 14px;
}

/* Keskiviiva */
.tm-menu-toggle span:nth-child(2) {
  top: 21px;
}

/* Alaviiva */
.tm-menu-toggle span:nth-child(3) {
  top: 28px;
}




/* =========================================================
   GLOBAL PAGE CONTAINER
========================================================= */

.tm-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 18px;
  
}

/* =========================================================
   DESKTOP OVERRIDES (UNCHANGED)
========================================================= */

@media (min-width: 1024px) {

  /* ================================
     HEADER / NAV
  ================================= */

  .tm-nav {
    display: flex;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    gap: 26px;
  }

  .tm-nav a {
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    padding: 0;
    opacity: 0.7;
  }

  .tm-nav a:hover {
    opacity: 1;
  }

  .tm-menu-toggle {
    display: none;
  }


}

/* =========================================================
   FOOTER
========================================================= */

.tm-footer {
  background: #F5F6F7;
  border-top: 2px solid #E9EBEE;

  padding: 10px 0;
  margin-top: 0;

  width: 100%;
}

.tm-footer-inner {
  max-width: 1100px;          /* sama rytmi kuin muu sivu */
  margin: 0 auto;

  padding: 0 24px;            /* hengitys mobiilissa */

  display: flex;
  justify-content: center;    /* 🔑 keskitys */
  align-items: center;

  text-align: center;
}

.tm-footer p {
  margin: 0;
  font-size: 14px;
  color: #6B7280;
}

.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.home-page main {
  flex: 1;
}

.tm-brand-accent {
    color: #55C1BD;
}

/* -----------------------------------------
   HERO IMAGE ATTRIBUTION (RESPONSIVE)
------------------------------------------ */

.tm-hero-collage {
  position: relative;
}

.hero-credits {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 10;
  max-width: 70%;
}

.hero-credit {
  display: block;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.45);
  padding: 6px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  word-wrap: break-word;
}

.hero-credit a {
  color: #ffffff;
  text-decoration: underline;
}

/* 📱 Mobile tuning — hero credit max 60% width */
@media (max-width: 640px) {
  .hero-credits {
    top: 16px;
    right: 8px;
    max-width: 60vw; /* ⬅️ EI koskaan yli 60 % näytön leveydestä */
  }

  .hero-credit {
    font-size: 10px;
    line-height: 1.35;
    white-space: normal;       /* sallii rivityksen */
    word-break: break-word;    /* estää overflow */
  }
}

/* =========================================================
   TRAVEL TOOLS BAR
========================================================= */

/* hidden by default */
.tm-travel-tools {
  display: none;
}

/* show only on destination pages */
body.is-destination .tm-travel-tools {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(0,0,0,0.3);

}

/* clickable row */
.tm-tool-link {
  display: block;
  width: 100%;
  text-decoration: none;
  color: inherit;
}

/* bar */
.tm-tool-bar {
  background: #f3f3f3;
  transition: background 0.15s ease;
}


.tm-tool-bar:hover {
  background: #dddddd;
}

/* =========================================================
   MOBILE (DEFAULT)
========================================================= */

.tm-tool-inner {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 🔑 TÄMÄ */
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
  text-align: left; /* 🔑 estää keskityksen */
}

/* LEFT */
.tm-tool-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tm-tool-text {
  color: #000;
  font-weight: 500;

  /* 🔑 Skaalautuva fonttikoko */
  font-size: clamp(0.85rem, 3.5vw, 1rem);

  /* 🔒 Pysy yhdellä rivillä */
  white-space: nowrap;

  /* Varmistus: ei layout-rikkoa */
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ICON */
.tm-tool-icon {
  width: 28px;
  height: 28px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.75;
}

.tm-icon-flight {
  background-image: url("/static/icons/plane.png");
}

.tm-icon-stay {
  background-image: url("/static/icons/stay.png");
}

/* RIGHT — destination button */
.tm-tool-right {
  flex-shrink: 0;
}

.tm-tool-destination {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(42,178,198,0.18);
  color: #000;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
}

/* separator */
.tm-stays-bar {
  border-top: 1px solid rgba(0,0,0,0.15);
}

/* =========================================================
   DESKTOP
========================================================= */

@media (min-width: 900px) {

  body.is-destination .tm-travel-tools {
    flex-direction: row;
  }

  .tm-tool-link {
    flex: 1 1 50%;
  }

    .tm-tool-link + .tm-tool-link {
    border-left: 1px solid rgba(0, 0, 0, 0.3);
  }

  .tm-tool-inner {
    justify-content: center;
    gap: 8px;
    text-align: center;
  }

  /* yhdistä visuaalisesti */
  .tm-tool-right {
    display: contents;
  }

  .tm-tool-destination {
    padding: 2px 8px;
    font-size: 0.95em;
  }

  .tm-stays-bar {
    border-top: none;
  }
}

.hero-stats {
  margin-top: -20px;
  font-size: 15px;
  color: #0A1128;
  letter-spacing: 0.2px;
}

.hero-stats strong {
  display: inline-block;

  padding: 3px 9px;
  margin: 0 2px;

  border-radius: 999px;
  background: rgba(42,178,198,0.18);

  color: #000;
  font-weight: 600;
  font-size: 0.95em;
  white-space: nowrap;
}

/* Desktop: näytä spanit samalla rivillä */
.hero-line {
  display: inline;
}

/* 📱 Mobile: pakotettu kahdelle riville */
@media (max-width: 1024px) {
  .hero-line {
    display: block;
    text-align: center;
  }

  .hero-stats {
    line-height: 1.35;
    margin-top: -20px;
  }
}

.country-overlay h2 {
  text-transform: none;
}

.hero-facts {
  margin-top: 10px;

  /* Typography */
  font-size: clamp(0.65rem, 2.5vw, 0.85rem);
  color: #ffffff;
  opacity: 0.92;
  letter-spacing: 0.08em;
  font-weight: 400;

  /* Layout */
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;

  white-space: nowrap;
}

/* =========================================
   HEADER SEARCH (DESKTOP + MOBILE) — FINAL
========================================= */

/* 🔍 icon button (always visible) */
.tm-search-toggle {
  background: none;
  border: none;
  cursor: pointer;

  padding: 6px 8px;

  display: flex;
  align-items: center;
  justify-content: center;

  color: #55C1BD;
}

.tm-search-toggle:hover {
  opacity: 0.7;
}

/* -----------------------------------------
   SEARCH CONTAINER (OVERLAY)
----------------------------------------- */

/* Hidden by default */
.tm-header-search {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;

  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  border-top: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 60;

  display: none;
}

.tm-header-search.active {
  display: block;
}

/* -----------------------------------------
   SEARCH INPUT
----------------------------------------- */

/* =========================================
   HEADER SEARCH — CENTERED & CONSTRAINED
========================================= */

.tm-header-search-inner {
  /* 🔑 rajoita leveys → estää leviämisen mobiilissa */
  max-width: 640px;

  /* 🔑 keskitys */
  margin: 0 auto;

  /* sama sivumarginaali kuin header */
  padding: 4px 16px;

  /* varma keskitys myös erikoistilanteissa */
  display: flex;
  justify-content: center;
}

/* input itself */
.tm-header-search-inner input {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;

  padding: 12px 14px 12px 38px;
  font-size: 16px;

  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.25);
  outline: none;

  /* 🔮 läpikuultava lasimainen tausta */
  background-color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  /* 🔍 icon */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}


.tm-header-search input {
  width: 100%;
  box-sizing: border-box;

  padding: 12px 14px 12px 38px;
  font-size: 14px;

  border-radius: 10px;
  border: 1px solid #ccc;
  outline: none;

  background-color: rgba(255, 255, 255, 0.2);

  /* 🔍 magnifying glass icon */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;

  margin: 12px auto;
}



/* 🔍 + NAV SAMALLE RIVILLE */
.tm-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

@media (max-width: 1023px) {
  .tm-header-actions {
    gap: 0px;
  }
}

/* NAV EI SAA PINOUTUA */
.tm-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 0;
}

/* MOBILE: hide nav links by default */
@media (max-width: 1023px) {
  .tm-nav {
    display: none;
  }
}

/* =========================================================
   MOBILE MENU OPEN STATE (CRITICAL)
========================================================= */

.tm-header.menu-open .tm-nav {
  display: block;
}

/* 🔍 EI TYÖNNÄ ITSEÄÄN */
.tm-search-toggle {
  flex-shrink: 0;
}

.tm-header-search {
  background-color: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.search-results {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
  overflow: hidden;
}

.search-item {
  padding: 10px 14px;
  cursor: pointer;
}

.search-item:hover {
  background: rgba(42,178,198,0.08);
}

.search-main {
  font-weight: 600;
  font-size: 15px;
}

.search-meta {
  font-size: 12px;
  color: #6B7280;
  margin-top: 2px;
}

.tm-header-search-inner {
  position: relative;
}

.tm-search-wrapper {
  position: relative;
  width: 100%;
  max-width: 640px;   /* sama kuin input */
  margin: 0 auto;     /* keskitys */
}


/* 🔽 SEARCH RESULTS */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;        /* 🔑 SAMA KUIN INPUT */

  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.15);

  padding: 6px 0;
  z-index: 4000;

  display: none;
}


/* näkyväksi JS:llä */
.search-results.active {
  display: block;
}

/* yksittäinen tulos */
.search-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-item:hover {
  background: rgba(42,178,198,0.08);
}

/* sisäinen rivi */
.search-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-main {
  font-weight: 600;
  color: #0A1128;
}

.search-meta {
  font-size: 12px;
  color: #6B7280;
}

#tm-header-search-input {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: block;
}

#tm-search-portal {
  position: absolute;

  /* keskitys */
  left: 50%;
  transform: translateX(-50%);

  /* 🔑 sama leveys kuin input */
  width: 100%;
  max-width: 640px;

  margin-top: 8px;

  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.15);

  padding: 6px 0;
  z-index: 4000;

  display: none;
}

#tm-search-portal.active {
  display: block;
}

/* =========================================================
   FOOTER — TRANSPARENT & LIGHT
========================================================= */

.tm-footer {
  background: transparent;          /* ❌ poista musta tausta */
  box-shadow: none;                 /* ❌ poista varjo */
}

/* sisältö */
.tm-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px 48px;
  text-align: center;

  display: flex;
  flex-direction: column;
  align-items: center;
}

/* linkkirivi */
.tm-footer-links {
  font-size: 12px;
  line-height: 1.8;
  color: #0A1128;                   /* 🔑 musta teksti */
}

/* linkit */
.tm-footer-links a {
  color: #0A1128;                   /* 🔑 musta */
  text-decoration: none;
  font-weight: 500;
}

.tm-footer-links a:hover {
    color: #55C1BD;
}

/* erotin */
.tm-footer-links .sep {
  margin: 0 10px;
  color: rgba(0,0,0,0.3);           /* vaalea musta */
}

/* alin rivi */
.tm-footer-bottom {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(0,0,0,0.6);            /* hieman vaimennettu */
}

/* mobiili */
@media (max-width: 640px) {
  .tm-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 16px;
  }

  .tm-footer-links .sep {
    display: none;
  }
}


/* =========================================================
   FOOTER PAGES (ABOUT, PRIVACY, ETC.)
========================================================= */

.tm-page {
  display: flex;
  justify-content: center;
  padding: 64px 24px 96px;
}

.tm-content {
  width: 100%;
  max-width: 760px;
  font-size: 17px;
  line-height: 1.7;
  color: #1b1f23;
}

.tm-content h1 {
  font-size: clamp(36px, 5vw, 44px);
  line-height: 1.2;
  margin-bottom: 24px;
}

.tm-content h2 {
  font-size: 22px;
  margin-top: 40px;
  margin-bottom: 12px;
}

.tm-content p {
  margin-bottom: 18px;
}

.tm-content ul {
  margin: 16px 0 24px 20px;
}

.tm-content li {
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .tm-page {
    padding: 40px 16px 64px;
  }

  .tm-content {
    font-size: 16px;
  }
}


/* ===============================
   BACK TO TOP BUTTON
================================ */

#backToTop {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;

  color: #000000;
  border: 1px solid #fff;
  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 22px;
  font-weight: 700;
  cursor: pointer;

  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    background 0.2s ease;
  z-index: 999;
}

#backToTop:hover {
    color: #55C1BD;
}

/* visible state */
#backToTop.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Mobile: hieman isompi tappialue */
@media (max-width: 768px) {
  #backToTop {
    width: 54px;
    height: 54px;
    font-size: 24px;
  }
}


/* =========================================================
   FOOTER FILL — estää valkoisen alueen footerin alla
========================================================= */

.tm-page-root::after {
  content: "";
  display: block;
  flex-grow: 1;
  background: linear-gradient(to bottom, #0e1114, #0b0e11);
}

.country-intro {
  position: relative;

  max-width: 1100px;
  margin: 1.75rem 0 3rem;
  padding: 1.6rem 1.8rem 1.6rem 2rem;

  font-size: 1.1rem;
  line-height: 1.7;
  color: #1f2a2e;

  background:
    radial-gradient(
      120% 120% at 0% 0%,
      rgba(42, 178, 198, 0.12),
      rgba(255, 255, 255, 0.9) 60%
    );

  border-radius: 14px;

  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.08),
    inset 0 0 0 1px rgba(42, 178, 198, 0.18);
}

/* Accent stripe */
.country-intro::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;

  width: 5px;
  border-radius: 5px;

  background: linear-gradient(
    180deg,
    #2ab2c6,
    #5fd3e2
  );
}

/* Subtle editorial emphasis */
.country-intro::after {
  content: "Overview";
  position: absolute;
  top: -0.6rem;
  left: 1.2rem;

  padding: 0 0.4rem;

  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2ab2c6;

  background: #ffffff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
