/* Article Detail Styles */

html {
    scroll-behavior: smooth;
}

/* Hero Image Styles */
.article-detail .hero-container {
    width: 100%;
    height: 500px;
    position: relative;
    overflow: hidden;
}

.article-detail .hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.article-detail .hero-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, #fafafa, transparent);
    pointer-events: none;
}

/* Main Content Styles */
.article-detail .main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 10;
    margin-top: -150px;
    display: flex;
    gap: 2rem;
}

.article-detail .content-container {
    background-color: #ffffff;
    padding: 5rem;
    position: relative;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Table of Contents Sidebar Styles */
.article-detail .sidebar {
    width: 280px;
    position: sticky;
    top: 7rem;
    align-self: flex-start;
    height: calc(100vh - 8rem);
    display: flex;
    flex-direction: column;
    margin-top: 0.5rem;
}

.article-detail .table-of-contents-container {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 100%;
}

.article-detail .table-of-contents {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.article-detail .toc-header {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #020617;
    font-size: 1rem;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.article-detail .toc-header svg {
    margin-right: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
}

.article-detail .toc-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.article-detail .toc-links a {
    color: #64748b;
    text-decoration: none;
    ;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 1.5rem;
}

.article-detail .toc-links a:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.article-detail .toc-links a.active {
    background-color: #eff6ff;
    color: #3b82f6;
    font-weight: 500;
}

.article-detail .toc-links a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.3rem;
    bottom: 0.3rem;
    width: 0.25rem;
    background-color: #3b82f6;
    border-radius: 0 0.125rem 0.125rem 0;
}

.article-detail .toc-links a::before {
    content: "";
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.375rem;
    height: 0.375rem;
    background-color: #94a3b8;
    border-radius: 50%;
}

/* Table of Contents Styles */
.article-detail .table-of-contents {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    width: 100%;
}

.article-detail .toc-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #020617;
    margin-bottom: 1rem;
    text-align: center;
}

.article-detail .toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.article-detail .toc-link {
    color: #64748b;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    display: block;
    border-left: 3px solid transparent;
}

.article-detail .toc-link:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}

.article-detail .toc-link.active {
    background-color: #eff6ff;
    color: #3b82f6;
    font-weight: 500;
}

/* Indent for different heading levels */
.article-detail .toc-level-2 .toc-link {
    padding-left: 1.5rem;
}

.article-detail .toc-level-3 .toc-link {
    padding-left: 2.25rem;
}

.article-detail .toc-level-4 .toc-link {
    padding-left: 3rem;
}

.article-detail .toc-level-5 .toc-link {
    padding-left: 3.75rem;
}

.article-detail .toc-level-6 .toc-link {
    padding-left: 4.5rem;
}

.article-detail .post-title {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
    font-weight: 700;
    color: #020617;
    line-height: 1.2;
    text-align: center;
}

.article-detail .divider {
    width: 60px;
    height: 3px;
    background-color: #0f172a;
    margin: 2rem 0;
    border-radius: 9999px;
}

/* Post Content Styles */
.article-detail .post-content {
    color: #020617;
    line-height: 1.8;
    width: 100%;
    margin-bottom: 4rem;
}

.article-detail .post-content h1,
.article-detail .post-content h2,
.article-detail .post-content h3,
.article-detail .post-content h4,
.article-detail .post-content h5,
.article-detail .post-content h6 {
    scroll-margin-top: 7rem;
}

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

.article-detail .post-content ul,
ol {
    margin-left: 1.2rem;
}

.post-content ul {
    list-style-type: disc;
}

.article-detail .post-content pre {
    background: whitesmoke;
    padding: 2px;
    border: 1px solid #8080806e;
    border-radius: 5px;
}

.article-detail .post-content code {
    padding: 13px;
}

.article-detail .post-content img {
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-detail .post-content img:hover {
    box-shadow: 0 25px 30px -5px rgba(0, 0, 0, 0.1),
        0 15px 15px -5px rgba(0, 0, 0, 0.05);
}

.article-detail .post-content figure {
    margin: auto;
}

/* Social Sharing and Back to Top Styles */
.article-detail .social-share {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    display: flex;
    gap: 0.5rem;
    z-index: 20;
}

.article-detail .social-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background-color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.article-detail .social-icon:hover {
    transform: translateY(-3px);
}

.article-detail .facebook {
    background-color: #4267b2;
}

.article-detail .twitter {
    background-color: #1da1f2;
}

.article-detail .linkedin {
    background-color: #0a66c2;
}

.article-detail .back-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 5rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #020617;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    z-index: 20;
}

