/* Tilitoimisto Pesa Oy — pesa.fi
   Vanilla CSS, mobile-first, no framework.
   Colors match the live site's actual WordPress theme tokens
   (background/foreground/tertiary/accent), not an invented palette. */

:root {
  --fg: #0b0620;        /* WP "foreground" — near-black, used for text and dark bars */
  --bg: #f7f7f7;         /* WP "background" — the page's off-white */
  --tertiary: #d2cedc;   /* WP "tertiary" — alternating section background */
  --accent: #381d92;     /* button/link accent, deep violet */
  --accent-dark: #2a1470;
  --ink-muted: #4a4658;
  --white: #ffffff;
  --border: #e0dee6;
  --radius: 8px;
  --max-width: 1120px;
  font-size: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: underline; }
a:hover { color: var(--accent); }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 1000;
  background: var(--white);
  padding: 8px 12px;
  border-radius: var(--radius);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
  gap: 20px;
  max-width: 1280px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 60px; width: auto; }
.brand-name { font-weight: 700; color: var(--fg); font-size: 1.05rem; }

.nav-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  margin: 4px 0;
}

.main-nav {
  min-width: 0;
}
.main-nav ul {
  display: flex;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: nowrap;
}
.main-nav a {
  color: var(--fg);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  white-space: nowrap;
}
.main-nav a:hover { text-decoration: underline; }
.main-nav a[aria-current="page"] { color: var(--accent); }

.header-contact {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.phone-link {
  font-weight: 700;
  color: var(--fg);
  white-space: nowrap;
  text-decoration: none;
}
.phone-price {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-muted);
  font-weight: 400;
}
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--white); }
.btn-outline { background: transparent; border-color: var(--fg); color: var(--fg); }
.btn-outline:hover { background: var(--fg); color: var(--bg); }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; flex-direction: column; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 12px 20px 18px; flex-wrap: wrap; }
  .main-nav li { border-bottom: 1px solid var(--border); }
  .main-nav a { display: block; padding: 12px 0; }
  .header-contact .btn-outline { display: none; }
}
@media (max-width: 480px) {
  .brand img { height: 44px; }
  .phone-price { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 40px;
  align-items: center;
}
/* Homepage hero: full-bleed photo background with a dark scrim and
   centered white text, matching the live site's cover-image treatment
   (this is a background image, not a side-by-side photo). */
.hero-cover {
  position: relative;
  padding: 100px 0;
  background-size: cover;
  background-position: center;
  color: var(--white);
  text-align: center;
}
.hero-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}
.hero-cover .container { position: relative; display: block; max-width: 760px; }
.hero.hero-cover h1 { color: var(--white); }
.hero.hero-cover p.lede { color: var(--white); }
.hero-cover .hero-actions { justify-content: center; }
.hero.hero-cover .hero-call { color: var(--white); }
.hero.hero-cover .hero-call strong { color: var(--white); }
.hero-cover .btn-outline { border-color: var(--white); color: var(--white); }
.hero-cover .btn-outline:hover { background: var(--white); color: var(--fg); }
.hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  color: var(--fg);
  margin: 0 0 16px;
  line-height: 1.2;
}
.hero p.lede { font-size: 1.08rem; color: var(--ink-muted); margin-bottom: 22px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 8px; }
.hero-call { font-size: 0.95rem; color: var(--ink-muted); }
.hero-call strong { color: var(--fg); }
.hero-media img {
  border-radius: var(--radius);
}
@media (max-width: 880px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .hero-cover { padding: 64px 0; }
}

/* ---------- Sections ---------- */
section { padding: 56px 0; }
.section-alt { background: var(--tertiary); }
h2.section-title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  color: var(--fg);
  margin: 0 0 12px;
  text-align: center;
}
.section-intro {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 1.02rem;
}
.section-alt .section-intro { color: var(--fg); opacity: 0.75; }

.card-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
}
/* Flex (not grid) so a row that doesn't divide evenly (e.g. 5 cards)
   centers its last row instead of leaving a visible empty cell. */
.card {
  background: var(--bg);
  padding: 24px;
  flex: 1 1 300px;
  max-width: 360px;
}
@media (max-width: 880px) { .card { flex-basis: 100%; max-width: none; } }
.card h3 { color: var(--fg); margin: 0 0 10px; font-size: 1.1rem; }
.card p { color: var(--ink-muted); margin: 0; font-size: 0.96rem; }
.section-alt .card { background: var(--white); }

.partners {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
}
.partners img {
  max-width: 150px;
  max-height: 75px;
  width: auto;
  height: auto;
}
.partner-media { text-align: center; margin-top: 32px; }
.partner-media img { border-radius: var(--radius); margin: 0 auto; max-height: 320px; }

