/* =========================================================
   Kiinteistöpalvelu Sajo – main stylesheet
   No framework, no build step. Edit the tokens below to
   change colours, fonts and spacing across the whole site.
   ========================================================= */

@font-face {
  font-family: "Adventor";
  src: url("../fonts/adventor-bold.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colours */
  /* Palette taken from the company logo */
  --ink: #0e2f55;          /* main text, dark surfaces (logo navy, deepened) */
  --blue: #1b4a82;         /* logo wordmark blue: links, details */
  --blue-dark: #143a68;
  --sky: #3db4dc;          /* logo light blue */
  --yellow: #ffc21a;       /* accent: 24/7 phone, main actions, highlights on dark */
  --yellow-dark: #e8ad00;
  --tint: #fff6db;         /* light yellow notice background */
  --concrete: #eef3f7;     /* light section background */
  --line: #d3dde6;         /* borders and dividers */
  --muted: #4a5d72;        /* secondary text */
  --paper: #ffffff;
  --error: #b3261e;
  --success: #1f6b3a;

  /* Type */
  --font-display: "Adventor", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Layout */
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --radius: 10px;
  --section: clamp(56px, 8vw, 96px);
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 96px;
}
@media (max-width: 820px) {
  html { scroll-padding-top: 16px; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: var(--blue); text-underline-offset: 3px; }
a[href^="tel:"] { white-space: nowrap; }
a:hover { color: var(--blue-dark); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.65rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; line-height: 1.25; }

p { margin: 0 0 1em; max-width: 68ch; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}
.hero :focus-visible,
.page-hero :focus-visible,
.urgent :focus-visible,
.site-footer :focus-visible { outline-color: var(--yellow); }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 100;
  background: var(--yellow);
  color: var(--ink);
  padding: 10px 16px;
  font-weight: 600;
  border-radius: 6px;
}
.skip-link:focus { top: 8px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: 999px;
  font: 600 1rem/1.2 var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn svg { width: 20px; height: 20px; flex: none; }

.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-primary:hover { background: var(--yellow-dark); color: var(--ink); }

.btn-outline-light { border-color: rgba(255,255,255,.55); color: #fff; }
.btn-outline-light:hover { border-color: #fff; background: rgba(255,255,255,.08); color: #fff; }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--blue); color: #fff; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.97);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 84px;
}

.brand { flex: none; display: block; }
.brand img { height: 64px; width: auto; }

.main-nav { margin-left: auto; }
.main-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.main-nav a {
  display: block;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.main-nav a:hover { background: var(--concrete); color: var(--ink); }
.main-nav a[aria-current="page"] {
  box-shadow: inset 0 -3px 0 var(--yellow);
  border-radius: 0;
}

.main-nav { display: flex; align-items: center; gap: 12px; }

.lang-switch {
  display: inline-flex;
  flex: none;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 700;
}
.lang-switch a {
  display: block;
  min-width: 34px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
}
.lang-switch a:hover { color: var(--ink); background: var(--concrete); }
.lang-switch a[aria-current="true"] { background: var(--ink); color: #fff; }
/* Override the general nav link styles for the switch */
.main-nav .lang-switch a { padding: 5px 8px; border-radius: 999px; font-size: .85rem; text-align: center; }

.header-phone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 8px 16px 8px 10px;
  background: var(--yellow);
  color: var(--ink);
  border-radius: 999px;
  text-decoration: none;
  line-height: 1.15;
}
.header-phone:hover { background: var(--yellow-dark); color: var(--ink); }
.header-phone .icon {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
}
.header-phone .icon svg { width: 18px; height: 18px; }
.header-phone small { display: block; font-size: .75rem; font-weight: 600; }
.header-phone strong { display: block; font-size: 1.05rem; white-space: nowrap; }

/* Mobile header: logo + phone on the first row, tabs on the second */
@media (max-width: 820px) {
  /* grid: row 1 = logo + phone button (logo shrinks if space runs out), row 2 = tabs */
  .header-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 12px;
    min-height: 0;
    padding-top: 10px;
  }
  /* logo and phone button share the first row: both shrink instead of wrapping */
  .brand { grid-column: 1; grid-row: 1; min-width: 0; justify-self: start; }
  .brand img { height: auto; width: 100%; max-width: 150px; }
  .header-phone { grid-column: 3; grid-row: 1; justify-self: end; gap: 8px; padding: 4px 12px 4px 4px; }
  .header-phone .icon { width: 30px; height: 30px; }
  .header-phone .icon svg { width: 16px; height: 16px; }
  .header-phone small { display: none; }
  .header-phone strong { font-size: .92rem; }
  .site-header { position: static; }
  /* the nav box is dissolved so its parts can sit in the grid:
     tabs on row 2, FI/EN on row 1 between the logo and the phone button */
  .header-inner { grid-template-columns: minmax(0, 1fr) auto auto; }
  .main-nav { display: contents; }
  .main-nav ul { grid-column: 1 / -1; grid-row: 2; gap: 0; margin: 0 calc(var(--gutter) * -1); width: calc(100% + var(--gutter) * 2); border-top: 1px solid var(--line); }
  .lang-switch { grid-column: 2; grid-row: 1; }
  .main-nav .lang-switch a { min-width: 30px; padding: 4px 7px; font-size: .8rem; }
  .main-nav li { flex: 1; }
  .main-nav a { text-align: center; padding: 12px 4px; border-radius: 0; font-size: .95rem; }
}
/* very narrow screens: round call button, number stays readable for screen readers */
@media (max-width: 25em) {
  .main-nav a { font-size: .85rem; padding: 12px 2px; }
  .header-phone { padding: 4px; }
  .header-phone .icon { width: 36px; height: 36px; }
  .header-phone > span:last-child {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* ---------- Hero ---------- */

.hero {
  background: var(--ink);
  color: #fff;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: end;
  gap: 40px;
  padding-top: clamp(48px, 7vw, 88px);
}
.hero-text { padding-bottom: clamp(48px, 7vw, 88px); }
.hero h1 { color: #fff; max-width: 15ch; }
.hero h1:lang(en) { max-width: 19ch; }
.hero .lead { font-size: 1.2rem; color: #d3deea; max-width: 46ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero-art img { width: 100%; max-width: 520px; margin-left: auto; }

.hero-247 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: #d3deea;
  font-weight: 600;
}
.hero-247 .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(255,194,26,.22);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: .55; box-shadow: 0 0 0 3px rgba(255,194,26,.12), 0 0 4px rgba(255,194,26,.2); }
  50%      { opacity: 1;   box-shadow: 0 0 0 5px rgba(255,194,26,.28), 0 0 14px rgba(255,194,26,.75); }
}

@media (max-width: 820px) {
  .hero-inner { grid-template-columns: 1fr; gap: 8px; }
  .hero-text { padding-bottom: 8px; }
  .hero .lead { font-size: 1.08rem; }
  .hero-actions .btn { flex: 1 1 220px; }
  .hero-art img { max-width: 300px; margin: 12px auto 0; }
}

/* Smaller page header for sub pages */
.page-hero { background: var(--ink); color: #fff; padding: clamp(40px, 6vw, 72px) 0; }
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero p { color: #d3deea; font-size: 1.15rem; margin: 0; max-width: 56ch; }

/* ---------- Sections ---------- */

.section { padding: var(--section) 0; }
.section-alt { background: var(--concrete); }
.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { color: var(--muted); }

/* Key facts strip */
.facts {
  display: grid;
  /* the 24/7 box has the longest text, so it gets a wider column */
  grid-template-columns: 0.9fr 1fr 1.5fr;
  border-bottom: 1px solid var(--line);
}
.fact {
  display: flex;
  gap: 16px;
  padding: 32px 28px 32px 0;
}
.fact + .fact { padding-left: 28px; border-left: 1px solid var(--line); }
.fact h3 { margin-bottom: .25em; font-size: 1.15rem; }
.fact p { margin: 0; color: var(--muted); font-size: 1rem; }
.fact p strong { color: var(--ink); }
.icon-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--concrete);
  color: var(--blue);
}
.icon-badge svg { width: 26px; height: 26px; }

/* medium screens: two boxes side by side, the 24/7 box on its own row below */
@media (min-width: 821px) and (max-width: 1100px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { grid-column: 1 / -1; padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 820px) {
  .facts { grid-template-columns: 1fr; }
  .fact { padding: 22px 0; }
  .fact + .fact { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
}

/* Split layout: heading left, content right */
.split {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: start;
}
@media (max-width: 820px) { .split { grid-template-columns: 1fr; gap: 24px; } }

/* Help list on the front page */
.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li {
  display: flex;
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.help-list li:last-child { border-bottom: 1px solid var(--line); }
.help-list h3 { margin-bottom: .2em; }
.help-list p { margin: 0; color: var(--muted); }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.text-link svg { width: 18px; height: 18px; }

/* Call to action band */
.cta-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  flex-wrap: wrap;
  padding: clamp(28px, 4vw, 44px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 8px solid var(--yellow);
  border-radius: var(--radius);
}
.cta-band h2 { font-size: clamp(1.45rem, 2.8vw, 2rem); margin-bottom: .3em; }
.cta-band p { margin: 0; color: var(--muted); }

/* ---------- Services page ---------- */

.service-list { list-style: none; margin: 0; padding: 0; }
.service {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 8px 24px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
}
.service:last-child { border-bottom: 1px solid var(--line); }
.service .icon-badge { width: 56px; height: 56px; }
.service h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin-bottom: .35em; }
.service p { color: var(--muted); }
.service ul { margin: 0; padding-left: 1.2em; }
.service li { margin: .2em 0; }
.service li::marker { color: var(--blue); }
.note {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--tint);
  border-radius: 8px;
  font-size: .98rem;
  max-width: 68ch;
}
@media (max-width: 560px) {
  .service { grid-template-columns: 44px 1fr; gap: 4px 14px; padding: 28px 0; }
  .service .icon-badge { width: 44px; height: 44px; }
}

/* Process steps (a real sequence, so it is numbered) */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--yellow);
  font: 700 1.2rem/1 var(--font-display);
}
.steps h3 { font-size: 1.1rem; margin-bottom: .3em; }
.steps p { margin: 0; color: var(--muted); font-size: 1rem; }
@media (max-width: 900px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } }

/* ---------- About page ---------- */

.about-text { max-width: 720px; }

/* ---------- Contact page ---------- */

.contact-list { list-style: none; margin: 0 0 28px; padding: 0; }
.contact-list li { padding: 18px 0; border-top: 1px solid var(--line); }
.contact-list li:last-child { border-bottom: 1px solid var(--line); }
.contact-list .label { display: block; color: var(--muted); font-size: .95rem; }
.contact-list .value { font-size: 1.2rem; font-weight: 600; word-break: break-word; }
.contact-list .value.big {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  color: var(--ink);
  text-decoration: none;
}
.contact-list a.value:hover { color: var(--blue); }

/* ---------- Forms ---------- */

.form-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 36px);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }

