/* Montalfer — Montagens e Construções Metálicas, Lda. */

:root {
  --navy: #0e2540;
  --navy-2: #163659;
  --steel: #1f5c99;
  --steel-light: #e8f0f8;
  --accent: #f2b705;
  --accent-ink: #1b1400;
  --ink: #1b2430;
  --muted: #5b6878;
  --line: #dde3ea;
  --bg: #f5f7fa;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(14 37 64 / .06), 0 4px 16px rgb(14 37 64 / .08);
  --wrap: 1160px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

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

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

a { color: var(--steel); text-underline-offset: .15em; }
a:hover { color: var(--navy); }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; color: var(--navy); letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

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

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

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

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  box-shadow: 0 2px 12px rgb(0 0 0 / .18);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 72px;
}
.brand { display: block; flex-shrink: 0; }
.brand img { height: 46px; width: auto; }

.nav-toggle {
  display: none;
  background: none; border: 1px solid rgb(255 255 255 / .35); border-radius: 8px;
  color: #fff; font: inherit; font-size: .95rem; padding: 8px 12px; cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: inline-block; width: 18px; height: 2px; background: currentColor; position: relative; vertical-align: middle;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle-label { margin-left: 8px; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 6px;
  color: #dbe6f2; text-decoration: none; font-weight: 500; font-size: .98rem;
}
.site-nav a:hover { color: #fff; background: rgb(255 255 255 / .08); }
.site-nav a[aria-current="page"] { color: #fff; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 6px 6px 0 0; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--navy-2); padding: 8px 16px 16px;
    box-shadow: 0 10px 20px rgb(0 0 0 / .2);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { padding: 12px; }
  .site-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); border-radius: 0 6px 6px 0; }
  .brand img { height: 38px; }
}

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

.hero {
  position: relative; isolation: isolate;
  color: #fff;
  padding: clamp(72px, 12vw, 140px) 0 clamp(64px, 10vw, 120px);
  background: var(--navy) url("../../img/full/44.jpg") center 35% / cover no-repeat;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, rgb(10 28 50 / .94) 0%, rgb(10 28 50 / .78) 45%, rgb(10 28 50 / .35) 100%);
}
.hero h1 { color: #fff; max-width: 16ch; }
.hero .lead { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: #d6e2ef; max-width: 52ch; }
.eyebrow {
  display: inline-block; margin-bottom: 14px;
  font-size: .82rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent);
}

.page-hero {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff; padding: 56px 0 48px;
}
.page-hero h1 { color: #fff; margin-bottom: .3em; }
.page-hero p { color: #c9d7e6; margin: 0; max-width: 60ch; }

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

.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 8px; border: 2px solid transparent;
  font-weight: 600; text-decoration: none; line-height: 1.2;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffc81f; color: var(--accent-ink); }
.btn-ghost { border-color: rgb(255 255 255 / .55); color: #fff; }
.btn-ghost:hover { background: rgb(255 255 255 / .1); color: #fff; }
.btn-outline { border-color: var(--steel); color: var(--steel); }
.btn-outline:hover { background: var(--steel); color: #fff; }

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

.section { padding: clamp(48px, 7vw, 88px) 0; }
.section-alt { background: var(--card); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); }

.notice {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--steel-light); border-left: 4px solid var(--steel);
  border-radius: var(--radius); padding: 18px 22px;
}
.notice strong { color: var(--navy); }
.notice p { margin: 0; }
.notice-icon { flex-shrink: 0; color: var(--steel); margin-top: 3px; }
.notice-wrap { margin-top: -32px; position: relative; z-index: 2; }
.notice-wrap .notice { background: #fff; box-shadow: var(--shadow); }

/* ---------- Cards / grids ---------- */

.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: .35em; }
.card-body p { color: var(--muted); font-size: .97rem; margin: 0; }
.card-link { text-decoration: none; color: inherit; }
.card-link:hover h3 { color: var(--steel); }
.card .meta { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 18px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.9rem; color: var(--steel); line-height: 1.1; }
.stat span { color: var(--muted); font-size: .95rem; }

.split { display: grid; gap: clamp(28px, 5vw, 56px); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1.1fr 1fr; } }
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Content ---------- */

.prose { max-width: 70ch; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

.timeline { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 22px 26px; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--steel); box-shadow: 0 0 0 4px var(--bg);
}
.timeline time, .timeline .year { display: block; font-weight: 700; color: var(--navy); }

.badge {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: var(--steel-light); color: var(--steel); font-weight: 600; font-size: .9rem;
}

/* Product / work entries */
.entry { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 32px); }
.entry + .entry { margin-top: 24px; }
.entry header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.entry header h2, .entry header h3 { margin: 0; }
.entry time { color: var(--muted); font-size: .92rem; }
.entry .facts { margin: 0 0 16px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); }
.entry .facts b { color: var(--ink); font-weight: 600; }

