
/* =========================================================
   HERO
========================================================= */

.tm-hero {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 420px;
  overflow: hidden;
}

.tm-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tm-hero-overlay {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 1040px;
  width: calc(100% - 48px);
  padding: 24px 32px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.tm-hero-overlay h1 {
  margin: 0;
  color: #0A1128;
  font-size: 42px;
  font-weight: 800;
}

.hero-text {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

/* COUNTRY */
.hero-country {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}

/* DESTINATION */
.hero-destination {
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.15;
  color: #FFFFFF;
  white-space: nowrap;
  text-shadow: 0 10px 30px rgba(0,0,0,0.45);

  overflow: hidden;              /* 🔑 */
  text-overflow: ellipsis;       /* 🔑 */
  max-width: 100%;               /* 🔑 */
}



/* =========================================================
   MAIN LAYOUT
========================================================= */

.tm-main-container {
  max-width: 1100px;
  margin: 26px auto;
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 10px;
}

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

.tm-toc-toggle {
  position: fixed;
  bottom: calc(env(safe-area-inset-top, 0px) + 28px);
  left: 20px;
  z-index: 2600;

  min-width: 96px;
  height: 44px;

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

  background: #000000;
  border: 1px solid #E9EBEE;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
}

.tm-toc {
  display: none;
}

.tm-toc.is-open {
  display: flex;
  position: fixed;
  inset: 0;

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

  background: rgba(0,0,0,0.42);
  z-index: 3000;
  padding: 16px;
}





.toc-inner {
  background: #FFFFFF;
  border: 1px solid #E9EBEE;
  border-radius: 12px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.18);
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  max-height: 82vh;
  overflow-y: auto;
}

.toc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0px;
  padding-left: 26px;
}

.toc-header h3 {
  margin-top: 20px;
  margin-bottom: -8px;
  font-size: 22px;
  font-weight: 700;
}


.tm-toc-close {
  border: none;
  background: #F5F6F7;
  border: 1px solid #E9EBEE;
  border-radius: 10px;
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 800;
}

.tm-toc a {
  display: block;
  padding: 8px 0;
  font-weight: 600;
  color: #0A1128;
  text-decoration: none;
}

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

/* =========================================================
   ARTICLE
========================================================= */

