/* Gasni.fi – järviteema: selkeä ja helppolukuinen.
   Iso perusteksti, vahvat kontrastit, isot painikkeet. Kaikki tekstivärit täyttävät WCAG AAA/AA. */

:root {
  --text: #10202b;
  --muted: #3b4a55;
  --bg: #fff;
  --bg-soft: #eef7fc;     /* vaalea taivas */
  --sky: #d6edf9;
  --line: #bcd6e6;
  --brand: #0b4a6e;       /* syvä järvensininen */
  --brand-dark: #073550;
  --brand-mid: #2a9ad6;   /* aalto */
  --brand-soft: #e2f1fa;
  --link: #0a4f8a;
  --call: #0b6b2f;        /* vihreä = soita */
  --call-hover: #08521f;
  --sold: #9b1c1c;
  --sun: #ffd23f;         /* kesäaurinko: uutuus-merkit */
  --focus: #ffbf00;
  --radius: 10px;
  --base: 21px;
}
html[data-textsize="2"] { --base: 24px; }
html[data-textsize="3"] { --base: 28px; }

* { box-sizing: border-box; }

html { font-size: var(--base); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Verdana, "Segoe UI", Tahoma, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 1rem; padding-bottom: 2.5rem; }

h1, h2, h3 { line-height: 1.25; color: var(--brand); margin: 1.4em 0 .5em; }
h1 { font-size: 2rem; margin-top: .6em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

p, ul { margin: 0 0 1em; }
a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 3px; }
strong { font-weight: 700; }
img { max-width: 100%; height: auto; }

