/* Accessibility Enhancements */
/* Focus styles */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(114, 47, 55, 0.1);
}

/* Ensure focus is visible even when using mouse */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

/* Enhanced keyboard navigation for menu items */
.nav-menu [role="menuitem"] {
    position: relative;
    transition: all 0.2s ease;
    padding: 0.5rem 0;
    margin: 0.25rem 0;
}

.nav-menu [role="menuitem"]:focus {
    background: rgba(114, 47, 55, 0.1);
    color: var(--link-hover);
    padding-left: 15px;
    border-radius: 4px;
}

/* Base styles */
:root {
  --text-color: #2b2b2b;
  --bg-color: #ffffff;
  --link-color: #8B4B52;
  --link-hover: #A25B62;
  --link-muted: #C8979C;
  --border-color: #e0e0e0;
  --accent-bg: #f8f8f8;
  --border-accent: rgba(139, 75, 82, 0.3);
  --sidebar-width: 220px;
  --font-sans: Verdana, Geneva, sans-serif;
  --container-max-width: 1200px;
  
  /* Font size variables for text adjustment */
  --base-font-size: 18px;
  --small-font-size: 16px;
  --large-font-size: 20px;
  --xlarge-font-size: 22px;
  --text-scale: 1;
}

/* Reset and base styles */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: calc(var(--base-font-size) * var(--text-scale));
  line-height: 1.7;
  color: var(--text-color);
  background: var(--bg-color);
  -webkit-font-smoothing: antialiased;
}

/* Text size adjustment classes */
body.text-size-small {
  --text-scale: 0.9;
}

body.text-size-normal {
  --text-scale: 1;
}

body.text-size-large {
  --text-scale: 1.1;
}

body.text-size-xlarge {
  --text-scale: 1.2;
}

/* Layout containers */
.page-container {
  display: flex;
  min-height: 100vh;
  max-width: var(--container-max-width);
  margin: 0 auto;
  position: relative;
  contain: layout;
  gap: 2rem; /* Add spacing between sidebar and main content */
}

/* Navigation */
nav {
  width: var(--sidebar-width);
  background: var(--accent-bg);
  border-right: 3px double var(--border-accent);
  padding: 1.5rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: all 0.3s ease;
  top: 0;
  left: 50%;
  transform: translateX(calc(-1 * var(--container-max-width) / 2));
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
  z-index: 100;
}