.section-media { text-align: center; margin-top: 32px; }
.section-media img { border-radius: var(--radius); margin: 0 auto; max-width: 100%; height: auto; }
.section-media figcaption { margin-top: 12px; font-size: 0.88rem; color: var(--ink-muted); }
.section-with-media .container { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.section-with-media .section-media { margin-top: 0; }
@media (max-width: 880px) {
  .section-with-media .container { grid-template-columns: 1fr; }
}

.cta-band {
  background: var(--fg);
  color: var(--bg);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}
.cta-band h2 { color: var(--bg); }
.cta-band p { color: var(--tertiary); max-width: 640px; margin: 0 auto 24px; }
.cta-band a { color: var(--bg); }

/* ---------- Pricing table ---------- */
.pricing-table-wrap { overflow-x: auto; margin: 28px 0; }
table.pricing {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  background: var(--white);
}
table.pricing caption { text-align: left; font-weight: 700; margin-bottom: 8px; color: var(--fg); }
table.pricing th, table.pricing td {
  border: 1px solid var(--border);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  font-size: 0.93rem;
}
table.pricing thead th {
  background: var(--fg);
  color: var(--bg);
}
table.pricing tbody tr:nth-child(even) { background: var(--tertiary); }
table.pricing td:nth-child(2) { font-weight: 700; color: var(--fg); white-space: nowrap; }

/* ---------- FAQ accordion ---------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 18px 0;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--fg);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq-question .icon { flex-shrink: 0; transition: transform 0.2s ease; font-weight: 400; color: var(--accent); }
.faq-question[aria-expanded="true"] .icon { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  color: var(--ink-muted);
}
.faq-answer .faq-answer-inner { padding: 0 0 18px; }
.faq-answer ul { margin: 8px 0; padding-left: 20px; }

/* ---------- Forms ---------- */
.form-section { max-width: 720px; margin: 0 auto; }
.hubspot-form-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  min-height: 260px;
}
.form-fallback {
  color: var(--ink-muted);
  font-size: 0.95rem;
}
.form-fallback a { font-weight: 700; color: var(--fg); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg);
  color: var(--fg);
  padding: 48px 0 22px;
  margin-top: 40px;
  border-top: 1px solid var(--border);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 880px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } }
.footer-grid h4 { color: var(--fg); margin: 0 0 12px; font-size: 0.95rem; letter-spacing: 0.02em; text-transform: uppercase; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--fg); text-decoration: none; }
.footer-grid a:hover { color: var(--accent); text-decoration: underline; }
.footer-brand img { height: 44px; margin-bottom: 12px; }
.footer-brand p { color: var(--ink-muted); font-size: 0.88rem; max-width: 280px; }
.footer-tal { height: 60px; width: auto; margin-top: 12px; }
.social-links { display: flex; gap: 12px; margin-top: 10px; }
.social-links a {
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: var(--fg);
}
.social-links a:hover { color: var(--accent); border-color: var(--accent); }
.social-links svg { width: 16px; height: 16px; }
.footer-bottom {
  border-top: 1px solid var(--border);
  margin-top: 36px;
  padding-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.footer-bottom-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom-links a { color: var(--ink-muted); }
#open-cookie-settings {
  background: none;
  border: none;
  color: var(--ink-muted);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.82rem;
  padding: 0;
}

/* ---------- Cookie consent banner ---------- */
#pesa-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 20px;
  display: none;
}
#pesa-consent-banner.is-visible { display: block; }
.consent-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}
.consent-text { flex: 1 1 380px; font-size: 0.9rem; color: var(--ink-muted); }
.consent-text strong { color: var(--fg); }
.consent-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.consent-modal-backdrop {
  position: fixed; inset: 0; background: rgba(11,6,32,0.45);
  z-index: 2100; display: none; align-items: center; justify-content: center; padding: 20px;
}
.consent-modal-backdrop.is-visible { display: flex; }
.consent-modal {
  background: var(--white); border-radius: var(--radius); padding: 28px; max-width: 520px; width: 100%;
  max-height: 85vh; overflow-y: auto;
}
.consent-modal h3 { margin-top: 0; color: var(--fg); }
.consent-category { border-bottom: 1px solid var(--border); padding: 14px 0; }
.consent-category:last-of-type { border-bottom: none; }
.consent-category-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.consent-category-row strong { color: var(--fg); }
.consent-category p { margin: 6px 0 0; font-size: 0.87rem; color: var(--ink-muted); }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 999px; transition: 0.2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: var(--white); border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: 0.6; cursor: not-allowed; }
.consent-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ---------- Job application extras ---------- */
.perk-list, .req-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.perk-list li, .req-list li {
  padding: 10px 0 10px 28px;
  position: relative;
  border-bottom: 1px solid var(--border);
  color: var(--ink-muted);
}
.perk-list li::before, .req-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.earnings-table th, .earnings-table td { text-align: center; }
.earnings-table td:first-child, .earnings-table th:first-child { text-align: left; }

.badge {
  display: inline-block;
  background: var(--tertiary);
  color: var(--fg);
  border-radius: var(--radius);
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.contact-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 32px;
}
@media (max-width: 700px) { .contact-info-grid { grid-template-columns: 1fr; } }
.contact-info-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.contact-info-card h3 { margin: 0 0 6px; font-size: 1rem; color: var(--fg); }
.contact-info-card p { margin: 0; color: var(--ink-muted); font-size: 0.92rem; }

/* Skip HubSpot loader visual noise until injected */
noscript.hs-noscript {
  display: block;
  padding: 16px;
  background: var(--tertiary);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--fg);
}