.article-detail .back-to-top:hover {
    transform: translateY(-3px);
    background-color: #f1f5f9;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .article-detail .main-content {
        flex-direction: column;
    }

    .article-detail .sidebar {
        width: 100%;
        position: static;
        height: auto;
        margin-bottom: 2rem;
    }

    .article-detail .table-of-contents-container {
        height: auto;
        max-height: none;
    }
}

@media (max-width: 768px) {
    .article-detail .post-title {
        font-size: 1.75rem;
    }

    .article-detail .content-container {
        padding: 1.5rem;
    }

    .article-detail .post-image {
        width: 100%;
        margin: 2rem 0;
    }

    .article-detail .social-share {
        bottom: 1rem;
    }

    .article-detail .back-to-top {
        bottom: 4.5rem;
    }

    .article-detail .hero-container {
        height: 300px;
    }

    .article-detail .main-content {
        margin-top: -100px;
    }
}

/* Main container */
.newsletter-canvas {
    width: 100%;
    max-width: 100%;
    padding: 8rem 2rem;
    background: linear-gradient(to right, rgb(61, 155, 252), rgb(123, 64, 228), rgb(245, 58, 139), rgb(238, 112, 74), rgb(45, 221, 79));
    background-size: 200% auto;
    position: relative;
    overflow: hidden;
    animation: gradientMove 15s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Artistic background elements */
.artistic-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    opacity: 0.7;
}

.artistic-shape {
    position: absolute;
    opacity: 0.4;
    filter: blur(40px);
    transition: all 0.5s ease;
}

.shape-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgb(61, 155, 252, 0.8) 0%, rgb(123, 64, 228, 0.8) 100%);
    top: -300px;
    right: -100px;
    border-radius: 43% 57% 70% 30% / 46% 40% 60% 54%;
    animation: morph 15s ease-in-out infinite, float 6s ease-in-out infinite;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgb(245, 58, 139, 0.8) 0%, rgb(238, 112, 74, 0.8) 100%);
    bottom: -250px;
    left: -100px;
    border-radius: 53% 47% 40% 60% / 36% 50% 50% 64%;
    animation: morph 18s ease-in-out infinite reverse, float 8s ease-in-out infinite;
}

.shape-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgb(45, 221, 79, 0.8) 0%, rgb(61, 155, 252, 0.8) 100%);
    top: 40%;
    right: 10%;
    border-radius: 63% 37% 50% 50% / 46% 60% 40% 54%;
    animation: morph 20s ease-in-out infinite, float 7s ease-in-out infinite;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }

    100% {
        transform: translateY(0px) rotate(0deg);
    }
}

@keyframes morph {
    0% {
        border-radius: 43% 57% 70% 30% / 46% 40% 60% 54%;
        transform: scale(1);
    }

    50% {
        border-radius: 53% 47% 40% 60% / 36% 50% 50% 64%;
        transform: scale(1.05);
    }

    100% {
        border-radius: 43% 57% 70% 30% / 46% 40% 60% 54%;
        transform: scale(1);
    }
}

/* Decorative lines */
.decorative-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0) 100%);
    animation: lineShine 3s ease-in-out infinite;
}

@keyframes lineShine {
    0% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.7;
    }

    100% {
        opacity: 0.3;
    }
}

.line-1 {
    width: 80%;
    top: 15%;
    left: 10%;
    transform: rotate(-2deg);
}

.line-2 {
    width: 60%;
    bottom: 15%;
    right: 10%;
    transform: rotate(2deg);
}

/* Newsletter content */
.newsletter-content {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    text-align: center;
    animation: contentFadeIn 1s ease-out;
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Typography */
.newsletter-title {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
    line-height: 1.1;
    position: relative;
    display: inline-block;
    letter-spacing: -0.5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.newsletter-title::after {
    content: "";
    position: absolute;
    width: 120px;
    height: 4px;
    background: linear-gradient(90deg,
            rgb(61, 155, 252),
            rgb(123, 64, 228),
            rgb(245, 58, 139));
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
    0% {
        opacity: 0.6;
        width: 100px;
    }

    50% {
        opacity: 1;
        width: 140px;
    }

    100% {
        opacity: 0.6;
        width: 100px;
    }
}

.newsletter-description {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 3rem;
    font-weight: 300;
    line-height: 1.8;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Form elements */
.newsletter-form {
    position: relative;
    width: 100%;
    margin: 0 auto;
    max-width: 600px;
    transform: perspective(1000px) rotateX(0deg);
    transition: transform 0.3s ease;
}

.newsletter-form:hover {
    transform: perspective(1000px) rotateX(2deg);
}

.newsletter-input {
    width: 100%;
    padding: 1.75rem 2rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 100px;
    font-size: 1.1rem;
    color: white;
    transition: all 0.3s ease;
    outline: none;
    font-family: 'Montserrat', sans-serif;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.newsletter-input:focus {
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 15px 35px rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 300;
}

.newsletter-button {
    position: absolute;
    right: 8px;
    top: 8px;
    bottom: 8px;
    padding: 0 2.5rem;
    background: white;
    color: rgb(123, 64, 228);
    border: none;
    border-radius: 100px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.newsletter-button::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0),
            rgba(255, 255, 255, 0.8),
            rgba(255, 255, 255, 0));
    transition: left 0.7s ease;
}

.newsletter-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.95);
    color: rgb(245, 58, 139);
}

