/* ===============================
   VARIABLES
   =============================== */
:root {
  --text-color: #333;
  --bg-color: #fff;
  --accent-color: #6000FF;
  --light-accent: #E8F0FE;
  --muted-color: #6C757D;
  --border-color: #EAEAEA;
  --header-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --body-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --code-font: "SF Mono", Monaco, Consolas, monospace;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --text-color: #e1e1e1;
    --bg-color: #121212;
    --accent-color: #4d9fff;
    --light-accent: #1e2b3d;
    --muted-color: #a0a0a0;
    --border-color: #2a2a2a;
  }
}

/* ===============================
   BASE STYLES
   =============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--body-font);
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-color);
  background-color: var(--bg-color);
  max-width: 100%;
  overflow-x: hidden;
}

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

/* ===============================
   LAYOUT
   =============================== */
.container {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
  box-sizing: border-box;
}

/* ===============================
   TYPOGRAPHY
   =============================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--header-font);
  line-height: 1.2;
  margin-bottom: 1rem;
}

/* ===============================
   LINKS - CONSOLIDATED STYLING
   =============================== */
/* Default link style */
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

a:hover {
  text-decoration: underline;
}

/* Navigation links */
nav a, .footer-navigation a {
  color: var(--text-color);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

nav a:hover, .footer-navigation a:hover {
  color: var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
  text-decoration: none;
}

/* Article card titles */
.card-title a {
  color: var(--text-color);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--accent-color);
  text-decoration: none;
}

/* Read more links */
.read-more {
  display: inline-block;
  color: var(--accent-color);
  font-weight: bold;
  text-decoration: none;
}

.read-more:hover {
  text-decoration: underline;
}

/* Support link */
.support-link {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: var(--accent-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  margin-top: 0.5rem;
}

.support-link:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* ===============================
   HEADER
   =============================== */
header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.site-logo {
  display: flex;
  align-items: center;
  font-family: var(--header-font);
  text-decoration: none;
  color: var(--text-color);
  font-weight: bold;
  font-size: 2rem;
  margin-bottom: 1rem;
}

.site-logo img {
  margin-right: 10px;
  height: 30px;
  width: auto;
}

.site-logo:hover {
  text-decoration: none;
}

.header-nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

nav {
  display: flex;
  gap: 1rem;
  font-family: var(--header-font);
  font-size: 0.9rem;
  flex: 1;
}

/* Search Container */
.search-container {
  flex-shrink: 0;
}

.search-container form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.search-container input[type="text"] {
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.85rem;
  font-family: var(--body-font);
  color: var(--text-color);
  background-color: var(--bg-color);
  min-width: 180px;
  transition: all 0.2s ease;
}

.search-container input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(96, 0, 255, 0.1);
}