/* Mobile menu button improvements */
.menu-button {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1001;
    padding: 10px 14px;
    background: var(--link-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.menu-button:hover {
    background: var(--link-hover);
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}


/* Main content */
main {
  flex: 1;
  padding: 2.5rem 3rem;
  margin-left: calc(var(--sidebar-width) + 2rem); /* Add gap spacing */
  width: calc(100% - var(--sidebar-width) - 2rem);
  box-sizing: border-box;
  min-height: 100vh;
  transition: all 0.3s ease;
  background: var(--bg-color);
  border-radius: 8px 0 0 0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.03);
}

/* Responsive breakpoints */
@media (min-width: 1441px) {
  :root {
    --sidebar-width: 260px;
    --container-max-width: 1440px;
  }

  nav {
    padding: 2rem;
  }

  main {
    padding: 3rem 4rem;
    margin-left: calc(var(--sidebar-width) + 3rem);
    width: calc(100% - var(--sidebar-width) - 3rem);
  }

  .page-container {
    gap: 3rem;
  }
}

@media (max-width: 1200px) {
  :root {
    --sidebar-width: 200px;
    --container-max-width: 100%;
  }

  nav {
    padding: 1.25rem;
    left: 0;
    transform: none;
  }

  main {
    padding: 2rem 2.5rem;
    margin-left: calc(var(--sidebar-width) + 1.5rem);
    width: calc(100% - var(--sidebar-width) - 1.5rem);
  }

  .page-container {
    gap: 1.5rem;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 180px;
  }

  nav {
    padding: 1rem;
    left: 0;
    transform: none;
  }

  main {
    padding: 1.75rem 2rem;
    margin-left: calc(var(--sidebar-width) + 1rem);
    width: calc(100% - var(--sidebar-width) - 1rem);
    border-radius: 0;
  }

  .page-container {
    gap: 1rem;
  }
}
@media (max-width: 768px) {
    /* Reset root variables for mobile */
    :root {
        --sidebar-width: 0;
        --container-max-width: 100%;
    }

    /* Page structure */
    .page-container {
        display: block;
        width: 100%;
        position: relative;
        gap: 0; /* Remove gap for mobile */
    }

    /* Navigation */
    nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: var(--accent-bg);
        z-index: 1000;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: none;
        padding: 25px 20px;
        overflow-y: auto;
        transform: none;
        border-right: 1px solid var(--border-color);
    }

    nav.active {
        left: 0;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    /* Overlay for mobile menu */
    .nav-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Mobile menu button */
    .menu-button {
        display: block;
        position: fixed;
        top: 10px;
        right: 10px;
        z-index: 1001;
        padding: 8px 12px;
        background: var(--link-color);
        color: #fff;
        border: none;
        border-radius: 4px;
        font-size: 14px;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    /* Main content area */
    main {
        width: 100%;
        margin: 0;
        padding: 60px 20px 30px;
        min-height: calc(100vh - 60px);
        box-shadow: none;
        border-radius: 0;
        transition: none;
    }

    /* Typography for mobile */
    h1 {
        font-size: 24px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    h2 {
        font-size: 20px;
        margin: 15px 0 10px;
    }

    h3 {
        font-size: 18px;
        margin: 12px 0 8px;
    }

    p, .post-description {
        font-size: inherit; /* Respect text scaling from body */
        line-height: 1.5;
        margin-bottom: 15px;
    }

    /* Card and grid layouts */
    .products-grid,
    .blog-grid,
    .reading-grid {
        display: block;
        margin: 0 -15px;
    }

    .card {
        margin: 0 0 20px;
        border-radius: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--border-color);
    }

    /* Form elements */
    .search-form {
        margin: 0 -15px 20px;
        padding: 15px;
        border-radius: 0;
    }

    .form-input,
    .search-input {
        width: 100%;
        padding: 10px;
        font-size: 16px; /* Better for mobile touch */
    }

    /* Tags and filters */
    .tag-cloud {
        margin: 10px -5px;
        padding: 0 5px;
    }

    .tag {
        padding: 6px 12px;
        margin: 0 5px 5px 0;
        font-size: 14px;
    }

    /* Blog post specific */
    .post-entry {
        margin: 0 -15px 20px;
        padding: 15px;
        border-bottom: 1px solid var(--border-color);
    }

    .post-meta {
        font-size: 14px;
        margin-bottom: 10px;
    }
}

/* Additional breakpoint for very small devices */
@media (max-width: 480px) {
    main {
        padding: 55px 12px 15px;
    }

    h1 {
        font-size: 22px;
    }

    h2 {
        font-size: 18px;
    }

    .menu-button {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
    }

    .search-form {
        padding: 12px;
    }

    .tag {
        padding: 4px 10px;
        font-size: 13px;
    }
}

/* Content containers */
.container {
  max-width: min(var(--container-max-width), calc(100% - 40px));
  margin: 0 auto;
  padding: 0 20px;
  transition: all 0.3s ease;
}

/* Logo styles */
.logo-container {
    padding: 25px 20px;
    text-align: center;
    margin-bottom: 25px;
    border-bottom: 3px double var(--border-accent);
    transition: all 0.3s ease;
}

.site-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 50%;
    overflow: hidden;
}

.logo-image {
    max-width: 100%;
    height: auto;
}

/* Profile styles */
.profile {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
}

.profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--accent-bg);
    border: 3px double var(--border-accent);
    flex-shrink: 0;
}

.profile-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-text {
    flex: 1;
}

