/* CSS Variables for consistent theming */
:root {
    --max-width: 1440px;
    --content-width: 50rem;
    --container-width: 67.5rem;
    --base-color: #000000;
    --primary-color: #ec4899; /* Pink for author name */
    --link-color: #1E76E9; /* Blue for links */
    --text-color: #0B0B0B;
    --text-light: #858585;
    --text-content: #242424;
    --text-highlight: #0B0B0B;
    --highlight-neutral: rgba(67,152,249,.15);
    --text-inverse: #ffffff;
    --border-color: #EDEDED;
    --bg-color: #ffffff;
    --bg-light: #FAFAFA;
    --surface-color: #F2F3F5;
    --surface-invesrse: #131415;
    --surface-blue: #CBEAFE;
    --btn-border: #D9D9D9;
    --bottom-cta-text: #1E3847; 
    --radius: 0.375rem;
    --transition: all 0.3s ease;
}

/* Dark theme variables - updated to dark gray palette */
[data-theme="dark"] {
    --bg-color: #121212; /* Main dark background */
    --bg-light: #21232B; /* Light elements on dark background */
    --surface-color: #2b2b2b;
    --surface-invesrse: #ffffff;
    --btn-border: transparent;
    --text-color: #ffffff; /* Primary text color */
    --text-light: #999999; /* Secondary text color */
    --text-content: #B6BDC9;
    --text-highlight: #BDD7FF;
    --highlight-neutral: rgba(67,152,249,.25);
    --text-inverse: #131415;
    --surface-blue: #63C2FF;
    --border-color: #242424; /* Border color */
    --link-color: #1E76E9;
    --base-color: #ffffff; /* Link color */
    --primary-color: #E91E63; /* Pink for author name in dark mode */
    --bottom-cta-text: #0B0B0B;
}

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

body {
    font-family: 'Zalando Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: var(--transition);
}

a {
    text-decoration: none;
    color: inherit;
}

/* Header with fixed positioning */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}

.header.scrolled {
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    position: relative; /* Added for mobile menu positioning */
}

.nav_logo {
    width: 120px;
    height: 27px;
}

.nav_logo a {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-buttons {
    display: flex;
    gap: 0.6rem;
}

.post-btn {
    display: flex;
    align-items: center;
    color: var(--surface-invesrse);
    gap: 0.3rem;
    font-weight: 400;
    height: 38px;
    padding: 0 20px 0 12px;
    font-size: 15px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    border-radius: 40px;
}

.post-btn:hover {
    background-color: var(--surface-color);
}

.post-btn:active {
    background-color: var(--surface-blue);
    color: #1774FF;
    border: 1px solid rgba(23, 116, 255, 0.3);
}

.btn--contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #ffffff;
    border: 1px solid var(--btn-border);
    color: #000000;
    font-weight: 400;
    height: 38px;
    padding: 0 16px 0 12px;
    font-size: 14px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    border-radius: 40px;
}

.btn--contact:hover {
    background-color: #EDEDED;
    border: 1px solid transparent;
    transition: transform 0.2s ease;
}

/* Theme toggle in header */
.theme-toggle {
    display: flex;
    align-items: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--surface-color);
    transition: var(--transition);
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-color);
    transition: var(--transition);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

input:checked + .toggle-slider {
    background-color: var(--surface-color);
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    transition: var(--transition);
}

.sun-icon {
    left: 6px;
    opacity: 1;
}

.moon-icon {
    right: 6px;
    opacity: 0;
}

input:checked + .toggle-slider .sun-icon {
    opacity: 0;
}

input:checked + .toggle-slider .moon-icon {
    opacity: 1;
}

/* Mobile menu styles */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    z-index: 1002; /* Increased z-index to stay above menu */
    position: relative; /* Ensure it stays above menu */
}

.mobile-menu-toggle:hover {
    background-color: var(--bg-light);
}

.burger-line {
    display: block;
    width: 16px;
    height: 2px;
    background-color: var(--text-color);
    transition: var(--transition);
    transform-origin: center;
}

