/*----------------------------------------*\
  TABLE OF CONTENTS
\*----------------------------------------*/

/*
  1. Navigation
     - Main Nav
     - Mobile Menu
     - Side Menu

  2. Components
     - Buttons
     - Forms
     - Cards
     - Search
     - Dividers
     - Posts Grid
     - Events List

  3. Page Specific
     - Home Page
       • Hero
       • Featured Section
       • Posts Grid
       • Events Section
       • CTA Section
     
     - Post Page
       • Post Hero
       • Post Content
       • Author Section
       • Related Posts

  4. Footer
     - Primary Footer
     - Secondary Footer

  5. Component Media Queries
*/

/*----------------------------------------*\
  1. NAVIGATION
\*----------------------------------------*/

/* Main Nav */
.navbar {
    position: sticky;
    top: 0;
    background-color: var(--color-neutral-50);
    border-bottom: 1px solid var(--color-neutral-200);
    z-index: 1000;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--color-neutral-200);
    z-index: 1002;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 92px;
    padding: 0 var(--container-padding);
    gap: 40px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

/* Navigation Links */
.nav-links a {
    text-decoration: none;
    font-size: var(--fs-body-medium);
    font-weight: 500;
    letter-spacing: 0;
    color: var(--color-neutral-1000);
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--color-neutral-700);
}

.nav-links .button {
    margin-left: 8px;
}

.nav-wrapper .logo {
   flex: 0 0 auto;  /* Prevent logo from flexing/shrinking */
}

.nav-wrapper .logo img {
   height: 44px;
   width: 191px;
   object-fit: contain;
   flex-shrink: 0;
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    cursor: pointer;
}

.mobile-menu img {
    width: 24px;
    height: 24px;
}

/* Mobile Menu Media Queries */
@media (max-width: 820px) {
    .mobile-menu {
        display: flex;
        align-items: center;
        width: 24px;
        height: 24px;
    }

    .nav-links li:not(:last-child) {
        display: none;
    }
}

@media (max-width: 620px) {
    .nav-wrapper {
        min-height: 64px;
        padding: 16px 24px;
    }

    .mobile-menu {
        order: 1;
    }

    .navbar .logo img {
        height: 32px;
        width: 137px;
    }

    .side-menu {
        top: 64px;
        height: calc(100vh - 64px);
    }
}

/* Mobile adjustments */
@media (max-width: 620px) {
   .nav-wrapper {
       padding: 16px 24px;
       min-height: 64px;
   }

   .nav-wrapper .logo img {
       height: 32px;
       width: 137px;
   }
}

/* Tablet Navigation (820px breakpoint) */
@media (max-width: 820px) {
    /* Hide all nav links except login and membership button */
    .nav-links li:not(:last-child):not(:nth-last-child(2)):not(:last-child) {
        display: none;
    }

    /* Keep logo, login, button, and hamburger visible */
    .nav-wrapper {
        justify-content: space-between;
        gap: 24px;
    }

    /* Show hamburger menu */
    .mobile-menu {
        display: flex;
        align-items: center;
        width: 24px;
        height: 24px;
        order: 3;
    }

    /* Adjust login position */
    .nav-links li:nth-last-child(3) {
        display: block;
        order: 1;
    }

    /* Adjust button position */
    .nav-links li:nth-last-child(2) {
        display: block;
        order: 2;
    }
}

/* Mobile Navigation (620px breakpoint) */
@media (max-width: 620px) {
    /* Hide all nav links including login and button */
    .nav-links li:not(:last-child) {
        display: none;
    }

    .mobile-menu {
        order: 1;
    }
}

/* Update mobile menu display */
.mobile-menu {
   cursor: pointer;
   display: none;  /* Hidden by default */
}

/* Show mobile menu at tablet breakpoint */
@media (max-width: 820px) {
   .mobile-menu {
       display: flex;  /* Changed from block to flex */
       align-items: center;
       width: 24px;
       height: 24px;
   }
   
   .mobile-menu img {
       width: 24px;
       height: 24px;
   }
}

/* Add body style when menu is open to prevent scrolling */
body.menu-open {
   overflow: hidden;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 92px;
    right: -320px;
    width: 320px;
    height: calc(100vh - 92px);
    background-color: var(--color-neutral-50);
    z-index: 1001;
    transition: right 0.3s ease;
}

.side-menu.open {
    right: 0;
}

.side-menu-content {
    height: 100%;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.side-menu-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 32px;
    list-style: none;
}

.side-menu-links a {
    font-size: var(--fs-body-medium);
    font-weight: 500;
    color: var(--color-neutral-1000);
    text-decoration: none;
}

.side-menu-links a:hover {
    color: var(--color-neutral-700);
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--color-neutral-1000);
    opacity: 0.7;
    z-index: 1000;
    display: none;
}

.mobile-overlay.show {
    display: block;
}

/*----------------------------------------*\
  2. COMPONENTS
\*----------------------------------------*/