.photos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); margin-top: 16px; }
.photos a, .gallery a { display: block; border-radius: 8px; overflow: hidden; background: var(--line); aspect-ratio: 4 / 3; }
.photos img, .gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease, opacity .3s; }
.photos a:hover img, .gallery a:hover img { transform: scale(1.05); }
.photos figure { margin: 0; }
.photos figcaption { font-size: .88rem; color: var(--muted); margin-top: 6px; }

.gallery { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

.also { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0; }
.also li { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 500; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 32px; }
.toc a { display: block; padding: 6px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-size: .95rem; color: var(--ink); }
.toc a:hover { border-color: var(--steel); color: var(--steel); }

/* Contacts */
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 14px; align-items: flex-start; }
.contact-list svg { flex-shrink: 0; color: var(--steel); margin-top: 3px; }
.contact-list b { display: block; color: var(--navy); }
.contact-list a { font-weight: 600; }
address { font-style: normal; }

/* CTA band */
.cta {
  background: linear-gradient(120deg, var(--steel) 0%, var(--navy-2) 100%);
  color: #fff; border-radius: 14px; padding: clamp(28px, 5vw, 48px);
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
}
.cta h2 { color: #fff; margin-bottom: .25em; }
.cta p { margin: 0; color: #d6e2ef; }
.cta .actions { margin-top: 0; }

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

.site-footer { background: var(--navy); color: #b9c7d8; padding: 56px 0 28px; margin-top: 0; font-size: .97rem; }
.site-footer a { color: #e3ecf6; text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; gap: 32px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.footer-grid h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: #fff; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer-logo { width: 260px; max-width: 100%; margin-bottom: 14px; }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / .12); margin-top: 40px; padding-top: 20px; font-size: .88rem; color: #8ea1b8; }

/* ---------- Lightbox ---------- */

.lightbox {
  border: 0; padding: 0; margin: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  background: rgb(6 14 26 / .94); color: #fff;
}
.lightbox[open] { display: grid; grid-template-rows: 1fr auto; place-items: center; }
.lightbox::backdrop { background: rgb(6 14 26 / .94); }
.lightbox img { max-width: min(94vw, 1600px); max-height: calc(100vh - 110px); object-fit: contain; border-radius: 4px; }
.lightbox figure { margin: 0; display: grid; place-items: center; padding: 56px 16px 0; min-height: 0; }
.lightbox figcaption { padding: 14px 16px 22px; text-align: center; color: #d6e2ef; font-size: .95rem; min-height: 1.6em; }
.lightbox button {
  position: absolute; background: rgb(255 255 255 / .12); color: #fff; border: 0; border-radius: 50%;
  width: 48px; height: 48px; font-size: 1.6rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.lightbox button:hover { background: rgb(255 255 255 / .24); }
.lightbox .lb-close { top: 14px; right: 14px; }
.lightbox .lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; top: 26px; left: 20px; font-size: .9rem; color: #9fb2c8; }

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

@media print {
  .site-header, .site-footer, .nav-toggle, .cta, .lightbox { display: none !important; }
  body { background: #fff; }
  .hero, .page-hero { background: none; color: var(--ink); padding: 0 0 16px; }
  .hero h1, .page-hero h1 { color: var(--navy); }
  .entry, .card, .stat { box-shadow: none; border: 1px solid var(--line); }
}
