/* =========================================================================
   AVA NEWS NETWORK — EXECUTIVE DESIGN SYSTEM & TOKENS (PHP 8.3)
   Aesthetic: Premium Newsroom Editorial · High Contrast · Obsidian & Crimson
   ========================================================================= */

:root {
  --arh-red: #c5161d;
  --arh-red-hover: #a10e14;
  --arh-red-subtle: rgba(197, 22, 29, 0.12);
  --arh-red-border: rgba(197, 22, 29, 0.35);
  --arh-red-glow: rgba(197, 22, 29, 0.3);

  --arh-bg-dark: #080d1a;
  --arh-bg-card: #0e1626;
  --arh-bg-card-hover: #131c30;
  --arh-bg-input: #080e1a;
  --arh-border: rgba(255, 255, 255, 0.08);
  --arh-border-light: rgba(255, 255, 255, 0.16);

  --arh-text-primary: #ffffff;
  --arh-text-secondary: #cbd5e1;
  --arh-text-muted: #8899a6;

  --arh-success: #10b981;
  --arh-warning: #f59e0b;
  --arh-danger: #ef4444;

  --arh-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --arh-font-serif: 'Newsreader', Georgia, serif;

  --arh-radius-sm: 8px;
  --arh-radius-md: 12px;
  --arh-radius-lg: 20px;
  --arh-radius-full: 9999px;

  --arh-shadow-subtle: 0 4px 12px rgba(0, 0, 0, 0.25);
  --arh-shadow-card: 0 12px 36px rgba(0, 0, 0, 0.35);
  --arh-shadow-elevated: 0 24px 60px rgba(0, 0, 0, 0.6);
  --arh-transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
  -webkit-text-size-adjust: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
  max-width: 100%;
}

body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  font-family: var(--arh-font-sans);
  background: var(--arh-bg-dark);
  color: var(--arh-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Vector SVG Helper */
.arh-svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  max-width: none;
}

/* Off-canvas Backdrop for Mobile Drawers */
.arh-drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 85;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.arh-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* Typography Overrides */
h1, h2, h3, h4, h5, h6 {
  color: var(--arh-text-primary) !important;
  font-weight: 800;
  letter-spacing: -0.02em;
}

p {
  color: var(--arh-text-secondary);
}

a {
  color: var(--arh-text-primary);
  text-decoration: none;
  transition: var(--arh-transition);
}

/* Brand Masthead */
.arh-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.arh-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
  text-decoration: none;
  vertical-align: middle;
}

.arh-brand-logo img {
  height: 34px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  display: inline-block;
}

.arh-brand-logo--large img {
  height: 46px;
}

.arh-brand-logo--small img {
  height: 26px;
}

.arh-brand-tag {
  background: var(--arh-red);
  color: #ffffff;
  font-weight: 900;
  font-size: 1.15rem;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 14px var(--arh-red-glow);
  letter-spacing: 0.05em;
  font-family: var(--arh-font-sans);
}

.arh-brand b {
  font-size: 1.15rem;
  font-weight: 900;
  color: #ffffff;
  display: block;
}

.arh-brand small {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fca5a5;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.arh-kicker {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #ff8080 !important;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}

/* Buttons */
.arh-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--arh-radius-sm);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--arh-transition);
  text-decoration: none;
  font-family: var(--arh-font-sans);
  min-height: 44px;
  touch-action: manipulation;
}

.arh-button--primary {
  background: var(--arh-red);
  color: #ffffff !important;
  box-shadow: 0 4px 16px var(--arh-red-glow);
}

.arh-button--primary:hover {
  background: var(--arh-red-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--arh-red-glow);
}

.arh-button--ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--arh-border-light);
  color: #ffffff !important;
}

.arh-button--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.arh-button--glass {
  background: rgba(14, 22, 38, 0.85);
  backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff !important;
}

.arh-button--glass:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.arh-button--small {
  padding: 7px 14px;
  font-size: 0.8rem;
  min-height: 36px;
}

.arh-button--full {
  width: 100%;
}

/* Form Controls with High-Contrast Tokens */
.arh-form-group {
  margin-bottom: 20px;
}