/* Layout Components */
.content-wrapper {
    display: flex;
    gap: var(--column-gap);
    padding: 0 var(--container-padding);
    padding-top: 1.5rem;
}

/* Logo */

.navbar .logo img,
.footer-logo img {
    height: 44px;
    width: 191px;
    object-fit: contain;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

/* Mobile logo size */
@media (max-width: 620px) {
    .navbar .logo img,
    .footer-logo img {
        height: 32px;
        width: 137px;
    }
}

/* Buttons */
.button {
    height: 44px;
    padding: 0 1.25rem;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-family: 'Open Sans', sans-serif;
    font-size: var(--fs-button);
    font-weight: 500;
    color: var(--color-neutral-1000);
    transition: background-color 0.2s ease;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.01em;
}

.button img {
   width: 20px;
   height: 20px;
}

.button img.rotated {
   transform: rotate(-90deg);
}

/* Primary Button */
.button-primary {
    background-color: var(--color-blue-300);
}

.button-primary:hover {
    background-color: var(--color-blue-400);
}

.button-primary:active {
    background-color: var(--color-blue-500);
}

.button-primary:disabled {
    background-color: var(--color-neutral-300);
    color: var(--color-neutral-700);
    cursor: not-allowed;
}

/* Secondary Button */
.button-secondary {
    background-color: var(--color-neutral-400);
}

.button-secondary:hover {
    background-color: var(--color-neutral-300);
}

.button-secondary:active {
    background-color: var(--color-neutral-500);
}

.button-secondary:disabled {
    background-color: var(--color-neutral-300);
    color: var(--color-neutral-700);
    cursor: not-allowed;
}

/* Membership Button */
.button-membership {
    background-color: var(--color-orange-300);
    color: var(--color-neutral-1000);
}

.button-membership:hover {
    background-color: var(--color-orange-400);
}

.button-membership:active {
    background-color: var(--color-orange-500);
}

.button-membership .chevron-icon {
    transform: rotate(-90deg);
    margin-left: 4px;
}

.button-membership:disabled {
    background-color: var(--color-neutral-300);
    color: var(--color-neutral-700);
    cursor: not-allowed;
}

/* CTA Button Variant */
.cta-text .button-primary {
    background-color: var(--color-neutral-50);
    color: var(--color-blue-600);
}

.cta-text .button-primary:hover {
    background-color: var(--color-neutral-100);
}

/* Load more button styles */
.load-more {
   margin-top: 80px;  /* Keep existing top margin */
   display: flex;
   align-items: center;
   margin-left: auto;
   margin-right: auto;
}

/* Forms */
.search-form {
    display: flex;
    gap: 16px;
    width: 100%;  /* Take full width of parent */
    margin: 0;
}

/* Make the search input grow to fill available space */
.search-form input {
    flex: 1;
    min-width: 0;
}

/* Keep button from growing */
.search-form .button {
    flex-shrink: 0;
}

/* Keep existing subscribe form styles */
.subscribe-form h3 {
   margin-bottom: 16px;
}

.subscribe-form form {
   display: flex;
   flex-direction: column;
   gap: 8px;
}

.subscribe-form form input:last-of-type {
   margin-bottom: 20px;  /* Add 20px space between last input and button */
}

/* Input styles */
input {
   padding: 12px 16px;
   border: 2px solid var(--color-neutral-300);
   border-radius: 8px;
   font-size: var(--fs-body-medium);
   color: var(--color-neutral-1000);
}

input::placeholder {
   color: var(--color-neutral-500);
}

/* Form styles */
.form-stack {
   display: flex;
   flex-direction: column;
   align-items: flex-start;  /* Aligns children (including button) to the left */
}

/* 8px gap between inputs */
.form-stack input {
   width: 100%;
   max-width: 320px;
}

/* Remove margin from last input before button */
.form-stack input:last-of-type {
   margin-bottom: 20px;  /* 20px gap before button */
}

/* Button will now only be as wide as its content */
.form-stack button {
   align-self: flex-start;  /* Ensures button hugs its content */
}

.subscribe-form .body-large {
   margin-bottom: 48px;  /* Changed from 24px to 48px */
   color: var(--color-neutral-800);
}


/* CTA Section */
.cta-section {
   padding: 80px 0;
}

.cta-card {
   background-color: var(--color-blue-500);
   border-radius: 8px;
}

.cta-content {
   display: flex;
   justify-content: space-between;
   align-items: center;
   padding: 40px;
   gap: 40px;  
   /* Added 40px gap between text and image */
}

.cta-text {
   flex: 1;
}

.cta-text h3 {
   color: var(--color-neutral-50);
   margin-bottom: 16px;
}

.cta-text h6 {
   color: var(--color-neutral-100);
   margin-bottom: 32px;
}

.cta-image {
   flex: 1;
   display: flex;
   justify-content: center;
   align-items: center;
   min-width: 290px;
}

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

/* CTA Mobile Styles */
@media (max-width: 620px) {
   .cta-content {
       padding: calc(var(--section-spacing) / 2) var(--container-padding-mobile);
       display: flex;
       flex-wrap: wrap;
   }
}

/* Cards */

/* Search Section */
.search-section > h4 {
    color: var(--color-neutral-1000);
    margin-bottom: 40px;  /* Default for index page */
}

/* More specific selector for post page */
section.search-section .post-search .search-header h4 {
    margin-bottom: 0;  /* Override for post page */
}

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

.search-header .body-large {
   color: var(--color-neutral-800);
}

.search-section .post-search {
   width: 100%;
}

.search-section .index-search {
   max-width: 600px;  /* Set max width on the section */
}

/* Dividers */

.divider {
   height: 2px;
   background-color: var(--color-neutral-500);
   width: 100%;
}

/* Posts Grid */

.post-link {
   text-decoration: none;
   color: inherit;
   display: block;
}

.post-link:hover .post-card h5,
.post-link:hover .featured h3,
.post-link:hover .related-post-card h6 {
   color: var(--color-blue-500);
}

/* Sidebar */


/* Tablet sidebar layout */
@media (max-width: 820px) {
   .sidebar {
       max-width: none;
       flex-direction: column;
       gap: 64px;
   }

   .sidebar .subscribe-form,
   .sidebar .events-list {
       width: 100%;
       height: fit-content;
   }

   /* Hide dividers in sidebar on tablet */
   .sidebar .event-divider {
       display: none;
   }
}

/* Return to single column on mobile */
@media (max-width: 620px) {
    .sidebar .events-list {
        display: flex;
        flex-direction: column;
    }
}

/* Keep the divider spacing consistent */
.sidebar .event-divider {
    width: 100%;
    height: 2px;
    background-color: var(--color-neutral-300);
    margin: 24px 0;
    display: block;
}

.sidebar-events h6 {
   margin-bottom: 24px;
}

/* Icons */

.chevron-icon {
   width: 24px;
   height: 24px;
   margin-left: 4px;
}


/*----------------------------------------*\
  3. PAGE SPECIFIC
\*----------------------------------------*/

/* Home Page */
/* Hero Section */
.hero {
   padding: 0;
   background: var(--color-neutral-50);
   margin-top: 40px;  /* Keep top margin only */
}

.hero-content {
   display: flex;
   gap: 24px;  /* Changed from 2rem to 24px */
   align-items: stretch;
}

.hero-card {
   flex: 2;  /* Takes up 2/3 of the space */
   background: linear-gradient(135deg, rgb(0, 128, 128) 0%, rgb(0, 0, 139) 50%, rgb(255, 140, 0) 100%);
   background-size: cover;
   background-position: center;
   border-radius: 8px;
   padding: 180px 48px 40px 48px;
   text-align: left;
}

.hero-image {
   flex: 1;  /* Takes up 1/3 of the space */
}

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

/* Update existing hero styles */
.hero h1 {
   margin: 1rem 0;
}

.hero .overline {
   color: var(--color-neutral-800);
}

.hero .body-large {
   color: var(--color-neutral-800);
}

/* Update text colors for better contrast against gradient */
.hero-card .overline,
.hero-card h1,
.hero-card .body-large {
   color: var(--color-neutral-50); /* White text for better readability */
}

/* Responsive adjustments */
@media (max-width: 768px) {
   .hero-content {
       flex-direction: column;
   }

   .hero-card {
       padding: 80px 24px 32px;  /* Smaller padding on mobile */
   }
}
/* Featured Section */
.featured-section {
   padding: 4rem 0;
}

.featured-section .container {
   display: flex;
   gap: 80px;
}

.subscribe-form {
   flex: 1;  /* Takes up 1/3 of the space */
   height: auto;  /* Add this to make it hug content */
}

.featured-post {
   flex: 2;  /* Takes up 2/3 of the space */
}

/* Featured Post Styles */
.featured-post .post-card {
   border: none;
   box-shadow: none;
   background: none;
   padding: 0;
   overflow: visible;
}

.featured-post .post-image {
   height: 340px;  /* Set fixed height */
   margin-bottom: 24px;
}

.featured-post .post-image img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   border-radius: 8px;
}

