/* HHCO Content Engine — Main Stylesheet
   Screen-reader-first. No color-only information. WCAG 2.1 AA baseline. */

/* ------------------------------------------------------------------ */
/* Reset and base */
/* ------------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --pink: #F8BFD9;
  --gold: #B78507;
  --gold-dark: #8a6305;
  --white: #ffffff;
  --black: #0a0a0a;
  --gray-100: #f5f5f5;
  --gray-200: #e5e5e5;
  --gray-400: #9a9a9a;
  --gray-700: #3a3a3a;
  --error: #c0392b;
  --success: #1e7e34;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --focus-ring: 3px solid var(--gold);
  --radius: 4px;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--black);
  background: var(--gray-100);
}

/* ------------------------------------------------------------------ */
/* Skip link (VoiceOver + keyboard users) */
/* ------------------------------------------------------------------ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--gold);
  color: var(--white);
  font-weight: bold;
  z-index: 9999;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

/* ------------------------------------------------------------------ */
/* Focus styles — visible and high contrast */
/* ------------------------------------------------------------------ */
:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Navigation */
/* ------------------------------------------------------------------ */
nav[role="navigation"] {
  background: var(--black);
  padding: 0 1.5rem;
}

nav[role="navigation"] ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

nav[role="navigation"] a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--white);
  text-decoration: none;
  font-size: 0.9375rem;
}

nav[role="navigation"] a:hover,
nav[role="navigation"] a:focus-visible {
  background: var(--gold);
  color: var(--white);
  outline: none;
}

nav[role="navigation"] a[aria-current="page"] {
  background: var(--gold-dark);
  color: var(--white);
}

nav[role="navigation"] .nav-separator-visual {
  border-left: 1px solid rgba(255, 255, 255, 0.25);
  margin-left: 0.25rem;
}

/* ------------------------------------------------------------------ */
/* Main content */
/* ------------------------------------------------------------------ */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ------------------------------------------------------------------ */
/* Headings */
/* ------------------------------------------------------------------ */
h1 { font-size: 1.75rem; margin: 0 0 1rem; }
h2 { font-size: 1.375rem; margin: 1.5rem 0 0.75rem; }
h3 { font-size: 1.125rem; margin: 1.25rem 0 0.5rem; }

/* ------------------------------------------------------------------ */
/* Cards / panels */
/* ------------------------------------------------------------------ */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

/* ------------------------------------------------------------------ */
/* Buttons */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

.btn-primary:hover {
  background: var(--gold-dark);
  border-color: var(--gold-dark);
}

.btn-secondary {
  background: var(--white);
  color: var(--gold-dark);
  border-color: var(--gold);
}

.btn-secondary:hover {
  background: var(--gray-100);
}

.btn-danger {
  background: var(--error);
  color: var(--white);
  border-color: var(--error);
}

.btn-danger:hover {
  background: #922b21;
  border-color: #922b21;
}

.btn:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Forms */
/* ------------------------------------------------------------------ */
.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.375rem;
  font-size: 0.9375rem;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="datetime-local"],
select,
textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--gray-400);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--black);
  transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  outline: none;
  box-shadow: 0 0 0 3px rgba(183, 133, 7, 0.2);
}

input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--error);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

/* ------------------------------------------------------------------ */
/* Alerts and errors */
/* ------------------------------------------------------------------ */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-error {
  background: #fdecea;
  border-color: var(--error);
  color: #7b1e18;
}

.alert-success {
  background: #eafaf1;
  border-color: var(--success);
  color: #145a23;
}

.alert-warning {
  background: #fef9e7;
  border-color: #d4ac0d;
  color: #7d6608;
}

.field-error {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: block;
}

/* ------------------------------------------------------------------ */
/* Tables */
/* ------------------------------------------------------------------ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

th {
  text-align: left;
  padding: 0.625rem 0.75rem;
  background: var(--gray-100);
  border-bottom: 2px solid var(--gray-200);
  font-weight: 600;
}

td {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: top;
}

tr:last-child td {
  border-bottom: none;
}

/* ------------------------------------------------------------------ */
/* Status badges */
/* ------------------------------------------------------------------ */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-review { background: #fef3cd; color: #664d03; }
.badge-approved { background: #d1e7dd; color: #0a3622; }
.badge-rejected { background: #f8d7da; color: #58151c; }
.badge-scheduled { background: #cff4fc; color: #055160; }
.badge-published { background: #d1e7dd; color: #0a3622; }

/* ------------------------------------------------------------------ */
/* Stats grid (dashboard) */
/* ------------------------------------------------------------------ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold-dark);
  display: block;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-700);
}

/* ------------------------------------------------------------------ */
/* Login page */
/* ------------------------------------------------------------------ */
.login-container {
  max-width: 420px;
  margin: 4rem auto;
  padding: 2rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.login-container h1 {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  text-align: center;
  color: var(--gray-700);
  margin-bottom: 1.75rem;
  font-size: 0.9375rem;
}

/* ------------------------------------------------------------------ */
/* Pagination */
/* ------------------------------------------------------------------ */
.pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
  align-items: center;
}

.pagination a, .pagination span {
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--gold-dark);
  font-size: 0.9375rem;
}

.pagination a:hover {
  background: var(--gray-100);
}

.pagination .current {
  background: var(--gold);
  color: var(--white);
  border-color: var(--gold);
}

/* ------------------------------------------------------------------ */
/* Post article (queue view) */
/* ------------------------------------------------------------------ */
.post-article {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 0.75rem;
}

.post-meta {
  font-size: 0.875rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-hook {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
}

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

/* ------------------------------------------------------------------ */
/* Caption display */
/* ------------------------------------------------------------------ */
.caption-block {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1rem;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ------------------------------------------------------------------ */
/* QC score table */
/* ------------------------------------------------------------------ */
.qc-score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold-dark);
}

/* ------------------------------------------------------------------ */
/* Image review */
/* ------------------------------------------------------------------ */
.review-image {
  max-width: 540px;
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

/* ------------------------------------------------------------------ */
/* Media library grid */
/* ------------------------------------------------------------------ */
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.media-item {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 0.75rem;
}

.media-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

.media-item-meta {
  font-size: 0.8125rem;
  color: var(--gray-700);
  margin-top: 0.5rem;
}

/* ------------------------------------------------------------------ */
/* Section divider */
/* ------------------------------------------------------------------ */
.section-divider {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 2rem 0;
}

/* ------------------------------------------------------------------ */
/* Utility */
/* ------------------------------------------------------------------ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.text-muted {
  color: var(--gray-700);
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.align-center { align-items: center; }