.burger-line:first-child {
    margin-bottom: 2px;
}

.burger-line:last-child {
    margin-top: 2px;
}

/* Mobile menu overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001; /* Below toggle button */
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background-color: var(--bg-color);
    padding: 5rem 1.5rem 2rem; /* Increased top padding to avoid toggle */
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-nav {
    display: flex;
    flex-direction: column;
}

.mobile-nav-link {
    padding: 0.75rem 0;
    color: var(--text-light);
    font-weight: 400;
    font-size: 1rem;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.mobile-nav-link:hover {
    color: var(--link-color);
    text-decoration: none;
    border-bottom-color: var(--link-color);
}

.mobile-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

.mobile-theme-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
}

.mobile-theme-text {
    color: var(--text-light);
    font-weight: 400;
    font-size: 1rem;
}

.mobile-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.mobile-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.mobile-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: var(--transition);
    border-radius: 24px;
}

.mobile-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--bg-color);
    transition: var(--transition);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-toggle-switch input:checked + .mobile-toggle-slider {
    background-color: var(--surface-color);
}

.mobile-toggle-switch input:checked + .mobile-toggle-slider:before {
    transform: translateX(20px);
}

.mobile-toggle-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    transition: var(--transition);
}

.mobile-toggle-switch .sun-icon {
    left: 6px;
    opacity: 1;
}

.mobile-toggle-switch .moon-icon {
    right: 6px;
    opacity: 0;
}

.mobile-toggle-switch input:checked + .mobile-toggle-slider .sun-icon {
    opacity: 0;
}

.mobile-toggle-switch input:checked + .mobile-toggle-slider .moon-icon {
    opacity: 1;
}

.mobile-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-top: 1rem;
}

.mobile-btn {
    height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.mobile-btn a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.mobile-btn.primary {
    background-color: var(--surface-invesrse);
    color: var(--bg-color);
}

.mobile-btn.primary:hover {
    background-color: var(--text-light);
}

.mobile-btn.secondary {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.mobile-btn.secondary:hover {
    background-color: var(--bg-light);
}

/* Main content container */
.content {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 2rem 1.2rem;
    margin-top: 80px; /* Offset for fixed header */
}

.narrow-content {
    max-width: var(--content-width);
    margin-left: auto;
    margin-right: auto;
}

/* Back link container */
.back-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.back-link svg {
    width: 12px;
    height: 12px;
}

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

/* Post title styling */
.post-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Author information section */
.author-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    text-align: center;
}

.author-avatar {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--border-color);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    overflow: hidden;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-details {
    display: flex;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: var(--text-light);
}

.author-name {
    color: var(--primary-color);
    font-weight: 500;
}

/* Post tags styling */
.post-tags {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-light);
    color: var(--text-content);
    border-radius: 1rem;
    transition: var(--transition);
    white-space: nowrap;
}