:focus-visible { outline: 4px solid var(--focus); outline-offset: 2px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 10px; top: 10px; z-index: 10; background: #fff; padding: .5rem 1rem; }

/* ---------- Painikkeet ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 56px; padding: .55em 1.1em;
  border: 3px solid transparent; border-radius: var(--radius);
  font: inherit; font-weight: 700; line-height: 1.2; text-align: center;
  text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-soft); }
.btn-call { background: var(--call); color: #fff; font-size: 1.1rem; white-space: nowrap; }
.btn-call:hover { background: var(--call-hover); }
.btn-danger { background: #fff; color: var(--sold); border-color: var(--sold); }
.btn-danger:hover { background: #fbeaea; }

/* ---------- Ylätunniste: taivas -> järvi ---------- */
.site-header { background: linear-gradient(180deg, #f4fbff 0%, var(--sky) 100%); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { text-decoration: none; color: var(--brand); display: flex; flex-direction: column; }
.logo { display: block; width: 300px; max-width: 70vw; height: auto; }
.brand-tag { color: var(--brand-dark); font-size: .95rem; font-weight: 700; margin-top: -2px; }
.header-contact .btn-call { box-shadow: 0 3px 0 rgba(7, 53, 80, .25); }

/* Aaltoreuna valikon alla ja alatunnisteen yllä */
.wave { height: 22px; background-repeat: repeat-x; background-size: 120px 22px; }
.wave-top { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 22'%3E%3Cpath d='M0 0h120v8c-15 0-15 10-30 10S75 8 60 8 45 18 30 18 15 8 0 8z' fill='%230b4a6e'/%3E%3C/svg%3E"); }
.wave-bottom { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 22'%3E%3Cpath d='M0 22h120V12c-15 0-15-10-30-10S75 12 60 12 45 2 30 2 15 12 0 12z' fill='%23073550'/%3E%3C/svg%3E"); margin-top: 2rem; }
.header-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; }

.textsize { display: flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.textsize button {
  min-width: 44px; min-height: 44px; border: 2px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; padding: 0 6px;
}
.textsize button.ts2 { font-size: 1.05rem; }
.textsize button.ts3 { font-size: 1.3rem; }
.textsize button[aria-pressed="true"] { border-color: var(--brand); background: var(--brand-soft); }

.main-nav { background: var(--brand); }
.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding-top: 0; padding-bottom: 0; margin: 0 auto; }
.main-nav a {
  display: block; padding: .7em .62em; color: #fff; text-decoration: none; font-weight: 700; font-size: .95rem;
  border-bottom: 5px solid transparent;
}
.main-nav a:hover { background: var(--brand-dark); }
.main-nav a[aria-current="page"] { background: #fff; color: var(--brand); border-bottom-color: var(--sun); }

.hero { margin-top: .6rem; }
.hero img { display: block; width: 100%; max-height: 300px; object-fit: cover; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 4px 14px rgba(7, 53, 80, .18); }
.feature-img { display: block; width: 100%; max-width: 800px; border-radius: 14px; margin: .5em 0 1em; }

/* ---------- Sisältö ---------- */
.lead { font-size: 1.15rem; }
.big-list { padding-left: 1.3em; }
.big-list li { margin-bottom: .45em; }
.big-list li::marker { color: var(--brand); }
.center { text-align: center; }
.notice { background: var(--bg-soft); border-left: 6px solid var(--brand); padding: .8em 1em; }
.hint { color: var(--muted); }
.back { margin: .5em 0 1em; font-weight: 700; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 40px; }
.highlight { background: var(--brand-soft); border-radius: var(--radius); padding: .2em 1em; display: inline-block; margin-bottom: 1.2em; }
.highlight h2 { margin: .5em 0; }
.feature { margin: .5em 0 1.2em; }
.feature-link { max-width: 800px; }
.feature-link img { aspect-ratio: auto; max-height: 520px; object-fit: cover; }
.page-text { max-width: 52em; }
.page-text h2:first-child { margin-top: .4em; }

.intro { padding-bottom: .5em; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.visit-counter {
  display: inline-flex; align-items: center; gap: .7em; flex-wrap: wrap; margin: 1.2em 0 0;
  background: var(--brand-soft); border: 2px solid var(--line); border-radius: var(--radius); padding: .4em 1em;
}
.visit-label { color: var(--brand-dark); font-weight: 700; }
.visit-num {
  font-size: 1.4rem; font-weight: 700; color: #fff; background: var(--brand); border-radius: 8px;
  padding: .05em .55em; letter-spacing: .04em; font-variant-numeric: tabular-nums;
}

.section-title { border-bottom: 3px solid var(--brand); padding-bottom: .25em; }

/* ---------- Haku ja ryhmät ---------- */
.search label { display: block; font-weight: 700; margin-bottom: .3em; }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; max-width: 680px; }
.search input {
  flex: 1 1 260px; min-height: 56px; font: inherit; padding: .4em .7em;
  border: 3px solid #555; border-radius: var(--radius);
}
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0; }
.chips a {
  display: inline-block; padding: .45em .9em; border: 2px solid var(--brand); border-radius: 999px;
  text-decoration: none; color: var(--brand); font-weight: 700; background: #fff;
}
.chips a:hover { background: var(--brand-soft); }
.chips a[aria-current="page"] { background: var(--brand); color: #fff; }
.result-info { font-weight: 700; }

/* ---------- Tuotekortit ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; margin: 1em 0 1.5em; }
.card {
  display: flex; flex-direction: column; border: 2px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff;
}
.card-img { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--bg-soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.no-img { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.badge {
  position: absolute; top: 12px; left: 12px; background: var(--call); color: #fff; border: 2px solid #fff;
  font-weight: 700; padding: .2em .6em; border-radius: 6px; font-size: .85rem;
}
.badge-sold { background: var(--sold); color: #fff; }
.photo-count {
  position: absolute; right: 10px; bottom: 10px; background: rgba(7, 53, 80, .85); color: #fff;
  font-weight: 700; font-size: .85rem; padding: .15em .55em; border-radius: 6px;
}
.card-body { padding: 14px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.card h3 { margin: 0 0 .3em; font-size: 1.2rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card-desc { color: var(--muted); flex: 1; }
.card .btn { width: 100%; }
.card.is-sold .card-img img { filter: grayscale(.6); }

.price { font-size: 1.35rem; font-weight: 700; color: var(--text); margin: .2em 0 .7em; }
.price-big { font-size: 1.8rem; background: var(--brand-soft); display: inline-block; padding: .15em .6em; border-radius: var(--radius); }

/* ---------- Tuotesivu ---------- */
.product h1 { margin-bottom: .2em; }
.product-cat { color: var(--muted); }
.product-desc { font-size: 1.1rem; max-width: 52em; margin-bottom: 1em; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 1.5em; }
.thumb-link { position: relative; display: block; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--line); }
.thumb-link img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .2s; }
.thumb-link:hover img { transform: scale(1.03); }
.zoom-hint {
  position: absolute; right: 8px; bottom: 8px; background: rgba(7, 53, 80, .85); color: #fff;
  font-size: .8rem; font-weight: 700; padding: .15em .55em; border-radius: 6px;
}

/* Kuvan suurennus koko näytölle */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(5, 20, 30, .94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 70px 12px 80px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; }
.lb-btn {
  position: absolute; min-width: 64px; min-height: 64px; border: 3px solid #fff; border-radius: 12px;
  background: rgba(7, 53, 80, .9); color: #fff; font: inherit; font-weight: 700; font-size: 1.1rem; cursor: pointer;
}
.lb-btn:hover { background: var(--brand-mid); }
.lb-close { top: 10px; right: 12px; padding: 0 1em; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); font-size: 2rem; }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); font-size: 2rem; }
.lb-count { position: absolute; bottom: 22px; color: #fff; font-weight: 700; }
@media (max-width: 700px) {
  .lb-prev, .lb-next { top: auto; bottom: 10px; transform: none; }
  .lb-count { bottom: 30px; }
}
body.lb-open { overflow: hidden; }

.pager { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: center; margin: 1em 0; font-weight: 700; }

/* ---------- Yhteystiedot ---------- */
.contact-box {
  background: var(--brand-soft); border: 3px solid var(--brand); border-radius: var(--radius);
  padding: .4em 1.3em 1em; margin: 2em 0;
}
.contact-box h2 { margin-top: .6em; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-card { font-size: 1.15rem; }
.contact-name { font-weight: 700; font-size: 1.3rem; }
.label { color: var(--muted); font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.big-link { font-size: 1.5rem; font-weight: 700; }

/* ---------- Alatunniste ---------- */
.site-footer { background: var(--brand-dark); color: #fff; padding: .5em 0 1.5em; }
.site-footer h2 { color: #fff; font-size: 1.15rem; margin-top: 1em; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 32px; }
.counter { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- Puhelimet ---------- */
@media (max-width: 700px) {
  :root { --base: 19px; }
  html[data-textsize="2"] { --base: 22px; }
  html[data-textsize="3"] { --base: 25px; }
  .wrap { padding: 0 16px; }
  .brand-name { font-size: 1.8rem; }
  .header-contact { width: 100%; }
  .header-contact .btn-call { flex: 1 1 100%; }
  .textsize { width: 100%; }
  .logo { width: 260px; }
  .main-nav ul { padding: 0; }
  .main-nav li { flex: 1 1 50%; }
  .main-nav a { padding: .6em .8em; border-bottom: 1px solid #1d6890; }
  .grid { grid-template-columns: 1fr; }
  .contact-actions .btn { width: 100%; }
  h1 { font-size: 1.7rem; }
}

@media print {
  .main-nav, .textsize, .site-footer, .contact-actions, .skip { display: none; }
}
