﻿/* Mati Paving – site styles. No framework; system fonts; no external requests. */

:root {
  --navy-900: #061637;
  --navy-800: #0b2560;   /* brand navy (existing site colour, slightly deepened) */
  --navy-700: #163679;
  --navy-100: #e6ebf5;
  --sand-500: #d8b47a;   /* warm stone accent, from the sandstone in the project photos */
  --sand-300: #ead3ab;
  --stone-50: #f7f5f1;
  --stone-100: #efebe4;
  --stone-300: #d8d1c5;
  --ink: #1b2230;
  --ink-muted: #4b5466;
  --white: #fff;
  --danger: #a3261b;
  --focus: #1d5fd6;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgb(6 22 55 / .06), 0 6px 20px rgb(6 22 55 / .08);
  --container: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-700); text-underline-offset: .18em; }
a:hover { color: var(--navy-900); }
h1, h2, h3, .h3 { line-height: 1.15; letter-spacing: -.015em; margin: 0 0 .5em; color: var(--navy-900); }
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 800; }
h3, .h3 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { font-size: .9em; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--navy-800); color: var(--white); padding: 10px 16px; border-radius: var(--radius); font-weight: 700; }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container.narrow { max-width: 560px; }
.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.muted { color: var(--ink-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 48px; padding: .7em 1.3em;
  font: inherit; font-weight: 700; line-height: 1.2; text-decoration: none;
  border: 2px solid transparent; border-radius: 999px; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { min-height: 54px; padding: .8em 1.6em; font-size: 1.08rem; }
.btn-sm { min-height: 36px; padding: .35em .9em; font-size: .9rem; }
.btn-primary { background: var(--navy-800); color: var(--white); }
.btn-primary:hover { background: var(--navy-900); color: var(--white); }
.btn-accent { background: var(--sand-500); color: var(--navy-900); }
.btn-accent:hover { background: var(--sand-300); color: var(--navy-900); }
.btn-ghost { background: rgb(255 255 255 / .08); color: var(--white); border-color: rgb(255 255 255 / .75); }
.btn-ghost:hover { background: var(--white); color: var(--navy-900); }
.btn-danger { background: var(--white); color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / .97);
  border-bottom: 1px solid var(--stone-100);
  backdrop-filter: saturate(1.2) blur(6px);
}
.header-inner { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: baseline; gap: .3em; text-decoration: none; color: var(--navy-800); font-size: 1.55rem; line-height: 1; margin-right: auto; padding-block: 8px; }
.brand-mati { font-weight: 900; letter-spacing: .01em; }
.brand-paving { font-weight: 400; letter-spacing: .04em; }
.header-call {
  display: inline-flex; align-items: center; gap: .5em;
  min-height: 44px; padding: .45em 1em; border-radius: 999px;
  background: var(--navy-800); color: var(--white); font-weight: 700; text-decoration: none; white-space: nowrap;
}
.header-call:hover { background: var(--navy-900); color: var(--white); }
.nav-toggle {
  display: none; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 1px solid var(--stone-300); border-radius: var(--radius);
  background: var(--white); color: var(--navy-900); cursor: pointer;
}
.nav-toggle .icon { width: 24px; height: 24px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a, .site-nav .link-button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 .8em;
  border-radius: var(--radius); color: var(--ink); font-weight: 600; text-decoration: none;
}
.site-nav a:hover, .site-nav .link-button:hover { background: var(--stone-50); color: var(--navy-800); }
.site-nav form { margin: 0; }

@media (min-width: 900px) {
  .site-nav { order: 2; }
  .header-call { order: 3; }
}
@media (max-width: 899px) {
  .nav-toggle { display: inline-flex; }
  .header-call-text { display: none; }
  .header-call { width: 44px; padding: 0; justify-content: center; }
  .header-call .icon { width: 20px; height: 20px; }
  .site-nav { flex-basis: 100%; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding-bottom: 12px; }
  .site-nav a, .site-nav .link-button { width: 100%; font-size: 1.1rem; }
  .header-inner { flex-wrap: wrap; }
}
@media (max-width: 380px) { .brand { font-size: 1.3rem; } }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; color: var(--white); background: var(--navy-900); overflow: hidden; }
.hero-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(6 22 55 / .92) 0%, rgb(6 22 55 / .78) 45%, rgb(6 22 55 / .35) 100%);
}
.hero-content { padding-block: clamp(56px, 11vw, 128px); max-width: var(--container); }
.hero h1 { color: var(--white); max-width: 15ch; }
.hero-lead { font-size: clamp(1.08rem, 1.8vw, 1.28rem); max-width: 46ch; color: #e9edf6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 32px; }
.hero-recommend { display: flex; align-items: center; gap: 10px; font-size: .95rem; color: #dfe5f1; margin: 0; }
.hero-recommend a { display: inline-block; background: var(--white); padding: 6px 10px; border-radius: 6px; }
.hero-recommend img { width: 97px; height: auto; }
@media (max-width: 640px) {
  .hero::after { background: linear-gradient(180deg, rgb(6 22 55 / .70) 0%, rgb(6 22 55 / .88) 100%); }
  .hero-actions .btn { width: 100%; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(48px, 8vw, 96px); }
.section-tight { padding-block: clamp(28px, 5vw, 56px); }
.section-alt { background: var(--stone-50); }
.section-head { max-width: 680px; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head p:last-child { color: var(--ink-muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 800; color: #7a5a24; margin-bottom: .5em; }

/* Category cards */
.category-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.category-card {
  display: block; position: relative; overflow: hidden; border-radius: var(--radius-lg);
  background: var(--navy-900); color: var(--white); text-decoration: none; box-shadow: var(--shadow);
  aspect-ratio: 13 / 8;
}
.category-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.category-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgb(6 22 55 / 0) 40%, rgb(6 22 55 / .88) 100%); }
.category-card-name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 14px 18px; font-size: 1.15rem; font-weight: 700;
}
.category-card:hover img, .category-card:focus-visible img { transform: scale(1.05); }
@media (max-width: 599px) {
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .category-card { aspect-ratio: 1 / 1; border-radius: var(--radius); }
  .category-card-name { padding: 10px 12px; font-size: .98rem; line-height: 1.25; }
  .category-card-name .icon { display: none; }
}
.category-card:hover { color: var(--white); }

/* Features */
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { background: var(--white); border: 1px solid var(--stone-100); border-radius: var(--radius-lg); padding: 24px; border-top: 4px solid var(--sand-500); }
.feature p { color: var(--ink-muted); margin: 0; }

/* About */
.about-inner { display: grid; gap: clamp(24px, 5vw, 64px); align-items: center; grid-template-columns: 1fr; }
.about-text p { color: var(--ink-muted); max-width: 62ch; }
.about-photos { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.about-photos img { border-radius: var(--radius-lg); aspect-ratio: 4 / 5; object-fit: cover; width: 100%; height: 100%; box-shadow: var(--shadow); }
.about-photos img:last-child { margin-top: 32px; }
@media (min-width: 900px) { .about-inner { grid-template-columns: 1.1fr 1fr; } }

/* Contact */
.contact { background: var(--navy-800); color: var(--white); padding-block: clamp(48px, 8vw, 88px); }
.contact h2 { color: var(--white); }
.contact .eyebrow { color: var(--sand-300); }
.contact-intro { max-width: 640px; margin-bottom: 28px; }
.contact-intro p:last-child { color: #dfe5f1; }
.contact-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.contact-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center;
  padding: 20px 22px; border-radius: var(--radius-lg); background: var(--white); color: var(--navy-900); text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.contact-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgb(0 0 0 / .25); color: var(--navy-900); }
.contact-card .icon { grid-row: span 2; width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--sand-300); color: var(--navy-900); }
.contact-card-label { font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); }
.contact-card-value { font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }

/* Footer */
.site-footer { background: var(--navy-900); color: #c9d2e6; padding-block: 32px; font-size: .95rem; }
.site-footer a { color: var(--white); }
.footer-inner { display: grid; gap: 6px; }
.footer-inner p { margin: 0; }
.footer-brand { color: var(--white); font-size: 1.3rem; display: flex; gap: .3em; }
.footer-small { font-size: .85rem; color: #b5bfd6; }

/* Mobile quick-contact bar */
.action-bar { display: none; }
@media (max-width: 899px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .action-bar {
    display: grid; grid-template-columns: repeat(3, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--navy-900); padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -4px 16px rgb(0 0 0 / .18);
  }
  .action-bar a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 64px; color: var(--white); text-decoration: none; font-weight: 700; font-size: .9rem;
  }
  .action-bar a:first-child { background: var(--sand-500); color: var(--navy-900); }
  .action-bar a + a { border-left: 1px solid rgb(255 255 255 / .12); }
  .action-bar .icon { width: 22px; height: 22px; }
  .action-bar a:focus-visible { outline-offset: -4px; }
}

/* ---------- Inner pages ---------- */
.page-head { background: var(--stone-50); border-bottom: 1px solid var(--stone-100); padding-block: clamp(28px, 5vw, 56px); }
.page-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); }
.page-lead { color: var(--ink-muted); max-width: 70ch; font-size: 1.05rem; }
.breadcrumb ol { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; font-size: .95rem; }
.breadcrumb li + li::before { content: "/"; margin: 0 .55em; color: var(--stone-300); }
.breadcrumb [aria-current] { color: var(--ink-muted); }
.chip-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px;
  padding: 12px 18px; border: 1px solid var(--stone-300); border-radius: var(--radius); background: var(--white);
  color: var(--navy-900); font-weight: 700; text-decoration: none; transition: border-color .15s, background-color .15s;
}
.chip:hover { border-color: var(--navy-700); background: var(--navy-100); color: var(--navy-900); }
.gallery-count { color: var(--ink-muted); font-size: .95rem; }
.gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
@media (max-width: 599px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
.gallery-item a { display: block; border-radius: var(--radius); overflow: hidden; background: var(--stone-100); }
.gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s ease; }
.gallery-item a:hover img { transform: scale(1.03); }
.empty { padding: 40px 0; color: var(--ink-muted); text-align: center; }
.notice { margin: 20px 0 0; padding: 12px 16px; border-radius: var(--radius); background: var(--navy-100); color: var(--navy-900); font-weight: 600; }
.back-link { padding-block: 24px 40px; margin-block: 0; }
.back-link a { display: inline-flex; align-items: center; gap: .3em; font-weight: 700; min-height: 44px; }
.cta-band { background: var(--stone-100); }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.cta-inner h2 { margin-bottom: .2em; }
.cta-inner p { margin: 0; color: var(--ink-muted); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.cta-band .btn-ghost { color: var(--navy-900); border-color: var(--navy-800); background: transparent; }
.cta-band .btn-ghost:hover { background: var(--navy-800); color: var(--white); }

/* Admin */
.admin-panel { margin-top: 28px; padding: 20px; border: 2px dashed var(--stone-300); border-radius: var(--radius-lg); }
.upload-form { display: grid; gap: 10px; max-width: 560px; }
.delete-form { margin-top: 8px; }

/* Forms */
.form-card { margin-top: 20px; padding: 24px; background: var(--white); border: 1px solid var(--stone-100); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; margin-bottom: 18px; }
.field label { font-weight: 700; }
.field input[type="email"], .field input[type="password"], .field input[type="text"] {
  min-height: 48px; padding: 10px 12px; font: inherit; color: var(--ink);
  border: 1px solid #8a93a6; border-radius: var(--radius); background: var(--white);
}
.field-check { grid-template-columns: auto 1fr; align-items: center; }
.field-check input { width: 22px; height: 22px; }
.field-check label { font-weight: 500; }
.field-error, .form-errors { color: var(--danger); font-weight: 600; }
.form-errors ul { margin: 0 0 12px; padding-left: 1.2em; }
.validation-summary-valid { display: none; }
.input-validation-error { border-color: var(--danger) !important; }

/* ---------- Lightbox ---------- */
.lightbox { padding: 0; border: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgb(4 10 24 / .92); }
.lightbox-inner { position: relative; display: grid; place-items: center; width: 100%; height: 100%; padding: 56px 12px 72px; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lightbox button {
  position: absolute; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .92); color: var(--navy-900); cursor: pointer;
}
.lightbox button .icon { width: 24px; height: 24px; }
.lightbox-close { top: 8px; right: 8px; }
.lightbox-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lightbox-count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: var(--white); font-weight: 600; margin: 0; }
@media (max-width: 640px) {
  .lightbox-prev, .lightbox-next { top: auto; bottom: 10px; transform: none; }
  .lightbox-count { bottom: 22px; }
}

/* Print: keep contact details, drop chrome */
@media print {
  .site-header, .action-bar, .hero-actions, .cta-band, .nav-toggle { display: none !important; }
  .hero { color: #000; background: none; }
  .hero::after, .hero-image { display: none; }
}