.newsletter-button:hover::before {
    left: 100%;
}

.newsletter-button:active {
    transform: translateY(1px);
}

/* Decorative elements */
.decorative-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    opacity: 0.6;
    animation: dotPulse 3s ease-in-out infinite;
}

@keyframes dotPulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 0.6;
    }
}

.dot-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.dot-2 {
    top: 30%;
    right: 15%;
    animation-delay: 0.5s;
}

.dot-3 {
    bottom: 25%;
    left: 20%;
    animation-delay: 1s;
}

.dot-4 {
    bottom: 15%;
    right: 10%;
    animation-delay: 1.5s;
}

.dot-5 {
    top: 50%;
    left: 5%;
    animation-delay: 2s;
}

.dot-6 {
    top: 60%;
    right: 5%;
    animation-delay: 2.5s;
}

/* Responsive styles */
@media (max-width: 768px) {
    .newsletter-canvas {
        padding: 6rem 1.5rem;
    }

    .newsletter-title {
        font-size: 3.5rem;
    }

    .newsletter-description {
        font-size: 1.1rem;
    }

    .newsletter-button {
        position: relative;
        right: auto;
        top: auto;
        bottom: auto;
        width: 100%;
        margin-top: 1rem;
        padding: 1.2rem;
    }

    .newsletter-input {
        text-align: center;
        padding: 1.5rem;
    }

    .shape-1,
    .shape-2,
    .shape-3 {
        transform: scale(0.7);
    }
}

@media (max-width: 480px) {
    .newsletter-canvas {
        padding: 4rem 1.5rem;
    }

    .newsletter-title {
        font-size: 2.75rem;
    }

    .newsletter-description {
        font-size: 1rem;
    }

    .shape-1,
    .shape-2,
    .shape-3 {
        transform: scale(0.5);
    }
}

/* Related Posts Section */
.related-posts {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 6rem;
    padding: 0 1.5rem;
    background-color: #fff;
}

.related-posts-header {
    text-align: center;
    margin-bottom: 3.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.related-post-title-detail {
    font-size: 2.25rem;
    font-weight: 700;
    background: black;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.2rem;
    position: relative;
    display: inline-block;
}

.related-post-title-detail::after {
    content: '';
    position: absolute;
    bottom: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: black;
    border-radius: 4px;
}

.related-posts-subtitle {
    color: #64748b;
    font-size: 1rem;
    max-width: 600px;
    margin: 1rem auto 0;
    line-height: 1.6;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
}

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

.related-post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -4px rgba(15, 23, 42, 0.1);
}

.related-post-image-wrapper {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f8fafc;
}

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

.related-post-card:hover .related-post-image {
    transform: scale(1.05);
}

.related-post-category {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06);
}

.category-icon {
    display: flex;
    align-items: center;
    color: #64748b;
}

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

.related-post-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.related-post-date {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #64748b;
    font-size: 0.875rem;
}

.read-time {
    color: #64748b;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    padding-left: 1rem;
    position: relative;
}

.read-time::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background-color: #cbd5e1;
}

.related-post-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: auto;
    color: #0f172a;
    font-family: 'Montserrat', sans-serif;
}

.related-post-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.related-post-link:hover {
    color: #3b82f6;
}

.related-post-footer {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e2e8f0;
}

.related-post-read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.related-post-read-more:hover {
    color: #2563eb;
}

.related-post-read-more svg {
    transition: transform 0.2s ease;
}

.related-post-read-more:hover svg {
    transform: translateX(4px);
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .related-post-title-detail {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .related-posts {
        margin-bottom: 4rem;
    }

    .related-posts-header {
        margin-bottom: 2.5rem;
    }

    .related-post-title-detail {
        font-size: 1.75rem;
    }

    .related-posts-subtitle {
        font-size: 0.875rem;
        padding: 0 1rem;
    }
}

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

    .related-post-card {
        max-width: 400px;
        margin: 0 auto;
    }

    .related-post-title-detail {
        font-size: 1.5rem;
    }
}
