/* =========================
   RESPONSIVE: DESKTOP / LAPTOP
   ========================= */

@media (max-width: 1360px) {
  .trezor-nav {
    gap: 18px;
  }

  .banner-nav .nav-link {
    gap: 6px;
    font-size: 12px;
    letter-spacing: 0.03em;
  }
}

@media (min-width: 1200px) and (max-width: 1400px) {
  .section-header h2 {
    font-size: 32px;
  }

  .section-title-icon {
    width: 36px;
  }

  .virtual-bear-icon {
    width: clamp(96px, 9.5vw, 142px);
  }

  .intro-text,
  .virtual-text,
  .journal-text {
    font-size: 30px;
    line-height: 1.35;
  }
}

@media (min-width: 901px) and (max-width: 1399px) and (max-height: 650px) {
  .fixed-gold-scroll {
    bottom: 8px;
  }
}

@media (min-width: 1200px) and (max-width: 1400px) and (max-height: 650px) {
  #vieraskirja .section-inner {
    justify-content: center;
    gap: 10px;
    padding-top: 98px;
    padding-bottom: 32px;
  }

  #vieraskirja .section-title-icon {
    display: none;
  }

  #vieraskirja .section-header h2 {
    font-size: 30px;
  }

  #vieraskirja .journal-text {
    font-size: 28px;
    line-height: 1.15;
  }

  #vieraskirja .journal-image-wrap {
    width: min(54vw, 540px);
    margin-top: 2px;
  }

  .virtual-image,
  #vieraskirja .journal-image {
    -webkit-mask-image:
      linear-gradient(to right, transparent 0%, #000 24%, #000 76%, transparent 100%),
      linear-gradient(to bottom, transparent 0%, #000 14%, #000 84%, transparent 100%);
    -webkit-mask-composite: source-in;

    mask-image:
      linear-gradient(to right, transparent 0%, #000 24%, #000 76%, transparent 100%),
      linear-gradient(to bottom, transparent 0%, #000 14%, #000 84%, transparent 100%);
    mask-composite: intersect;
  }

  #vieraskirja .journal-image {
    max-height: 32vh;
  }

  #vieraskirja .journal-actions-below-image {
    gap: 8px;
    margin-top: 8px;
  }

  #vieraskirja .journal-actions-below-image .ui-btn {
    width: 190px;
    min-height: 34px;
    padding: 5px 14px;
    font-size: 6.4px;
  }
}


/* =========================
   RESPONSIVE: MOBILE
   ========================= */

