/* CSS Design System for Smart Consumer Savings website */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&display=swap');

:root {
  /* Color Palette */
  --primary-color: #0f172a;       /* Deep Navy */
  --primary-light: #1e293b;
  --secondary-color: #0284c7;     /* Soft Blue */
  --accent-color: #0f766e;        /* Deep Forest Green/Teal */
  --accent-light: #f0fdf4;
  --text-dark: #1e293b;           /* Slate */
  --text-light: #64748b;          /* Soft Slate */
  --text-white: #ffffff;
  --bg-light: #f8fafc;            /* Cool Light Gray */
  --bg-white: #ffffff;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --success-color: #16a34a;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Merriweather', Georgia, Cambria, "Times New Roman", Times, serif;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Layout */
  --container-max-width: 1200px;
  --article-max-width: 720px;
}

/* Base Styles & Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text-dark);
  background-color: var(--bg-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

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

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

/* Header & Navigation */
header {
  background-color: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* Navigation Links */
.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-dark);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

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

/* Hamburger Menu button */
.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
}

.hamburger span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* Main Layout */
.main-container {
  max-width: var(--container-max-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

/* Grid Layout for sidebar */
@media (min-width: 1024px) {
  .main-container.with-sidebar {
    grid-template-columns: 2.5fr 1fr;
  }
}

/* Reading Progress Bar */
.progress-container {
  width: 100%;
  height: 4px;
  background-color: var(--border-color);
  position: sticky;
  top: 61px;
  left: 0;
  z-index: 99;
}

.progress-bar {
  height: 4px;
  background-color: var(--accent-color);
  width: 0%;
  transition: width 0.1s ease;
}

/* Homepage Hero */
.hero-section {
  background-color: var(--primary-color);
  color: var(--text-white);
  padding: 4rem 2rem;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(2, 132, 199, 0.15) 0%, transparent 80%);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-tag {
  background-color: var(--accent-color);
  color: var(--text-white);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 1rem;
}

.hero-section h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero-section p {
  font-size: 1.2rem;
  color: #cbd5e1;
  margin-bottom: 2rem;
  font-family: var(--font-serif);
}

/* Article Page Styling */
.article-header {
  margin-bottom: 2rem;
}

.article-category {
  color: var(--accent-color);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
}

.article-title {
  font-family: var(--font-serif);
  font-size: 2.5rem;
  color: var(--primary-color);
  line-height: 1.25;
  margin-bottom: 1rem;
  font-weight: 700;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
}

.author-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background-color: #cbd5e1;
}

.article-intro {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--primary-light);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-weight: 300;
}

.article-hero-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Article Body */
.article-content {
  font-family: var(--font-serif);
  font-size: 1.15rem; /* 18.4px roughly, optimal for readability */
  line-height: 1.75;
  color: #334155;
}

.article-content p {
  margin-bottom: 1.5rem;
}

.article-content h2 {
  font-family: var(--font-sans);
  font-size: 1.6rem;
  color: var(--primary-color);
  margin: 2.5rem 0 1rem 0;
  font-weight: 700;
}

.article-content h3 {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  color: var(--primary-light);
  margin: 2rem 0 1rem 0;
  font-weight: 600;
}

/* Feature/Highlight box */
.highlight-box {
  background-color: var(--bg-light);
  border-left: 4px solid var(--accent-color);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 0 8px 8px 0;
}

.highlight-box p {
  margin-bottom: 0;
  font-style: italic;
  color: var(--primary-light);
}

.tip-box {
  background-color: var(--accent-light);
  border: 1px solid #dcfce7;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.tip-box-title {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Keep Reading Box */
.keep-reading-box {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.keep-reading-image {
  width: 100px;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
}

.keep-reading-content {
  flex: 1;
}

.keep-reading-tag {
  color: var(--accent-color);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  display: block;
}

.keep-reading-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* Sidebar Styling */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-widget {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* Popular list widget */
.popular-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  list-style: none;
}

.popular-item {
  display: flex;
  gap: 0.75rem;
}

.popular-num {
  font-size: 1.5rem;
  font-weight: 800;
  color: #cbd5e1;
  line-height: 1;
  width: 24px;
}

.popular-text a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

.popular-text a:hover {
  color: var(--accent-color);
}

/* Newsletter Widget */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.newsletter-form p {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.newsletter-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.newsletter-button {
  background-color: var(--accent-color);
  color: var(--text-white);
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: var(--font-sans);
}

.newsletter-button:hover {
  background-color: var(--primary-color);
}

/* Grid Layout for Articles (Homepage) */
.section-title {
  font-size: 1.75rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

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

@media (min-width: 768px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .articles-grid.triple {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

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

.card-image {
  width: 100%;
  aspect-ratio: 16/10;
  object-fit: cover;
}

.card-content {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-category {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.card-title {
  font-size: 1.15rem;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
  line-height: 1.4;
  font-weight: 700;
}

.card-excerpt {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
  flex: 1;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
}

/* Footer styling */
footer {
  background-color: var(--primary-color);
  color: #cbd5e1;
  padding: 3rem 1.5rem 1.5rem 1.5rem;
  margin-top: 4rem;
  border-top: 4px solid var(--accent-color);
}

.footer-container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-container {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-info h3 {
  color: var(--text-white);
  font-size: 1.3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.footer-info p {
  font-size: 0.9rem;
  margin-bottom: 1rem;
  max-width: 400px;
}

.footer-links h4 {
  color: var(--text-white);
  font-size: 1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-links ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--text-white);
}

.footer-bottom {
  max-width: var(--container-max-width);
  margin: 2rem auto 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--primary-light);
  font-size: 0.8rem;
  text-align: center;
  color: #94a3b8;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-disclosure {
  text-align: justify;
  font-size: 0.75rem;
  line-height: 1.5;
  color: #64748b;
  margin-bottom: 1rem;
}

/* Mobile Nav Drawer styling */
@media (max-width: 767px) {
  .hamburger {
    display: block;
  }
  
  .nav-links {
    position: fixed;
    top: 61px;
    left: -100%;
    width: 80%;
    max-width: 300px;
    height: calc(100vh - 61px);
    background-color: var(--bg-white);
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-lg);
    transition: left 0.3s ease;
    border-right: 1px solid var(--border-color);
  }

  .nav-links.active {
    left: 0;
  }

  .hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
  }

  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}

/* Page Banner/Standard Page Styling */
.page-container {
  max-width: var(--article-max-width);
  margin: 3rem auto;
  padding: 0 1.5rem;
  background-color: var(--bg-white);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow-sm);
}

.page-title {
  font-family: var(--font-sans);
  font-size: 2.2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.page-content {
  font-size: 1.05rem;
  line-height: 1.7;
}

.page-content p {
  margin-bottom: 1.25rem;
}

.page-content h2 {
  font-size: 1.4rem;
  color: var(--primary-color);
  margin: 2rem 0 1rem 0;
  font-weight: 700;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-weight: 600;
  font-size: 0.95rem;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.form-textarea {
  min-height: 150px;
  resize: vertical;
}

.form-button {
  background-color: var(--accent-color);
  color: var(--text-white);
  border: none;
  padding: 0.9rem;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: var(--font-sans);
  margin-top: 0.5rem;
  align-self: flex-start;
}

.form-button:hover {
  background-color: var(--primary-color);
}
