/* ========================================
   DOWNUNDER DOLLAR - Personal Finance Blog
   Clean, professional, trustworthy design
   ======================================== */

:root {
  --primary: #0f4c5c;
  --primary-light: #1a6b7a;
  --primary-dark: #0a3540;
  --accent: #e8b931;
  --accent-light: #f5d56b;
  --text: #1a1a2e;
  --text-light: #555;
  --text-muted: #888;
  --bg: #ffffff;
  --bg-light: #f8f9fa;
  --bg-warm: #fafaf8;
  --border: #e8e8e8;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.1);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

a:hover {
  color: var(--primary-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

/* Layout */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

/* ========== HEADER / NAV ========== */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.logo span {
  color: var(--accent);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-light);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
}

.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
}

.btn-accent:hover {
  background: var(--accent-light);
  color: var(--primary-dark);
}

/* Navigation */
.main-nav {
  background: var(--bg-light);
  border-bottom: 1px solid var(--border);
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 0;
  overflow-x: auto;
}

.nav-list a {
  display: block;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-light);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Ad Banner Placeholder */
.ad-banner {
  background: var(--bg-light);
  border: 2px dashed var(--border);
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 1.5rem 0;
  border-radius: var(--radius);
}

.ad-banner--header {
  margin: 0;
  border-radius: 0;
  padding: 0.75rem;
}

/* ========== HERO ========== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 500px;
  height: 500px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}

.hero h1 {
  color: #fff;
  font-size: 3rem;
  margin-bottom: 1rem;
  max-width: 600px;
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 500px;
  margin-bottom: 2rem;
}

.hero .btn {
  font-size: 1rem;
  padding: 0.85rem 2rem;
}

/* ========== NEWSLETTER SIGNUP ========== */
.newsletter {
  background: var(--bg-light);
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.newsletter-inner {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.newsletter h2 {
  margin-bottom: 0.5rem;
}

.newsletter p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
}

.newsletter-form input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-form input:focus {
  border-color: var(--primary);
}

.newsletter-form .btn {
  padding: 0.85rem 2rem;
  font-size: 1rem;
}

/* ========== ARTICLE CARDS ========== */
.section {
  padding: 4rem 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.section-header h2 {
  font-size: 1.5rem;
}

.section-header a {
  font-size: 0.875rem;
  font-weight: 600;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.card-image {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 3rem;
}

.card-body {
  padding: 1.5rem;
}

.card-category {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary);
  background: rgba(15,76,92,0.08);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.card-title {
  font-size: 1.125rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
}

.card-title a {
  color: var(--text);
}

.card-title a:hover {
  color: var(--primary);
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ========== FEATURED / LARGE CARD ========== */
.featured-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 3rem;
}

.featured-card .card-image {
  height: 100%;
  min-height: 300px;
}

.featured-card .card-body {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-card .card-title {
  font-size: 1.5rem;
}

/* ========== SIDEBAR ========== */
.content-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 120px;
}

.sidebar-widget {
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-widget h4 {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.sidebar-widget ul {
  list-style: none;
}

.sidebar-widget li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.sidebar-widget li:last-child {
  border-bottom: none;
}

.sidebar-widget li a {
  font-size: 0.875rem;
  color: var(--text-light);
}

.sidebar-widget li a:hover {
  color: var(--primary);
}

/* ========== ARTICLE PAGE ========== */
.article-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.article-header .card-category {
  margin-bottom: 1rem;
}

.article-header h1 {
  font-size: 2.25rem;
  max-width: 700px;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.article-meta img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
}

.article-content {
  max-width: 720px;
  font-size: 1.05rem;
  line-height: 1.8;
}

.article-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}

.article-content p {
  margin-bottom: 1.25rem;
  color: var(--text);
}

.article-content ul, .article-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.article-content li {
  margin-bottom: 0.5rem;
}

.article-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--bg-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-light);
}

.article-content .info-box {
  background: rgba(15,76,92,0.05);
  border: 1px solid rgba(15,76,92,0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.article-content .info-box h4 {
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* Affiliate Callout */
.affiliate-box {
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
}

.affiliate-box .badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: block;
}

/* In-article ad */
.ad-inline {
  background: var(--bg-light);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ========== ABOUT PAGE ========== */
.page-header {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 2.25rem;
}

.page-header p {
  color: var(--text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin-top: 0.5rem;
}

.page-content {
  padding: 3rem 0;
  max-width: 720px;
}

.page-content h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.page-content p {
  margin-bottom: 1.25rem;
  color: var(--text);
  line-height: 1.8;
}

/* ========== FOOTER ========== */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-brand .logo {
  color: #fff;
  margin-bottom: 1rem;
  display: block;
}

.footer-brand p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
}

.footer-col h4 {
  color: #fff;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  transition: color 0.2s;
}

.footer-col a:hover {
  color: #fff;
}

.footer-social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  font-weight: 600;
}

.footer-social a:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

.footer-bottom a {
  color: rgba(255,255,255,0.5);
}

.footer-bottom a:hover {
  color: #fff;
}

.footer-legal {
  display: flex;
  gap: 1.5rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .content-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  html { font-size: 15px; }

  .hero { padding: 3rem 0; }
  .hero h1 { font-size: 2rem; }

  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }

  .featured-card {
    grid-template-columns: 1fr;
  }

  .featured-card .card-image {
    min-height: 200px;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .header-top {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-list {
    padding: 0 1rem;
  }

  .section { padding: 2.5rem 0; }

  .article-header h1 { font-size: 1.75rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.75rem; }
  .container { padding: 0 1rem; }
}

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }

/* ========== NEWS BRIEF (homepage) ========== */
.news-brief {
  background: linear-gradient(180deg, #f5fafc 0%, var(--bg) 100%);
  border-top: 4px solid var(--accent);
  padding: 2.5rem 0 3rem;
}
.news-brief .section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.news-brief h2 {
  margin: 0;
  font-size: 1.75rem;
  color: var(--primary-dark);
}
.news-stamp {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}
.news-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s, transform 0.2s;
}
.news-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.news-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--accent-light);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
  align-self: flex-start;
}
.news-item h3 {
  font-size: 1rem;
  line-height: 1.35;
  margin: 0 0 0.5rem;
  color: var(--text);
}
.news-item p {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  flex: 1;
}
.news-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ========== UPDATE BOX (article pages) ========== */
.update-box {
  background: #fff8e7;
  border: 1px solid var(--accent);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem 1rem;
  margin: 1.5rem 0 2rem;
  box-shadow: var(--shadow-sm);
}
.update-stamp {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--accent-light);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.6rem;
}
.update-box h4 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--primary-dark);
}
.update-box p {
  margin-bottom: 0;
  font-size: 0.92rem;
  color: var(--text);
}