.featured-post h3 {
   font-size: var(--fs-h3);
   margin-bottom: 16px;
}

.featured-post .overline {
   color: var(--color-neutral-700);
}


/* Posts Grid */
.posts-container {
   display: grid;
   grid-template-columns: repeat(3, 1fr);
   column-gap: 24px;
   row-gap: 64px;
}

/* Media query for tablet */
@media (max-width: 820px) {
   .posts-container {
       grid-template-columns: repeat(2, 1fr);
   }
}

/* Media query for mobile */
@media (max-width: 620px) {  /* Changed from 480px to match our mobile breakpoint */
   .posts-container {
       grid-template-columns: 1fr;  /* Single column on mobile */
   }
}

.post-card {
   border: none;
   background: none;
   box-shadow: none;
}

/* Post Card Images */
.post-card .post-image {
    height: 340px;  /* Default height for featured posts */
    margin-bottom: 24px;
}

/* Grid Post Card Images */
.posts-container .post-card .post-image {
    height: 180px;  /* Specific height for grid posts */
}

.post-card .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.post-card h5 {
   margin-bottom: 16px;
}

.post-card .overline {
   color: var(--color-neutral-700);
}

/* Post Page */

/* Post Hero Styles */
.post-hero {
   padding-top: 40px;  /* Keep top padding */
   padding-bottom: 0;  /* Remove bottom padding */
}

