/* AOC GIS portal — shared styles for the portal and the web map list */
:root {
  /* AOC Archaeology brand: charcoal #353131, terracotta #B96434, white */
  --ink: #ffffff;
  --ink-soft: #d9d2cf;
  --ink-faint: #a59c98;
  --bg: #2a2626;
  --panel: rgba(53, 49, 49, 0.78);
  --panel-hover: rgba(66, 60, 60, 0.9);
  --line: rgba(255, 255, 255, 0.14);
  --accent: #b96434;      /* AOC terracotta */
  --accent-2: #d8c3b4;    /* warm stone, secondary */
  --radius: 14px;
  --font: "Nunito Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --font-head: "Fredoka", "Nunito Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  /* Layers, top to bottom: shade, optional photo, contour pattern.
     Drop a photo at /assets/portal-bg.jpg and it appears automatically. */
  background-image:
    linear-gradient(180deg, rgba(42,38,38,0.55) 0%, rgba(42,38,38,0.86) 100%),
    url("/assets/portal-bg.jpg"),
    url("/assets/portal-contours.webp");
  background-size: cover, cover, cover;
  background-position: center, center, center;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-family: var(--font-head); font-weight: 600; letter-spacing: .5px; font-size: 14px;
}
.brand-text { line-height: 1.15; }
.brand-text strong { display: block; font-family: var(--font-head); font-weight: 600; font-size: 17px; letter-spacing: .3px; }
.brand-text span { font-size: 12.5px; color: var(--ink-soft); }
.crumbs { font-size: 14px; color: var(--ink-soft); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

/* Portal */
.portal { min-height: calc(100vh - 82px - 56px); display: flex; flex-direction: column; justify-content: center; padding: 24px 0 48px; }
.portal h1 { font-family: var(--font-head); font-size: clamp(30px, 4.4vw, 48px); margin: 0 0 8px; font-weight: 600; letter-spacing: -.2px; }
.portal .lede { margin: 0 0 36px; color: var(--ink-soft); font-size: clamp(15px, 1.6vw, 18px); max-width: 60ch; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
@media (max-width: 720px) { .tiles { grid-template-columns: 1fr; gap: 16px; } }

.tile {
  position: relative; display: flex; flex-direction: column; justify-content: space-between;
  min-height: 280px; padding: 28px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  text-decoration: none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
@media (max-width: 720px) { .tile { min-height: 190px; padding: 22px; } }
.tile:hover, .tile:focus-visible { transform: translateY(-3px); background: var(--panel-hover); border-color: var(--tile-accent, var(--accent)); outline: none; }
.tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  border-radius: var(--radius) 0 0 var(--radius); background: var(--tile-accent, var(--accent));
}
.tile.geoserver { --tile-accent: var(--accent-2); }
.tile-icon { width: 52px; height: 52px; color: var(--tile-accent, var(--accent)); }
.tile h2 { margin: 18px 0 6px; font-family: var(--font-head); font-size: 27px; font-weight: 600; }
.tile p { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.5; max-width: 42ch; }
.tile .go { margin-top: 22px; font-size: 14px; font-weight: 600; color: var(--tile-accent, var(--accent)); }
.tile .go::after { content: " →"; }

.site-footer { padding: 18px 0; font-size: 12.5px; color: var(--ink-faint); border-top: 1px solid var(--line); }

/* Web map list */
.list-head { padding: 18px 0 8px; }
.list-head h1 { margin: 0 0 6px; font-family: var(--font-head); font-weight: 600; font-size: 34px; }
.list-head p { margin: 0; color: var(--ink-soft); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin: 22px 0 8px; }
.toolbar input, .toolbar select {
  font: inherit; font-size: 15px; color: var(--ink);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 14px;
}
.toolbar input { flex: 1 1 260px; }
.toolbar input::placeholder { color: var(--ink-faint); }
.count { color: var(--ink-faint); font-size: 13px; margin: 6px 0 18px; }

.group-title { margin: 26px 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--accent-2); }
.maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.map-card {
  display: block; padding: 18px 18px 16px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: border-color .15s ease, background .15s ease;
}
.map-card:hover, .map-card:focus-visible { border-color: var(--accent); background: var(--panel-hover); outline: none; }
.map-card .code { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 5px; padding: 1px 7px; letter-spacing: .5px; }
.map-card h3 { margin: 4px 0 6px; font-family: var(--font-head); font-weight: 500; font-size: 18px; }
.map-card p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.45; }
.map-card .meta { margin-top: 10px; font-size: 12px; color: var(--ink-faint); }
.empty { padding: 40px 0; color: var(--ink-soft); }

/* Embed link button + panel */
.map-card-wrap { position: relative; display: flex; flex-direction: column; }
.map-card-wrap .map-card { flex: 1; padding-bottom: 46px; }
.embed-btn {
  position: absolute; right: 12px; bottom: 12px;
  font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  color: var(--ink-soft); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px;
}
.embed-btn:hover, .embed-btn:focus-visible { color: var(--ink); border-color: var(--accent); outline: none; }
dialog#embed-dlg {
  width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 14px;
  background: #353131; color: var(--ink);
}
dialog#embed-dlg::backdrop { background: rgba(8, 10, 12, 0.6); }
.embed-form { padding: 22px 22px 18px; }
.embed-form h2 { margin: 0; font-size: 20px; }
.embed-sub { margin: 4px 0 16px; color: var(--accent); font-weight: 600; font-size: 14px; }
.embed-form label { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 600; }
.embed-form label span { font-weight: 400; color: var(--ink-faint); }
.embed-form input {
  width: 100%; font: 13px ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--ink);
  background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px;
}
.embed-form input.bad { border-color: #d46a5c; }
.embed-form .row { display: flex; gap: 8px; }
.embed-form button {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
  color: #fff; background: var(--accent); border: 0; border-radius: 8px; padding: 8px 14px;
}
.embed-form button:disabled { opacity: .4; cursor: default; }
.embed-note { margin: 16px 0 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.45; }
.embed-status { min-height: 18px; margin: 8px 0 0; font-size: 12.5px; color: var(--accent-2); }
.embed-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.embed-actions button { background: transparent; color: var(--ink); border: 1px solid var(--line); }
