/* =========================================================
   Hemängen – Tvålboken
   Ljus guide-layout, samma grundidé som Raktvålsboken
   Fil: public/css/guider/tvalbok.css
   ========================================================= */

:root{
  --bg:#f5f1e7;
  --panel:#fbfaf5;
  --paper:#ffffff;
  --text:#2f3423;
  --muted:#6f765c;
  --accent:#4e5328;
  --accent-soft:#e8eadc;
  --line:rgba(78,83,40,.18);
  --shadow:0 12px 30px rgba(53,57,35,.12);
  --radius:18px;
}

*{ box-sizing:border-box; }

html,body{
  height:100%;
  margin:0;
}

body{
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  line-height:1.5;
}

/* ---------- Book / page ---------- */

.book{
  height:100svh;
  overflow:auto;
  scroll-snap-type:y mandatory;
  scroll-behavior:smooth;
}

section.page{
  --pad:clamp(18px,4vw,44px);
  height:100svh;
  padding:var(--pad);
  scroll-snap-align:start;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at top right, rgba(78,83,40,.05), transparent 34%),
    linear-gradient(180deg,var(--panel),var(--bg));
}

.sheet{
  width:min(1040px,100%);
  height:100%;
  min-height:0;
  display:grid;
  gap:clamp(18px,3vw,34px);
  align-content:start;
  padding-bottom:58px;
}

/* ---------- Typography ---------- */

h1,h2,h3,p{ margin-top:0; }

h1,h2{
  color:var(--accent);
  letter-spacing:.01em;
}

h1{
  font-size:clamp(42px,6vw,76px);
  line-height:1.02;
  margin-bottom:10px;
}

h2{
  font-size:clamp(28px,4vw,48px);
  line-height:1.08;
  margin-bottom:12px;
}

h3{
  color:var(--accent);
  margin-bottom:6px;
}

p{
  margin-bottom:14px;
  font-size:clamp(16px,2vw,20px);
}

.kicker{
  color:var(--muted);
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:.82rem;
  margin-bottom:8px;
}

.lead{
  max-width:52ch;
  font-size:clamp(17px,2vw,21px);
}

.note{
  color:var(--muted);
  font-weight:650;
}

.rule{
  height:1px;
  background:var(--line);
  margin:14px 0;
}

/* ---------- Layout ---------- */

.twoCol{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:clamp(20px,4vw,38px);
  align-items:stretch;
  height:100%;
  min-height:0;
}

.sideCol{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-height:0;
}

.card{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:180px;
}

.card img{
  display:block;
  width:100%;
  height:auto;
  max-height:48svh;
  object-fit:contain;
  border-radius:12px;
}

.illusStack{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-height:0;
  height:100%;
}

.illusStack .card{
  flex:1;
  min-height:0;
}

.grid2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

.mini{
  background:rgba(255,255,255,.75);
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
  box-shadow:0 5px 14px rgba(53,57,35,.05);
}

.steps{
  display:grid;
  gap:12px;
}

.step{
  background:rgba(255,255,255,.65);
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px;
}

.stepHead{
  display:flex;
  align-items:baseline;
  gap:8px;
}

.stepHead .n{
  color:var(--muted);
  font-weight:800;
}

.stepHead h3{
  margin:0;
  font-size:18px;
}

.faq{
  display:grid;
  gap:16px;
}

.callout{
  background:var(--accent-soft);
  border-left:4px solid var(--accent);
  border-radius:10px;
  padding:14px 16px;
}

.callout a,
.pageFooter a{
  color:var(--accent);
}

/* ---------- Cover ---------- */

.coverGrid{
  height:100%;
  display:grid;
  grid-template-columns:1fr 1fr;
  grid-template-areas:
    "logo intro"
    "hero hero"
    "bottom bottom";
  gap:clamp(16px,3vw,30px);
  align-items:start;
}

.coverLogoWrap{ grid-area:logo; }
.coverIntro{ grid-area:intro; }
.coverHero{ grid-area:hero; }
.coverBottom{ grid-area:bottom; }

.coverLogo{
  width:clamp(180px,28vw,400px);
  max-width:400px;
  height:auto;
  display:block;
}

.coverH1{
  font-size:clamp(40px,6vw,74px);
}

.hero .bg,
.coverHero .bg{
  position:relative;
  height:340px;
  overflow:hidden;
  border-radius:18px;
  box-shadow:var(--shadow);
}

.hero-img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  filter:
    brightness(1.10)
    saturate(.88)
    contrast(.92);
}