@media (max-width: 900px) {
  :root {
    --banner-visual-side-gap: 10px;
    --mobile-banner-top: 20px;
    --mobile-banner-height: 54px;
  }

  body {
    background: #070807;
  }

  body::after {
    background: url("../images/myllyerik.jpg") center center / cover no-repeat;
  }

  body::before {
    background:
      linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.42) 0%,
        rgba(0, 0, 0, 0.18) 34%,
        rgba(0, 0, 0, 0.42) 100%
      ),
      linear-gradient(
        to right,
        rgba(0, 0, 0, 0.62) 0%,
        rgba(0, 0, 0, 0.08) 44%,
        rgba(0, 0, 0, 0.5) 100%
      );
  }

  .site-banner,
  .site-banner.trezor-banner {
    top: 24px;
    left: 30px;
    right: 30px;

    height: 74px;
    padding: 0 20px;

    grid-template-columns: auto auto;
    justify-content: space-between;

    border-color: rgba(255, 255, 255, 0.22);
    border-radius: 26px;

    background: rgba(24, 24, 22, 0.58);

    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.5),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);

    backdrop-filter: blur(18px) saturate(1.08);
    -webkit-backdrop-filter: blur(18px) saturate(1.08);
  }

  .trezor-nav,
  .banner-nav,
  .products-mega,
  .guide-mega,
  .journal-mega {
    display: none;
  }

  .banner-logo {
    height: 42px;
  }

  .banner-right {
    gap: 14px;
  }

  .burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;

    width: 38px;
    height: 38px;
    padding: 0;

    border: 0;
    background: transparent;

    cursor: pointer;
  }

  .burger span {
    display: block;

    width: 26px;
    height: 3px;
    margin-inline: auto;

    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
  }

  .mobile-menu {
    position: fixed;
    top: 82px;
    left: 10px;
    right: 10px;
    z-index: 99999;

    display: flex;
    flex-direction: column;
    gap: 18px;

    padding: 22px 26px 26px;
    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 22px;

    background: rgba(255, 255, 255, 0.16);

    box-shadow:
      0 18px 45px rgba(0, 0, 0, 0.55),
      0 4px 12px rgba(0, 0, 0, 0.35),
      inset 0 1px 0 rgba(255, 255, 255, 0.28);

    opacity: 0;
    pointer-events: none;

    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);

    transform: translateY(-8px);

    transition:
      opacity 0.35s ease,
      transform 0.35s ease;
  }

  .mobile-menu a {
    position: relative;

    display: flex;
    align-items: center;
    gap: 12px;

    min-height: 42px;
    padding: 8px 4px;

    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-inter);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
    text-transform: uppercase;
  }

  .mobile-menu a:hover {
    color: var(--yellow);
  }

  .mobile-menu a::before {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
  }

  .home-section {
    position: relative;

    display: block;
    min-height: 100svh;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
  }

  .home-stack {
    position: relative;

    display: block;

    width: 100%;
    min-height: 100svh;
    min-height: 100dvh;
  }

  .hero-image-wrap,
  .scroll-bear-layer {
    position: absolute;
    inset: 0;
    z-index: 0;

    width: 100%;
    height: 100%;

    pointer-events: none;

    transform: none;
  }

  .hero-image {
    width: 100%;
    max-width: none;
    height: 100%;

    object-fit: cover;
    object-position: center 38%;

    opacity: 0.88;

    filter: brightness(0.62) contrast(1.12) saturate(0.95);

    transform: none;

    mask-image: none;
    -webkit-mask-image: none;
  }

  #home::after {
    content: "";

    position: absolute;
    inset: 0;
    z-index: 1;

    pointer-events: none;

    background:
      linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.36) 0%,
        rgba(0, 0, 0, 0.28) 28%,
        rgba(0, 0, 0, 0.58) 58%,
        rgba(0, 0, 0, 0.82) 100%
      );
  }

  #home .hero-title-block {
    --hero-heading-x: 0px;

    position: relative;
    top: auto;
    left: auto;
    z-index: 2;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    width: 100%;
    max-width: none;
    min-height: 100svh;
    min-height: 100dvh;

    padding:
      calc(var(--mobile-banner-top) + var(--mobile-banner-height) + 92px)
      18px
      92px;

    text-align: center;

    transform: none;
  }

  .hero-kicker {
    width: min(100%, 360px);
    margin: 0 auto 0.7em;

    font-size: clamp(10px, 3.1vw, 14px);
    letter-spacing: 0.28em;

    transform: none;
  }

  .hero-eyebrow {
    width: min(100%, 360px);
    margin: 0 auto;

    color: rgba(255, 255, 255, 0.94);
    -webkit-text-fill-color: rgba(255, 255, 255, 0.94);

    font-size: clamp(32px, 10vw, 43px);
    line-height: 1.05;
    letter-spacing: 0.13em;
    text-align: center;
    white-space: normal;

    transform: none;

    text-shadow:
      0 3px 8px rgba(0, 0, 0, 0.95),
      0 14px 28px rgba(0, 0, 0, 0.72);
  }

  .quote-inner {
    padding:
      calc(var(--mobile-banner-top, 20px) + var(--mobile-banner-height, 54px) + 90px)
      18px
      86px;
  }

  .quote-section .hero-quote-wrap {
    width: min(100%, 360px);
    padding: 22px 16px 20px;

    border-top: 1px solid rgba(217, 184, 111, 0.26);
    border-bottom: 1px solid rgba(217, 184, 111, 0.22);
    border-radius: 16px;

    background: rgba(0, 0, 0, 0.2);

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
  }

  .quote-section .hero-quote-wrap::before,
  .quote-section .hero-quote-wrap::after,
  .quote-section .hero-quote-ornament,
  .quote-section .hero-quote-ornament-bottom {
    display: none;
  }

  .quote-section .hero-forest-quote {
    width: 100%;
    margin: 0;

    font-size: clamp(21px, 6vw, 30px);
    line-height: 1.18;
  }

  .quote-section .hero-forest-quote span {
    display: block;

    margin-top: 6px;

    font-size: 0.78em;
    line-height: 1.2;
  }

  .fixed-gold-scroll {
    bottom: 18px;
    z-index: 4;

    width: 30px;
    height: 30px;
  }

  .fixed-gold-scroll span {
    width: 11px;
    height: 11px;

    border-right-width: 3px;
    border-bottom-width: 3px;
  }

  .section-inner {
    width: 100%;
    max-width: none;
    min-height: 100%;
    gap: 14px;

    padding:
      calc(var(--banner-top) + var(--banner-height) + 20px)
      18px
      86px;
  }

  .intro-text,
  .virtual-text,
  .journal-text {
    font-size: clamp(22px, 6vw, 30px);
    line-height: 1.26;
  }

  .section-header h2 {
    font-size: clamp(24px, 6vw, 34px);
  }

  .section-title-icon {
    width: 34px;
  }

  .virtual-image {
    width: min(88vw, 450px);
    max-height: 28vh;
  }

  .journal-image {
    width: min(86vw, 420px);
    max-height: 26vh;
  }

  .virtual-bear-icon {
    width: clamp(82px, 20vw, 118px);
  }

  .tours-window-article,
  .guide-article {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
    margin: 8px auto;

    border-radius: 18px;
  }

  .tours-window-topbar {
    height: 56px;
    padding: 0 64px 0 16px;
  }

  .tours-window-topbar h2 {
    font-size: 15px;
  }

  .tours-window-frame {
    inset: 56px 0 0 0;
    height: calc(100% - 56px);
  }

  .guide-shell {
    padding: 24px 16px 22px;
  }

  .guide-hero,
  .guide-mega-inner--info-grid,
  .guide-mega-panel--combined {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .guide-photo-wrap {
    max-width: 420px;
    margin: 0 auto;
  }

  .guide-intro h2 {
    font-size: 24px;
  }

  .guide-lead,
  .guide-body-text,
  .guide-quote p {
    font-size: 21px;
  }

  .guide-mega-panel--combined,
  .guide-mega-panel--history {
    min-height: 0;
  }

  .guide-mega-panel--history {
    grid-template-rows: 120px 1fr;
  }
}