@media (max-width: 768px) {
    .profile {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .profile-photo {
        width: 120px;
        height: 120px;
    }
}

.logo {
  text-align: left;
  margin-bottom: 35px;
  padding: 0 10px 25px;
  border-bottom: 4px double var(--border-accent);
}

.name {
  font-family: var(--font-sans);
  font-size: 26px;
  color: var(--text-color);
  margin-bottom: 10px;
  font-weight: bold;
  letter-spacing: -0.3px;
}

.subtitle {
  font-size: 14px;
  color: #666;
}

.nav-links {
  margin-top: 30px;
  padding: 0 10px;
}

nav a {
  display: block;
  color: var(--link-color);
  text-decoration: none;
  padding: 10px 14px;
  margin-bottom: 8px;
  border-radius: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  position: relative;
}

nav a:hover {
  background: rgba(114, 47, 55, 0.08);
  color: var(--link-hover);
  padding-left: 18px;
  transform: translateX(2px);
}

nav a:active {
  transform: translateX(1px);
}

/* Social links */
/* Text size controls - inline for post pages */
.text-size-controls-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.size-label {
    font-size: 13px;
    color: #666;
    margin-right: 4px;
}

.size-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 3px;
    font-weight: bold;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.text-size-controls-inline .size-btn:nth-of-type(1) { font-size: 10px; }
.text-size-controls-inline .size-btn:nth-of-type(2) { font-size: 11px; }
.text-size-controls-inline .size-btn:nth-of-type(3) { font-size: 13px; }
.text-size-controls-inline .size-btn:nth-of-type(4) { font-size: 15px; }

.size-btn:hover {
    background: var(--accent-bg);
    border-color: var(--link-color);
}

.size-btn.active {
    background: var(--link-color);
    color: white;
    border-color: var(--link-color);
}

.social-links {
    margin-top: auto;
    padding: 25px 20px;
    display: flex;
    justify-content: center;
    gap: 18px;
    border-top: 3px double var(--border-accent);
}

.social-link {
    color: var(--link-color);
    padding: 10px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 75, 82, 0.03);
}

.social-link:hover {
    color: var(--link-hover);
    background: rgba(139, 75, 82, 0.12);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(139, 75, 82, 0.15);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* Main content */
main {
  flex: 1;
  padding: 40px;
  background: #fff;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-width));
  box-sizing: border-box;
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-sans);
  font-weight: bold;
  color: var(--text-color);
  line-height: 1.3;
  margin-top: 0;
}

h1 {
  font-size: 28px;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 4px double var(--border-accent);
}

h2 {
  font-size: 22px;
  margin: 30px 0 20px;
  color: var(--link-color);
}

/* Search styles */
.search-form {
  margin-bottom: 20px;
  display: flex;
  gap: 6px;
  padding: 12px;
  background: var(--accent-bg);
  border: 1px solid var(--border-color);
  border-radius: 3px;
}

.search-input {
  flex: 1;
  padding: 6px 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-color);
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 3px;
}

.search-input:focus {
  outline: none;
  border-color: var(--link-color);
  box-shadow: 0 0 0 2px rgba(114, 47, 55, 0.1);
}

.search-button {
  background: var(--link-color);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  padding: 0 12px;
  border-radius: 3px;
  transition: background-color 0.2s ease;
}

.search-button:hover {
  background: var(--link-hover);
}

/* Post styles */
.post-meta {
  color: #666;
  font-size: 13px;
  margin-bottom: 25px;
  font-family: var(--font-sans);
  line-height: 1.6;
}

.post-meta time {
  color: var(--text-color);
}

.post-meta .separator {
  margin: 0 8px;
  color: var(--border-color);
}

.reading-time {
  color: #666;
}

/* TL;DR section */
.post-tldr {
  margin: 20px 0;
  padding: 20px;
  background: var(--accent-bg);
  border: 1px solid var(--link-color);
  border-radius: 3px;
  font-family: var(--font-sans);
  line-height: 1.6;
  position: relative;
}

.tldr-label {
  font-family: var(--font-sans);
  font-weight: bold;
  color: var(--link-color);
  font-size: 14px;
  display: block;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

.post-tldr p {
  margin: 0;
  font-size: 14px;
  color: var(--text-color);
  line-height: 1.6;
}

/* Quote styling */
blockquote {
  margin: 1.5em 0;
  padding: 1em 1.5em;
  border-left: 3px solid var(--link-color);
  background: var(--accent-bg);
  font-size: 14px;
  position: relative;
}

/* Footer */
footer {
  text-align: center;
  padding: 25px 0;
  color: #666;
  font-size: 13px;
  border-top: 4px double var(--border-accent);
  margin-top: 50px;
}

/* Time display and hit counter */
.time-display, .hit-counter {
  margin: 25px 0;
  padding: 12px;
  background: var(--accent-bg);
  border: 1px solid var(--link-color);
  border-radius: 3px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  color: #666;
}

/* Featured Reading styles */
.featured-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.featured-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    color: var(--link-color);
    font-size: 22px;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--link-color);
    display: inline-block;
}

