/* TTM Guidehub 1.8.0 (Oppaat, /blogi/): ttmfactory.com-ilme kuten /varaosat/ ja /varaa/ (skilli ttm-look).
   Saira otsikoihin, punainen ainoa korostusväri, pyöristykset 18 / 14 / 10 px, sentence case.
   Wow: hakulaatikko (.ttm-gh-haku) punaisella hehkulla ja kerran kiertävällä reunavalolla.
   Vanha 1.7.0-tyyli: wordpress/varmuuskopiot/oppaat-20261008/ttm-guidehub-1.7.0.css */

.ttm-gh {
  --gh-puna: #e51b24;
  --gh-puna-tumma: #c8141c;
  --gh-tumma: #0f1114;
  --gh-teksti: #15181d;
  --gh-harmaa: #59606b;
  --gh-reuna: #e3e7ec;
  --gh-r-iso: 18px;
  --gh-r-kortti: 14px;
  --gh-r-nappi: 10px;
  --gh-varjo: 0 1px 2px rgba(15, 17, 20, .06), 0 8px 24px rgba(15, 17, 20, .08);
  --gh-varjo-hover: 0 2px 4px rgba(15, 17, 20, .08), 0 18px 40px rgba(15, 17, 20, .14);
  --gh-otsikko: var(--otsikko, "TTM Saira", "Saira", system-ui, sans-serif);
  color: var(--gh-teksti);
  background: transparent;
}
.ttm-gh *, .ttm-gh *::before, .ttm-gh *::after { box-sizing: border-box; }
.ttm-gh :is(h1, h2, h3, .ttm-gh-card-title, .ttm-gh-esittely, .ttm-gh-search-label, .ttm-gh-btn, .ttm-gh-chip, .ttm-gh-oireet, .ttm-gh-hero-actions a, .ttm-gh-section-head > span, .ttm-gh-card-label, .ttm-gh-card-meta, .ttm-gh-kicker) {
  font-family: var(--gh-otsikko) !important;
  text-transform: none;
  letter-spacing: 0;
}
.ttm-gh-wrap { max-width: none; margin: 0; padding: 0; }

