/* ==========================================================================
   apkurinat.lv — SIA J.R Santehnika
   Kopējais stils visām lapām
   ========================================================================== */

/* ---------- 1. Mainīgie ---------- */
:root {
  --red: #D92328;
  --red-hover: #B81C20;
  --graphite: #232323;
  --white: #FFFFFF;
  --card: #F4F4F4;
  --text: #222222;
  --text-2: #555555;
  --line: #E4E4E4;

  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --wrap: 1240px;
  --gutter: 24px;
  --skew: -10deg;
  --unskew: 10deg;
  --header-h: 84px;
}

/* ---------- 2. Pamati ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: var(--red); }
a:hover { color: var(--red-hover); }

h1, h2, h3 { margin: 0; line-height: 1.1; }

p { margin: 0; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  background: var(--graphite);
  color: var(--white);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { top: 12px; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* Displeja virsraksti — lielie burti, slīpraksts */
.display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}
.accent { color: var(--red); }

/* ---------- 3. Slīpās pogas un birkas ---------- */
.btn {
  display: inline-block;
  transform: skewX(var(--skew));
  padding: 16px 30px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.btn > span { display: inline-block; transform: skewX(var(--unskew)); }

.btn--red { background: var(--red); color: var(--white); }
.btn--red:hover { background: var(--red-hover); color: var(--white); }

.btn--dark { background: var(--graphite); color: var(--white); }
.btn--dark:hover { background: #000; color: var(--white); }

.btn--outline { background: transparent; color: var(--graphite); box-shadow: inset 0 0 0 2px var(--graphite); }
.btn--outline:hover { background: var(--graphite); color: var(--white); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

.tag {
  display: inline-block;
  transform: skewX(var(--skew));
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  padding: 2px 10px;
}
.tag > span { display: inline-block; transform: skewX(var(--unskew)); }

/* ---------- 4. Saraksts ar sarkaniem trijstūriem ---------- */
.tri-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tri-list li { position: relative; padding-left: 28px; font-weight: 600; }
.tri-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .42em;
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 13px solid var(--red);
}

/* ---------- 5. Augšējā josla ---------- */
.topbar { background: var(--graphite); color: var(--white); font-size: 14px; }
.topbar .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 16px; padding-block: 8px;
}
.topbar__left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar a { color: var(--white); }
.topbar a:hover { color: #ffd3d4; }

/* ---------- 6. Galvene un navigācija ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.is-scrolled { box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: var(--header-h);
}

/* Logo ar rezerves tekstu */
.logo { display: inline-flex; align-items: center; text-decoration: none; color: var(--graphite); flex-shrink: 0; }
.logo img { height: 56px; width: auto; }
.logo__text {
  display: none;
  font-family: var(--font-display); font-style: italic; font-weight: 800;
  font-size: 28px; letter-spacing: .5px; text-transform: uppercase;
}
.logo__text b { color: var(--red); }
.logo.is-missing .logo__text { display: inline; }

.nav { display: flex; align-items: center; gap: 28px; }
.nav a {
  position: relative;
  color: var(--text); text-decoration: none; font-weight: 600; font-size: 16px;
  padding: 8px 0;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--red);
  transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.nav a:hover::after,
.nav a.is-active::after { transform: scaleX(1); }
.nav a.is-active { color: var(--red); }

.header-actions { display: flex; align-items: center; gap: 12px; }
.header-phone {
  font-family: var(--font-display); font-style: italic; font-weight: 800;
  font-size: 23px; padding: 8px 20px; white-space: nowrap;
}

.nav-toggle {
  display: none;
  width: 48px; height: 48px;
  background: var(--graphite); border: 0; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle__bars,
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  display: block; width: 22px; height: 2px; background: var(--white);
  position: relative; transition: transform .2s ease, background-color .2s ease;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -7px; }
.nav-toggle__bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 7. Attēli ar rezerves bloku ---------- */
.media { position: relative; background: var(--card); overflow: hidden; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media.is-missing {
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(-55deg, transparent 0 22px, rgba(217,35,40,.07) 22px 26px),
    var(--card);
  min-height: 220px;
}
.media.is-missing::after {
  content: attr(data-label);
  font-family: var(--font-display); font-style: italic; font-weight: 800;
  text-transform: uppercase; font-size: 26px; color: #9a9a9a;
  text-align: center; padding: 16px;
}

/* ---------- 8. Hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 640px;
  background: var(--white);
}
.hero__content {
  display: flex; flex-direction: column; justify-content: center; gap: 24px;
  padding: 64px var(--gutter) 64px max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter)));
  position: relative; z-index: 2;
}
.hero__kicker { font-size: 18px; font-weight: 600; color: var(--text-2); max-width: 560px; }
.hero__title { font-size: clamp(44px, 5.6vw, 80px); line-height: .95; }
.hero__photo { position: relative; min-height: 520px; }
.hero__photo .media {
  position: absolute; inset: 0;
  clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
}
.hero__photo .media img { object-position: 50% 55%; }
/* Diagonālā sarkanā josla */
.hero__photo::before {
  content: "";
  position: absolute; left: -2px; top: 0; bottom: 0; width: 22%;
  background: var(--red);
  clip-path: polygon(82% 0, 100% 0, 18% 100%, 0 100%);
  z-index: 1;
}

/* ---------- 9. Faktu josla ---------- */
.facts { background: var(--graphite); color: var(--white); }
.facts .wrap {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px;
  padding-block: 30px;
}
.fact__title { display: block; font-size: 36px; color: #ff4a50; line-height: 1.05; }
.fact__text { display: block; color: #d0d0d0; font-size: 15px; }

/* ---------- 10. Sadaļas ---------- */
.section { padding-block: 88px; }
.section--grey { background: var(--card); }
.section__head { display: grid; gap: 16px; margin-bottom: 36px; max-width: 820px; }
.section__title { font-size: clamp(40px, 4.6vw, 58px); color: var(--graphite); }
.section__lead { color: var(--text-2); font-size: 18px; }

/* Pakalpojumu kartītes */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.card {
  background: var(--card);
  padding: 30px 28px;
  border-bottom: 3px solid var(--red);
  display: flex; flex-direction: column; gap: 12px;
}
.section--grey .card { background: var(--white); }
.card__num { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 54px; line-height: 1; color: var(--red); }
.card__title { font-size: 22px; font-weight: 700; color: var(--graphite); }
.card__text { color: var(--text-2); font-size: 16px; }

.section__actions { margin-top: 36px; }

/* Kāpēc mēs */
.why {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: start;
}
.why__text { display: grid; gap: 20px; font-size: 18px; color: var(--text-2); }
.why__closing {
  font-family: var(--font-display); font-style: italic; font-weight: 800;
  font-size: 28px; line-height: 1.15; color: var(--graphite);
  border-left: 5px solid var(--red); padding-left: 18px;
}

/* Saišu bloks (pakalpojumi.html) */
.link-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-top: 28px; }
.link-tile {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--graphite); color: var(--white); text-decoration: none;
  padding: 28px; transition: background-color .15s ease;
}
.link-tile:hover { background: var(--red); color: var(--white); }
.link-tile__title { font-size: 30px; }
.link-tile__arrow { font-size: 30px; font-weight: 700; }

/* ---------- 11. Lapas galvene (apakšlapām) ---------- */
.page-head { background: var(--graphite); color: var(--white); position: relative; overflow: hidden; }
.page-head::after {
  content: ""; position: absolute; top: 0; bottom: 0; right: -40px; width: 320px;
  background: var(--red); clip-path: polygon(45% 0, 100% 0, 100% 100%, 0 100%);
}
.page-head .wrap { position: relative; z-index: 1; padding-block: 64px; display: grid; gap: 12px; }
.page-head__title { font-size: clamp(42px, 5.4vw, 72px); max-width: 900px; }
.page-head__sub { font-size: 19px; color: #d0d0d0; max-width: 720px; }

/* ---------- 12. Apakšējā CTA josla ---------- */
.cta-band { position: relative; background: var(--red); color: var(--white); overflow: hidden; }
.cta-band::before {
  content: ""; position: absolute; top: 0; bottom: 0; right: -60px; width: 42%;
  background: var(--graphite);
  clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%);
}
.cta-band .wrap {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 40px;
  padding-block: 60px;
}
.cta-band__title { font-size: clamp(36px, 4.4vw, 60px); line-height: .95; flex: 1 1 480px; }
.cta-band__phone {
  font-family: var(--font-display); font-style: italic; font-weight: 800;
  font-size: clamp(38px, 4.2vw, 58px); color: var(--white); text-decoration: none; white-space: nowrap;
}
.cta-band__phone:hover { color: #ffd3d4; }
/* Platos ekrānos tumšais slīpais lauks seko tālrunim, lai virsraksts (ar "?") paliek sarkanajā daļā */
@media (min-width: 900px) {
  .cta-band::before { display: none; }
  .cta-band .wrap { column-gap: 72px; }
  .cta-band__title { font-size: clamp(34px, 3.8vw, 56px); }
  .cta-band__phone { position: relative; }
  .cta-band__phone::before {
    content: ""; position: absolute; z-index: -1;
    top: -400px; bottom: -400px; left: -34px; right: -100vw;
    background: var(--graphite);
    transform: skewX(-38deg);
  }
}

/* ---------- 13. Kājene ---------- */
.site-footer { background: var(--white); border-top: 1px solid var(--line); }
.site-footer .wrap {
  display: grid; grid-template-columns: auto 1fr auto; gap: 24px 48px; align-items: center;
  padding-block: 40px; font-size: 15px; color: var(--text-2);
}
.site-footer .logo img { height: 46px; }
.footer-info { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; }
.footer-info strong { color: var(--text); }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav a { color: var(--text); text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--red); }
.footer-legal { border-top: 1px solid var(--line); }
.footer-legal .wrap { display: block; padding-block: 14px; font-size: 13px; text-align: center; }
.footer-legal a { color: var(--text-2); }

/* ---------- 14. Katli: cilnes un tabulas ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 36px; }
.tab {
  transform: skewX(var(--skew));
  background: var(--card); color: var(--graphite);
  border: 0; cursor: pointer;
  font-family: var(--font-display); font-style: italic; font-weight: 800;
  font-size: 22px;
  padding: 12px 24px;
  transition: background-color .15s ease, color .15s ease;
}
.tab > span { display: inline-block; transform: skewX(var(--unskew)); }
.tab:hover { background: #e6e6e6; }
.tab[aria-selected="true"] { background: var(--red); color: var(--white); }

.model { display: grid; gap: 36px; }
.model[hidden] { display: none; }
.model__top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 40px; align-items: start; }
.model__media { aspect-ratio: 4 / 5; }
.model__title { font-size: clamp(38px, 4vw, 54px); margin-bottom: 18px; text-transform: none; }
.no-upper { text-transform: none; }
.model__desc { display: grid; gap: 14px; color: var(--text-2); }
.model__actions { margin-top: 24px; }

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
}
.spec-table { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 15px; }
.spec-table caption {
  text-align: left; padding: 14px 16px;
  font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 24px;
  text-transform: uppercase; color: var(--graphite);
}
.spec-table th,
.spec-table td { padding: 11px 16px; border-top: 1px solid var(--line); text-align: center; white-space: nowrap; }
.spec-table thead th { background: var(--graphite); color: var(--white); font-weight: 700; }
.spec-table thead th:first-child { text-align: left; }
.spec-table tbody th { text-align: left; font-weight: 600; color: var(--text); white-space: normal; min-width: 220px; }
.spec-table tbody tr:nth-child(even) { background: #fafafa; }
.spec-table td.unit { color: var(--text-2); }

/* ---------- 15. Ūdens spices ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.split__media { aspect-ratio: 4 / 3; }
.stack { display: grid; gap: 22px; }
.stack h2 { font-size: 34px; color: var(--graphite); }
.lead { font-size: 19px; color: var(--text-2); }

.callout {
  position: relative; overflow: hidden;
  background: var(--graphite); color: var(--white);
  padding: 44px; display: grid; gap: 22px; margin-top: 56px;
}
.callout::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 14px; background: var(--red);
}
.callout__text { font-size: 24px; font-weight: 600; max-width: 820px; }

/* ---------- 16. Kontakti un forma ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr); gap: 48px; align-items: start; }
.contact-card { background: var(--card); border-bottom: 3px solid var(--red); padding: 36px; display: grid; gap: 18px; }
.contact-card h2,
.contact-form-box h2 { font-size: 44px; color: var(--graphite); }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: 18px; }
.contact-list span { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-2); font-weight: 600; }
.contact-list a { color: var(--text); font-weight: 700; text-decoration: none; }
.contact-list a:hover { color: var(--red); }

.contact-form-box { display: grid; gap: 18px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; gap: 6px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 600; }
.field input,
.field textarea {
  font: inherit; font-size: 16px;
  padding: 13px 14px;
  border: 1px solid #c9c9c9; border-radius: 0;
  background: var(--white); color: var(--text);
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus,
.field textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
.field.has-error input,
.field.has-error textarea { border-color: var(--red); background: #fff6f6; }
.field__error { font-size: 13px; color: var(--red-hover); min-height: 0; }
.form__note { grid-column: 1 / -1; font-size: 13px; color: var(--text-2); }
.form__actions { grid-column: 1 / -1; }
.form__status { grid-column: 1 / -1; padding: 14px 16px; font-weight: 600; }
.form__status[hidden] { display: none; }
.form__status--ok { background: #eaf6ec; color: #1d5e2b; border-left: 5px solid #2e8b45; }
.form__status--err { background: #fff0f0; color: #8f0f14; border-left: 5px solid var(--red); }
.honeypot { display: none; }

/* ---------- 17. Responsīvie izmēri ---------- */

/* Planšete */
@media (max-width: 1080px) {
  .nav { gap: 20px; }
  .nav a { font-size: 15px; }
  .facts .wrap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why,
  .model__top,
  .split,
  .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .model__media { aspect-ratio: 16 / 10; max-width: 640px; }
  .site-footer .wrap { grid-template-columns: 1fr; justify-items: start; }
  .footer-info { justify-content: flex-start; }
}

/* Mobilā izvēlne */
@media (max-width: 960px) {
  :root { --header-h: 72px; }
  .logo img { height: 46px; }
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white);
    border-bottom: 3px solid var(--red);
    box-shadow: 0 12px 24px rgba(0,0,0,.1);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; font-size: 17px; border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .hero__content { padding: 48px var(--gutter); }
  .hero__photo { min-height: 360px; }
  .hero__photo .media { clip-path: polygon(0 12%, 100% 0, 100% 100%, 0 100%); }
  .hero__photo::before {
    left: 0; right: 0; top: -1px; bottom: auto; width: auto; height: 16%;
    clip-path: polygon(0 75%, 100% 0, 100% 25%, 0 100%);
  }
}

/* Telefons */
@media (max-width: 600px) {
  :root { --gutter: 18px; }
  body { font-size: 16px; }
  .topbar__desc { display: none; }
  .header-phone { font-size: 19px; padding: 8px 14px; }
  .logo img { height: 40px; }
  .section { padding-block: 64px; }
  .facts .wrap { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .fact__title { font-size: 30px; }
  .btn { padding: 15px 24px; font-size: 17px; }
  .btn-row .btn { flex: 1 1 100%; text-align: center; }
  .cta-band::before { width: 100%; right: 0; top: 55%; clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%); }
  .page-head::after { width: 160px; }
  .callout { padding: 32px 24px; }
  .callout__text { font-size: 20px; }
  .contact-card { padding: 28px 22px; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .tab { font-size: 18px; padding: 10px 16px; }
}

@media (max-width: 380px) {
  .header-phone { font-size: 16px; padding: 8px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
