/* ============================================================
   Hope Restore Team — design tokens
   Palette: deep teal-navy (trust/institution) + warm gold
   (the "restored light"), on a cool pale paper background.
   Type: Fraunces (display serif, warmth + authority) paired
   with Public Sans (the typeface built for U.S. government
   digital services — a deliberate nod to this site's mission).
   Signature: a ripple/sunrise mark used as the logo and as a
   recurring divider, standing for "restoring" outward from harm.
   ============================================================ */

/* ---------- Reset & Base ---------- */
:root {
  --color-navy: #1a365d;
  --color-navy-dark: #17272a; /* Matching FTC's dark tone */
  --color-navy-tint: #e6f0fa; /* Light blue/grey tint */
  --color-gold: #f6c844; /* Hope Restore Team yellow */
  --color-gold-light: #fbe388;
  --color-danger: #e53e3e;
  --color-success: #38a169;
  --color-text: #2d3748;
  --color-text-muted: #718096;
  --color-border: #e2e8f0;
  --color-bg: #f7fafc;
  
  --font-display: 'Cormorant', serif;
  --font-body: 'Inter', system-ui, sans-serif;
  
  --radius: 8px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1);
  --max-width: 1120px;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: #fff; /* Main bg white as requested */
  color: var(--color-text);
  line-height: 1.5;
  animation: fadeInUp 0.8s ease-out;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--color-navy-dark);
  line-height: 1.15;
  margin: 0 0 0.5em;
}

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Ripple / sunrise signature mark ---------- */
.ripple-mark { display: inline-block; }
.ripple-mark circle { fill: none; stroke-width: 2.5; }

.divider-ripple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 48px 0 32px;
  color: var(--color-gold);
}
.divider-ripple::before,
.divider-ripple::after {
  content: '';
  height: 1px;
  width: 64px;
  background: var(--color-border);
}

/* ---------- Top Bar ---------- */
.top-bar {
  background: var(--color-navy-tint);
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
}
.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.gov-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
}
.top-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.top-links a {
  text-decoration: none;
  font-weight: 600;
  color: var(--color-navy);
}
.top-links a:hover { text-decoration: underline; }

/* ---------- Header / nav ---------- */
.site-header {
  background: #fff;
  border-bottom: 4px solid var(--color-navy);
  position: relative;
}
.site-header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  padding-bottom: 16px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-text .agency {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--color-navy);
  letter-spacing: 0.05em;
}
.brand-text .sub-agency {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-navy-dark);
  line-height: 1;
}

.mobile-menu-btn {
  display: none;
  background: var(--color-navy);
  color: #fff;
  border: none;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 4px;
}
.mobile-top-links { display: none; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-top: 10px;
  width: 100%;
}
.nav-item { position: relative; }
.nav-link, .nav-item > a {
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-navy);
  cursor: pointer;
  padding: 10px 14px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link:hover, .nav-item > a:hover {
  text-decoration: underline;
  color: var(--color-navy-dark);
}
.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 200px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  z-index: 100;
}
.dropdown-content a {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--color-navy);
  border-bottom: 1px solid var(--color-border);
}
.dropdown-content a:hover {
  background: var(--color-navy-tint);
}
.nav-item:hover .dropdown-content {
  display: block;
}
.user-actions { margin-left: auto; display: flex; }