.search-container button {
  padding: 0.6rem;
  background-color: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.search-container button:hover {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(96, 0, 255, 0.2);
}

.search-container button svg {
  display: block;
}

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

.article-card:last-child {
  border-bottom: none;
}

.card-title {
  font-family: var(--header-font);
  font-size: 2rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.card-meta {
  display: flex;
  gap: 1rem;
  color: var(--muted-color);
  font-family: var(--header-font);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  align-items: flex-start;
}

.card-meta a {
  color: var(--muted-color);
  text-decoration: none;
  transition: color 0.2s;
}

.card-meta a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.card-meta .date-time {
  min-width: 120px;
  line-height: 1.3;
  text-align: right;
  white-space: nowrap;
}

.card-excerpt {
  margin-bottom: 1rem;
}

.featured-image {
  max-width: 100%;
  height: auto;
  margin-bottom: 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: block;
}

.featured-image:hover {
  opacity: 0.9;
}

/* Image links should not have underlines */
a.image-link {
  text-decoration: none !important;
  border: none !important;
}

/* ===============================
   ARTICLE PAGE
   =============================== */
.article-header {
  margin-bottom: 2rem;
}

.article-title {
  font-family: var(--header-font);
  font-size: 2.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-weight: 800;
}

.article-meta {
  display: flex;
  gap: 1rem;
  color: var(--muted-color);
  font-family: var(--header-font);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.article-meta a {
  color: var(--muted-color);
  text-decoration: none;
  transition: color 0.2s;
}

.article-meta a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.image-caption {
  font-size: 0.9rem;
  color: var(--muted-color);
  margin-bottom: 2rem;
  line-height: 1.4;
  text-align: left;
}

.article-content {
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

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

.article-content h2 {
  font-family: var(--header-font);
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin: 1.5rem 0;
  cursor: pointer;
  transition: opacity 0.2s ease;
  display: block;
}

.article-content img:hover {
  opacity: 0.9;
}

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

.article-content figure {
  margin: 2rem 0;
}

.article-content figcaption {
  font-size: 0.9rem;
  color: var(--muted-color);
  margin-top: 0.5rem;
  line-height: 1.4;
  text-align: left;
}

/* ===============================
   BLOCKQUOTES
   =============================== */
blockquote {
  border-left: 4px solid var(--accent-color);
  margin: 2rem 0;
  padding: 1.5rem;
  padding-left: 2rem;
  font-style: italic;
  color: var(--text-color);
  background-color: var(--light-accent);
  border-radius: 0 8px 8px 0;
  position: relative;
}

blockquote p {
  margin: 0;
  line-height: 1.8;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* Ensure bold and italic formatting is visible inside blockquotes */
blockquote strong,
blockquote b {
  font-weight: 700;
  font-style: normal;  /* Override parent italic */
}

blockquote em,
blockquote i {
  font-style: italic;
  font-weight: normal;
}

/* For bold+italic combinations */
blockquote strong em,
blockquote strong i,
blockquote b em,
blockquote b i {
  font-weight: 700;
  font-style: italic;
}

/* Optional: Add quotation marks */
blockquote::before {
  content: '"';
  font-size: 3rem;
  position: absolute;
  left: 0.5rem;
  top: 0;
  color: var(--accent-color);
  opacity: 0.3;
  font-family: Georgia, serif;
}

/* ===============================
   BUTTONS
   =============================== */
.center-button {
  text-align: center;
  margin: 20px 0;
}

.red-button {
  display: inline-block;
  padding: 12px 24px;
  background: #D2281B;
  color: white;
  border-radius: 5px;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  border: none;
  transition: background 0.3s ease;
}

.red-button:hover {
  background: #B92016;
  text-decoration: none;
}

/* ===============================
   AUTHOR BIO
   =============================== */
.author-bio {
  display: flex;
  align-items: flex-start;
  margin-top: 2rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.author-avatar {
  flex-shrink: 0;
  margin-right: 1rem;
}

.author-avatar img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  font-family: var(--header-font);
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

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

.author-name a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

.author-description {
  font-size: 0.9rem;
  color: var(--text-color);
  margin: 0;
  line-height: 1.5;
}

/* ===============================
   RELATED ARTICLES
   =============================== */
.related-articles {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-articles h2 {
  font-family: var(--header-font);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

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

.related-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.related-date {
  font-size: 0.8rem;
  color: var(--muted-color);
}

/* ===============================
   FORM STYLES
   =============================== */
.form-container {
  text-align: center;
  margin: 20px auto;
  max-width: 400px;
  padding: 20px;
  background: var(--bg-color);
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

input[type="email"] {
  width: 80%;
  padding: 10px;
  margin: 10px 0;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 16px;
  background-color: var(--bg-color);
  color: var(--text-color);
}

input[type="submit"] {
  width: 85%;
  padding: 10px;
  background: #7601FF;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}

input[type="submit"]:hover {
  background: #3F0A7E;
}

/* ===============================
   FOOTER
   =============================== */
footer {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
  font-family: var(--header-font);
  font-size: 0.9rem;
  color: var(--muted-color);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-navigation {
  display: flex;
  gap: 1rem;
  font-family: var(--header-font);
  font-size: 0.9rem;
  justify-content: center;
  margin-top: 1rem;
}

.cc-license {
  font-size: 0.8em;
  text-align: center;
  margin-top: 10px;
  color: var(--muted-color);
}

.cc-license a {
  color: inherit;
  text-decoration: underline;
}

/* ===============================
   RESPONSIVE STYLES
   =============================== */
/* Medium screens and iPads */
@media (max-width: 768px) {
  .article-title {
    font-size: 2rem;
  }
  
  body {
    font-size: 17px;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
  
  .card-title {
    font-size: 1.75rem;
  }
  
  /* Ensure images never overflow on tablets */
  img {
    max-width: 100% !important;
    height: auto !important;
  }
  
  .article-content img,
  .featured-image {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
  }
}

/* Small screens */
@media (max-width: 480px) {
  .article-title {
    font-size: 1.75rem;
  }

  .article-meta, .card-meta {
    flex-direction: column;
    gap: 0.25rem;
  }

  body {
    font-size: 16px;
  }

  .container {
    padding: 0 15px;
  }

  .author-bio {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .author-avatar {
    margin-right: 0;
    margin-bottom: 1rem;
  }

  .site-logo {
    font-size: 1.75rem;
  }

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

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .search-container {
    width: 100%;
  }

  .search-container form {
    width: 100%;
  }

  .search-container input[type="text"] {
    flex: 1;
    min-width: 0;
  }
}

.article-navigation {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  flex-wrap: wrap;
}

.nav-block {
  max-width: 48%;
}

.nav-label {
  font-family: var(--header-font);
  font-size: 0.85rem;
  color: var(--muted-color);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-link {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--accent-color);
  text-decoration: none;
}

.nav-link:hover {
  text-decoration: underline;
}

/* ===============================
   EMBED STYLES
   =============================== */

/* Responsive YouTube embeds */
.embed-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  max-width: 100%;
  margin: 1.5rem 0;
  background: #000;
  border-radius: 8px;
}

.embed-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
}

/* Twitter embed styling */
.twitter-tweet {
  margin: 1.5rem auto !important;
  max-width: 550px;
}

/* Giphy embed styling */
.giphy-embed {
  margin: 1.5rem 0;
  text-align: center;
}

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

/* Ensure embeds are responsive on mobile */
@media (max-width: 768px) {
  .embed-container {
    margin: 1rem 0;
  }
  
  .twitter-tweet {
    margin: 1rem auto !important;
  }
  
  .giphy-embed {
    margin: 1rem 0;
  }
}

/* ===============================
   AUTHOR PAGE STYLES
   =============================== */
.author-header {
  text-align: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3rem;
}

.author-avatar-large {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  display: block;
}

.author-name {
  font-size: 2.5rem;
  margin: 0 0 1rem 0;
  color: var(--text-color);
}

.author-bio {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--muted-color);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

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

.social-links a {
  display: inline-block;
  margin: 0 0.5rem;
  color: var(--accent-color);
  text-decoration: none;
  font-size: 1rem;
}

.social-links a:hover {
  text-decoration: underline;
}

.articles-section h2 {
  font-size: 2rem;
  margin: 0 0 2rem 0;
  color: var(--text-color);
}

.author-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.author-article-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.author-article-item:last-child {
  border-bottom: none;
}

.author-article-thumbnail {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  overflow: hidden;
  border-radius: 8px;
  background: #f0f0f0;
}

.author-article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.author-article-item:hover .author-article-thumbnail img {
  transform: scale(1.05);
}

.author-article-content {
  flex: 1;
  min-width: 0;
}

.author-article-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.author-article-title a {
  color: var(--text-color);
  text-decoration: none;
}

.author-article-title a:hover {
  color: var(--accent-color);
}

.author-article-meta {
  color: var(--muted-color);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.author-article-summary {
  color: var(--text-color);
  line-height: 1.7;
  margin: 0;
}

/* ===============================
   CATEGORY PAGE STYLES
   =============================== */
.category-header {
  text-align: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3rem;
  position: relative;
}

.category-header-image {
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.category-icon {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--accent-color);
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: white;
}

.category-name {
  font-size: 2.5rem;
  margin: 0 0 1rem 0;
  color: var(--text-color);
}

.category-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--muted-color);
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.category-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-article-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.category-article-item:last-child {
  border-bottom: none;
}

.category-article-thumbnail {
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  overflow: hidden;
  border-radius: 8px;
  background: #f0f0f0;
}

.category-article-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.category-article-item:hover .category-article-thumbnail img {
  transform: scale(1.05);
}

.category-article-content {
  flex: 1;
  min-width: 0;
}

.category-article-title {
  font-size: 1.5rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

.category-article-title a {
  color: var(--text-color);
  text-decoration: none;
}

.category-article-title a:hover {
  color: var(--accent-color);
}

.category-article-meta {
  color: var(--muted-color);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.category-article-summary {
  color: var(--text-color);
  line-height: 1.7;
  margin: 0;
}

.no-articles {
  text-align: center;
  color: var(--muted-color);
  padding: 3rem 0;
  font-size: 1.1rem;
}

/* Mobile responsive for author and category pages */
@media (max-width: 768px) {
  .author-article-item,
  .category-article-item {
    flex-direction: column;
  }
  
  .author-article-thumbnail,
  .category-article-thumbnail {
    width: 100%;
    height: 200px;
  }
}

/* ===============================
   PAGINATION STYLES
   =============================== */
.pagination {
  margin-top: 3rem;
  text-align: center;
  padding: 2rem 0;
  border-top: 1px solid #eee;
}

.pagination-info {
  margin-bottom: 1rem;
  color: #666;
}

.pagination-nav {
  display: flex;
  justify-content: center;
  gap: 2rem;
  align-items: center;
}

.pagination-link {
  text-decoration: none;
  color: #0066cc;
  font-weight: 500;
}

.pagination-link:hover {
  text-decoration: underline;
}

.pagination-disabled {
  color: #ccc;
}

.pagination-separator {
  color: #666;
}

/* ===============================
   UTILITY STYLES
   =============================== */
.logo-image {
  margin-right: 10px;
  height: 30px;
  width: auto;
}

.cc-license {
  font-size: 0.8em;
  text-align: center;
  margin-top: 10px;
}

.placeholder-avatar {
  width: 150px;
  height: 150px;
  background: #ddd;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
}

.placeholder-avatar-small {
  width: 100px;
  height: 100px;
  background: #ddd;
  border-radius: 50%;
  margin: 0 auto 1.5rem;
}

/* ===============================
   ARTICLE NAVIGATION STYLES
   =============================== */
.article-navigation {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  gap: 2rem;
}

.nav-block {
  flex: 1;
  max-width: 50%;
}

.prev-article {
  text-align: left;
}

.next-article {
  text-align: right;
}

.nav-label {
  font-size: 0.9rem;
  color: var(--muted-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.nav-link {
  display: inline-block;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  line-height: 1.4;
}

.nav-link:hover {
  text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .article-navigation {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .nav-block {
    max-width: 100%;
  }
  
  .next-article {
    text-align: left;
  }
}

/* ===============================
   AUTHORS LIST PAGE STYLES
   =============================== */
.page-header {
  text-align: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 3rem;
}

.page-title {
  font-size: 2.5rem;
  margin: 0 0 1rem 0;
  color: var(--text-color);
}

.page-description {
  font-size: 1.2rem;
  color: var(--muted-color);
}

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

.author-card {
  background: var(--bg-color);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.author-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.author-card .author-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  display: block;
}

.author-card .author-name {
  font-size: 1.5rem;
  margin: 0 0 0.75rem 0;
}

.author-card .author-name a {
  color: var(--text-color);
  text-decoration: none;
}

.author-card .author-name a:hover {
  color: var(--accent-color);
}

.author-card .author-bio {
  color: var(--muted-color);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.author-stats {
  color: var(--muted-color);
  font-size: 0.9rem;
  margin: 0;
}

/* ===============================
   USER MANAGEMENT STYLES
   =============================== */

/* Login form */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--light-accent), var(--bg-color));
  padding: 2rem;
}

.login-form {
  background: var(--bg-color);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--border-color);
}

.login-form h1 {
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--accent-color);
  font-size: 2rem;
}

.login-subtitle {
  text-align: center;
  color: var(--muted-color);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.login-footer p {
  color: var(--muted-color);
  font-size: 0.9rem;
}

/* User management */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
}

.admin-nav {
  display: flex;
  gap: 1rem;
}

.admin-nav a {
  color: var(--accent-color);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.admin-nav a:hover {
  background-color: var(--light-accent);
}

/* User grid */
.users-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.user-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.user-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.user-card.user-inactive {
  opacity: 0.7;
  border-color: var(--muted-color);
}

.user-avatar {
  text-align: center;
  margin-bottom: 1rem;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-large {
  width: 100px;
  height: 100px;
}

.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.5rem;
  margin: 0 auto;
}

.avatar-placeholder.avatar-large {
  width: 100px;
  height: 100px;
  font-size: 2rem;
}

.user-info h3 {
  margin: 0 0 0.25rem 0;
  color: var(--text-color);
}

.user-username {
  color: var(--muted-color);
  font-size: 0.9rem;
  margin: 0 0 0.25rem 0;
}

.user-email {
  color: var(--muted-color);
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
}

.user-role {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.role-admin {
  background: #dc3545;
  color: white;
}

.role-editor {
  background: #fd7e14;
  color: white;
}

.role-author {
  background: #198754;
  color: white;
}

.role-past_author {
  background: var(--muted-color);
  color: white;
}

.user-meta {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.user-meta p {
  font-size: 0.8rem;
  color: var(--muted-color);
  margin: 0.25rem 0;
}

.user-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* User forms */
.user-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.form-section h2 {
  margin: 0 0 1.5rem 0;
  color: var(--accent-color);
  font-size: 1.3rem;
}

.form-help {
  color: var(--muted-color);
  font-style: italic;
  margin-bottom: 1rem;
}

.required {
  color: #dc3545;
}

.current-avatar {
  margin-bottom: 1rem;
}

/* Profile styles */
.user-profile {
  max-width: 800px;
  margin: 0 auto;
}

.profile-header {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 2rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.profile-avatar {
  flex-shrink: 0;
}

.profile-info {
  flex-grow: 1;
}

.profile-info h2 {
  margin: 0 0 0.5rem 0;
  font-size: 2rem;
}

.profile-username {
  color: var(--muted-color);
  font-size: 1.1rem;
  margin: 0 0 0.25rem 0;
}

.profile-email {
  color: var(--muted-color);
  margin: 0 0 1rem 0;
}

.profile-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.profile-section {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.profile-section h3 {
  margin: 0 0 1rem 0;
  color: var(--accent-color);
}

.user-bio {
  line-height: 1.6;
  color: var(--text-color);
}

.profile-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.detail-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-item label {
  font-weight: 600;
  color: var(--muted-color);
}

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 1rem;
}

.status-inactive {
  background: var(--muted-color);
  color: white;
}

/* Articles list in profile */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-item {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: background-color 0.2s;
}

.article-item:hover {
  background-color: var(--light-accent);
}

.article-item h4 {
  margin: 0 0 0.5rem 0;
}

.article-item h4 a {
  color: var(--text-color);
  text-decoration: none;
}

.article-item h4 a:hover {
  color: var(--accent-color);
}

.article-meta {
  display: flex;
  gap: 1rem;
  align-items: center;
  font-size: 0.9rem;
}

.article-status {
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-draft {
  background: #ffc107;
  color: #333;
}

.status-published {
  background: #198754;
  color: white;
}

.article-date {
  color: var(--muted-color);
}

/* Error pages */
.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.error-content {
  text-align: center;
  max-width: 500px;
}

.error-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

.error-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: var(--muted-color);
}

.error-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Button improvements */
.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.btn-success {
  background-color: #198754;
  color: white;
  border: 1px solid #198754;
}

.btn-success:hover {
  background-color: #157347;
  border-color: #146c43;
}

.btn-warning {
  background-color: #ffc107;
  color: #333;
  border: 1px solid #ffc107;
}

.btn-warning:hover {
  background-color: #e0a800;
  border-color: #d39e00;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
  border: 1px solid #dc3545;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #bd2130;
}

/* Content actions */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.content-actions {
  display: flex;
  gap: 1rem;
}

/* Flash messages improvements */
.flash-message {
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  border-left: 4px solid;
}

.flash-success {
  background-color: #d1edff;
  border-left-color: #198754;
  color: #0f5132;
}

.flash-error {
  background-color: #f8d7da;
  border-left-color: #dc3545;
  color: #721c24;
}

.flash-info {
  background-color: #d1ecf1;
  border-left-color: #0dcaf0;
  color: #055160;
}

/* User selector header updates */
.user-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.user-selector .user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-selector .user-actions {
  display: flex;
  gap: 0.5rem;
}

/* Responsive design for user management */
@media (max-width: 768px) {
  .user-selector {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .user-selector .user-actions {
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .profile-header {
    flex-direction: column;
    text-align: center;
  }
  
  .admin-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }
  
  .admin-nav {
    flex-wrap: wrap;
  }
  
  .users-grid {
    grid-template-columns: 1fr;
  }
  
  .user-actions {
    justify-content: center;
  }
  
  .profile-actions {
    justify-content: center;
  }
  
  .error-actions {
    flex-direction: column;
    align-items: center;
  }
}

/* ===============================
   IMAGE LIBRARY STYLES
   =============================== */

/* Tab navigation */
.image-tabs {
  display: flex;
  gap: 0;
  background: white;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  margin-top: 20px;
  box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.05);
}

.tab-button {
  flex: 1;
  padding: 12px 20px;
  background: #f5f5f5;
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  color: #666;
}

.tab-button:hover {
  background: #e9ecef;
}

.tab-button.active {
  background: white;
  border-bottom-color: #007bff;
  color: #007bff;
}

/* Tab content */
.tab-content {
  background: white;
  padding: 20px;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Library search */
.library-search input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.library-search input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Library grid */
#libraryGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  max-height: 500px;
  overflow-y: auto;
  padding: 4px;
}

/* Library item */
.library-item {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  background: white;
}

.library-item:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
  transform: translateY(-2px);
}

.library-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.library-item > div {
  padding: 12px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
}

.library-item p {
  margin: 0;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #495057;
}

/* Empty state */
#libraryEmpty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

#libraryEmpty p {
  font-size: 16px;
  margin: 0;
}

/* Scrollbar styling for library grid */
#libraryGrid::-webkit-scrollbar {
  width: 8px;
}

#libraryGrid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

/* Inline Images Section - Compact Layout */
.inline-image-container {
  display: flex;
  flex-direction: row;
  gap: 30px;
  align-items: flex-start;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  width: 100%;
  box-sizing: border-box;
}

.inline-image-left {
  flex: 0 0 200px;
  max-width: 200px;
  text-align: center;
}

.inline-image-left img {
  width: 100%;
  max-width: 200px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: block;
}

.inline-image-right {
  flex: 1;
  min-width: 0;
}

.inline-image-upload {
  margin-bottom: 10px;
}

/* Uploaded Images Container */
.uploaded-images-container {
  margin-top: 20px;
}

/* Uploaded Image Row - Matches Featured Image Layout */
.uploaded-image-row, .pending-image-row, .existing-image-row {
  display: flex;
  flex-direction: row;
  gap: 30px;
  align-items: flex-start;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  transition: box-shadow 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.uploaded-image-row:hover, .pending-image-row:hover, .existing-image-row:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.uploaded-image-left, .pending-image-left, .existing-image-left {
  flex: 0 0 200px;
  width: 200px;
  max-width: 200px;
  min-width: 200px;
  text-align: center;
}

.uploaded-image-left img, .pending-image-left img, .existing-image-left img {
  width: 200px !important;
  max-width: 200px !important;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: block;
  object-fit: cover;
}

.uploaded-image-right, .pending-image-right, .existing-image-right {
  flex: 1;
  min-width: 0;
}

.uploaded-image-right .form-group,
.pending-image-right .form-group,
.existing-image-right .form-group {
  margin-bottom: 10px;
}

.uploaded-image-right .form-group:last-of-type {
  margin-bottom: 0;
}

.uploaded-image-right .form-label,
.pending-image-right .form-label,
.existing-image-right .form-label {
  font-size: 13px;
  margin-bottom: 4px;
  font-weight: 600;
  color: #495057;
}

.uploaded-image-right .form-text,
.pending-image-right .form-text,
.existing-image-right .form-text {
  margin: 0;
  color: #495057;
  font-size: 14px;
}

.uploaded-image-right textarea,
.pending-image-right textarea,
.existing-image-right textarea {
  font-size: 13px;
  padding: 6px 10px;
  min-height: 50px;
}

.pending-image-row {
  background-color: #fff3cd;
  border-color: #ffeaa7;
}

.image-markdown {
  background: #f5f5f5;
  padding: 10px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 13px;
  margin: 10px 0;
  color: #333;
  border: 1px solid #ddd;
  white-space: pre-wrap;
  word-break: break-all;
}

.image-markdown-compact {
  background: #f5f5f5;
  padding: 6px 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
  line-height: 1.4;
  color: #333;
  border: 1px solid #ddd;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 10px;
  max-height: 60px;
  overflow-y: auto;
}

.image-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.image-actions button {
  padding: 4px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.image-actions button:hover {
  opacity: 0.8;
}

/* Make the overall row more compact */
.uploaded-image-row, .pending-image-row, .existing-image-row {
  padding: 15px;
  gap: 20px;
}

#libraryGrid::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

#libraryGrid::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Loading state */
.library-loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.library-loading::after {
  content: '...';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% {
    color: rgba(0, 0, 0, 0);
    text-shadow:
      .25em 0 0 rgba(0, 0, 0, 0),
      .5em 0 0 rgba(0, 0, 0, 0);
  }
  40% {
    color: #666;
    text-shadow:
      .25em 0 0 rgba(0, 0, 0, 0),
      .5em 0 0 rgba(0, 0, 0, 0);
  }
  60% {
    text-shadow:
      .25em 0 0 #666,
      .5em 0 0 rgba(0, 0, 0, 0);
  }
  80%, 100% {
    text-shadow:
      .25em 0 0 #666,
      .5em 0 0 #666;
  }
}

/* ===============================
   LOG VIEWER STYLES
   =============================== */
#refreshIcon {
  display: inline-block;
  transition: transform 0.5s ease;
}

.log-viewer {
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  padding: 1rem;
  height: 600px;
  overflow-y: auto;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  padding: 2px 0;
}

.log-line:hover {
  background: #e9ecef;
}

.log-selector {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.log-selector select {
  flex: 1;
  max-width: 300px;
}

.log-info {
  display: flex;
  gap: 2rem;
  font-size: 0.875rem;
}

.log-controls {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  align-items: center;
}

.log-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