.featured-list {
    margin-left: 20px;
}

.featured-item {
    margin-bottom: 30px;
    position: relative;
    padding-left: 25px;
}

.featured-item:before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--link-color);
    font-weight: bold;
}

.featured-item h3 {
    font-size: 18px;
    margin: 0 0 10px;
}

.featured-item h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.featured-item h3 a:hover {
    color: var(--link-color);
}

.featured-item .description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0 0 8px;
}

.featured-item .meta {
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Blog filters */
.blog-filters {
    margin: 25px 0 35px;
    padding: 25px;
    background: var(--accent-bg);
    border: 2px solid var(--border-accent);
    border-radius: 3px;
}

.filters-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px double var(--border-accent);
}

.filters-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--link-color);
}

.filter-icon {
    margin-right: 12px;
    font-size: 24px;
    color: var(--link-color);
}

.filter-groups {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-group label {
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-color);
    font-weight: bold;
}

.category-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-color);
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.category-select:hover {
    border-color: var(--link-color);
}

.category-select:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 2px rgba(114, 47, 55, 0.1);
}

.tags-group {
    margin-top: 5px;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent-bg);
    color: var(--link-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid rgba(139, 75, 82, 0.2);
}

.tag:hover, .tag.active {
    background: var(--link-color);
    color: white;
    border-color: var(--link-color);
}

/* Post entries */
.post-entry {
    margin-bottom: 40px;
    padding-bottom: 35px;
    border-bottom: 3px double var(--border-accent);
}

.post-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.post-header h2 {
    margin: 0 0 12px;
    font-size: 24px;
}

.post-header h2 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-header h2 a:hover {
    color: var(--link-color);
}

.post-description {
    margin: 15px 0;
    font-size: 14px;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: var(--link-color);
    text-decoration: none;
    font-size: 14px;
    margin-top: 10px;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: var(--link-hover);
}

/* Duplicate body styles removed - using earlier body definition with text scaling */

/* Guestbook styles */
.guestbook-intro {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--accent-bg);
    border: 1px solid var(--link-color);
    border-radius: 3px;
    font-size: 15px;
    line-height: 1.6;
}

.guestbook-form {
    margin: 30px 0;
    padding: 25px;
    background: var(--accent-bg);
    border: 1px solid var(--link-color);
    border-radius: 3px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--text-color);
}

.form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--text-color);
    transition: border-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 2px rgba(114, 47, 55, 0.1);
}

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

.form-help {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: var(--link-muted);
}

.form-actions {
    margin-top: 25px;
}

