@font-face {
  font-family: "Cheddar Gothic Sans";
  src: url("/fonts/CheddarGothicSans.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

* { box-sizing: border-box; }

:root {
  --night: #0d1611;
  --night-raised: #131f18;
  --panel: #101d16;
  --cream: #fcf7f1;
  --olive: #909453;
  --line: #61665b;
  --muted: #abb0a7;
  --danger: #c47769;
  --success: #9eaa72;
  --display: "Oswald", "Arial Narrow", Arial, sans-serif;
  --headline: "Cheddar Gothic Sans", Impact, sans-serif;
  --copy: "Asap Condensed", Arial, sans-serif;
}

html { scroll-behavior: smooth; }
body { margin: 0; background: var(--night); color: var(--cream); font: 16px/1.5 var(--copy); }
body.menu-open { overflow: hidden; }
a { color: inherit; }
button, input, textarea { font: inherit; }

/* Cheddar Gothic Sans and Rough are always displayed in lowercase. */
h1, h2, h3, .brand strong { text-transform: lowercase; }
h1, h2, h3 { font-family: var(--headline); font-weight: 400; }
h1 { margin: .1em 0; font-size: clamp(58px, 8vw, 110px); line-height: .85; }
h2 { margin: .1em 0 .5em; font-size: 48px; }
h3 { font-size: 28px; }

.admin-header {
  position: sticky;
  z-index: 50;
  top: 0;
  min-height: 84px;
  padding: 14px clamp(20px, 2vw, 38px);
  display: grid;
  grid-template-columns: max-content auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: clamp(14px, 1.5vw, 28px);
  border-bottom: 1px solid rgba(97, 102, 91, .55);
  background: rgba(13, 22, 17, .98);
  backdrop-filter: blur(10px);
}
.brand { display: inline-flex; width: max-content; color: var(--cream); text-decoration: none; }
.brand strong, .brand small { display: block; }
.brand strong { font: 400 31px/.82 var(--headline); letter-spacing: .025em; }
.brand small { margin-top: 5px; color: var(--olive); font: 400 11px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; }

.system-switches { display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.system-switches a, .mobile-system-switches a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 122px;
  min-height: 34px;
  padding: 8px 14px;
  border: 1px solid rgba(151, 158, 84, .42);
  background: rgba(151, 158, 84, .13);
  color: var(--muted);
  font: 400 12px/1 var(--display);
  letter-spacing: .065em;
  text-decoration: none;
  text-transform: uppercase;
}
.system-switches a:hover, .mobile-system-switches a:hover { border-color: var(--olive); color: var(--cream); }
.system-switches a.active, .mobile-system-switches a.active { border-color: var(--olive); background: var(--olive); color: var(--night); font-weight: 700; }
.mobile-system-switches { display: none; }

.main-nav { display: flex; align-items: center; justify-self: end; gap: clamp(16px, 2vw, 38px); white-space: nowrap; }
.main-nav a, .main-nav form button {
  position: relative;
  padding: 12px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 400 14px/1 var(--display);
  letter-spacing: .09em;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
}
.main-nav form { margin: 0; }
.main-nav a:hover, .main-nav form button:hover, .main-nav a.active { color: var(--cream); }
.main-nav a.active::after { content: ""; position: absolute; right: 0; bottom: 1px; left: 0; height: 1px; background: var(--olive); }
.main-nav a.live-site { margin-inline: -8px; padding: 10px 12px; border: 1px solid rgba(158, 170, 114, .58); color: var(--success); }
.main-nav a.live-site::after { display: none; }
.main-nav a.live-site:hover { border-color: var(--cream); background: rgba(158, 170, 114, .12); }
.nav-separator { align-self: stretch; width: 1px; min-height: 32px; background: rgba(97, 102, 91, .55); }

.header-user-name { display: flex; min-width: 145px; flex-direction: column; align-items: flex-end; justify-self: end; padding-left: 28px; border-left: 1px solid rgba(97, 102, 91, .35); }
.header-user-name small { color: var(--olive); font: 400 9px/1 var(--display); letter-spacing: .09em; text-transform: uppercase; }
.header-user-name strong { margin-top: 4px; color: var(--success); font: 500 17px/1.1 var(--copy); white-space: nowrap; }
.avatar { display: grid; place-items: center; justify-self: end; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; color: var(--cream); font: 400 13px/1 var(--display); }
.menu-toggle { display: none; width: 42px; height: 42px; padding: 10px 8px; border: 0; outline: 0; background: transparent; color: var(--cream); cursor: pointer; }
.menu-toggle span { display: block; width: 100%; height: 1px; margin: 5px 0; background: currentColor; transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.admin-main { width: min(1500px, 94vw); margin: auto; padding: 55px 0 100px; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 38px; }
.intro p { max-width: 740px; color: var(--muted); }
.eyebrow { margin: 0 0 8px; color: var(--olive); font: 700 12px/1 var(--display); letter-spacing: .18em; text-transform: uppercase; }
.panel { scroll-margin-top: 105px; margin: 26px 0; padding: clamp(22px, 3vw, 44px); background: var(--panel); border: 1px solid var(--line); }
.panel[hidden] { display: none; }
.panel.muted { opacity: .75; }
.panel-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.hint, .flash { padding: 14px 16px; border: 1px solid var(--line); background: var(--night-raised); }
.flash { margin: 18px 0; }
.flash.error { border-color: var(--danger); color: #ffd4ca; }
.group-title { margin: 45px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--olive); }
.translation-row { display: grid; grid-template-columns: 220px 1fr 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.field-label { padding-top: 26px; }
.field-label strong, .field-label code { display: block; }
.field-label code, code { color: var(--muted); font-size: 11px; word-break: break-all; }
label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
label span { display: flex; justify-content: space-between; }
label em { color: #f0bb75; font-style: normal; }
input, textarea { width: 100%; border: 1px solid var(--line); background: #08110c; color: var(--cream); padding: 11px 12px; font: 15px/1.45 var(--copy); }
textarea { resize: vertical; }

button, .preview { border: 1px solid var(--olive); background: var(--olive); color: var(--night); padding: 12px 18px; font-weight: 800; letter-spacing: .03em; text-decoration: none; cursor: pointer; }
button:hover, .preview:hover { border-color: var(--cream); background: var(--cream); }
button:disabled { opacity: .45; cursor: not-allowed; }
.sticky-actions { position: sticky; bottom: 12px; display: flex; justify-content: end; margin-top: 20px; }
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.media-card, .item-card, .add-form { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); background: #091a11; }
.media-card img { width: 100%; height: 260px; object-fit: cover; }
.logo-card img { padding: 22px; background: var(--night); object-fit: contain; }
.pride-admin-grid { display: grid; grid-template-columns: 180px minmax(0, 680px); align-items: start; gap: 26px; margin-top: 28px; }
.pride-preview-card { display: grid; place-items: center; gap: 14px; min-height: 180px; padding: 24px; border: 1px solid var(--line); background: var(--night); color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pride-preview-card img { display: block; width: 74px; height: 74px; object-fit: contain; }
.pride-settings { display: grid; gap: 18px; padding: 22px; border: 1px solid var(--line); background: #091a11; }
.pride-settings .hint { margin: 0; color: var(--muted); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.item-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.item-card img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.item-card audio { width: 100%; }
.audio-trim-status { display: block; min-height: 18px; color: var(--olive); font-size: 12px; font-weight: 500; letter-spacing: 0; }
.audio-trim-status.ready { color: var(--success); }
.audio-trim-status.error { color: #ffd4ca; }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; }
.check input { width: auto; }
.add-form { grid-template-columns: repeat(2, 1fr); margin-top: 15px; }
details { margin-top: 20px; }
summary { cursor: pointer; color: var(--olive); font-weight: 800; }
.delete-control { padding-top: 14px; border-top: 1px solid rgba(196, 119, 105, .35); }
.delete-control p { color: var(--muted); font-size: 13px; }
.danger-button { border-color: var(--danger); background: transparent; color: #e0a29d; }
.danger-button:hover { border-color: var(--danger); background: var(--danger); color: var(--cream); }

.login-shell, .sso-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(520px, 100%); padding: 40px; background: var(--panel); border: 1px solid var(--line); }
.login-card form { display: grid; gap: 16px; margin: 28px 0; }
.login-card h1 { font-size: 72px; }
.sso-shell { color: var(--cream); text-align: center; }
.sso-shell p { font-size: 20px; }

@media (min-width: 901px) and (max-width: 1500px) {
  .admin-header { gap: 12px; }
  .system-switches { gap: 8px; }
  .system-switches a { min-width: 100px; padding-inline: 9px; font-size: 10px; }
  .main-nav { gap: 12px; }
  .main-nav a, .main-nav form button { font-size: 11px; letter-spacing: .05em; }
  .header-user-name { min-width: 112px; padding-left: 14px; }
}

@media (max-width: 900px) {
  .admin-header { grid-template-columns: 1fr auto auto auto; gap: 10px; }
  .admin-header > .system-switches { display: none; }
  .header-user-name { grid-column: 2; grid-row: 1; min-width: 0; padding-left: 0; border-left: 0; }
  .header-user-name small { display: none; }
  .header-user-name strong { max-width: 130px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; }
  .avatar { grid-column: 3; grid-row: 1; }
  .menu-toggle { display: block; grid-column: 4; grid-row: 1; }
  .main-nav { position: absolute; z-index: 49; top: 100%; right: 0; left: 0; max-height: calc(100svh - 84px); display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 24px max(24px, 7vw) 40px; overflow-y: auto; background: rgba(13, 22, 17, .985); opacity: 0; pointer-events: none; transform: translateY(-10px); visibility: hidden; transition: transform .2s ease, opacity .2s ease, visibility 0s linear .2s; }
  .main-nav.is-open { opacity: 1; pointer-events: auto; transform: translateY(0); visibility: visible; transition-delay: 0s; }
  .mobile-system-switches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-bottom: 18px; border-bottom: 1px solid rgba(97, 102, 91, .55); }
  .mobile-system-switches a { min-width: 0; min-height: 48px; padding: 10px; font-size: 15px; }
  .main-nav > a, .main-nav form button { display: flex; align-items: center; width: 100%; min-height: 67px; border-bottom: 1px solid rgba(97, 102, 91, .55); color: var(--muted); font-size: 20px; text-align: left; }
  .main-nav a.active { color: var(--olive); }
  .main-nav a.active::after { display: none; }
  .main-nav a.live-site { margin: 14px 0 0; padding-inline: 14px; }
  .main-nav form { width: 100%; }
  .nav-separator { width: 100%; height: 1px; min-height: 1px; margin-top: 14px; }
  .translation-row { grid-template-columns: 1fr; }
  .field-label { padding-top: 10px; }
  .panel-heading, .intro { align-items: flex-start; flex-direction: column; }
  .card-grid { grid-template-columns: 1fr; }
  .pride-admin-grid { grid-template-columns: 1fr; }
  .add-form { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .admin-header { min-height: 70px; padding-inline: 18px; }
  .brand strong { font-size: 25px; }
  .brand small { font-size: 9px; }
  .main-nav { max-height: calc(100svh - 70px); }
  .header-user-name strong { max-width: 92px; }
  .avatar { width: 38px; height: 38px; }
  .admin-main { width: calc(100% - 28px); padding-top: 42px; }
}
