/* Single Post Reading Page Styles */

:root {
    --color-bg: #F5EFE7;
    --color-text-primary: #5C4033;
    --color-text-secondary: #6B5744;
    --color-accent: #D4844D;
    --color-accent-hover: #C17844;
    --color-brown: #8B4513;
    --color-white: #ffffff;
    --color-border: rgba(139, 69, 19, 0.1);
    --color-white: #ffffff;
}

/* Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    z-index: 9999;
}

.reading-progress__bar {
    height: 100%;
    background: linear-gradient(to right, var(--color-accent), var(--color-brown), var(--color-accent));
    width: 0%;
    transition: width 0.1s ease-out;
    transform-origin: left;
}

/* Post Single Container */
.post-single {
    background-color: var(--color-bg);
    min-height: 100vh;
}

/* Hero Section */
.post-hero {
    padding-top: 3rem;
    padding-bottom: 3rem;
    background: linear-gradient(to bottom, var(--color-white), var(--color-bg));
}

/* Hero Sections managed by .container */

.post-back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    margin-right: 2rem;
}

.post-back-button:hover {
    color: var(--color-accent);
    transform: translateX(-5px);
}

.post-back-button svg {
    width: 1.25rem;
    height: 1.25rem;
    transition: transform 0.3s ease;
}

.post-back-button:hover svg {
    transform: translateX(-4px);
}

.post-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.post-category-badge svg {
    width: 1rem;
    height: 1rem;
    color: var(--color-accent);
}

.post-category-badge span {
    color: var(--color-accent);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.post-hero__title {
    font-size: 3.75rem;
    font-family: serif;
    color: var(--color-text-primary);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.post-hero__excerpt {
    font-size: 1.25rem;
    color: var(--color-text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.post-hero__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-secondary);
    font-size: 0.875rem;
}

.post-meta-item svg {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--color-accent);
}

/* Featured Image */
.post-featured-image {
    padding-bottom: 4rem;
}

/* Featured Image managed by .container */

.post-featured-image__wrapper {
    position: relative;
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: fadeInScale 0.8s ease-out 0.4s both;
}

.post-featured-image__wrapper img {
    width: 100%;
    height: 380px;
    object-fit: cover;
    display: block;
}

.post-featured-image__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
}

/* Content Section */
.post-content-section {
    padding-bottom: 4rem;
}

/* Content Section managed by .container */

.post-content-layout {
    display: flex;
    flex-direction: row;
    gap: 3rem;
}

.post-content-layout> :first-child {
    flex: 1;
}

.post-content-layout> :last-child {
    flex: 0 0 300px;
}

/* Main Article Content */
.post-article {
    background-color: var(--color-white);
    border-radius: 1.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.post-article__quote {
    margin-bottom: 2rem;
    padding-left: 1.5rem;
    border-left: 4px solid var(--color-accent);
    font-style: italic;
    font-size: 1.125rem;
    color: var(--color-brown);
}

.post-article__content h2 {
    color: var(--color-text-primary);
    font-family: serif;
    font-size: 2rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 0.5rem;
}

.post-article__content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--color-accent), transparent);
}

.post-article__content p {
    margin-bottom: 1.75rem;
    line-height: 1.9;
    color: var(--color-text-secondary);
    font-size: 1.125rem;
}

.post-article__content p:first-of-type::first-letter {
    font-size: 4rem;
    font-family: serif;
    float: left;
    line-height: 0.85;
    margin: 0.1em 0.15em 0 0;
    color: var(--color-accent);
}

.post-article__content strong {
    color: var(--color-brown);
    font-weight: 600;
}

.post-article__content ul,
.post-article__content ol {
    margin: 2rem 0;
    padding-left: 2rem;
}