.tm-article {
  background: #FFFFFF;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid #E9EBEE;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}



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

@media (min-width: 901px) {


  /* ================================
     TOC (DESKTOP SIDEBAR)
  ================================= */

  /* Piilotetaan mobiilin TOC-nappi */
  .tm-toc-toggle {
    display: none;
  }

  /* TOC = normaali sticky-sivupalkki */
  .tm-toc {
    display: block;
    width: 260px;
    flex-shrink: 0;

    position: sticky;
    top: 110px;

    background: transparent;
    padding: 0;

    z-index: 10;
  }




  /* Ei sulkunappia desktopissa */
  .tm-toc-close {
    display: none;
  }

  /* Sisäkortti saa rullata, ei koko sivupalkki */
  .toc-inner {
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 18px 6px 42px;

    max-height: calc(100vh - 130px);
    overflow-y: auto;
  }

  /* ================================
     ARTICLE
  ================================= */

  .tm-article {
    flex: 1;                   /* 🔑 varmistaa oikean leveysjaon */
    padding: 10px 50px;
  }

    /* ================================
     MAIN LAYOUT
  ================================= */

  .tm-main-container {
    display: flex;
    flex-direction: row;
    align-items: flex-start;   /* 🔑 tärkeä stickyä varten */
    gap: 40px;
    margin: 40px auto;
    padding: 0 24px;

    overflow: visible;         /* 🔑 sticky EI toimi ilman tätä */
  }
}



.tm-article img {
  width: 100%;
  height: auto;              /* 🔑 palauttaa oikean skaalauksen */
  max-width: 100%;
  display: block;
}

.tm-article h2 {
  border-left: 6px solid rgba(85, 193, 189, 0.7);
  padding-left: 14px;
}

/* 🔑 Korjaa TOC-ankkurit sticky headerin kanssa */
.tm-article h2,
.tm-article h3,
.tm-article h4 {
  scroll-margin-top: 40px; /* ≈ appbar + hengitys */
}

/* =========================================
   🔑 STICKY HEADER + TOC ANKKURIT
========================================= */

/* 📱 Mobiili: enemmän tilaa appbarin alle */
@media (max-width: 900px) {
  .tm-article [id] {
    scroll-margin-top: 160px;
  }
}

/* 🖥 Desktop: maltillisempi offset */
@media (min-width: 901px) {
  .tm-article [id] {
    scroll-margin-top: 104px;
  }
}

.callout {
  border-radius: 12px;
  padding: 1.2rem 1.4rem;
  margin: 2rem 0;
  font-size: 0.95rem;
}

.callout strong {
  display: block;
  margin-bottom: 0.4rem;
  letter-spacing: 0.03em;
}

.callout-weather {
  background: #eef6ff;
  border-left: 4px solid #4a90e2;
}

.callout-tips {
  background: #f4fff6;
  border-left: 4px solid #2ecc71;
}

.callout-info {
  background: #fff9e6;
  border-left: 4px solid #f5a623;
}

.callout-warning {
  background: #fff1f1;
  border-left: 4px solid #e74c3c;
}

.callout-budget {
  background: #f5f3ff;
  border-left: 4px solid #8e44ad;
}

/* Calloutin sisäinen otsikko */
.tm-article .callout h2 {
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* Halutessasi vielä erottavampi */
.callout h2:first-child {
  margin-top: 0;
}

.callout-title {
  font-size: 1.35rem !important;
  font-weight: 600  !important;
  line-height: 1.25;
  margin-bottom: 0.6rem;
  letter-spacing: -0.015em;
}

.callout-body {
  font-size: 1rem;
}

.tm-article .callout h2 {
  font-size: 1.6rem;
  line-height: 1.25;
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

/* =========================================================
   HERO COLLAGE (PYTHON GENERATED)
========================================================= */

.tm-hero-collage {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 420px;
  overflow: hidden;
  background: #000000;
}

.hero-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 100%;
  height: 100%;
}

.hero-img {
  position: relative;
  overflow: hidden;
}

.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* iso kuva vasemmalla */
.hero-img.hero-main {
  grid-column: 1 / span 1;
  grid-row: 1 / span 2;
}

/* title overlay */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  padding: 5%;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.55),
    rgba(0,0,0,0.15)
  );
}

.hero-overlay h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1.05;
  max-width: 80%;
  text-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 900px) {
  .tm-hero-collage {
    height: 60vh;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
  }

  .hero-img.hero-main {
    grid-row: auto;
  }

  .hero-overlay {
    align-items: flex-end;
    padding: 6%;
  }

  .hero-overlay h1 {
    font-size: clamp(2rem, 8vw, 3rem);
    max-width: 100%;
  }
}

/* =========================================================
   TOC HEADER BRANDING
========================================================= */

.toc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.toc-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* logo row */
.toc-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.2rem;
  color: #0A1128;
  margin-bottom: 20px;
}

.toc-logo svg {
  width: 22px;
  height: 22px;
  color: #0A1128;
  position: relative;
  top: 1px;
}

/* contents title */
.toc-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #111;
}

/* ===============================
   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;
  }
}



/* =========================================
   GROUPED H2 (category-style)
========================================= */

.tm-article h2.h2-group-title {
  border-left: none;          /* poista pystyviiva */
  padding-left: 0;
  padding-bottom: 12px;
  margin-bottom: 28px;
  position: relative;
}

/* Vaakaviiva otsikon alle */
.tm-article h2.h2-group-title::after {
  content: "";
  display: block;
  width: 180px;               
  height: 6px;              
    color: #55C1BD;
  margin-top: 10px;
}

/* =========================================================
   ARTICLE IMAGE EMBED
========================================================= */

.tm-article-image {
  margin: 48px auto;
  max-width: 900px;
}

.tm-article-image-frame {
  overflow: hidden;
  border-radius: 14px;
  box-shadow:
    0 10px 30px rgba(0,0,0,0.12);
}

.tm-article-image img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s ease;
}

.tm-article-image-frame:hover img {
  transform: scale(1.03);
}

.tm-article-image figcaption {
  margin-top: 10px;
  font-size: 14px;
  color: #6b7280;
  text-align: center;
}

/* =========================================================
   ARTICLE IMAGES — FORCED LANDSCAPE
========================================================= */

.tm-article-image-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;

  border-radius: 14px;
  background: #f4f4f4;

  /* 🔑 kehys + pehmeä varjo */
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.tm-article-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