.post-hero-card {
   padding: 40px 48px;
   background-image: url('../assets/blog-overlay-2.png');
   background-size: cover;
   background-position: center;
   border-radius: 8px;
   display: flex;
   flex-direction: column;
   justify-content: space-between;
   min-height: 400px;  /* Changed from fixed height to min-height */
   max-height: 560px;  /* Added maximum height */
   height: auto;  /* Allow natural height between min and max */
}

/* Bottom content wrapper */
.post-hero-bottom {
   display: flex;
   flex-direction: column;
   gap: 24px;  /* Changed from 32px to 24px */
}

.back-link {
   display: flex;
   align-items: center;
   gap: 8px;
   color: var(--color-neutral-50);
   cursor: pointer;
}

.back-link img {
   width: 24px;
   height: 24px;
}

.post-info {
   display: flex;
   flex-direction: column;
}

.post-info h1 {
   color: var(--color-neutral-50);
   font-size: var(--fs-h2);  /* Use h2 font size */
   letter-spacing: 0.01em;
   font-weight: 400;  /* Changed from 700 to 400 */
   line-height: 1.2;
   margin-bottom: 1rem;
}

.post-meta {
   display: flex;
   flex-wrap: wrap;
   gap: 16px;
   color: var(--color-neutral-50);
   align-items: center;
}

.post-meta span {
   font-size: var(--fs-overline);
   text-transform: uppercase;
   letter-spacing: 0.02em;
   font-weight: 500;
   line-height: 1.2;
}

.post-meta .separator {
   color: var(--color-neutral-50);
   font-weight: 400;
}

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

.tag {
   padding: 8px 12px;
   background: rgba(255, 246, 227, 0.1);  /* orange-50 with 10% opacity */
   border: 1px solid var(--color-orange-50);  /* 1px stroke using orange-50 */
   border-radius: 8px;
   color: var(--color-orange-50);
   font-size: var(--fs-body-small);
   font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
   .post-hero-card {
       padding: calc(var(--section-spacing) / 2) var(--container-padding-mobile);
   }
}

/* Post content */

.post-content p {
   margin-bottom: 16px;
}

.post-content p:last-child {
   margin-bottom: 0;
}

/* Post Lists */
.post-content ul,
.post-content ol {
    margin: 16px 0;
    padding-left: 32px;
}

.post-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.post-content li:last-child {
    margin-bottom: 0;
}

/* Ensure nested lists have proper spacing */
.post-content ul ul,
.post-content ol ol,
.post-content ul ol,
.post-content ol ul {
    margin: 8px 0;
}

/* Post Inline Images */
.post-inline-image {
   margin: 32px 0;
}

.post-inline-image img {
   width: 100%;
   height: auto;
   border-radius: 8px;
   border: 1px solid var(--color-neutral-200);
   cursor: pointer;
   transition: opacity 0.2s ease;
}

.post-inline-image img:hover {
   opacity: 0.9;
}

/* Image Alignment Options */
.post-inline-image.centered {
   display: flex;
   justify-content: center;
}

.post-inline-image.right {
   display: flex;
   justify-content: flex-end;
}

.post-inline-image.wrapped {
   float: right;
   margin: 32px 0 32px 32px; /* top, right, bottom, left */
   clear: right;
}

/* Overlay System for Post Hero Card */
.post-hero-card.with-overlay {
    background-image: 
        linear-gradient(270deg, rgba(28, 35, 49, 0.15) 0.04%, rgba(28, 35, 49, 0.45) 81.71%),
        url('../assets/blog-background-test.jpg');
    background-size: cover;
    background-position: center;
    background-color: transparent;
    background-blend-mode: normal;
    position: relative;
}

/* Background image variations */
.post-hero-card.with-overlay.bg-1 {
    background-image: 
        linear-gradient(270deg, rgba(28, 35, 49, 0.15) 0.04%, rgba(28, 35, 49, 0.45) 81.71%),
        url('../assets/blog-background-test.jpg');
}

.post-hero-card.with-overlay.bg-2 {
    background-image: 
        linear-gradient(270deg, rgba(28, 35, 49, 0.15) 0.04%, rgba(28, 35, 49, 0.45) 81.71%),
        url('../assets/blog-background-test2.jpg');
}

.post-hero-card.with-overlay.bg-3 {
    background-image: 
        linear-gradient(270deg, rgba(28, 35, 49, 0.15) 0.04%, rgba(28, 35, 49, 0.45) 81.71%),
        url('../assets/blog-background-test3.jpg');
}

