/* Unified stylesheet for PsycheBloom Blog */

:root {
  --primary-color: #2D6A4F;
  --primary-hover: #1B4332;
  --accent-color: #52B788;
  --light-color: #B7E4C7;
  --white: #FFFFFF;
  --background: #F8FAF9;
  --text-main: #1B1B1B;
  --text-secondary: #4A4A4A;
  --border-color: #D8F3DC;
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition: all 0.3s ease;
  --max-width: 1100px;
}

/* Base resets & typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background-color: var(--background);
  scroll-behavior: smooth;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
}

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

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

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

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

/* Header & Sticky Navigation */
.main-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: transparent;
  transition: background-color 0.3s, box-shadow 0.3s;
}

.main-header.scrolled {
  background-color: var(--white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

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

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

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

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  font-weight: 600;
  color: var(--text-main);
  position: relative;
  padding: 0.5rem 0;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary-color);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent-color);
  transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 5px 0;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
  padding: 4rem 0 3rem 0;
  text-align: center;
  border-bottom: 2px solid var(--border-color);
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Category Navigation (Homepage) */
.category-nav-bar {
  background-color: var(--white);
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.category-list {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  list-style: none;
}

.category-btn {
  background-color: var(--background);
  color: var(--text-secondary);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  cursor: pointer;
}

.category-btn:hover, .category-btn.active {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

/* Main Grid Layout */
.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 992px) {
  .main-layout.has-sidebar {
    grid-template-columns: 2fr 1fr;
  }
}

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

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

/* Article Card */
.article-card {
  background-color: var(--white);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05);
}

.card-img-wrapper {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.card-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  transition: var(--transition);
}

.article-card:hover .card-img-wrapper img {
  transform: scale(1.05);
}

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

.category-badge {
  background-color: var(--light-color);
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  align-self: flex-start;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.card-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

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

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

/* Ad Unit styling */
.ad-unit {
  min-height: 90px;
  background-color: #F0F2F1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  margin: 2rem auto;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border: 1px dashed var(--light-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: 100%;
}

.ad-unit::before {
  content: attr(aria-label);
}

.ad-leaderboard {
  min-height: 90px;
  max-width: 728px;
}

.ad-in-article {
  min-height: 280px;
  max-width: 336px;
}

.ad-sidebar {
  min-height: 250px;
  max-width: 300px;
  position: sticky;
  top: 90px;
}

.ad-footer {
  min-height: 90px;
  max-width: 728px;
}

/* Article Template specific styles */
.article-header {
  margin: 2rem 0;
  text-align: center;
}

.article-header .category-badge {
  align-self: center;
  display: inline-block;
  margin-bottom: 1rem;
}

.article-title {
  font-size: 2.25rem;
  margin-bottom: 1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.article-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.article-hero-wrapper {
  margin-bottom: 2.5rem;
  aspect-ratio: 21/9;
  overflow: hidden;
  border-radius: 8px;
}

.article-hero-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.article-wrapper {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 992px) {
  .article-wrapper {
    grid-template-columns: 2.5fr 1fr;
  }
}

.article-body {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-main);
}

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

.article-body h2 {
  font-size: 1.75rem;
  margin: 2.5rem 0 1.25rem 0;
}

.article-body h3 {
  font-size: 1.35rem;
  margin: 2rem 0 1rem 0;
}

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

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

/* Sidebar Box styling */
.sidebar-box {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.sidebar-box-title {
  font-size: 1.15rem;
  border-bottom: 2px solid var(--light-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

/* Table of Contents */
.toc-list {
  list-style: none;
  font-size: 0.95rem;
}

.toc-list li {
  margin-bottom: 0.75rem;
}

.toc-link {
  color: var(--text-secondary);
  display: block;
}

.toc-link:hover {
  color: var(--primary-color);
  padding-left: 5px;
}

/* Author Bio box */
.author-bio-box {
  display: flex;
  gap: 1.5rem;
  background-color: #E8F5E9;
  border-radius: 8px;
  padding: 2rem;
  margin: 3rem 0;
  border: 1px solid var(--light-color);
}

.author-bio-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid var(--white);
}

.author-bio-details h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.author-bio-details p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Social Share component */
.share-buttons-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.share-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--primary-color);
  text-transform: uppercase;
}

.share-btn {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.share-btn:hover {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.share-btn.native-share {
  background-color: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

.share-btn.native-share:hover {
  background-color: var(--primary-hover);
}

/* Related articles section */
.related-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

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

/* Forms styling (Contact Page) */
.contact-wrapper {
  max-width: 600px;
  margin: 0 auto;
  background-color: var(--white);
  padding: 2.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  background-color: var(--background);
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-main);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1);
}

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

.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
  text-align: center;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  color: var(--white);
}

/* Privacy Policy / Standard Content Pages */
.standard-content {
  background-color: var(--white);
  padding: 3rem 2rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 3rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.standard-content h1 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
}

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

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

.standard-content ul {
  margin-bottom: 1.25rem;
  padding-left: 2rem;
}

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

/* 404 Page Styling */
.error-page-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.5rem;
  flex-grow: 1;
}

.error-code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 1.5rem;
  letter-spacing: -0.05em;
}

.error-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.error-text {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 2rem;
}

/* Footer Section */
.main-footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 4rem 0 2rem 0;
  margin-top: auto;
}

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

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

.footer-widget h3 {
  color: var(--light-color);
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-widget h3::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 40px;
  height: 2px;
  background-color: var(--accent-color);
}

.footer-about p {
  color: #E8F5E9;
  font-size: 0.95rem;
  line-height: 1.7;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #E8F5E9;
  font-size: 0.95rem;
}

.footer-links a:hover {
  color: var(--accent-color);
  padding-left: 5px;
}

.footer-contact p {
  color: #E8F5E9;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: #C8E6C9;
}

/* Accessibility Focus States */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 3px solid var(--accent-color);
  outline-offset: 2px;
}

/* Mobile Nav adjustments */
@media (max-width: 767px) {
  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background-color: var(--white);
    flex-direction: column;
    align-items: center;
    padding: 3rem 1.5rem;
    gap: 2rem;
    transition: var(--transition);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
  }

  .nav-menu.open {
    left: 0;
  }

  .nav-toggle {
    display: block;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}
