/* Wespac brand: white first, Wespac Red accents, tan and warm stone for panels, black text only. */
:root {
  --red: #e81d2d;
  --red-dark: #b8121f;
  --tan: #b2996a;
  --stone: #ede8e2;
  --text: #111111;
  --muted: #5b5b5b;
  --line: #d6d0c8;
  --ok-bg: #e7f3ea;
  --ok-text: #1d5b2c;
  --err-bg: #fdecee;
  --err-text: #9b1420;
  --bg: #ffffff;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

/* ---- Header / footer ---------------------------------------------------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 16px;
  border-bottom: 4px solid var(--red);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}
.logo img { display: block; height: 54px; width: auto; }
.header-contact { margin: 0; text-align: right; font-size: .9rem; color: var(--muted); }
.header-contact a { color: var(--text); font-weight: 600; text-decoration: none; }

.admin-nav { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.admin-nav a { color: var(--text); font-weight: 600; text-decoration: none; }
.admin-nav a:hover { color: var(--red-dark); }
.admin-nav .who { color: var(--muted); font-size: .9rem; }
.admin-nav form { margin: 0; }

main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 1.5rem 16px 3rem;
}
main.wide { max-width: 1200px; }

.site-footer {
  background: var(--stone);
  color: var(--muted);
  font-size: .8rem;
  text-align: center;
  padding: 1rem 16px;
}
.site-footer p { margin: .2rem 0; }

/* ---- Type --------------------------------------------------------------- */
h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 300;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin: .5rem 0 .75rem;
}
h2 {
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  margin: 1.75rem 0 .5rem;
}
h2:first-child { margin-top: 0; }
.lead { font-size: 1.05rem; color: var(--muted); margin-top: 0; }
.muted { color: var(--muted); }
.hint { font-size: .85rem; color: var(--muted); margin: .25rem 0 0; }
.nowrap { white-space: nowrap; }

/* ---- Messages ----------------------------------------------------------- */
.flash { padding: .75rem 1rem; border-left: 4px solid; margin: 0 0 1rem; }
.flash.ok { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-text); }
.flash.error { background: var(--err-bg); color: var(--err-text); border-color: var(--red); }

/* ---- Public form -------------------------------------------------------- */
.request-form fieldset {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 1.25rem;
  padding: 1.25rem 0 0;
  min-width: 0;
}
.request-form legend {
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 700;
  padding: 0;
  margin-bottom: .75rem;
  max-width: 100%;
  white-space: normal;
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

.field { margin-bottom: 1rem; min-width: 0; }
.field label, .stack label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .3rem; }
.opt { font-weight: 400; color: var(--muted); font-size: .85rem; }
.static { margin: .55rem 0 0; }

input[type=text], input[type=email], input[type=tel], input[type=search], select, textarea {
  width: 100%;
  font: inherit;
  padding: .6rem .7rem;
  border: 1px solid #a9a39b;
  border-radius: 2px;
  background: #fff;
  color: var(--text);
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid rgba(232, 29, 45, .35);
  outline-offset: 1px;
  border-color: var(--red);
}
input[type=file] { font: inherit; max-width: 100%; }

.has-error input, .has-error textarea { border-color: var(--red); background: #fffafa; }
.error { color: var(--err-text); font-size: .88rem; margin: .3rem 0 0; }

.choice, .check { display: flex; gap: .65rem; align-items: flex-start; margin: 0 0 .75rem; cursor: pointer; }
.choice input, .check input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; flex: none; accent-color: var(--red); }
.check.small { font-size: .9rem; color: var(--muted); }

/* Honeypot: off-screen, not display:none (some bots skip hidden fields). */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.actions { margin-top: 1.5rem; }

button, .button {
  font: inherit;
  font-weight: 600;
  padding: .6rem 1.1rem;
  border: 1px solid #a9a39b;
  background: #fff;
  color: var(--text);
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .button:hover { border-color: var(--text); }
button.primary { background: var(--red); border-color: var(--red); color: #fff; letter-spacing: .03em; }
button.primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.actions button.primary { padding: .8rem 2rem; font-size: 1.05rem; width: 100%; max-width: 320px; }
button.danger { color: var(--err-text); }
button.small { padding: .25rem .6rem; font-size: .85rem; }
button.link { border: 0; background: none; padding: 0; color: var(--text); font-weight: 600; }

.ref-box {
  background: var(--stone);
  border-left: 4px solid var(--tan);
  padding: 1rem 1.25rem;
  font-size: .9rem;
  color: var(--muted);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ref-box strong { font-size: 1.8rem; color: var(--text); letter-spacing: .04em; }

/* ---- Admin -------------------------------------------------------------- */
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a {
  padding: .5rem .9rem;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  font-weight: 600;
}
.tabs a.active { color: var(--text); border-bottom-color: var(--red); }
.tabs .count { font-weight: 400; font-size: .85rem; }

.search { display: flex; gap: .5rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.search input { flex: 1 1 260px; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
table.list th, table.list td, table.mini th, table.mini td {
  text-align: left;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table th { font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
table.list tbody tr:hover { background: #faf8f5; }
table.mini { font-size: .9rem; margin-bottom: .75rem; }
.empty { color: var(--muted); padding: 2rem 0; }
.pager { display: flex; gap: 1rem; justify-content: center; color: var(--muted); }

.status { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 2px; vertical-align: middle; }
.s-new { background: var(--red); color: #fff; }
.s-in-progress { background: var(--tan); color: #000; }
.s-closed { background: var(--stone); color: var(--muted); }

.crumbs { margin: 0; }
.title-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.title-row h1 { margin-bottom: .25rem; }

.columns { display: grid; grid-template-columns: 3fr 2fr; gap: 1.5rem; margin-top: 1rem; }
@media (max-width: 860px) { .columns { grid-template-columns: 1fr; } }

.panel { border: 1px solid var(--line); padding: 1.25rem; margin-bottom: 1.5rem; min-width: 0; }

dl.details { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.details dt { color: var(--muted); font-size: .9rem; }
dl.details dd { margin: 0; overflow-wrap: anywhere; }
.description { background: #faf8f5; padding: .6rem .75rem; border-left: 3px solid var(--tan); }
@media (max-width: 520px) { dl.details { grid-template-columns: 1fr; } dl.details dd { margin-bottom: .5rem; } }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.photos figure { margin: 0; }
.photos img { width: 100%; height: 130px; object-fit: cover; display: block; border: 1px solid var(--line); }
.photos figcaption { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }

.stack { display: flex; flex-direction: column; gap: .75rem; }
.stack label { margin: 0; }
.stack label input, .stack label select, .stack label textarea { margin-top: .3rem; font-weight: 400; }
.stack .check { font-weight: 400; }
.stack button { align-self: flex-start; }
.narrow { max-width: 480px; margin-top: 1rem; }
form.inline { display: inline; margin: 0; }
.history { padding-left: 1.1rem; font-size: .88rem; color: var(--muted); }