/* ---------- Hero: täysleveä, vaalea liukuväri kuten .ttm-vo2-hero ---------- */
/* Sisältö pysyy muun sivun levyisenä (linjaus), tausta venyy reunasta reunaan pseudoelementillä. */
.ttm-gh-hero {
  position: relative;
  isolation: isolate;
  margin-top: -40px;
  padding: 56px 0 44px;
}
.ttm-gh-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: calc(50% - 50vw);
  right: calc(50% - 50vw);
  background: linear-gradient(180deg, #f6f7f9 0%, #fff 100%);
  border-bottom: 1px solid #eef1f4;
}
.ttm-gh-hero > .ttm-gh-wrap { position: relative; z-index: 1; }
.ttm-gh-esittely { margin: 0 0 10px !important; font-weight: 600; font-size: 15px; color: #3d4652; }
.ttm-gh-hero h1 {
  max-width: 760px;
  margin: 0 0 14px !important;
  font-style: italic;
  font-weight: 800 !important;
  font-size: clamp(34px, 4.4vw, 56px) !important;
  line-height: 1.04 !important;
  letter-spacing: -.5px !important;
  color: var(--gh-teksti) !important;
}
.ttm-gh .ttm-gh-ingressi { max-width: 560px; margin: 0 0 24px !important; font-size: 18px; font-weight: 400 !important; line-height: 1.55; color: #2b323b; }

/* Hillitty dynokäyrä taustalla (vain leveällä näytöllä) */
.ttm-gh .ttm-gh-hero-dyno { position: absolute; z-index: 0; top: 48px; right: 0; width: min(420px, 34vw) !important; height: auto !important; max-width: none !important; max-height: none !important; pointer-events: none; }
.ttm-gh-hero-dyno path { fill: none; stroke-linecap: round; }
.ttm-gh-dyno-akselit path { stroke: #d4dbe3; stroke-width: 1.5; }
.ttm-gh-dyno-akselit .ttm-gh-dyno-nolla { stroke-dasharray: 4 6; }
.ttm-gh-dyno-ennen { stroke: #9aa3ae; stroke-width: 3; stroke-dasharray: 8 7; opacity: .8; }
.ttm-gh-dyno-jalkeen { stroke: var(--gh-puna); stroke-width: 4; stroke-dasharray: 700; stroke-dashoffset: 700; animation: ttm-gh-piirto 1.8s cubic-bezier(.2, .7, .2, 1) .5s forwards; }
/* Tekstit SVG:n yksiköissä: 18 ≈ 14,5 px kun SVG on 420 px leveä. Ei raskasta varafonttia. */
.ttm-gh .ttm-gh-hero-dyno text { font-family: "Source Sans 3", Arial, sans-serif !important; font-size: 18px; font-weight: 600; fill: #59606b; stroke: none !important; letter-spacing: 0; }
.ttm-gh .ttm-gh-hero-dyno text:first-of-type { fill: #c8141c; font-weight: 700; }
@keyframes ttm-gh-piirto { to { stroke-dashoffset: 0; } }

/* ---------- Wow: haku ---------- */
.ttm-gh-haku {
  position: relative;
  max-width: 640px;
  padding: 16px;
  background: #fff;
  border: 1px solid rgba(229, 27, 36, .35);
  border-radius: 16px;
  box-shadow: 0 0 0 1px rgba(229, 27, 36, .12), 0 18px 50px rgba(229, 27, 36, .18), 0 8px 24px rgba(15, 17, 20, .08);
  animation: ttm-gh-nousu .6s cubic-bezier(.2, .7, .2, 1) .12s both;
}
.ttm-gh-haku::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 18px;
  padding: 2px;
  background: linear-gradient(120deg, transparent 20%, rgba(229, 27, 36, .85) 45%, transparent 70%);
  background-size: 300% 100%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  animation: ttm-gh-reuna 2.4s ease-in-out .6s 1 both;
}
.ttm-gh-haku:focus-within { box-shadow: 0 0 0 3px rgba(229, 27, 36, .25), 0 22px 60px rgba(229, 27, 36, .25); }
.ttm-gh-search-label { display: block; margin: 0 0 8px; padding-left: 2px; font-weight: 700; font-size: 15px; color: var(--gh-teksti); }
.ttm-gh-search { position: relative; }
.ttm-gh-search input {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 48px 0 16px;
  border: 1px solid #d4dbe3;
  border-radius: var(--gh-r-nappi);
  background: #fff;
  color: var(--gh-teksti);
  font: inherit;
  font-size: 16px;
  box-shadow: none;
}
.ttm-gh-search input:focus { outline: none; border-color: var(--gh-puna); box-shadow: 0 0 0 3px rgba(229, 27, 36, .15); }
.ttm-gh-search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: -18px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #f4f6f8;
  color: var(--gh-harmaa);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.ttm-gh-search-clear:hover { color: var(--gh-puna); }
.ttm-gh-oireet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; }
.ttm-gh-oireet > span { margin-right: 2px; font-weight: 600; color: #3d4652; }
.ttm-gh-oireet button {
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #d4dbe3;
  border-radius: var(--gh-r-nappi);
  background: #fff;
  color: var(--gh-teksti);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.ttm-gh-oireet button:hover { border-color: var(--gh-puna); color: var(--gh-puna-tumma); background: rgba(229, 27, 36, .04); }
.ttm-gh-hero-actions { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 20px; }
.ttm-gh-hero-actions a { font-weight: 700; font-size: 15px; color: var(--gh-puna) !important; text-decoration: none !important; }
.ttm-gh-hero-actions a:hover { text-decoration: underline !important; text-underline-offset: 4px; }

/* ---------- Suodatus ---------- */
.ttm-gh-controls { padding: 28px 0 8px; }
.ttm-gh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ttm-gh-chip {
  margin: 0;
  padding: 8px 14px;
  border: 1px solid var(--gh-reuna);
  border-radius: var(--gh-r-nappi);
  background: #fff;
  color: var(--gh-teksti);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.ttm-gh-chip:hover { border-color: var(--gh-teksti); }
.ttm-gh-chip.is-active { background: var(--gh-tumma); border-color: var(--gh-tumma); color: #fff; }
.ttm-gh-count { margin: 10px 0 0 !important; font-size: 13px; color: var(--gh-harmaa); }

/* ---------- Osiot ---------- */
.ttm-gh-featured, .ttm-gh-rail, .ttm-gh-all { padding: 36px 0 0; }
.ttm-gh-all { scroll-margin-top: 90px; }
.ttm-gh-rails .ttm-gh-rail:first-child { padding-top: 36px; }
.ttm-gh-section-head { margin-bottom: 16px; }
.ttm-gh-section-head > span { display: block; margin-bottom: 6px; font-weight: 700; font-size: 12px; letter-spacing: .14em !important; text-transform: uppercase !important; color: var(--gh-harmaa); }
.ttm-gh-section-head h2 { margin: 0 !important; font-style: italic; font-weight: 800 !important; font-size: clamp(24px, 2.8vw, 34px) !important; line-height: 1.1 !important; letter-spacing: -.3px !important; color: var(--gh-teksti) !important; }
.ttm-gh-section-head p { max-width: 640px; margin: 8px 0 0 !important; font-size: 15px; color: var(--gh-harmaa); }
.ttm-gh-rail-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ttm-gh-rail-actions { display: flex; gap: 8px; margin-bottom: 16px; }
.ttm-gh-rail-actions button {
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--gh-reuna);
  border-radius: var(--gh-r-nappi);
  background: #fff;
  color: var(--gh-teksti);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--gh-varjo);
}
.ttm-gh-rail-actions button:hover { border-color: var(--gh-puna); color: var(--gh-puna); }

.ttm-gh-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ttm-gh-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 300px);
  gap: 16px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  margin: -4px -4px 0;
  scroll-snap-type: inline mandatory;
  scrollbar-width: thin;
}
.ttm-gh-row > * { scroll-snap-align: start; }
.ttm-gh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

/* ---------- Kortit ---------- */
.ttm-gh-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #edf0f3;
  border-radius: var(--gh-r-kortti);
  box-shadow: var(--gh-varjo);
  color: var(--gh-teksti) !important;
  text-decoration: none !important;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ttm-gh-card:hover { transform: translateY(-3px); box-shadow: var(--gh-varjo-hover); border-color: var(--gh-reuna); }
.ttm-gh-card:focus-visible { outline: 3px solid rgba(229, 27, 36, .35); outline-offset: 2px; }
.ttm-gh-card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #f4f6f8; }
.ttm-gh-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.ttm-gh-card:hover .ttm-gh-card-media img { transform: scale(1.04); }
.ttm-gh-card-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.ttm-gh-card-label {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(229, 27, 36, .08);
  color: var(--gh-puna-tumma);
  font-weight: 700;
  font-size: 12px;
}
.ttm-gh-card-title { display: block; margin-top: 2px; font-weight: 700; font-size: 18px; line-height: 1.2; color: var(--gh-teksti); }
.ttm-gh-card-desc { font-size: 14px; line-height: 1.45; color: #3d4652; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ttm-gh-card-meta { margin-top: auto; padding-top: 6px; font-weight: 600; font-size: 13px; color: var(--gh-harmaa); }
.ttm-gh-card--featured .ttm-gh-card-title { font-style: italic; font-weight: 800; font-size: 21px; letter-spacing: -.2px; }
.ttm-gh-card--mini .ttm-gh-card-media { display: none; }
.ttm-gh-card--no-image .ttm-gh-card-body { padding-top: 18px; }
.ttm-gh-card--kind-tool .ttm-gh-card-label { background: var(--gh-tumma); color: #fff; }

/* Sivuston Lisä-CSS (custom_css 2870) pakottaa featured-työkalukortin tummaksi !important-säännöillä
   (1.7.0-ajalta). Kumotaan korkeammalla tarkkuudella, ettei yksi kortti poikkea muista. */
.ttm-etu .ttm-gh .ttm-gh-card--featured.ttm-gh-card--kind-tool { background: #fff !important; color: var(--gh-teksti) !important; }
.ttm-etu .ttm-gh .ttm-gh-card--featured.ttm-gh-card--kind-tool .ttm-gh-card-media::after { content: none !important; }
.ttm-etu .ttm-gh .ttm-gh-card--featured.ttm-gh-card--kind-tool .ttm-gh-card-media img { filter: none !important; }
.ttm-etu .ttm-gh .ttm-gh-card--featured.ttm-gh-card--kind-tool .ttm-gh-card-title { color: var(--gh-teksti) !important; }
.ttm-etu .ttm-gh .ttm-gh-card--featured.ttm-gh-card--kind-tool :is(.ttm-gh-card-desc) { color: #3d4652 !important; }
.ttm-etu .ttm-gh .ttm-gh-card--featured.ttm-gh-card--kind-tool .ttm-gh-card-meta { color: var(--gh-harmaa) !important; }

/* ---------- Tyhjä haku ja CTA ---------- */
.ttm-gh-empty { padding: 28px; margin-top: 8px; border: 1px dashed #d4dbe3; border-radius: var(--gh-r-kortti); background: #fff; text-align: center; }
.ttm-gh-empty h3 { margin: 0 0 6px !important; font-size: 20px !important; }
.ttm-gh-empty p { margin: 0 !important; color: var(--gh-harmaa); }
.ttm-gh-cta { padding: 48px 0 8px; }
.ttm-gh-cta-box {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  padding: 32px;
  border-radius: var(--gh-r-iso);
  color: #fff;
  background: radial-gradient(circle at 85% 0%, rgba(229, 27, 36, .28), transparent 55%), #121519;
}
.ttm-gh-kicker { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; color: rgba(255, 255, 255, .7); }
.ttm-gh-cta-box h2 { margin: 0 0 10px !important; font-style: italic; font-weight: 800 !important; font-size: clamp(22px, 2.4vw, 30px) !important; line-height: 1.12 !important; color: #fff !important; }
.ttm-gh-cta-box p { margin: 0 !important; font-size: 15px; line-height: 1.55; color: rgba(255, 255, 255, .78); }
.ttm-gh-cta-actions { display: flex; flex-direction: column; gap: 10px; }
.ttm-gh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--gh-r-nappi);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none !important;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ttm-gh-btn--red { background: var(--gh-puna); color: #fff !important; }
.ttm-gh-btn--red:hover { background: var(--gh-puna-tumma); }
.ttm-gh-btn--dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .2); color: #fff !important; }
.ttm-gh-btn--dark:hover { border-color: #fff; }
.ttm-gh-btn--light { background: #fff; color: var(--gh-teksti) !important; }
.ttm-gh-btn--light:hover { color: var(--gh-puna) !important; }

/* ---------- Tilat (ttm-guidehub.js) ---------- */
.ttm-gh-filter-card.is-hidden,
.ttm-gh-rail.is-hidden,
.ttm-gh-featured.is-hidden,
.ttm-gh-all.is-hidden,
.ttm-gh-rail-actions.is-hidden { display: none !important; }
body.ttm-gh-no-results .ttm-gh-rails,
body.ttm-gh-no-results .ttm-gh-featured,
body.ttm-gh-no-results .ttm-gh-all .ttm-gh-grid { display: none !important; }
.ttm-gh.is-filtering .ttm-gh-featured { display: none !important; }
.ttm-gh:not(.is-searching) .ttm-gh-all { display: none !important; }
.ttm-gh.is-searching .ttm-gh-featured,
.ttm-gh.is-searching .ttm-gh-tools-rail,
.ttm-gh.is-searching .ttm-gh-rails,
.ttm-gh.is-searching .ttm-gh-cta { display: none !important; }
.ttm-gh.is-topic-filtering .ttm-gh-all { display: none !important; }
.ttm-gh.is-topic-filtering .ttm-gh-rail:not(.is-hidden),
.ttm-gh.is-topic-filtering .ttm-gh-tools-rail:not(.is-hidden),
.ttm-gh.is-searching .ttm-gh-all { animation: ttm-gh-nousu .25s ease both; }

@keyframes ttm-gh-reuna { 0% { opacity: 0; background-position: 100% 0; } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; background-position: 0 0; } }
@keyframes ttm-gh-nousu { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Mobiili ---------- */
@media (max-width: 1023px) {
  .ttm-gh-hero-dyno { display: none; }
}
@media (max-width: 860px) {
  .ttm-gh-hero { margin-top: -24px; padding: 32px 0 28px; }
  .ttm-gh-hero h1 { font-size: 32px !important; }
  .ttm-gh-ingressi { font-size: 16px; }
  .ttm-gh-haku { padding: 14px; }
  .ttm-gh-feature-grid { grid-template-columns: 1fr; }
  .ttm-gh-chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -18px; padding: 0 18px 6px; scrollbar-width: none; }
  .ttm-gh-chips::-webkit-scrollbar { display: none; }
  .ttm-gh-chip { flex: none; }
  .ttm-gh-rail-actions { display: none; }
  .ttm-gh-row { grid-auto-columns: 78%; }
  .ttm-gh-cta-box { grid-template-columns: 1fr; padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .ttm-gh-haku, .ttm-gh-haku::before, .ttm-gh .ttm-gh-rail, .ttm-gh .ttm-gh-all { animation: none; }
  .ttm-gh-dyno-jalkeen { animation: none; stroke-dashoffset: 0; }
  .ttm-gh-card, .ttm-gh-card-media img { transition: none; }
}