.button.primary {
    background: var(--link-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    font-family: var(--font-sans);
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

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

.guestbook-entries {
    margin-top: 40px;
}

.guestbook-entry {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

.guestbook-entry:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.entry-header {
    margin-bottom: 15px;
}

.entry-meta {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.entry-name {
    margin: 0;
    font-size: 18px;
    color: var(--link-color);
}

.entry-name a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.entry-name a:hover {
    color: var(--link-hover);
}

.entry-meta time {
    font-size: 13px;
    color: var(--link-muted);
}

.entry-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
}

/* Admin guestbook styles */
.pending-entries {
    margin-top: 30px;
    padding: 20px;
    background: var(--accent-bg);
    border: 1px solid var(--link-color);
    border-radius: 3px;
}

.entry-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.button.approve {
    background: #2e7d32;
}

.button.approve:hover {
    background: #1b5e20;
}

.button.delete {
    background: #c62828;
}

.button.delete:hover {
    background: #b71c1c;
}

/* Related Posts styles */
.related-posts {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 4px double var(--border-accent);
}

.related-posts h2 {
    font-size: 24px;
    color: var(--text-color);
    margin-bottom: 25px;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.related-post {
    background: var(--accent-bg);
    padding: 20px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.related-post:hover {
    border-color: var(--link-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.related-post h3 {
    font-size: 18px;
    margin: 0 0 12px;
    line-height: 1.4;
}

.related-post h3 a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-post h3 a:hover {
    color: var(--link-hover);
}

.related-meta {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
}

.related-description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-color);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

/* Reading List styles */
.reading-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px double var(--border-accent);
}

.reading-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.book-grid, .blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.book-card, .blog-card, .article-card {
    background: var(--accent-bg);
    border-radius: 3px;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.card-link {
    display: block;
    padding: 25px;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.book-card:hover, .blog-card:hover, .article-card:hover {
    border-color: var(--link-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.book-card h3, .blog-card h3, .article-card h3 {
    font-size: 20px;
    margin: 0 0 10px;
    color: var(--link-color);
}

.author {
    color: var(--link-color);
    font-style: italic;
    margin-bottom: 15px;
}

.progress-bar {
    background: var(--border-color);
    height: 4px;
    border-radius: 2px;
    margin: 15px 0 5px;
}

.progress {
    background: var(--link-color);
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--link-muted);
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.article-card {
    border-left: 3px solid var(--link-color);
}

.source {
    color: var(--link-color);
    font-size: 14px;
    margin: 5px 0 10px;
}

.article-card time {
    display: block;
    font-size: 13px;
    color: var(--link-muted);
    margin-top: 10px;
}

.tag-wrapper {
    margin-top: 10px;
}

.tag {
    display: inline-block;
    padding: 4px 8px;
    background: rgba(139, 75, 82, 0.1);
    color: var(--link-color);
    border-radius: 3px;
    font-size: 12px;
    margin-right: 6px;
}

@media (max-width: 768px) {
    .book-grid, .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* Blog Layout styles */
.blog-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.blog-header {
    margin-bottom: 40px;
}

.post-entry {
    margin-bottom: 25px;
    background: var(--accent-bg);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    transition: all 0.2s ease;
    overflow: hidden;
    position: relative;
}

.post-entry:hover {
    border-color: var(--link-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.post-link {
    display: block;
    padding: 25px;
    color: inherit;
    text-decoration: none;
    position: relative;
}

.post-header {
    margin-bottom: 15px;
}

.post-header h2 {
    font-size: 24px;
    margin: 0 0 12px;
    color: var(--link-color);
    transition: color 0.2s ease;
}

.post-meta {
    font-size: 14px;
    color: var(--link-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.post-meta .separator {
    color: var(--border-color);
}

.post-description {
    margin: 15px 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-color);
}

.post-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.post-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

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

.post-cta {
    margin-top: 20px;
    text-align: right;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.cta-text {
    color: var(--link-color);
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .post-meta .separator {
        display: none;
    }
}

/* Reading List Full Page styles */
.reading-list-full {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.reading-list-full header {
    margin-bottom: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.back-link {
    color: var(--link-color);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

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

.section-footer {
    margin-top: 25px;
    text-align: right;
}

.show-more {
    display: inline-block;
    color: var(--link-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 8px 16px;
    background: rgba(139, 75, 82, 0.1);
    border-radius: 3px;
}

.show-more:hover {
    color: var(--link-hover);
    background: rgba(139, 75, 82, 0.15);
}

.full-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.full-list {
    gap: 30px;
}

/* Enhanced tag styles */
.tag-wrapper {
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    background: rgba(139, 75, 82, 0.1);
    color: var(--link-color);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.tag:hover {
    background: rgba(139, 75, 82, 0.2);
}

/* Products page styles */
.products-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.products-header {
    text-align: center;
    margin-bottom: 40px;
}

/* Products Grid */
.products-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.products-header {
    text-align: center;
    margin-bottom: 40px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.product-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--link-color);
}

.product-content {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.product-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-header h3 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
    line-height: 1.3;
}

.product-description {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin: 0;
    flex: 1;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.tag {
    font-size: 13px;
    padding: 6px 14px;
    background: var(--accent-bg);
    color: var(--link-color);
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid rgba(139, 75, 82, 0.2);
}

.product-card:hover .tag {
    background: rgba(139, 75, 82, 0.1);
    border-color: var(--link-color);
}

.product-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.primary-button {
    display: inline-block;
    width: 100%;
    padding: 14px 24px;
    background: var(--link-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    transition: all 0.2s ease;
}

.primary-button:hover {
    background: var(--link-hover);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-content {
        padding: 24px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Product Hunt Widget */
.product-hunt-widget {
    background: white;
    border: 1px solid #DA552F;
    border-radius: 12px;
    padding: 30px;
    margin: 30px 0 50px;
    box-shadow: 0 4px 12px rgba(218, 85, 47, 0.1);
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.ph-logo {
    width: 48px;
    height: 48px;
}

.widget-header h2 {
    margin: 0;
    color: #DA552F;
    font-size: 24px;
    font-weight: 600;
}

.widget-content {
    background: #FFF8F6;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid rgba(218, 85, 47, 0.2);
}

.widget-content h3 {
    margin: 0 0 12px;
    font-size: 28px;
    color: var(--text-color);
    line-height: 1.3;
}

.tagline {
    font-size: 16px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.widget-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    color: #DA552F;
    font-weight: 600;
    font-size: 16px;
}

.widget-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #DA552F;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s ease;
    padding: 12px 24px;
    background: white;
    border: 1px solid rgba(218, 85, 47, 0.3);
    border-radius: 6px;
}

.widget-link:hover {
    background: #DA552F;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(218, 85, 47, 0.2);
}

@media (max-width: 768px) {
    .product-hunt-widget {
        margin: 20px 0 30px;
        padding: 20px;
    }

    .widget-content {
        padding: 20px;
    }

    .widget-header h2 {
        font-size: 20px;
    }

    .widget-content h3 {
        font-size: 24px;
    }
}

/* Filter section styles */
.filter-section {
    background: var(--accent-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.filter-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--link-color);
}

.filter-icon {
    color: var(--link-color);
    font-size: 20px;
}

/* Tag styles - Consistent across all pages */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 15px 0;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background: var(--accent-bg);
    color: var(--link-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid rgba(139, 75, 82, 0.2);
}

.tag:hover, .tag.active {
    background: var(--link-color);
    color: white;
    border-color: var(--link-color);
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-content {
        padding: 24px;
    }

    .filter-section {
        padding: 20px;
        margin: 20px 0;
    }
}

.intro {
    font-size: 16px;
    margin-bottom: 20px;
}

/* Enhanced Blog Post Structure for Better Readability */
.post {
  max-width: 750px;
  margin: 0 auto;
}

.post header {
  margin-bottom: 40px;
  padding-bottom: 25px;
  border-bottom: 2px solid var(--border-color);
}

.post header h1 {
  font-size: 36px;
  margin-bottom: 20px;
  line-height: 1.3;
  letter-spacing: -0.5px;
  font-weight: 600;
  color: var(--text-color);
}

.post-summary {
  font-size: 18px;
  line-height: 1.6;
  color: #555;
  margin: 20px 0;
  padding: 16px;
  background: var(--accent-bg);
  border-radius: 4px;
  border-left: 3px solid var(--link-color);
}

/* Enhanced post content structure */
.post-content {
  font-size: calc(var(--base-font-size) * var(--text-scale));
  line-height: 1.85;
  letter-spacing: 0.3px;
  color: var(--text-color);
  margin-bottom: 40px;
}

.post-content p {
  margin-bottom: 24px;
  text-align: justify;
  hyphens: auto;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.3px;
}

.post-content h2 {
  font-size: 28px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.post-content h3 {
  font-size: 24px;
}

.post-content h4 {
  font-size: 20px;
}

.post-content ul,
.post-content ol {
  margin-bottom: 24px;
  padding-left: 30px;
  line-height: 1.85;
}

.post-content li {
  margin-bottom: 10px;
}

.post-content blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 4px solid var(--link-color);
  background: var(--accent-bg);
  font-style: italic;
  color: #555;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 24px auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content code {
  background: var(--accent-bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: var(--accent-bg);
  padding: 16px;
  border-radius: 4px;
  overflow-x: auto;
  margin: 24px 0;
  line-height: 1.5;
}

.post-content pre code {
  background: none;
  padding: 0;
}

.post-content a {
  color: var(--link-color);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: all 0.2s ease;
}

.post-content a:hover {
  color: var(--link-hover);
  text-decoration-thickness: 2px;
}

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

.post-content table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 0.95em;
}

.post-content th,
.post-content td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.post-content th {
  background: var(--accent-bg);
  font-weight: 600;
}

/* Responsive adjustments for blog posts */
@media (max-width: 768px) {
  .post header h1 {
    font-size: 28px;
  }
  
  .post-content {
    font-size: calc(var(--base-font-size) * var(--text-scale) * 0.95);
  }
  
  .post-content p {
    text-align: left;
  }
}