@media (max-width: 420px) {
  .site-banner,
  .site-banner.trezor-banner {
    left: 20px;
    right: 20px;
  }
}

@media (max-width: 400px) {
  #home .hero-title-block {
    padding-top: 145px !important;
  }

  .hero-eyebrow {
    font-size: 35px;
  }
}

@media (max-width: 380px) {
  .hero-eyebrow {
    letter-spacing: 0.12em;
  }
}

@media (min-width: 701px) and (max-width: 950px) and (max-height: 600px) {
  .hero-eyebrow {
    margin-bottom: 6px;

    font-size: 22px;
    letter-spacing: 0.22em;
  }

  .intro-text,
  .virtual-text,
  .journal-text {
    font-size: 25px;
    line-height: 1.35;
  }

  .hero-image {
    max-height: 42vh;
  }
}


/* =========================
   TAUSTAKUVA
   ========================= */

html,
body {
  background: #050608 !important;
}

body {
  background-image:
    linear-gradient(
      to right,
      rgba(0, 0, 0, 0.98) 0%,
      rgba(0, 0, 0, 0.88) 8%,
      rgba(0, 0, 0, 0.58) 20%,
      rgba(0, 0, 0, 0.16) 34%,
      rgba(0, 0, 0, 0.16) 66%,
      rgba(0, 0, 0, 0.58) 80%,
      rgba(0, 0, 0, 0.88) 92%,
      rgba(0, 0, 0, 0.98) 100%
    ),
    url("../images/polku-vaaka-pieni.jpg") !important;

  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}



/* =========================
   DIGIRETKET-MEGA
   ========================= */

.digital-mega .products-mega-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  width: min(100%, 860px) !important;
  margin-inline: auto !important;
}


/* =========================
   RETKIKIRJA-MEGA
   HTML käyttää nyt samoja service-mega-luokkia kuin muut valikot
   ========================= */

.journal-mega .products-mega-inner {
  display: block !important;
}

.journal-mega .products-mega-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  width: min(100%, 860px) !important;
  margin-inline: auto !important;
}

/* Vasen kuva normaalisti */
#journal-mega-write .service-mega-image {
  width: 78% !important;
  height: 100% !important;
  margin-inline: auto !important;

  object-fit: contain !important;
  object-position: center center !important;
}

/* Oikea kuva pienemmäksi, koska itse kirja täyttää kuvatiedoston enemmän */
#journal-mega-read .service-mega-image {
  width: 62% !important;
  height: 100% !important;
  margin-inline: auto !important;

  object-fit: contain !important;
  object-position: center center !important;
}
body::before {
  background-image: url("../images/niskakoski.jpg") !important;
}