/* Reset & Base Styles */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --bg-color: #ffffff;
  --text-color: #1e293b;
  --text-muted: #64748b;
  --accent: #0f766e; /* Curated teal */
  --accent-light: #f0fdfa;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --max-width-article: 780px;
  --max-width-listing: 1100px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  color: #0f172a;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1.5em;
  margin-bottom: 0.5em;
}

h1 {
  font-size: 2.25rem;
  letter-spacing: -0.025em;
  margin-top: 0;
}

h2 {
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}

h3 {
  font-size: 1.25rem;
}

p, ul, ol {
  margin-bottom: 1.25rem;
}

ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.5rem;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

/* Layout Wrapper */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-listing {
  max-width: var(--max-width-listing);
}

.container-article {
  max-width: var(--max-width-article);
}

/* Header & Nav */
.header {
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-color);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1.25rem 0;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-link {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.03em;
}

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

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  align-items: center;
}

.nav-links a {
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 3rem 0;
  background-color: #f8fafc;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
}

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

.footer-disclaimer {
  line-height: 1.6;
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
}

/* Homepage Hero */
.hero {
  padding: 5rem 0;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 1.25rem;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.cta-button {
  display: inline-block;
  background-color: var(--accent);
  color: #fff;
  padding: 0.75rem 1.75rem;
  border-radius: 6px;
  font-weight: 600;
  transition: background-color 0.2s ease;
}

.cta-button:hover {
  background-color: #0d645e;
  text-decoration: none;
  color: #fff;
}

/* Sections */
.section {
  padding: 4rem 0;
}

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

.section-title a {
  font-size: 1rem;
  font-weight: 500;
}

/* Post Cards */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.post-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.post-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.75rem;
}

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

.post-card h3 {
  font-size: 1.25rem;
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}

.post-card h3 a {
  color: #0f172a;
}

.post-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.post-card-readmore {
  font-weight: 600;
  font-size: 0.875rem;
}

/* Categories Grid on Homepage */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.category-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  background-color: var(--accent-light);
  text-align: center;
  font-weight: 600;
  color: var(--accent);
  transition: all 0.2s ease;
}

.category-card:hover {
  background-color: #e0f2fe;
  text-decoration: none;
}

/* Articles layout */
.article-header {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 2rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1rem;
}

/* Table of Contents */
.toc {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.toc h2 {
  font-size: 1.15rem;
  margin-top: 0;
  border: none;
  padding: 0;
}

.toc ul {
  list-style-type: none;
  padding-left: 0;
  margin-bottom: 0;
}

.toc li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

/* Ad Slot */
.ad-slot {
  background-color: #f8fafc;
  border: 1px dashed #cbd5e1;
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-radius: 6px;
  margin: 2.5rem 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* In-article ad */
.ad-slot-in-content {
  margin: 3rem 0;
}

/* Page styles */
.page-header {
  margin-bottom: 2.5rem;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  list-style: none;
  padding-left: 0;
}

.pagination-item {
  display: flex;
}

.pagination-item a {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background-color: #fff;
  color: var(--text-color);
  font-weight: 500;
}

.pagination-item a:hover {
  background-color: var(--accent-light);
  color: var(--accent);
  text-decoration: none;
}

.pagination-item.active a {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.breadcrumbs a {
  color: var(--text-muted);
}

.breadcrumbs span {
  margin: 0 0.5rem;
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #0f172a;
  color: #fff;
  padding: 1rem 1.5rem;
  z-index: 100;
  font-size: 0.9rem;
  box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.1);
  display: none;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.cookie-banner.visible {
  display: flex;
}

.cookie-banner-btn {
  background-color: var(--accent);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}

.cookie-banner-btn:hover {
  background-color: #0d645e;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 500px;
}

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

.form-group label {
  font-weight: 500;
  color: #0f172a;
}

.form-group input,
.form-group textarea {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-color);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.form-submit-btn {
  background-color: var(--accent);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  transition: background-color 0.2s ease;
}

.form-submit-btn:hover {
  background-color: #0d645e;
}

/* Related Posts */
.related-posts {
  border-top: 1px solid var(--border-color);
  padding-top: 3rem;
  margin-top: 4rem;
}

.related-posts h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

/* Article Content Styles */

.article-content {
  font-size: 1.0625rem;
  line-height: 1.8;
}

.article-content h2 { margin-top: 2.5rem; }
.article-content h3 { margin-top: 2rem; }

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

.article-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

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

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

/* Tables */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin: 2rem 0;
}

.article-content th {
  padding: 0.6rem 0.875rem;
  text-align: left;
  font-weight: 600;
  background-color: #f1f5f9;
  border-bottom: 2px solid var(--border-color);
}

.article-content td {
  padding: 0.6rem 0.875rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

/* Blockquotes — warning/tip callouts */
.article-content blockquote {
  border-left: 3px solid #f59e0b;
  padding: 0.75rem 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.article-content blockquote p { margin: 0; }

/* Inline code */
.article-content code {
  background-color: #f1f5f9;
  border-radius: 4px;
  padding: 0.1em 0.35em;
  font-size: 0.875em;
  font-family: 'Menlo', 'Consolas', monospace;
}

/* Links inside articles */
.article-content a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Table scroll on mobile */
@media (max-width: 600px) {
  .article-content table {
    display: block;
    overflow-x: auto;
  }
}

/* Mobile responsive menu */
@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-container {
    flex-wrap: wrap;
  }
  .hero h1 {
    font-size: 2.25rem;
  }
}

/* Author Bio Section */
.author-bio {
  display: flex;
  gap: 2rem;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin: 3.5rem 0;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.author-bio-avatar {
  background-color: var(--accent);
  color: #fff;
  width: 64px;
  height: 64px;
  min-width: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.author-bio-content h4 {
  font-size: 1.25rem;
  margin: 0 0 0.25rem 0;
  color: #0f172a;
}

.author-bio-title {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.author-bio-text {
  font-size: 0.95rem;
  color: var(--text-color);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.author-bio-disclaimer {
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px dashed var(--border-color);
  padding-top: 0.75rem;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .author-bio {
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
  }
}