.overlay{
  position:relative;
  z-index:1;
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:center;
  padding:2rem;
  /* Hemängen morgondis – ljus slöja, inte mörk overlay */
  background:linear-gradient(
    180deg,
    rgba(255,255,255,.18) 0%,
    rgba(248,247,240,.24) 52%,
    rgba(255,255,255,.42) 100%
  );
}

.hero-title{
  color:#fff;
  font-weight:800;
  font-size:clamp(1.55rem,3vw,2.35rem);
  margin-bottom:.5rem;
  text-shadow:0 2px 10px rgba(0,0,0,.45);
}

.hero-sub{
  color:#fff;
  margin:0;
  font-size:1rem;
  text-shadow:0 2px 8px rgba(0,0,0,.45);
}

/* ---------- Buttons / language ---------- */

.navRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}

.navUnderImages{ margin-top:8px; }

.btn,
.lang{
  appearance:none;
  border:1px solid rgba(78,83,40,.35);
  background:var(--accent);
  color:#fff;
  padding:10px 15px;
  border-radius:999px;
  cursor:pointer;
  font-weight:700;
  font-size:14px;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.btn:hover,
.lang:hover{ filter:brightness(.95); }

.btn--ghost,
.lang--ghost{
  background:transparent;
  color:var(--accent);
}

.languageRow{
  display:flex;
  gap:8px;
  margin-bottom:12px;
}

/* ---------- Dots ---------- */

.dots{
  position:fixed;
  right:14px;
  top:50%;
  transform:translateY(-50%);
  display:flex;
  flex-direction:column;
  gap:10px;
  z-index:10;
}

.dot{
  width:10px;
  height:10px;
  border-radius:50%;
  border:1px solid rgba(78,83,40,.45);
  background:transparent;
  cursor:pointer;
}

.dot[aria-current="true"]{
  background:var(--accent);
  border-color:var(--accent);
}

/* ---------- Footer ---------- */

.pageFooter{
  position:absolute;
  right:clamp(24px,5vw,48px);
  bottom:clamp(16px,3vh,32px);
  display:flex;
  gap:16px;
  align-items:center;
  font-size:14px;
  color:var(--muted);
  z-index:2;
}

/* ---------- Mobile: kompakt boklayout ---------- */
@media (max-width:760px){

  .book{
    height:100svh;
    overflow:auto;
    scroll-snap-type:none;
    scroll-behavior:smooth;
    -webkit-overflow-scrolling:touch;
  }

  .dots,
  .pageFooter{
    display:none !important;
  }

  section.page{
    height:auto;
    min-height:100svh;
    padding:14px 12px 18px;
    align-items:flex-start;
    justify-content:center;
    overflow:visible;
  }

  .sheet{
    width:100%;
    height:auto;
    min-height:0;
    gap:12px;
    padding-bottom:0;
  }

  /* Pärmen får fortfarande vara enkel och vertikal */
  .coverGrid{
    height:auto;
    grid-template-columns:1fr;
    grid-template-areas:
      "logo"
      "intro"
      "hero"
      "bottom";
    gap:12px;
  }

  .coverLogo{
    width:min(52vw,210px);
    max-width:210px;
  }

  .coverH1{
    font-size:clamp(34px,10vw,46px);
    line-height:1.02;
  }

  .coverIntro p{
    font-size:16px;
    margin-bottom:0;
  }

  .hero .bg,
  .coverHero .bg{
    height:185px;
    border-radius:16px;
  }

  .overlay{
    padding:16px;
  }

  .hero-title{
    font-size:clamp(1.35rem,6vw,1.75rem);
    line-height:1.15;
  }

  .hero-sub{
    font-size:.92rem;
  }

  .languageRow{
    gap:8px;
    margin:4px 0 8px;
  }

  .lang{
    min-width:52px;
    padding:9px 13px;
  }

  .coverBottom .navRow{
    display:grid;
    grid-template-columns:1fr;
    gap:8px;
  }

  .coverBottom .btn{
    width:100%;
    padding:11px 14px;
  }

  /* Innehållssidor: samma kompakta tvåkolumnsprincip som raktvålsboken */
  section.page:not(.coverPage) .twoCol{
    display:grid;
    grid-template-columns:minmax(0,1.42fr) minmax(108px,.72fr);
    gap:12px;
    height:auto;
    min-height:0;
    align-items:start;
  }

  section.page:not(.coverPage) .twoCol > div{
    min-width:0;
    min-height:0;
  }

  h1{
    font-size:36px;
  }

  h2{
    font-size:clamp(23px,6.8vw,29px);
    line-height:1.03;
    margin-bottom:10px;
    overflow-wrap:normal;
    word-break:normal;
    hyphens:none;
    -webkit-hyphens:none;
  }

  h3{
    font-size:15px;
    line-height:1.18;
    margin-bottom:4px;
  }

  p,
  .lead{
    font-size:14px;
    line-height:1.38;
    margin-bottom:9px;
    max-width:none;
    overflow-wrap:normal;
    word-break:normal;
    hyphens:none;
    -webkit-hyphens:none;
  }

  .kicker{
    font-size:.72rem;
    margin-bottom:5px;
  }

  /* Finska och engelska behöver lite mer luft på smal skärm */
  html[lang="fi"] h2,
  html[lang="en"] h2{
    font-size:clamp(21px,6.2vw,27px);
  }

  html[lang="fi"] p,
  html[lang="fi"] .lead,
  html[lang="en"] p,
  html[lang="en"] .lead{
    font-size:13.5px;
    line-height:1.36;
  }

  /* Små boknotiser i stället för stora mobilkort */
  .grid2{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:7px;
    margin-top:8px;
  }

  .mini{
    min-width:0;
    padding:9px 10px;
    border-radius:11px;
    box-shadow:0 3px 9px rgba(53,57,35,.05);
    font-size:12.5px;
    line-height:1.28;
    overflow-wrap:anywhere;
  }

  .mini strong{
    font-size:13.5px;
  }

  .steps{
    gap:7px;
    margin-top:7px;
  }

  .step{
    padding:9px 10px;
    border-radius:11px;
  }

  .stepHead{
    gap:5px;
  }

  .stepHead .n{
    font-size:14px;
  }

  .stepHead h3{
    font-size:14px;
  }

  .step p{
    font-size:12.5px;
    line-height:1.30;
    margin-bottom:0;
  }

  .faq{
    gap:10px;
  }

  .faq h3{
    margin-bottom:3px;
  }

  .faq p{
    font-size:12.75px;
    line-height:1.32;
  }

  /* Högerspalt: liten bild och små knappar */
  .sideCol{
    display:flex;
    flex-direction:column;
    gap:8px;
    min-width:0;
    align-items:stretch;
  }

  .card{
    min-height:0;
    padding:7px;
    border-radius:12px;
    box-shadow:0 7px 16px rgba(53,57,35,.12);
  }

  .card img{
    width:100%;
    height:auto !important;
    max-height:21svh;
    object-fit:contain;
    border-radius:8px;
  }

  .sideCol > .card{
    aspect-ratio:1 / 1.02;
  }

  .sideCol > .card img{
    width:100%;
    height:100% !important;
    max-height:none;
    object-fit:contain;
  }

  .navRow,
  .navUnderImages{
    display:grid;
    grid-template-columns:1fr;
    gap:6px;
    margin-top:0;
  }

  .sideCol .btn{
    width:100%;
    min-height:34px;
    padding:7px 7px;
    font-size:11.5px;
    line-height:1.1;
    white-space:normal;
    text-align:center;
  }

  .callout{
    padding:9px 10px;
    font-size:12.5px;
    line-height:1.3;
  }

  .rule{
    margin:9px 0;
  }
}

/* Extra smala telefoner */
@media (max-width:390px){

  section.page{
    padding-left:10px;
    padding-right:10px;
  }

  section.page:not(.coverPage) .twoCol{
    grid-template-columns:minmax(0,1.48fr) minmax(100px,.68fr);
    gap:9px;
  }

  h2{
    font-size:22px;
  }

  html[lang="fi"] h2,
  html[lang="en"] h2{
    font-size:20px;
  }

  p,
  .lead{
    font-size:13.2px;
  }

  html[lang="fi"] p,
  html[lang="fi"] .lead,
  html[lang="en"] p,
  html[lang="en"] .lead{
    font-size:12.8px;
  }

  .mini{
    padding:8px;
    font-size:12px;
  }

  .mini strong{
    font-size:13px;
  }

  /* Högerspalten sträcker sig nedåt på sidan */
  .sideCol{
    display:flex;
    flex-direction:column;
    gap:8px;
    min-width:0;
    align-items:stretch;

    min-height:calc(100svh - 70px);
  }

  /* Bilden stannar uppe – navigationen trycks mot botten */
  .sideCol .navUnderImages{
    margin-top:auto;
    padding-bottom:8px;
  }
}