/* Post info section with read time and copy URL */
.post-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.info-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.read-time {
    display: flex;
    gap: 0.3rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.read-time svg {
    width: 20px;
    height: 20px;
}

.copy-url {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: none;
    border: none;
    color: var(--link-color);
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem;
    border-radius: var(--radius);
}

.copy-url:hover {
    text-decoration: none;
}

.copy-url svg {
    width: 16px;
    height: 16px;
}

/* Featured image styling */
.featured-image {
    margin-bottom: 4rem;
}

.main-image-container {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: var(--bg-light);
}

.main-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* Post content styling */
.post-content {
    text-align: left;
}

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

.highlight-green {
  padding: .1rem 0;
  background-color: rgba(20,200,180,.25);
  color: var(--text-color);
}

.highlight-yellow {
    padding: .1rem 0;
    background-color: rgba(255,209,50,.25);
    color: var(--text-color);
}

.highlight-neutral {
    padding: .1rem 0;
    background-color: var(--highlight-neutral);
    color: var(--text-color);
}

.post-section {
    margin-bottom: 3.5rem;
}

.post-section h2 {
    font-weight: 500;
    font-size: 1.8rem;
    margin-bottom: 1.2rem;
    line-height: 2.2rem;
    color: var(--text-color);
    letter-spacing: -0.03rem;
}

.post-section h3 {
    font-weight: 500;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    line-height: 1.8rem;
    color: var(--text-color);
    letter-spacing: -0.03rem;
}

.post-section p {
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
    line-height: 1.7;
    letter-spacing: -0.03rem;
    font-weight: 300;
    color: var(--text-content);
}

/* List styling */
.post-section .numbered-list,
.post-section .bullet-list {
    margin: 1.2rem 0;
    font-size: 1.125rem;
    padding-left: 1.5rem;
    color: var(--text-content);
}

.post-section .numbered-list li,
.post-section .bullet-list li {
    margin-bottom: 0.7rem;
    line-height: 1.6;
}

.post-section .numbered-list {
    list-style-type: decimal;
}

.post-section .bullet-list {
    list-style-type: disc;
}

/* Post image containers - wider and with automatic height */
.post-image-container {
    width: 100%;
    margin: 1.5rem 0 3.5rem;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-image-container img {
    width: 100%;
    height: auto;
}

.image-text{
    display: flex;
    font-size: 0.8rem;
    font-weight: 400;
    justify-content: center;
    text-align: center;
    letter-spacing: -0.02em;
    color: var(--text-light);
    padding: 1rem;
}

.image-caption {
    font-size: 0.85rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Quote container */
.quote-container {
    background-color: var(--bg-light);
    border-left: 4px solid var(--link-color);
    padding: 1.8rem;
    margin: 1.8rem 0;
    border-radius: 0 var(--radius) var(--radius) 0;
    max-width: var(--content-width);
}

.quote-text {
    margin-bottom: 0 !important;
    color: var(--text-highlight) !important;
}

.quote-author {
    font-size: 0.9rem;
    color: var(--text-light);
    text-align: right;
}

/* Highlight box */
.highlight-box {
    background-color: var(--surface-blue);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: var(--radius);
    border-left: 4px solid var(--link-color);
}

.highlight-box p {
    margin: 0;
    font-weight: 500;
    font-size: 1.1rem;
    text-align: center;
    color: #0B0B0B;
}

/* Scroll to top button - updated for light theme */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background-color: var(--bg-light);
    transform: translateY(-2px);
}

.scroll-to-top svg {
    width: 1.5rem;
    height: 1.5rem;
}

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

.bottom-cta_container{
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 60px;
}

.bottom-cta__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 24px;
    margin: 0 auto;
    background-color: var(--surface-blue);
    border-radius: 32px;
    padding: 80px 40px;
    position: relative;
}

.bottom-cta_heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.bottom-cta__title {
    font-size: 40px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--bottom-cta-text);
    margin: 0;
}

.bottom-cta__description {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.5;
    color: var(--bottom-cta-text);
    margin: 0;
    max-width: 500px;
}

.bottom-cta__description br {
    display: none;
}

.bottom-cta__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
    align-items: center;
}

.bottom-cta .btn--primary {
    display: flex;
    background-color: #0B0B0B;
    color: #FFFFFF;
    border: none;
    padding: 16px 32px 16px 24px;
    height: 56px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 28px;
    transition: all 0.3s ease;
    justify-content: center;
    gap: 8px;
    align-self: center;
}

.bottom-cta .btn--primary:hover {
    background-color: #000000;
    transform: scale(0.95);
}

.bottom-cta__disclaimer {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--bottom-cta-text);
    margin: 0;
}

.bottom-cta__disclaimer br {
    display: none;
}

/* Footer */
.footer {
    padding: 40px 0;
    text-align: center;
}

.footer_container{
    max-width: 100%;
    margin: 0 auto;
    padding: 0 60px;
}

.footer__copyright {
    font-size: 12px;
    font-weight: 300;
    line-height: 1;
    color: var(--text-color);
}

