/* Operation Giving Back — TrustedWebsite.org staging UI
   Large text, high contrast, keyboard-friendly. Original closed source. */

:root {
  --bg: #0f1419;
  --panel: #1a222c;
  --panel-2: #232d3a;
  --text: #f4f1ea;
  --muted: #c9b896;
  --accent: #f0c36a;
  --accent-ink: #1a1408;
  --border: #3a4654;
  --ok: #8fd19e;
  --err: #ffb4a8;
  --focus: #7ec8ff;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --fs: 1.125rem;
}

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

html { font-size: 112.5%; } /* ~18px base */

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-ink);
  padding: 0.5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.site-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.site-header img { width: 56px; height: 56px; border-radius: 8px; }
.site-header h1 { margin: 0; font-size: 1.35rem; color: #fff8e7; }
.site-header .tag { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.95rem; }

.layout {
  display: grid;
  gap: 1.5rem;
  padding: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 900px) {
  .layout { grid-template-columns: 1fr 1fr; align-items: start; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
}

.panel h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  color: #fff8e7;
}

label {
  display: block;
  font-weight: 600;
  margin: 0.85rem 0 0.35rem;
}
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.95rem; margin-top: 0.15rem; }

input[type="text"], input[type="password"], input[type="file"], textarea {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
}
textarea { min-height: 7rem; resize: vertical; }

.checkbox-row {
  display: flex; align-items: flex-start; gap: 0.6rem;
  margin-top: 1rem;
}
.checkbox-row input { width: auto; margin-top: 0.35rem; transform: scale(1.25); }
.checkbox-row label { margin: 0; font-weight: 500; }

.hp {
  position: absolute !important;
  left: -10000px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

button, .btn {
  font: inherit; font-weight: 700;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  display: inline-block;
}
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
button:disabled { opacity: 0.55; cursor: not-allowed; }

.msg {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.msg.ok { background: #16301c; color: var(--ok); border-color: #2d5a38; }
.msg.err { background: #3a1a16; color: var(--err); border-color: #6b2f28; }

.preview-frame {
  background: #0b0f14;
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 1rem;
  min-height: 18rem;
  font-family: var(--serif);
}
.preview-frame h3 { margin: 0 0 0.25rem; font-size: 1.6rem; color: #fff8e7; }
.preview-frame .by { color: var(--muted); margin: 0 0 0.75rem; }
.preview-frame img { max-width: 100%; height: auto; border-radius: 8px; margin-bottom: 0.75rem; }
.preview-frame .para { white-space: pre-wrap; margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.site-footer {
  max-width: 1100px; margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  color: var(--muted); font-size: 0.95rem;
}

/* Admin */
table.admin {
  width: 100%; border-collapse: collapse; font-size: 1rem;
}
table.admin th, table.admin td {
  text-align: left; padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
table.admin th { color: var(--muted); font-weight: 600; }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.gallery-grid figure {
  margin: 0; background: var(--panel); border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
}
.gallery-grid img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
.gallery-grid figcaption { padding: 0.4rem 0.55rem; font-size: 0.85rem; color: var(--muted); }
