/* IPA-D.com — one stylesheet, no build step. */

:root {
  --black: #0b0b0c;
  --gold: #ecbd53;
  --gold-deep: #b8860b;
  --brown: #9d5c1b;
  --ink: #1f2328;
  --muted: #5d646d;
  --line: #e2e5e9;
  --soft: #f6f7f8;
  --bg: #ffffff;
  --link: #184660;
  --danger: #a1261b;
  --danger-soft: #fbeceb;
  --ok: #2b6420;
  --ok-soft: #ecf5e8;
  --radius: 8px;
  --wrap: 1040px;
  --gutter: 16px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--brown); }

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

h1, h2, h3 { line-height: 1.25; margin: 1.6em 0 0.5em; }
h1 { color: var(--brown); font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.25rem); font-weight: 650; margin-top: 0; }
h2 { font-size: 1.3rem; font-weight: 650; }
p, ul, ol, dl { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 720px) { :root { --gutter: 24px; } }

.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: var(--black); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

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

/* ---------- header ---------- */

.site-header { background: var(--black); }

.header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
  padding-top: 18px;
  padding-bottom: 18px;
}

.brand img { display: block; width: 240px; }
@media (min-width: 720px) { .brand img { width: 280px; } }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 22px; }
.nav a, .nav-button {
  color: var(--gold);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover, .nav-button:hover { color: #fff; }
.nav a[aria-current="page"] { border-bottom-color: var(--gold); }
.nav form { display: contents; }
.nav-button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; cursor: pointer; font-family: inherit; }
.site-header .nav-login { border: 1px solid var(--gold); border-radius: 999px; padding: 3px 14px; }
.site-header .nav-login:hover { background: var(--gold); color: var(--black); }

.hero {
  background: #2a3130 url("../img/tunnel.png") left center / cover no-repeat;
  border-top: 1px solid #222;
}
.hero-inner { display: flex; justify-content: flex-end; align-items: center; min-height: 200px; padding-top: 20px; padding-bottom: 20px; }
.award {
  max-width: 340px;
  background: rgb(255 255 255 / 0.9);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.25);
}
.award h2 { margin: 0 0 6px; font-size: 1.05rem; color: var(--brown); }
.award p { margin: 0; font-size: 0.92rem; }
@media (max-width: 600px) {
  .hero-inner { min-height: 150px; align-items: flex-end; }
  .award { max-width: none; }
}

/* ---------- main ---------- */

.main { flex: 1; padding-top: 40px; padding-bottom: 56px; }
.main.with-sidebar { display: grid; gap: 40px; }
@media (min-width: 880px) { .main.with-sidebar { grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; } }
.content { min-width: 0; }

.lede { font-size: 1.1rem; color: var(--muted); }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.narrow { max-width: 30rem; }
.breadcrumb { margin-bottom: 8px; font-size: 0.95rem; }
.signature { margin-top: 1.5em; font-weight: 600; }
.signature span { font-weight: 400; color: var(--muted); }
.subhead { display: block; font-size: 0.85em; font-weight: 400; color: var(--muted); }

.contact { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.contact dt { font-weight: 600; }
.contact dd { margin: 0; }

.history > li { margin-bottom: 1em; }
.history p { margin: 0.25em 0 0; color: var(--muted); }
.history ul { margin: 0.25em 0 0; }

.logos { display: flex; flex-wrap: wrap; align-items: center; gap: 24px 36px; margin-top: 2.5em; padding-top: 2em; border-top: 1px solid var(--line); }
.logos img { max-height: 90px; width: auto; }

.downloads { padding-left: 1.2em; }

/* ---------- sidebar gallery ---------- */

.sidebar-title { margin-top: 0; font-size: 1rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.gallery { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (min-width: 880px) { .gallery { grid-template-columns: 1fr; } }
.gallery figure { margin: 0; }
.gallery figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.thumb { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 6px; overflow: hidden; }
.thumb img { display: block; width: 100%; transition: transform 0.2s; }
.thumb:hover img { transform: scale(1.03); }

.lightbox { padding: 0; border: 0; border-radius: var(--radius); max-width: min(92vw, 760px); background: var(--black); color: #fff; }
.lightbox::backdrop { background: rgb(0 0 0 / 0.78); }
.lightbox img { display: block; width: 100%; }
.lightbox-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 10px 14px; font-size: 0.95rem; }

/* ---------- forms & buttons ---------- */

button, .button {
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.2;
  color: var(--gold);
  background: var(--black);
  border: 1px solid var(--black);
  border-radius: 6px;
  padding: 0.65em 1.15em;
  cursor: pointer;
}
button:hover { background: #2b2b2e; }
button:disabled { opacity: 0.55; cursor: progress; }
button.secondary { background: #fff; color: var(--ink); border-color: #c4c9cf; }
button.secondary:hover { background: var(--soft); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link { background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; font-weight: 400; }
button.link.danger { color: var(--danger); }

input[type="text"], input[type="email"], input:not([type]) {
  font: inherit;
  width: 100%;
  padding: 0.55em 0.7em;
  border: 1px solid #c4c9cf;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

.stack { display: grid; gap: 10px; margin-bottom: 1.5em; }
.stack label { font-weight: 600; }
.stack button { justify-self: start; }

.form-grid { display: grid; gap: 14px; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid label { display: grid; gap: 4px; font-weight: 600; font-size: 0.95rem; }
.form-grid label .muted { font-weight: 400; }
.form-grid .check { display: flex; align-items: center; gap: 8px; font-weight: 400; grid-column: 1 / -1; }

.inline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0 0 28px; }
.inline-actions .muted { font-size: 0.9rem; }

.flash { padding: 10px 14px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); border: 1px solid #cfe3c7; }
.flash-error { background: var(--danger-soft); color: var(--danger); border-color: #f0cdca; }

.card { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 0 0 28px; }
.card > h2:first-child { margin-top: 0; }
details.card > summary { cursor: pointer; font-weight: 650; }
details.card[open] > summary { margin-bottom: 14px; }
.danger-zone summary { color: var(--danger); }

/* ---------- uploads ---------- */

.uploader { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.uploader button { justify-self: start; }
.dropzone {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 2px dashed #c4c9cf;
  border-radius: var(--radius);
  background: var(--soft);
  color: var(--muted);
  font-size: 0.95rem;
}
.dropzone:hover { border-color: var(--gold-deep); }
.dropzone input { font: inherit; color: var(--ink); width: 100%; min-width: 0; }

.upload-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.upload-list:empty { display: none; }
.upload-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; font-size: 0.92rem; }
.upload-list .name { overflow-wrap: anywhere; }
.upload-list .status { color: var(--muted); text-align: right; }
.upload-list .status.error { color: var(--danger); }
.upload-list .status.done { color: var(--ok); }
.upload-list progress { grid-column: 1 / -1; width: 100%; height: 8px; accent-color: var(--gold-deep); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; margin-bottom: 1.5em; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--soft); font-weight: 600; }
.file-name { overflow-wrap: anywhere; min-width: 7rem; }
td form { margin: 0; }

/* ---------- footer ---------- */

.site-footer { background: var(--black); color: #b9b9b9; font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; padding-top: 24px; padding-bottom: 24px; }
.footer-inner p { margin: 0; }
.site-footer .nav a, .site-footer .nav-button { font-size: 0.9rem; }

@media print {
  .site-header, .site-footer, .sidebar, .uploader { display: none; }
}