.post-hero-card.with-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0.7;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    z-index: 1;
}

.post-hero-card.with-overlay.overlay-1::before {
    background-image: url('../assets/blog-overlay-1.png');
}

.post-hero-card.with-overlay.overlay-2::before {
    background-image: url('../assets/blog-overlay-2.png');
}

.post-hero-card.with-overlay.overlay-3::before {
    background-image: url('../assets/blog-overlay-3.png');
}

.post-hero-card.with-overlay.overlay-4::before {
    background-image: url('../assets/blog-overlay-4.png');
}

.post-hero-card.with-overlay .back-link,
.post-hero-card.with-overlay .post-hero-bottom {
    position: relative;
    z-index: 2;
}

/* Image Size Options */
.post-inline-image.small {
   max-width: 250px;
}

.post-inline-image.medium {
   max-width: 500px;
}

.post-inline-image.small img,
.post-inline-image.medium img {
   width: 100%;
   height: auto;
}

/* Mobile Responsiveness */
@media (max-width: 620px) {
   .post-inline-image.right {
       justify-content: center;
   }
   
   .post-inline-image.wrapped {
       float: none;
       margin: 32px 0;
       display: flex;
       justify-content: center;
   }
   
   .post-inline-image.small,
   .post-inline-image.medium {
       max-width: 100%;
   }
}

/* Blog Post Image Classes - Intuitive naming system */
/* Left aligned with text wrap */
.post-left-small {
   max-width: 250px;
   margin: 32px 32px 32px 0; /* top, right, bottom, left */
   float: left;
   clear: left;
}

.post-left-medium {
   max-width: 500px;
   margin: 32px 32px 32px 0; /* top, right, bottom, left */
   float: left;
   clear: left;
}

/* Center aligned with no text wrap */
.post-center-small {
   max-width: 250px;
   margin: 32px auto;
   display: block;
}

.post-center-medium {
   max-width: 500px;
   margin: 32px auto;
   display: block;
}

/* Right aligned with text wrap */
.post-right-small {
   max-width: 250px;
   margin: 32px 0 32px 32px; /* top, right, bottom, left */
   float: right;
   clear: right;
}

.post-right-medium {
   max-width: 500px;
   margin: 32px 0 32px 32px; /* top, right, bottom, left */
   float: right;
   clear: right;
}

/* Image styling for new classes */
.post-left-small img,
.post-left-medium img,
.post-center-small img,
.post-center-medium img,
.post-right-small img,
.post-right-medium img {
   width: 100%;
   height: auto;
   border-radius: 8px;
   border: 1px solid var(--color-neutral-200);
   cursor: pointer;
   transition: opacity 0.2s ease;
}

.post-left-small img:hover,
.post-left-medium img:hover,
.post-center-small img:hover,
.post-center-medium img:hover,
.post-right-small img:hover,
.post-right-medium img:hover {
   opacity: 0.9;
}

/* Mobile Responsiveness for new classes */
@media (max-width: 620px) {
   .post-left-small,
   .post-left-medium,
   .post-right-small,
   .post-right-medium {
       float: none;
       margin: 32px auto;
       display: block;
       max-width: 100%;
   }
   
   .post-center-small,
   .post-center-medium {
       max-width: 100%;
   }
}

/* Blog Post Table Styles */
.post-table {
   width: 100%;
   border-collapse: collapse;
   margin: 32px 0;
   font-size: 16px;
   line-height: 1.6;
   border: 1px solid var(--color-neutral-200);
   border-radius: 8px;
   overflow: hidden;
}

.post-table thead {
   background-color: var(--color-neutral-100);
}

.post-table th,
.post-table td {
   padding: 16px;
   text-align: left;
   border-bottom: 1px solid var(--color-neutral-200);
   vertical-align: top;
}

.post-table th {
   font-weight: 600;
   color: var(--color-neutral-900);
   font-size: 16px;
}

.post-table td {
   color: var(--color-neutral-700);
}

.post-table tbody tr:hover {
   background-color: var(--color-neutral-50);
}

.post-table tbody tr:last-child td {
   border-bottom: none;
}

/* Mobile table responsiveness */
@media (max-width: 768px) {
   .post-table {
       font-size: 14px;
   }
   
   .post-table th,
   .post-table td {
       padding: 12px 8px;
   }
}

/* Image Lightbox Modal */
.image-lightbox {
   position: fixed;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   z-index: 9999;
   display: none;
   align-items: center;
   justify-content: center;
}

.image-lightbox.active {
   display: flex;
}

.lightbox-overlay {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(0, 0, 0, 0.8);
   cursor: pointer;
}

.lightbox-content {
   position: relative;
   max-width: 90%;
   max-height: 90%;
   margin: 40px;
   display: flex;
   align-items: center;
   justify-content: center;
}