label, legend { font-weight: 600; font-size: .98rem; }
.optional { font-weight: 400; color: var(--muted); }

input[type="text"],
input[type="tel"],
input[type="email"],
textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1.5px solid #b9c3cb;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: 1rem/1.4 var(--font-body);   /* 16px+ prevents zoom on iOS */
}
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29,78,137,.2);
}
.field.has-error input,
.field.has-error textarea { border-color: var(--error); }
.field-error { color: var(--error); font-size: .92rem; margin: 0; }
.field-error:empty { display: none; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 8px; }
.choice { display: inline-flex; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
.choice input { width: 22px; height: 22px; accent-color: var(--blue); margin: 0; }
.hint { color: var(--muted); font-size: .92rem; margin: 4px 0 0; }

.hp-field { position: absolute; left: -9999px; }

.form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  margin-top: 24px;
}
.form-footer .privacy { margin: 0; font-size: .9rem; color: var(--muted); flex: 1 1 260px; }
.form-footer .btn { flex: 0 0 auto; }
@media (max-width: 560px) { .form-footer .btn { width: 100%; } }

.form-status {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 8px;
  font-weight: 500;
}
.form-status:empty { display: none; }
.form-status.is-success { background: #e4f3e8; color: var(--success); }
.form-status.is-error { background: #fbe9e7; color: var(--error); }
.form-status.is-info { background: var(--tint); color: var(--ink); }

.urgent {
  display: flex;
  gap: 14px;
  margin: 24px 0;
  padding: 18px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
}
.urgent svg { flex: none; width: 26px; height: 26px; color: var(--yellow); margin-top: 2px; }
.urgent p { margin: 0; }
.urgent a { color: var(--yellow); font-weight: 700; white-space: nowrap; }

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

.site-footer {
  background: var(--ink);
  color: #c9d6e6;
  padding: 56px 0 28px;
  font-size: .98rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 32px;
}
.footer-grid h2 {
  font-size: 1.05rem;
  color: #fff;
  margin-bottom: .8em;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: .4em 0; }
.footer-logo img { height: 52px; width: auto; margin-bottom: 16px; }
.footer-bottom {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.14);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  font-size: .9rem;
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- Simple content pages (privacy, thanks, 404) ---------- */

.prose { max-width: 720px; }
.prose h2 { font-size: 1.4rem; margin-top: 1.6em; }
.prose ul { padding-left: 1.2em; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
  .hero-247 .dot { animation: none; opacity: 1; }
}

@media print {
  .site-header, .hero-art, form { display: none !important; }
  body { padding: 0; }
}