.arh-form-group label {
  display: block;
  font-size: 0.84rem;
  font-weight: 700;
  color: #f1f5f9 !important;
  margin-bottom: 8px;
}

.arh-form-group label span {
  color: #ff8080;
}

.arh-form-group input[type="text"],
.arh-form-group input[type="email"],
.arh-form-group input[type="password"],
.arh-form-group input[type="tel"],
.arh-form-group input[type="url"],
.arh-form-group input[type="date"],
.arh-form-group input[type="number"],
.arh-form-group textarea,
.arh-form-group select,
.arh-select,
.arh-title-input,
.arh-story-editor {
  width: 100%;
  padding: 13px 16px;
  background: var(--arh-bg-input) !important;
  border: 1px solid var(--arh-border-light) !important;
  border-radius: var(--arh-radius-sm);
  color: #ffffff !important;
  font-family: var(--arh-font-sans);
  font-size: 0.95rem;
  transition: var(--arh-transition);
  min-height: 48px;
}

.arh-form-group textarea {
  min-height: 120px;
}

.arh-form-group input:focus,
.arh-form-group textarea:focus,
.arh-form-group select:focus,
.arh-title-input:focus,
.arh-story-editor:focus {
  outline: none;
  border-color: var(--arh-red) !important;
  box-shadow: 0 0 0 3px var(--arh-red-subtle);
  background: #0d1524 !important;
}

.arh-form-group input[type="file"] {
  width: 100%;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1.5px dashed var(--arh-border-light);
  border-radius: var(--arh-radius-sm);
  color: #cbd5e1;
  font-size: 0.88rem;
  cursor: pointer;
}

.arh-form-group input[type="file"]:hover {
  border-color: var(--arh-red);
}

.arh-form-row {
  display: grid;
  gap: 18px;
}

.arh-form-row--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.arh-form-row--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.arh-form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px 18px;
  border-radius: var(--arh-radius-sm);
  border: 1px solid var(--arh-border);
}

.arh-form-checkbox input {
  margin-top: 4px;
  accent-color: var(--arh-red);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.arh-form-checkbox label {
  font-size: 0.84rem;
  color: var(--arh-text-secondary);
  line-height: 1.5;
  cursor: pointer;
}

/* Alerts */
.arh-alert {
  padding: 16px 20px;
  border-radius: var(--arh-radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 22px;
}

.arh-alert--error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

.arh-alert--success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #86efac;
}

/* Status Badges */
.arh-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--arh-radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.arh-badge--draft { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; }
.arh-badge--pending, .arh-badge--under_review { background: rgba(245, 158, 11, 0.15); color: #fde68a; border: 1px solid rgba(245, 158, 11, 0.35); }
.arh-badge--published, .arh-badge--issued, .arh-badge--paid, .arh-badge--captured, .arh-badge--verified { background: rgba(16, 185, 129, 0.15); color: #86efac; border: 1px solid rgba(16, 185, 129, 0.35); }
.arh-badge--revision_needed, .arh-badge--needs_update, .arh-badge--declined { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }

/* Priority Tags */
.arh-priority-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.arh-priority-tag--standard { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.arh-priority-tag--important { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.arh-priority-tag--breaking { background: var(--arh-red); color: #ffffff; box-shadow: 0 2px 8px var(--arh-red-glow); }

/* Data Tables */
.arh-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -8px;
  padding: 0 8px;
}

.arh-data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  min-width: 600px;
}

.arh-data-table th {
  padding: 14px 18px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--arh-text-muted);
  border-bottom: 1px solid var(--arh-border);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.arh-data-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--arh-border);
  font-size: 0.88rem;
  vertical-align: middle;
}

.arh-data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.arh-table-time {
  font-size: 0.8rem;
  color: var(--arh-text-muted);
  white-space: nowrap;
}

/* Empty State */
.arh-empty-state {
  text-align: center;
  padding: 56px 24px;
}

.arh-empty-icon {
  font-size: 2.8rem;
  display: block;
  margin-bottom: 14px;
}

.arh-empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}

.arh-empty-state p {
  color: var(--arh-text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .arh-form-row--2,
  .arh-form-row--3 {
    grid-template-columns: 1fr;
  }
}