.lightbox-image {
   max-width: 100%;
   max-height: 100%;
   width: auto;
   height: auto;
   border-radius: 8px;
   box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.lightbox-close {
   position: absolute;
   top: -16px;
   right: -16px;
   width: 40px;
   height: 40px;
   background-color: var(--color-neutral-50);
   border: 2px solid var(--color-neutral-200);
   border-radius: 50%;
   cursor: pointer;
   display: flex;
   align-items: center;
   justify-content: center;
   transition: all 0.2s ease;
   z-index: 10001;
}

.lightbox-close:hover {
   background-color: var(--color-neutral-100);
   transform: scale(1.1);
}

.lightbox-close img {
   width: 20px;
   height: 20px;
}

/* Mobile Lightbox Adjustments */
@media (max-width: 620px) {
   .lightbox-content {
       margin: 20px;
   }
   
   .lightbox-close {
       top: -12px;
       right: -12px;
       width: 36px;
       height: 36px;
   }
   
   .lightbox-close img {
       width: 18px;
       height: 18px;
   }
}

.post-content-section .subscribe-form {
   background-color: var(--color-neutral-100);
   border: 2px solid var(--color-neutral-200);
   border-radius: 8px;
   padding: 24px;
   height: auto;
}

/* Post page search header */
.post-search .search-header {
   margin-bottom: 0;  /* Remove margin for post page */
}

.post-content {
   flex: 2;
}

.sidebar {
   flex: 1;
   max-width: 288px;
   width: 100%;
   display: flex;
   flex-direction: column;
   gap: 64px;
   align-self: flex-start;  /* Add this to prevent stretching */
}

.sidebar .events-list {
   display: flex;
   flex-direction: column;
}

.sidebar .event-card {
   display: flex;
   flex-direction: column;
}

.sidebar .event-divider {
   width: 100%;
   height: 2px;
   background-color: var(--color-neutral-300);
   margin: 24px 0;
   display: block;  /* Always show dividers */
}

.section-wrapper {
   display: flex;
   gap: 64px;  /* Changed from 80px to 64px */
   padding: 4rem 0;
}

.author-related-wrapper {
   display: flex;
   gap: 64px;
}

.about-author {
   flex: 0 0 420px;
   width: 420px;  /* Remove this as flex-basis already sets width */
   display: flex;
   flex-direction: column;
   gap: 24px;
}

.author-content-wrapper {
   display: flex;
   gap: 24px;
}

.author-image {
   flex-shrink: 0;
   width: 176px;  /* Fixed width */
}

.author-image img {
   width: 100%;
   height: 176px;  /* Make it square */
   object-fit: cover;
   border-radius: 8px;
}

.author-content {
   flex: 1;
   display: flex;
   flex-direction: column;
   gap: 16px;
}

.author-content p {
   color: var(--color-neutral-800);
   font-size: var(--fs-body-small);
   line-height: 1.5;
}


/* Post page search section */
.post-search {
   display: flex;
   justify-content: space-between;
   align-items: center;
   gap: 40px;  /* Add gap between search header and form */
}

.post-search .search-form {
   max-width: 440px;  /* Set max width for search bar */
   width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
   .post-search {
       flex-direction: column;
       align-items: flex-start;
       gap: 24px;
   }

   .post-search .search-form {
       max-width: 100%;  /* Full width on mobile */
   }
}

/* Responsive adjustments */
@media (max-width: 820px) {
   .author-related-wrapper {
       flex-direction: column;
       gap: 40px;
   }

   .about-author {
       flex: 0 0 100%;
       width: 100%;
   }
}

/* Keep author-content-wrapper in two columns until mobile */
@media (max-width: 620px) {
   .author-content-wrapper {
       flex-direction: column;
   }

   .author-image {
       width: 100%;
       max-width: 176px;
   }
}

.related-posts {
   flex: 2;  /* Takes up 2/3 of the space */
}

/* Responsive Design */
@media (max-width: 768px) {
   .content-wrapper {
       flex-direction: column;
       padding: 0 0;
   }
   
   .related-posts .posts-container {
       grid-template-columns: repeat(2, 1fr);
   }

   .featured-section .container,
   .section-wrapper {
       flex-direction: column;
   }

   .post-card {
       flex: 0 1 calc(50% - 1rem);
   }

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

   .sidebar {
       max-width: none;  /* Remove max-width on mobile */
   }

   .section-wrapper {
       flex-direction: column;
       gap: 40px;  /* Reduced gap on mobile */
   }
}

@media (max-width: 620px) {  /* Changed from 480px to 620px */
   .nav-links li:not(:last-child) {
       display: none;
   }

   .mobile-menu {
       order: 1;
   }

   .navbar .logo img,
   .footer-logo img {
       height: 32px;
       width: 137px;
   }

   .sidebar .events-list {
       display: flex;
       flex-direction: column;
   }
}

/* Related Posts Grid */
.related-posts h4 {
   margin-bottom: 40px;  /* Add spacing between title and grid */
}

.related-posts .posts-container {
   display: grid;
   grid-template-columns: repeat(2, 1fr);
   gap: 24px;
}

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

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

.about-author img {
   width: 176px;
   height: 100%;
   object-fit: cover;
   border-radius: 8px;
}

.about-author p {
   color: var(--color-neutral-800);
   font-size: var(--fs-body-small);
   line-height: 1.5;
}

/* Related Post Card Style */
.related-post-card {
   display: flex;
   flex-direction: column;
   gap: 16px;
}

.related-post-card .post-image {
   height: 140px;  /* Changed from 180px to 140px */
   width: 100%;
}

.related-post-card .post-image img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   border-radius: 8px;
}

