/* ===== Global (homepage + admin). Redirect uses /css/redirect.css ===== */

/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Hind+Vadodara:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Palanquin+Dark:wght@400;500;600;700&display=swap');

/* ===== Theme tokens ===== */
:root{
  --bg: rgba(22, 56, 84, 1);
  --bg-img: url('/images/background.webp');

  --text: #bfbfbf;
  --brand: #ffbe55;
  --hover-grey: #bfbfbf;
  --card-bg: rgba(14, 15, 16, 0.75);
  --border: #2a323d;

  /* Button system (matches test2) */
  --btn-radius: 14px;
  --btn-weight: 700;
  --btn-gap: 10px;
  --btnY: 12px;
  --btnX: 22px;
  --focus-ring: 0 0 0 2px #fff, 0 0 0 4px rgba(255,190,85,.55);
}

/* ===== Base ===== */
html, body { height: 100%; margin: 0; }

body.page,
body.admin {
  font-family: "Hind Vadodara", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-img);
  background-repeat: repeat;
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main, .site-main { flex: 1; }

/* ===== Layout ===== */
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* ===== Header & Footer ===== */
.site-header, .site-footer{
  box-sizing: border-box;
  width: 100%;
  background: rgba(13,30,48,0.3);
  color: var(--text);
  padding: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  position: relative;
  z-index: 10;
}
.site-header{ border-bottom:1px solid rgba(255,255,255,.08); }
.site-footer{ border-top:   1px solid rgba(255,255,255,.08); }

.site-header .wrap, .site-footer .wrap{
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.site-header .wrap{ justify-content: space-between; }
.site-footer .wrap{ justify-content: center; }
.site-footer { font-size: 15px; }
.site-footer .wrap { padding: 12px 24px; }

header.card, footer.card { border-radius: 0; box-shadow: none; }

/* Brand (logo + title) */
.site-header .brand{
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--text);
}
.site-header .brand img{ width: 72px; height: 72px; border-radius: 8px; display:block; }
.site-header .brand-title{
  font-family: "Palanquin Dark", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 18px; font-weight: 700; letter-spacing: .2px; color: #e7e9ee;
}

/* ===== Buttons (canonical) ===== */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--btn-gap);
  padding: var(--btnY) var(--btnX);
  border-radius: var(--btn-radius);
  font-weight: var(--btn-weight);
  border: 1px solid transparent;
  background: var(--brand); color: #0b0b0b;
  text-decoration: none; user-select: none; cursor: pointer; white-space: nowrap;
  transition: transform 100ms ease, filter 120ms ease, box-shadow 120ms ease,
              background-color 120ms ease, border-color 120ms ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.25), inset 0 -2px 0 rgba(0,0,0,.08);
}
a.btn, .btn:link, .btn:visited { color: #0b0b0b !important; }

.btn--s { padding: 8px 16px; font-size: 0.9375rem; }
.btn--l { padding: 14px 26px; font-size: 1.0625rem; }

/* Primary button interactions */
.btn:hover  { transform: translateY(-1px); filter: brightness(.96); }
.btn:active { transform: translateY(0);    filter: brightness(.90); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn[disabled], .btn.is-disabled { opacity: .55; pointer-events: none; }

/* Header buttons: smaller padding, same label size */
.site-header .nav.hero{ gap: 10px; }
.site-header .btn{ font-size: 1.125rem; }

/* Secondary (outlined, brand-yellow text) */
.btn.btn-secondary{
  background: transparent; border: 2px solid var(--brand); color: var(--brand);
  box-shadow: none;
}
a.btn.btn-secondary,
.btn.btn-secondary:link,
.btn.btn-secondary:visited { color: var(--brand) !important; }
.btn.btn-secondary:hover  { background: rgba(255,190,85,.10); transform: translateY(-1px); }
.btn.btn-secondary:active { background: rgba(255,190,85,.16); transform: translateY(0); }
.btn.btn-secondary:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* Copy button = secondary (outlined), compact size (global) */
.copy{
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 8px 12px;                 /* compact */
  font-size: 0.9375rem;
  font-weight: var(--btn-weight);
  border-radius: var(--btn-radius);
  background: transparent;
  color: var(--brand);
  border: 1px solid var(--brand);    /* outlined (1px) */
  text-decoration: none; user-select: none; cursor: pointer; white-space: nowrap;
  box-shadow: none;
  transition: transform 100ms ease, background-color 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}
/* Tighter in list rows */
.row .copy{ padding: 6px 10px; }

/* Copy interactions (secondary behavior) */
.copy:hover  { background: rgba(255,190,85,.10); transform: translateY(-1px); }
.copy:active { background: rgba(255,190,85,.16); transform: translateY(0); }
.copy:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.copy[disabled], .copy.is-disabled { opacity: .55; pointer-events: none; }

/* ===== Cards & grid ===== */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); }
@media (min-width: 900px) { .card.half { grid-column: span 6; } }