.post-article__content li {
    margin-bottom: 0.75rem;
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.post-article__content blockquote {
    margin: 2rem 0;
    padding-left: 1.5rem;
    border-left: 4px solid var(--color-accent);
    font-style: italic;
    color: var(--color-brown);
}

/* Tags Section */
.post-tags {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.post-tags__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.post-tags__label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.post-tag {
    padding: 0.5rem 1rem;
    background-color: var(--color-bg);
    color: var(--color-brown);
    border-radius: 9999px;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.post-tag:hover {
    background-color: var(--color-accent);
    color: var(--color-white);
}

/* Social Share */
.post-social {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.post-social__text {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.post-social__buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.social-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    color: var(--color-white);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.social-button:hover {
    transform: scale(1.05);
}

.social-button:active {
    transform: scale(0.95);
}

.social-button svg {
    width: 1rem;
    height: 1rem;
}

.social-button--facebook {
    background-color: #1877F2;
}

.social-button--facebook:hover {
    background-color: #1565D8;
}

.social-button--twitter {
    background-color: #1DA1F2;
}

.social-button--twitter:hover {
    background-color: #1A8CD8;
}

.social-button--whatsapp {
    background-color: #25D366;
}

.social-button--whatsapp:hover {
    background-color: #20BA5A;
}

.social-button--email {
    background-color: var(--color-accent);
}

.social-button--email:hover {
    background-color: var(--color-accent-hover);
}

/* Sidebar */
.post-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 6rem;
    align-self: flex-start;
}

.sidebar-card {
    background-color: var(--color-white);
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    animation: fadeInRight 0.8s ease-out 0.8s both;
}

.sidebar-card__title {
    font-family: serif;
    font-size: 1.125rem;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.sidebar-stats .sidebar-card__title {
    color: var(--color-white);
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.action-button:hover {
    transform: scale(1.02);
}

.action-button:active {
    transform: scale(0.98);
}

.action-button svg {
    width: 1.25rem;
    height: 1.25rem;
}

.action-button--like {
    background-color: var(--color-bg);
    color: var(--color-text-secondary);
}

.action-button--like:hover {
    background-color: rgba(212, 132, 77, 0.1);
}

.action-button--like.is-active {
    background-color: var(--color-accent);
    color: var(--color-white);
}

.action-button--like.is-active svg {
    fill: currentColor;
}

.action-button--save {
    background-color: var(--color-bg);
    color: var(--color-text-secondary);
}

.action-button--save:hover {
    background-color: rgba(139, 69, 19, 0.1);
}

.action-button--save.is-active {
    background-color: var(--color-brown);
    color: var(--color-white);
}

.action-button--save.is-active svg {
    fill: currentColor;
}

.action-button--share {
    background-color: var(--color-bg);
    color: var(--color-text-secondary);
}

.action-button--share:hover {
    background-color: rgba(212, 132, 77, 0.1);
}

/* Stats Card */
.sidebar-stats {
    background: linear-gradient(135deg, var(--color-brown), var(--color-text-primary));
    color: var(--color-white);
}

.sidebar-stats__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.sidebar-stats__header svg {
    width: 1.5rem;
    height: 1.5rem;
}

.sidebar-stats__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-item__label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.stat-item__value {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Newsletter Card */
.sidebar-newsletter {
    background-color: var(--color-bg);
    border: 2px solid rgba(212, 132, 77, 0.2);
}

.sidebar-newsletter__title {
    margin-bottom: 0.5rem;
}

.sidebar-newsletter__description {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

.newsletter-form__input {
    width: 100%;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.newsletter-form__input:focus {
    border-color: var(--color-accent);
}

.newsletter-form__button {
    width: 100%;
    padding: 0.5rem 1rem;
    background-color: var(--color-accent);
    color: var(--color-white);
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.newsletter-form__button:hover {
    background-color: var(--color-accent-hover);
}

/* Related Posts */
.related-posts {
    padding: 4rem 0;
    background-color: var(--color-white);
}

/* Related Posts managed by .container */

.related-posts__title {
    font-size: 1.875rem;
    font-family: serif;
    color: var(--color-text-primary);
    margin-bottom: 0;
}

.related-posts__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.related-posts__nav {
    display: flex;
    gap: 1rem;
}

.related-nav-btn {
    width: 2.5rem;
    /* 40px */
    height: 2.5rem;
    /* 40px */
    border-radius: 50%;
    border: 2px solid rgba(139, 69, 19, 0.2);
    /* Stronger border */
    background-color: var(--color-white);
    color: var(--color-brown);
    /* Stronger color */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    opacity: 1;
    visibility: visible;
}

.related-nav-btn:hover {
    background-color: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

.related-nav-btn svg {
    /* Ensure icon size is explicit */
    width: 20px;
    height: 20px;
    display: block;
}

.related-posts__list {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.related-posts__list::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.related-posts__list>* {
    flex: 0 0 300px;
    /* Fixed width for slider items */
    width: 300px;
}

.related-post-card {
    text-decoration: none;
    display: block;
    animation: fadeInScale 0.6s ease-out both;
    flex: 0 0 300px;
    width: 300px;
}

.related-post-card:nth-child(1) {
    animation-delay: 0s;
}

.related-post-card:nth-child(2) {
    animation-delay: 0.15s;
}

.related-post-card:nth-child(3) {
    animation-delay: 0.3s;
}

.related-post-card__inner {
    background-color: var(--color-bg);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.related-post-card:hover .related-post-card__inner {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: translateY(-10px);
}

.related-post-card__image-wrapper {
    position: relative;
    height: 12rem;
    overflow: hidden;
}

.related-post-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.related-post-card:hover .related-post-card__image {
    transform: scale(1.1);
}

.related-post-card__category {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.related-post-card__category-tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--color-accent);
    color: var(--color-white);
    font-size: 0.75rem;
    border-radius: 9999px;
}

.related-post-card__content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-post-card__title {
    font-family: serif;
    font-size: 1.125rem;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-card:hover .related-post-card__title {
    color: var(--color-accent);
}

.related-post-card__excerpt {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.related-post-card__meta {
    font-size: 0.75rem;
    color: rgba(107, 87, 68, 0.6);
}

/* CTA Section */
.post-cta {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--color-brown), var(--color-text-primary));
    position: relative;
    overflow: hidden;
}

.post-cta__bg-circle-1 {
    position: absolute;
    top: -5rem;
    right: -5rem;
    width: 16rem;
    height: 16rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: rotate-scale 30s linear infinite;
}

.post-cta__bg-circle-2 {
    position: absolute;
    bottom: -5rem;
    left: -5rem;
    width: 20rem;
    height: 20rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    animation: rotate-scale-reverse 40s linear infinite;
}

.post-cta__container {
    max-width: 48rem;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.8s ease-out both;
}

.post-cta__title {
    font-size: 2.25rem;
    font-family: serif;
    color: var(--color-white);
    margin-bottom: 1rem;
}

.post-cta__description {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    font-size: 1.125rem;
}

.post-cta__buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-button {
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.cta-button:hover {
    transform: scale(1.05);
}

.cta-button:active {
    transform: scale(0.95);
}

.cta-button--primary {
    background-color: var(--color-white);
    color: var(--color-brown);
}

.cta-button--primary:hover {
    background-color: var(--color-bg);
}

.cta-button--secondary {
    background-color: var(--color-accent);
    color: var(--color-white) !important;
}

.cta-button--secondary:hover {
    background-color: var(--color-accent-hover);
}

/* Media Queries consolidated at the end */
@media (max-width: 1019px) {
    .post-content-layout {
        flex-direction: column;
    }

    .post-content-layout> :last-child {
        flex: none;
    }

    .post-sidebar {
        position: static;
        align-self: auto;
    }

    .related-posts__list {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2rem;
        padding-top: 1rem;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }

    .related-posts__list>* {
        width: auto;
    }

    .related-posts__list::-webkit-scrollbar {
        display: none;
    }

    .related-posts__list {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .related-post-card {
        flex: 0 0 280px;
        scroll-snap-align: start;
    }
}

@media (max-width: 767px) {
    .post-hero__title {
        font-size: 2.5rem;
    }

    .post-featured-image__wrapper img {
        height: 280px;
    }

    .post-article {
        padding: 2rem;
    }

    .post-cta__title {
        font-size: 1.875rem;
    }
}