.related-post-card h6 {
   margin-bottom: 0;  /* Remove margin */
   color: var(--color-neutral-1000);
}

.related-post-card .overline {
   color: var(--color-neutral-700);
}

/*----------------------------------------*\
  4. FOOTER
\*----------------------------------------*/

/* Primary Footer */
.footer-primary {
    background-color: var(--color-neutral-1000);
    padding: 80px 0 40px;
    color: var(--color-neutral-50);
}

.footer-logo {
    margin-bottom: 48px;
    text-align: left;
}

.footer-logo img {
    height: 44px;
    width: 191px;
    object-fit: contain;
    flex-shrink: 0;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 40px 80px;
}

/* Footer Links */
.footer-links {
    display: flex;
    flex-direction: row;
    gap: 32px;
}

.footer-links a {
    color: var(--color-neutral-50);
    text-decoration: none;
    white-space: nowrap;
}

/* Footer Contact */
.footer-contact {
    display: flex;
    gap: 48px;
    align-items: center;
}

.address {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.address h6 {
    color: var(--color-neutral-50);
    margin-bottom: 8px;
}

.address p {
    color: var(--color-neutral-300);
    margin-bottom: 0;
    white-space: nowrap;
}

.social-icons {
    display: flex;
    gap: 16px;
}

.social-icons img {
    width: 24px;
    height: 24px;
}

/* Secondary Footer */
.footer-secondary {
    background-color: var(--color-blue-100);
    padding: 20px 0;
    text-align: left;
}

.footer-secondary p {
    color: var(--color-neutral-900);
    margin-bottom: 0;  /* Add this to remove space below paragraph */
}

/* Footer Media Queries */
@media (max-width: 768px) {
    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 32px;
        width: fit-content;
    }

    .footer-contact {
        flex-direction: row;
        gap: 24px;
    }

    .address {
        flex-direction: column;
    }
}

/*----------------------------------------*\
  5. COMPONENT MEDIA QUERIES
\*----------------------------------------*/

