/*
* Karen's Wellness Notes - Main Stylesheet
* A clean, minimalist design with earth tone colors
*/

/* Global styles and variables */
:root {
  /* Earth tone color palette */
  --primary-color: #6b8e23;        /* Olive green */
  --primary-light: #a2b76b;        /* Light olive */
  --secondary-color: #8b4513;      /* Saddle brown */
  --tertiary-color: #d2b48c;       /* Tan */
  --background-color: #faf9f7;     /* Off-white */
  --text-color: #333333;           /* Dark gray */
  --light-text: #6c6c6c;           /* Medium gray */
  --accent-color: #d8ae5e;         /* Muted gold */
  --error-color: #b7410e;          /* Rust red */
  --success-color: #2e8b57;        /* Sea green */
  --border-color: #e6e2dd;         /* Light beige */
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

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

body {
  font-family: 'Lato', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
}

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

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'Merriweather', Georgia, 'Times New Roman', Times, serif;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--secondary-color);
}

h1 {
  font-size: 2.5rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.75rem;
}

h4 {
  font-size: 1.5rem;
}

p {
  margin-bottom: 1.2rem;
}

ul, ol {
  margin-left: 2rem;
  margin-bottom: 1.2rem;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin-right: -15px;
  margin-left: -15px;
}

/* Utility Classes */
.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-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.py-4 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.py-5 {
  padding-top: 1rem !important;
  padding-bottom: 3rem;
}

.btn {
  display: inline-block;
  font-weight: 400;
  color: #ffffff;
  text-align: center;
  vertical-align: middle;
  border: 1px solid transparent;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 0.25rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

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

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

.btn-secondary {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

.btn-secondary:hover {
  background-color: #c09b4e;
  border-color: #c09b4e;
  color: white;
}

.btn-block {
  display: block;
  width: 100%;
}

/* Alert/Flash Messages */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
  border-radius: 0.25rem;
}

.alert-success {
  background-color: rgba(46, 139, 87, 0.1);
  border-color: var(--success-color);
  color: var(--success-color);
}

.alert-danger {
  background-color: rgba(183, 65, 14, 0.1);
  border-color: var(--error-color);
  color: var(--error-color);
}

/* Form styling */
.form-group {
  margin-bottom: 1rem;
}

.form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-color);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(107, 142, 35, 0.25);
}

label {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--secondary-color);
}

textarea.form-control {
  height: auto;
  min-height: 100px;
}