.card {
  grid-column: span 12;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  overflow: hidden;
  color: var(--text);
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* Headings (global) — match test2.html */
h2{
  font-family: "Palanquin Dark", sans-serif;
  font-weight: 700;
  font-size: 24px;
  line-height: 1.25;
  margin: 0 0 12px;
  color: var(--brand);
}

/* ===== Hero: logo left, welcome right ===== */
.intro-wrap{
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 24px;
  align-items: start;
  margin: 8px 0 24px;
}
.intro-wrap .intro-logo { grid-column: 1 / span 1; }
.intro-wrap .card.home  { grid-column: 2 / span 1; align-self: start; }

.intro-logo img{
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,.35);
}

/* Welcome card text */
.card.home .welcome-meta{
  font-size: clamp(15px, 1.06rem, 18px);
  line-height: 1.6;
}
.card.home .welcome-meta strong{ color: var(--brand); }
.card.home .cta .btn{
  font-size: 1.0625rem;
  padding: calc(var(--btnY)*1.1) calc(var(--btnX)*1.2);
  border-radius: 12px;
}

/* Mobile: stack hero */
@media (max-width: 899.98px){
  .intro-wrap{ grid-template-columns: 1fr; gap: 16px; }
  .intro-wrap .intro-logo, .intro-wrap .card.home{ grid-column: 1 / -1; }
}

/* ===== Lists ===== */
.list{
  display: grid;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 14px;    /* keeps scrollbar away from rounded border */
  max-height: 58vh;       /* prevents clipping at card corners */
  box-sizing: content-box;
}
@media (max-width: 899.98px){
  .list{ max-height: 44vh; padding-right: 12px; }
}

/* Row layout: 2 x 2 grid with right-aligned status/meta */
.row{
  display: grid;
  grid-template-columns: minmax(0,1fr) auto; /* prevent overflow from long URLs */
  grid-template-areas:
    "short pill"
    "dest  meta";
  column-gap: 12px;
  row-gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #0f141b;
  color: var(--text);
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}
.row a.short{
  grid-area: short;
  font-weight: 600;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.row .pill-copy{
  grid-area: pill;
  justify-self: end;
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.row .dest{
  grid-area: dest;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
  max-width: 100%;
  min-width: 0;
}
.row .meta{
  grid-area: meta;
  justify-self: end; text-align: right; white-space: nowrap;
  font-size: 12px; opacity: .85;
}
.row .pill{ font-size: 11px; padding: 4px 8px; }

/* ===== Pills / badges ===== */
.badge{
  font-size: 11px; padding: 4px 8px; border-radius: 999px;
  background: #2a3b4c; color: #f0c674;
  border: 1px solid rgba(255,255,255,.1);
  font-weight: 700; display: inline-block;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
}

/* Base pill */
.pill{
  display:inline-flex; align-items:center; justify-content:center;
  padding: 5px 10px;
  border-radius: 999px;
  font: 700 11px/1 "Hind Vadodara", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  letter-spacing: .2px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 2px 4px rgba(0,0,0,.30);
  user-select: none;
}

/* === test2-style status pills (exact colors) === */
.row .pill{
  border: 0;                         /* test2 chips are borderless */
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  color: #fff;                       /* white label */
}
.row .pill.is-perm{ background: #3B82F6; color: #fff !important; }  /* Permanent = blue */
.row .pill.is-temp{ background: #6B7280; color: #fff !important; }  /* Temporary = gray */
.row .pill:hover{ filter: brightness(1.06); }

/* ===== Links (non-buttons): brand → visited grey ===== */
a:not(.btn){ color: var(--brand) !important; }
a:not(.btn):visited{ color: var(--hover-grey) !important; }
a:not(.btn):hover{ color: var(--hover-grey); }

/* ===== Forms ===== */
.page input, .page select, .page textarea,
.admin input, .admin select, .admin textarea {
  width: 100%;
  max-width: 640px;
  padding: 10px 12px;
  margin: 5px 0;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #0f141b;
  color: var(--text);
  font: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea { min-height: 120px; }
.page input:focus, .page select:focus, .page textarea:focus,
.admin input:focus, .admin select:focus, .admin textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255,190,85,0.15);
}

/* ===== Admin nudges ===== */
body.admin { min-height: 100vh; padding-top: 8px; }
body.admin .wrap { padding: 0 12px !important; }
body.admin .card { margin-top: 50px !important; }
body.admin .card img { margin-top: 0; margin-bottom: 6px; }
body.admin h2 { margin: 8px 0 10px; }

.right-actions .badge {
  background-color: #2a3b4c;
  color: #f0c674;
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
}

/* Scrollbar styling */
.list::-webkit-scrollbar { width: 10px; }
.list::-webkit-scrollbar-thumb { background: #212734; border-radius: 8px; }
.list::-webkit-scrollbar-thumb:hover { background: #2a3140; }