/* ---------- Take Action Horizontal ---------- */
.take-action-section {
  background: #fff;
  padding: 40px 0 20px;
}
.take-action-horizontal {
  display: flex;
  align-items: center;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 0;
}
.style-as-h4 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-navy-dark);
  min-width: 150px;
  margin: 0 24px 0 0;
  padding-right: 24px;
  border-right: 1px solid var(--color-border);
}
.usa-icon-list {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  flex: 1;
  list-style: none;
  padding: 0;
  margin: 0;
}
.usa-icon-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 1px solid var(--color-border);
  padding-right: 30px;
}
.usa-icon-list li:last-child { border-right: none; }
.usa-icon-list li a {
  text-decoration: none;
  color: #005ea2;
  font-weight: 500;
  font-size: 0.95rem;
}
.usa-icon-list li a:hover { text-decoration: underline; color: #1a4480; }
.fontawesome-icon-inline svg {
  width: 18px;
  height: 18px;
  color: var(--color-navy-dark);
}

/* ---------- Latest Advice Section ---------- */
.latest-advice-section {
  margin-bottom: 60px;
}
.advice-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 16px;
  margin-bottom: 24px;
}
.advice-header h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--color-navy-dark);
  margin: 0;
}
.advice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;
}
.advice-col.has-left-border {
  border-left: 1px solid var(--color-border);
  padding-left: 30px;
}
.col-heading {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--color-navy-dark);
  font-size: 1.1rem;
  margin-bottom: 24px;
}
.advice-card { 
  margin-bottom: 30px; 
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 8px;
  padding: 10px;
}
.advice-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
  background: var(--color-bg);
}
.advice-card.mt-border { border-top: 1px solid var(--color-border); padding-top: 30px; }
.advice-tag {
  display: inline-block;
  background: var(--color-navy-tint);
  color: var(--color-navy-dark);
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.advice-card h4 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 10px;
}
.advice-card h4 a {
  text-decoration: none;
  color: var(--color-navy-dark);
}
.advice-card h4 a:hover { text-decoration: underline; }
.advice-card p {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
}
.advice-meta {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

/* Banners */
.advice-banner {
  padding: 20px;
  margin-bottom: 20px;
  text-align: center;
  border-radius: 4px;
}
.advice-banner.banner-light { background: var(--color-navy-tint); }
.advice-banner.banner-dark { background: var(--color-navy-dark); color: #fff; }
.banner-inner { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 200px; }
.banner-title { font-family: var(--font-body); font-weight: 700; font-size: 1.3rem; margin-bottom: 10px; }
.banner-graphic { font-size: 4rem; margin-bottom: 10px; }
.banner-link { font-weight: 700; font-size: 1.2rem; color: var(--color-navy); }
.banner-dark .banner-link { color: #fff; }

@media (max-width: 900px) {
  .take-action-horizontal { flex-direction: column; align-items: flex-start; }
  .style-as-h4 { border-right: none; border-bottom: 1px solid var(--color-border); width: 100%; padding-bottom: 10px; margin-bottom: 10px; }
  .usa-icon-list { flex-direction: column; gap: 10px; }
  .usa-icon-list li { border-right: none; }
  .advice-grid { grid-template-columns: 1fr; }
  .advice-col.has-left-border { border-left: none; padding-left: 0; border-top: 1px solid var(--color-border); padding-top: 30px; margin-top: 20px; }
}

/* Mobile Menu Overrides */
@media (max-width: 1000px) {
  .top-bar { display: none; }
  .mobile-menu-btn { display: block; }
  .site-header .header-inner { flex-wrap: nowrap; }
  .brand-text .sub-agency { font-size: 1.15rem; }
  .brand-text .agency { font-size: 0.65rem; }
  
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    flex-direction: column;
    padding: 20px 24px;
    box-shadow: var(--shadow-md);
    z-index: 99;
    align-items: flex-start;
  }
  .main-nav.open { display: flex; }
  
  .mobile-top-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
  }
  .mobile-block-link {
    display: block;
    background: var(--color-navy);
    color: #fff;
    padding: 14px;
    font-weight: 700;
    text-align: left;
    text-decoration: none;
  }
  
  .nav-item { width: 100%; border-bottom: 1px solid var(--color-border); margin: 0; }
  .nav-link, .nav-item > a { width: 100%; justify-content: space-between; padding: 16px 0; font-size: 1.05rem; }
  .dropdown-content { position: static; box-shadow: none; border: none; display: none; padding-left: 16px; }
  .nav-item.active .dropdown-content { display: block; }
  .nav-item:hover .dropdown-content { display: none; }
  .nav-item.active:hover .dropdown-content { display: block; }
  
  .user-actions { margin-top: 20px; border-bottom: none; margin-left: 0; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--color-gold); color: var(--color-navy-dark); }
.btn-primary:hover { background: var(--color-gold-light); }
.btn-outline { background: transparent; color: #fff; border-color: rgba(255,255,255,0.5); }
.btn-outline:hover { border-color: var(--color-gold-light); color: var(--color-gold-light); }
.btn-dark { background: var(--color-navy); color: #fff; }
.btn-dark:hover { background: var(--color-navy-dark); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Hero ---------- */
.hero {
  background: var(--color-navy-dark);
  color: #fff;
  padding: 72px 0 88px;
  position: relative;
  overflow: hidden;
}
.hero .container { 
  position: relative; 
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}
.hero-content {
  flex: 1;
  max-width: 600px;
}
@keyframes floatImage {
  0% { transform: translateY(0) scale(0.9); }
  50% { transform: translateY(-15px) scale(0.9); }
  100% { transform: translateY(0) scale(0.9); }
}

.hero-graphic {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  position: relative;
}
.hero-graphic img {
  max-width: 80%;
  height: auto;
  transform: scale(0.9);
  transform-origin: center right;
}
.hero-eyebrow {
  color: var(--color-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  margin-top: 10px;
}
.hero p.lead {
  color: #C9DAD7;
  font-size: 1.08rem;
  margin-top: 14px;
}
.hero-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 800px) {
  .hero .container {
    flex-direction: column;
    text-align: center;
  }
  .hero-actions { justify-content: center; }
  .hero-graphic { margin-top: 30px; }
}

/* ---------- Alert / post cards ---------- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.section-title h2 { font-size: 1.6rem; margin: 0; }
.section-title a { font-weight: 700; font-size: 0.9rem; text-decoration: none; }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}

.alert-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 6px solid var(--color-low);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.alert-card:hover { box-shadow: var(--shadow-md); }
.alert-card.sev-high { border-left-color: var(--color-danger); }
.alert-card.sev-medium { border-left-color: var(--color-medium); }
.alert-card.sev-low { border-left-color: var(--color-low); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  width: fit-content;
}
.badge-high { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-medium { background: var(--color-medium-bg); color: var(--color-medium); }
.badge-low { background: var(--color-low-bg); color: var(--color-low); }
.badge-category { background: var(--color-navy-tint); color: var(--color-navy); }

.alert-card h3 { font-size: 1.15rem; margin: 0; }
.alert-card p { color: var(--color-text-muted); font-size: 0.93rem; margin: 0; }
.card-meta { font-size: 0.8rem; color: var(--color-text-muted); }

/* ---------- Flash messages ---------- */
.flash { padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; font-weight: 600; }
.flash-error { background: var(--color-danger-bg); color: var(--color-danger); border: 1px solid #F2C6C1; }
.flash-success { background: var(--color-low-bg); color: var(--color-low); border: 1px solid #C7E4D3; }

/* ---------- Typography in Post Body ---------- */
.post-body h1, .post-body h2, .post-body h3, .post-body h4 {
  margin-top: 1.5em;
  margin-bottom: 0.5em;
  color: var(--color-navy-dark);
}
.post-body h2 { font-size: 1.75rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.3em; }
.post-body h3 { font-size: 1.5rem; }
.post-body p {
  margin-bottom: 1.25em;
}
.post-body ul, .post-body ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}
.post-body li {
  margin-bottom: 0.5em;
}
.post-body blockquote {
  border-left: 4px solid var(--color-gold);
  padding-left: 1rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 1.25em;
}
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  margin-bottom: 1.25em;
}
.post-body a {
  color: #005ea2;
  text-decoration: none;
}
.post-body a:hover {
  text-decoration: underline;
}

/* ---------- Forms ---------- */
.form-card { max-width: 460px; margin: 40px auto; }
.form-group { margin-bottom: 18px; }
label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; }
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--color-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: #fff;
  color: var(--color-text);
}
textarea { min-height: 160px; resize: vertical; }
.form-help { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 4px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

/* ---------- Post detail ---------- */
.post-header { padding: 48px 0 20px; }
.post-body { font-size: 1.05rem; }
.post-body p { margin: 0 0 1.1em; }
.post-hero-img { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); margin: 18px 0; }

.comment { border-top: 1px solid var(--color-border); padding: 16px 0; }
.comment-meta { font-size: 0.82rem; color: var(--color-text-muted); margin-bottom: 6px; }
.comment-meta strong { color: var(--color-navy); }

/* ---------- Filters / search bar ---------- */
.filter-bar { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 12px; flex-wrap: wrap; align-items: end; margin-bottom: 26px; }
.filter-bar .form-group { margin: 0; min-width: 160px; }

.pagination { display: flex; gap: 8px; justify-content: center; margin: 30px 0; }
.pagination a, .pagination span { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--color-border); text-decoration: none; color: var(--color-navy); font-weight: 600; font-size: 0.88rem; }
.pagination .current { background: var(--color-navy); color: #fff; border-color: var(--color-navy); }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-navy-dark); color: #B7CBC8; padding: 44px 0 28px; margin-top: 64px; }
.site-footer h4 { color: #fff; font-size: 1rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.site-footer a { color: #B7CBC8; text-decoration: none; font-size: 0.9rem; }
.site-footer a:hover { color: var(--color-gold-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 30px; padding-top: 18px; font-size: 0.82rem; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- Admin layout ---------- */
.admin-body { background: #EEF2F1; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: var(--color-navy-dark); color: #DCE8E6; padding: 22px 0; flex-shrink: 0; }
.admin-sidebar .brand { padding: 0 20px 20px; }
.admin-sidebar nav a {
  display: block; padding: 11px 22px; color: #C9DAD7; text-decoration: none; font-size: 0.92rem; font-weight: 600;
  border-left: 3px solid transparent;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: rgba(255,255,255,0.06); border-left-color: var(--color-gold); color: #fff; }
.admin-main { flex: 1; padding: 30px 36px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius); padding: 18px 20px; }
.stat-card .num { font-family: var(--font-display); font-size: 2rem; color: var(--color-navy); }
.stat-card .label { color: var(--color-text-muted); font-size: 0.85rem; font-weight: 600; }

table.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
table.admin-table th, table.admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--color-border); font-size: 0.9rem; }
table.admin-table th { background: var(--color-navy-tint); color: var(--color-navy); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
table.admin-table tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 8px; }
.status-pill { padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.status-published, .status-active, .status-approved { background: var(--color-low-bg); color: var(--color-low); }
.status-draft, .status-banned, .status-hidden { background: var(--color-danger-bg); color: var(--color-danger); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }

@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-main { padding: 22px 18px; }
  .site-header .container { flex-direction: column; text-align: center; justify-content: center; }
  .main-nav { justify-content: center; width: 100%; margin-top: 10px; }
  .hero { padding: 48px 0; }
  .hero h1 { font-size: 2.2rem; }
}

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr !important; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; text-align: center; }
  .main-nav { flex-direction: column; gap: 12px; }
  .main-nav .btn { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover { transform: none; }
}