/* Header & Navigation */
.site-header {
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.navbar-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

.navbar-brand span {
  color: var(--secondary-color);
}

.site-title-heading {
  margin: 0; 
  font-family: 'Playfair Display', serif; 
  font-size: 2rem; 
  font-weight: 700; 
  color: var(--primary-color);
}

.navbar-nav {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item {
  margin-left: 1.5rem;
}

.nav-link {
  color: var(--text-color);
  font-weight: 500;
}

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

.nav-link.active {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
}

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

/* Search form */
.search-form {
  margin-left: 1rem;
}

.search-input {
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  font-size: 0.9rem;
  width: 150px;
  transition: width 0.3s ease;
}

.search-input:focus {
  width: 200px;
  outline: none;
  border-color: var(--primary-color);
}

/* Hero section */
.hero {
  background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://pixabay.com/get/g2a67e19d0e5038688f7741b43b6a904fc1578f4c6a092eb4db811f6a2b7c6b1604476d5a20e8b61bcfabe1d474695c015cc09b3db04cdf43607ee886c288f94c_1280.jpg');
  background-size: cover;
  background-position: center;
  color: white;
  padding: 5rem 0;
  margin-bottom: 3rem;
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  color: white;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

/* Featured Posts */
.featured-posts {
  margin-bottom: 3rem;
}

.featured-title {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}

.featured-title:after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 0.5rem auto 0;
}

/* Removed featured-cards flexbox that was interfering with Bootstrap grid */

/* Post Cards */
.post-card {
  background-color: white;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: var(--box-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  margin-bottom: 2rem;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.post-card-img {
  height: 200px;
  overflow: hidden;
}

.post-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.post-card-content {
  padding: 1.5rem;
}

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

.post-card-excerpt {
  color: var(--light-text);
  margin-bottom: 1rem;
}

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

.post-categories {
  margin-bottom: 0.75rem;
}

.post-category {
  display: inline-block;
  background-color: var(--primary-light);
  color: white;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.5rem;
}

/* Post card without image styling */
.post-card-no-image {
  background: var(--bg-color);
  border: 2px solid var(--border-color);
  position: relative;
}

.post-card-no-image .post-card-content {
  padding: 2rem 1.5rem;
}

/* Image admin controls for post detail view */
.image-admin-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  padding: 8px;
  border-radius: 5px;
  opacity: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.image-admin-controls .btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
}

.image-admin-controls .btn-outline-primary {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.image-admin-controls .btn-outline-primary:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.image-admin-controls .btn-outline-danger {
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.image-admin-controls .btn-outline-danger:hover {
  background-color: #dc3545;
  border-color: #dc3545;
  color: white;
}

/* Admin form remove image button - always visible */
#remove-image-btn {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Blog post content */
.post-header {
  margin-bottom: 2rem;
}

.post-featured-img {
  margin-bottom: 2rem;
  border-radius: 0.5rem;
  overflow: hidden;
}

.post-featured-img img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.post-meta {
  color: var(--light-text);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.post-content {
  margin-bottom: 2rem;
}

.post-content a {
  color: #1a73e8;
  text-decoration: underline;
}

.post-content a:hover {
  text-decoration: none;
}

.post-content img {
  margin: 1.5rem 0;
  border-radius: 0.5rem;
}

.post-content h2, .post-content h3 {
  margin-top: 2rem;
}

.post-content ul, .post-content ol {
  margin-left: 2rem;
  margin-bottom: 1.5rem;
}

.post-content blockquote {
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 4px solid var(--primary-color);
  background-color: rgba(107, 142, 35, 0.05);
  font-style: italic;
}

/* Comments section */
.comments-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.comment {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--box-shadow);
}

.comment-meta {
  margin-bottom: 0.75rem;
  display: flex;
  justify-content: space-between;
}

.comment-author {
  font-weight: 600;
  color: var(--secondary-color);
}

.comment-date {
  font-size: 0.875rem;
  color: var(--light-text);
}

/* Sidebar */
.sidebar {
  background-color: white;
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--box-shadow);
  margin-bottom: 2rem;
}

.sidebar-title {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.5rem;
}

.sidebar-categories, .sidebar-posts {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

.sidebar-categories li:last-child, .sidebar-posts li:last-child {
  border-bottom: none;
}

/* Subscription form */
.subscription-section {
  background-color: #e8f5e9;
}

.subscription-form {
  background-color: transparent;
  padding: 2rem;
  border-radius: 0.5rem;
  text-align: center;
  margin-bottom: 3rem;
}

.subscription-form h3 {
  margin-bottom: 1rem;
}

.subscription-form p {
  margin-bottom: 1.5rem;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.form-inline .form-control {
  flex: 1;
  min-width: 200px;
}

/* About Page */
.about-section {
  margin-bottom: 3rem;
}

.about-image {
  border-radius: 50%;
  width: 300px;
  height: 300px;
  object-fit: cover;
  margin: 0 auto 2rem;
  display: block;
}

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

/* Contact Page */
.contact-info {
  margin-bottom: 2rem;
}

.contact-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* Missing Image Styles */
.post-featured-img-missing {
  background-color: #fff3cd;
  border: 1px solid #ffecb5;
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-bottom: 2rem;
  text-align: center;
}

.post-featured-img-missing p {
  margin-bottom: 1rem;
  color: #856404;
}

.post-featured-img-missing i {
  margin-right: 0.5rem;
}

/* Footer */
.site-footer {
  background-color: #333;
  color: white;
  padding: 3rem 0 1.5rem;
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.footer-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

.footer-title {
  color: white;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

.footer-links a {
  color: #ccc;
}

.footer-links a:hover {
  color: white;
}

.social-links {
  margin-top: 1rem;
}

.social-links a {
  display: inline-block;
  margin-right: 1rem;
  color: white;
  font-size: 1.25rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Admin Dashboard */
.admin-dashboard {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: var(--tertiary-color);
  padding: 1.5rem;
  border-radius: 0.5rem;
  text-align: center;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--secondary-color);
}

.stat-label {
  color: var(--text-color);
  font-weight: 600;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.admin-table th {
  background-color: var(--primary-light);
  color: white;
}

.admin-table tr:hover {
  background-color: rgba(107, 142, 35, 0.05);
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.btn-edit {
  background-color: var(--accent-color);
  color: white;
}

.btn-delete {
  background-color: var(--error-color);
  color: white;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 2rem 0;
  padding: 0;
}

.page-item {
  margin: 0 0.25rem;
}

.page-link {
  display: block;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  color: var(--primary-color);
}

.page-link:hover {
  background-color: var(--primary-light);
  color: white;
}

.page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.page-item.disabled .page-link {
  color: var(--light-text);
  pointer-events: none;
}

/* Responsive design */
@media (max-width: 992px) {
  .footer-section {
    width: calc(50% - 1rem);
  }
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
  
  .navbar-brand {
    font-size: 1.2rem;
  }
  
  .site-header .text-center .site-title .site-title-heading,
  .site-header .site-title-heading,
  .site-header h1.site-title-heading {
    font-size: 1.4rem !important;
  }
  
  .navbar-nav {
    flex-direction: column;
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
  }
  
  .navbar-nav.show {
    max-height: 300px;
  }
  
  .nav-item {
    margin: 0.5rem 0;
    margin-left: 0;
  }
  
  .hero h1 {
    font-size: 2.5rem;
  }
  
  .post-card {
    width: 100%;
  }
  
  .form-inline {
    flex-direction: column;
  }
  
  .footer-section {
    width: 100%;
  }
}

@media (max-width: 576px) {
  h1 {
    font-size: 1.5rem !important;
  }
  
  h2 {
    font-size: 1.7rem;
  }
  
  .hero {
    padding: 3rem 0;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .search-input:focus {
    width: 150px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Accessibility */
:focus {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Print styles */
@media print {
  .site-header, .site-footer, .subscription-form, .comments-form {
    display: none;
  }
  
  body {
    background-color: white;
    color: black;
    font-size: 12pt;
  }
  
  .container {
    width: 100%;
    max-width: 100%;
  }
  
  a:after {
    content: " (" attr(href) ")";
    font-size: 90%;
  }
}