/* Responsive design */
@media (max-width: 768px) {
    .narrow-content {
        max-width: 100%;
        padding: 0 1rem;
    }

    .featured-image{
        margin-bottom: 1.5rem;
    }

    .post-section{
        margin-bottom: 1rem;
    }

    .post-title {
        font-size: 1.9rem;
        line-height: 2.2rem;
    }
    
    .post-section h2 {
        font-size: 1.6rem;
        line-height: 2rem;
    }
    
    .post-section h3 {
        font-size: 1.3rem;
        line-height: 1.7rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .post-info {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .info-left {
        width: 100%;
        justify-content: space-between;
    }
    
    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
    }
    
    .main-image-container,
    .post-image-container {
        margin: 1rem -1.2rem;
        width: calc(100% + 2.4rem);
        border-radius: 0;
    }
    
    .quote-container {
        margin-left: -1.2rem;
        margin-right: -1.2rem;
        width: calc(100% + 2.4rem);
        border-radius: 0;
    }
    
    .bottom-cta {
        padding: 40px 0;
    }

    .bottom-cta br {
        display: block;
    }

    .bottom-cta__title {
        font-size: 32px;
        line-height: 1.1;
        letter-spacing: -0.03em;
    }

    .bottom-cta__content {
        padding: 48px 24px;
        border-radius: 12px;
        gap: 20px;
    }

    .bottom-cta__title {
        font-size: 32px;
    }

    .bottom-cta__description {
        font-size: 16px;
    }

    .bottom-cta .btn--primary {
        display: flex;
        align-items: center;
        width: 240px;
        justify-content: center;
        height: 52px;
    }

    .bottom-cta__disclaimer {
        font-size: 13px;
    }

    .bottom-cta_container{
        padding: 0 24px;
    }

    .footer {
        padding: 16px 0;
    }
}

@media (max-width: 640px) {
    .narrow-content {
        padding: 0;
    }

    .featured-image{
        margin-bottom: 1.5rem;
    }

    .post-section{
        margin-bottom: 1.5rem;
    }

    .post-title {
        font-size: 1.8rem;
        line-height: 2rem;
        font-weight: 500;
    }

    .post-section h2 {
        font-weight: 500;
        font-size: 1.5rem;
        margin-bottom: 1rem;
        line-height: 1.8rem;
    }
    
    .post-section h3 {
        font-weight: 500;
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
        line-height: 1.6rem;
    }
    
    .post-section p {
        font-size: 1rem;
        line-height: 1.6;
    }

    .post-section .numbered-list,
.post-section .bullet-list {
    font-size: 1rem;
}

    .image-text {
        padding: 0.3rem 1rem 1rem;
        line-height: normal;
    }
    
    .nav-container {
        padding: 0.75rem 1rem;
    }
    
    .content {
        margin-top: 70px;
        padding: 1.5rem 1rem;
    }
    
    .back-container {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .mobile-menu-content {
        width: 100%;
        padding-top: 6rem; /* Even more space for toggle on small screens */
    }

    .main-image-container,
    .post-image-container {
        margin: 2rem -1rem;
        width: calc(100% + 2rem);
    }

    .bottom-cta {
        padding: 40px 0;
    }

    .bottom-cta__title {
        font-size: 32px;
        line-height: 1.1;
        letter-spacing: -0.03em;
    }

    .bottom-cta br {
        display: block;
    }

    .bottom-cta_container{
        padding: 0 16px;
    }

    .bottom-cta .btn--primary {
        display: flex;
        align-items: center;
        width: 240px;
        justify-content: center;
        height: 52px;
    }


    .footer{
        padding: 16px 0;
    }
}

/* Burger menu animation */
.mobile-menu-toggle.active .burger-line:first-child {
    transform: rotate(45deg) translate(2px, 2px);
}

.mobile-menu-toggle.active .burger-line:last-child {
    transform: rotate(-45deg) translate(2px, -2px);
}