/* Desktop First (986px) */
@media (max-width: 986px) {
    /* Author Section */
    .author-related-wrapper {
        flex-direction: column;
        gap: 40px;
    }

    .about-author {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* Tablet (820px) */
@media (max-width: 820px) {
    /* Navigation */
    .nav-links li:not(:last-child):not(:nth-last-child(2)):not(:last-child) {
        display: none;
    }

    .nav-wrapper {
        justify-content: space-between;
        gap: 24px;
    }

    /* Show hamburger menu */
    .mobile-menu {
        display: flex;
        align-items: center;
        width: 24px;
        height: 24px;
        order: 3;
    }

    /* Keep login and button visible */
    .nav-links li:nth-last-child(3) { /* Login */
        display: block;
        order: 1;
    }
    
    .nav-links li:nth-last-child(2) { /* Button */
        display: block;
        order: 2;
    }
}

/* Tablet/Mobile (768px) */
@media (max-width: 768px) {
    /* Layout */
    .content-wrapper {
        flex-direction: column;
        padding-top: 1rem;
    }

    /* Post Hero */
    .post-hero-card {
        padding: calc(var(--section-spacing) / 2) var(--container-padding-mobile);
    }

    /* Post Search */
    .post-search {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }

    .post-search .search-form {
        max-width: 100%;
    }

    /* Footer */
    .footer-links {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px 32px;
        width: fit-content;
    }

    .footer-contact {
        flex-direction: row;
        gap: 24px;
    }
}

/* Mobile (620px) */
@media (max-width: 620px) {
    /* Navigation */
    .nav-wrapper {
        min-height: 64px;
        padding: 16px 24px;  /* Keep original nav padding */
    }

    .nav-links li:not(:last-child) {
        display: none;
    }

    .mobile-menu {
        order: 1;
    }

    /* Logo Sizes */
    .navbar .logo img,
    .footer-logo img {
        height: 32px;
        width: 137px;
    }

    /* Side Menu */
    .side-menu {
        top: 64px;
        height: calc(100vh - 64px);
    }

    /* Layout */
    .posts-container {
        grid-template-columns: 1fr;
    }

    .content-wrapper {
        flex-direction: column;
        padding: 0 0;
        padding-top: 1rem;
    }

    /* Author Section */
    .author-content-wrapper {
        flex-direction: column;
    }

    .author-image {
        width: 100%;
        max-width: 176px;
    }

    /* Section Padding */
    section {
        padding: calc(var(--section-spacing) / 2) 0;
    }
}

/* Keep other mobile padding standardization */
@media (max-width: 620px) {
    .cta-content {
        padding: calc(var(--section-spacing) / 2) var(--container-padding-mobile);
    }

    .post-hero-card {
        padding: calc(var(--section-spacing) / 2) var(--container-padding-mobile);
    }
}

/* Events Section */
.event-divider {
    width: 2px;
    height: 100px;
    background-color: var(--color-neutral-300);
    margin: 0 24px;  /* Half of the gap */
}

.events-section .events-container {
    display: flex;
    align-items: flex-start;
    margin-top: 40px;
}

.events-section .event-card {
    flex: 1;
}

.event-presenter {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

.presenter-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.presenter-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.presenter-name {
    color: var(--color-neutral-800);
    font-size: var(--fs-body-medium);
}

.event-card .body-subheading {
    margin-bottom: 0;
}

/* Sidebar Events */
.sidebar .events-list {
    display: flex;
    flex-direction: column;
}

.sidebar .event-divider {
    width: 100%;
    height: 2px;
    background-color: var(--color-neutral-300);
    margin: 24px 0;
    display: block;
}

.sidebar-events h6 {
    margin-bottom: 24px;
}

/* Events Section Media Queries */
@media (max-width: 820px) {
    .events-section .events-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 24px;
    }

    .events-section .event-card {
        flex: none;
    }

    .events-section .event-divider {
        display: none;
    }

    /* Sidebar Events - Tablet */
    .sidebar .events-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 24px;
    }

    .sidebar .event-divider {
        display: none;
    }
}

@media (max-width: 620px) {
    .events-section .events-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    /* Sidebar Events - Mobile */
    .sidebar .events-list {
        display: flex;
        flex-direction: column;
    }

    .sidebar .event-divider {
        display: block;
    }
}

/* Post Content Styles */
.post-content p {
    margin-bottom: 24px;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* Post Content Links */
.post-content a {
    color: var(--color-blue-600);
    text-decoration: underline;
    font-weight: inherit;
    font-size: inherit;
    transition: color 0.2s ease;
}

.post-content a:hover {
    color: var(--color-blue-700);
}

/* Code Snippet Styles */
.post-content code {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.9em;
    background-color: var(--color-neutral-100);
    color: var(--color-neutral-800);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--color-neutral-200);
}

.post-content pre {
    background-color: var(--color-neutral-100);
    border: 1px solid var(--color-neutral-200);
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
    overflow-x: auto !important;
    overflow-y: visible !important;
    position: relative;
    max-width: 100% !important;
    width: 100%;
    box-sizing: border-box;
    /* Ensure scrolling works by constraining the container */
    contain: layout style;
}

.post-content pre code {
    background-color: transparent;
    border: none;
    padding: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-neutral-900);
    display: block;
    white-space: pre;
    /* Allow content to be wider than container for scrolling */
    min-width: 0;
    width: max-content;
    /* Ensure long lines don't break */
    word-break: keep-all;
    overflow-wrap: normal;
}

/* Code block with language label */
.post-content pre[data-language]::before {
    content: attr(data-language);
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: var(--fs-body-small);
    color: var(--color-neutral-600);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Syntax highlighting for common keywords (optional) */
.post-content pre code .keyword {
    color: var(--color-blue-600);
    font-weight: 500;
}

.post-content pre code .string {
    color: var(--color-teal-600);
}

.post-content pre code .comment {
    color: var(--color-neutral-500);
    font-style: italic;
}

.post-content pre code .number {
    color: var(--color-orange-600);
}

/* Ensure parent containers don't interfere with code block scrolling */
.post-content {
    overflow: visible !important;
    word-wrap: normal;
}

.content-wrapper {
    overflow: visible !important;
}

.container {
    overflow: visible !important;
}

main {
    overflow: visible !important;
}

/* Horizontal scrolling solution for long code lines */
.post-content pre {
    background-color: var(--color-neutral-100);
    border: 1px solid var(--color-neutral-200);
    border-radius: 8px;
    padding: 20px;
    margin: 24px 0;
    position: relative;
    overflow-x: auto;  /* Enable horizontal scrolling */
    /* Use a responsive width that triggers scrolling for long lines */
    width: min(85vw, 900px);  /* 85% of viewport width, max 900px */
    max-width: 100%;  /* But don't exceed container on mobile */
}

.post-content pre code {
    display: block;
    white-space: pre;  /* Preserve line breaks but allow horizontal scroll */
    padding: 0;
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-neutral-900);
    background-color: transparent;
    word-wrap: normal;  /* Don't wrap words */
    overflow-wrap: normal;  /* Don't break words */
}


/* Mobile responsiveness */
@media (max-width: 620px) {
    .post-content pre {
        padding: 16px;
        margin: 20px -24px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .post-content pre code {
        font-size: 0.8125rem;
    }
}
