/**
 * Single Page Modern Professional Layout
 * Gradient Design, Clean Typography, Mobile Responsive
 * Version: 3.1.0
 */

:root {
    /* Gradient Colors */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-accent: linear-gradient(135deg, #FA8BFF 0%, #2BD2FF 50%, #2BFF88 100%);
    --gradient-overlay: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Roboto', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;
}

/* ============================================
   SINGLE POST WRAPPER
   ============================================ */

.single-post-wrapper {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 2rem 0;
}

/* ============================================
   BREADCRUMB - GRADIENT ACCENT
   ============================================ */

.breadcrumb {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.breadcrumb ol {
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    display: inline-flex;
    align-items: center;
}

.breadcrumb a {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.breadcrumb a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.breadcrumb a:hover {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.breadcrumb a:hover::after {
    width: 100%;
}

/* ============================================
   POST HEADER - MODERN DESIGN
   ============================================ */

.post-header {
    position: relative;
    overflow: hidden;
}

.post-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
}

.post-header .post-title {
    font-family: var(--font-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #667eea 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Category Badge with Gradient */
.post-header .inline-flex {
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
}

.post-header .inline-flex:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* Post Excerpt */
.post-excerpt {
    font-size: 1.25rem;
    line-height: 1.8;
    color: #4b5563;
    font-weight: 400;
    animation: fadeIn 0.8s ease-out 0.2s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Post Meta */
.post-meta {
    animation: fadeIn 0.8s ease-out 0.4s both;
}

.post-meta .flex {
    transition: all 0.3s ease;
}

.post-meta .flex:hover {
    transform: translateX(3px);
}

.post-meta a {
    transition: all 0.3s ease;
}

.post-meta a:hover {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   FEATURED IMAGE - MODERN PRESENTATION
   ============================================ */

.post-thumbnail {
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s ease-out 0.6s both;
}

.post-thumbnail img {
    transition: transform 0.5s ease;
    display: block;
}

.post-thumbnail:hover img {
    transform: scale(1.02);
}

.post-thumbnail figcaption {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ============================================
   ARTICLE CONTENT - PROFESSIONAL TYPOGRAPHY
   ============================================ */

.article-content {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.article-credits {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-left: 4px solid;
    border-image: var(--gradient-primary);
    border-image-slice: 1;
}

/* Article Content Prose Enhancements */
.prose {
    font-family: var(--font-secondary);
}

.prose p {
    text-align: justify;
    text-justify: inter-word;
}

.prose p:first-child::first-letter {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1;
    float: left;
    margin: 0.1em 0.1em 0 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.prose h2 {
    position: relative;
    padding-left: 1.5rem;
}

.prose h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.prose h3 {
    color: #667eea;
}

.prose blockquote {
    position: relative;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    padding: 1.5rem 2rem;
    border-left: 4px solid;
    border-image: var(--gradient-primary);
    border-image-slice: 1;
    border-radius: 0 0.5rem 0.5rem 0;
}

.prose blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 4rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0.3;
}

.prose a {
    position: relative;
    text-decoration: none;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.prose a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.prose a:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.prose img {
    transition: all 0.3s ease;
}

.prose img:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.prose table {
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.prose thead {
    background: var(--gradient-primary);
    color: white;
}

.prose th {
    background: transparent;
    border: none;
    padding: 1rem;
    font-weight: 700;
}

.prose td {
    border-color: #e5e7eb;
}

.prose tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* ============================================
   POST TAGS - GRADIENT STYLE
   ============================================ */

.post-tags {
    animation: fadeInUp 0.8s ease-out 1s both;
}

.post-tags a {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.post-tags a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-tags a:hover::before {
    opacity: 1;
}

.post-tags a:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.post-tags a span {
    position: relative;
    z-index: 1;
}

/* ============================================
   SOCIAL SHARE - MODERN BUTTONS
   ============================================ */

.post-share {
    animation: fadeInUp 0.8s ease-out 1.2s both;
}

.social-share-btn,
.copy-link-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.social-share-btn::before,
.copy-link-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.social-share-btn:hover::before,
.copy-link-btn:hover::before {
    width: 300px;
    height: 300px;
}

.social-share-btn:active,
.copy-link-btn:active {
    transform: scale(0.95);
}

/* Share Button Success State */
.social-share-btn.shared,
.copy-link-btn.copied {
    background: var(--gradient-success) !important;
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ============================================
   SIDEBAR - STICKY & MODERN
   ============================================ */

.lg\:col-span-1 .sticky {
    top: 6rem;
}

.widget {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.widget::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
}

.widget:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid;
    border-image: var(--gradient-primary);
    border-image-slice: 1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   COMMENTS SECTION
   ============================================ */

.comments-area {
    background: white;
    border-radius: 1.5rem;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-top: 2rem;
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.comment-body {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 1rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.comment-body:hover {
    background: #f3f4f6;
    transform: translateX(5px);
}

.comment-author img {
    border-radius: 50%;
    border: 3px solid;
    border-image: var(--gradient-primary);
    border-image-slice: 1;
}

/* ============================================
   READING PROGRESS BAR
   ============================================ */

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 4px;
    background: var(--gradient-primary);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.5);
    cursor: pointer;
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.scroll-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.6);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .single-post-wrapper {
        padding: 1rem 0;
    }
    
    .post-header {
        padding: 1.5rem;
    }
    
    .post-header .post-title {
        font-size: 2rem;
    }
    
    .article-content {
        padding: 1.5rem;
    }
    
    .prose p:first-child::first-letter {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .post-header .post-title {
        font-size: 1.75rem;
    }
    
    .post-excerpt {
        font-size: 1rem;
    }
    
    .prose p {
        font-size: 1rem;
        text-align: left;
    }
    
    .prose p:first-child::first-letter {
        font-size: 2.5rem;
    }
    
    .prose h2 {
        font-size: 1.5rem;
    }
    
    .prose h3 {
        font-size: 1.25rem;
    }
    
    .social-share-btn,
    .copy-link-btn {
        flex: 1 1 calc(50% - 0.375rem);
        justify-content: center;
    }
    
    .scroll-to-top {
        bottom: 5rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }
}

@media (max-width: 640px) {
    .breadcrumb {
        font-size: 0.75rem;
        padding: 0.75rem 1rem;
    }
    
    .post-meta {
        font-size: 0.75rem;
        gap: 0.75rem;
    }
    
    .social-share-btn,
    .copy-link-btn {
        padding: 0.625rem 1rem;
        font-size: 0.813rem;
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .breadcrumb,
    .post-share,
    .social-share-btn,
    .copy-link-btn,
    .scroll-to-top,
    .widget,
    aside,
    .reading-progress {
        display: none !important;
    }
    
    .single-post-wrapper {
        background: white;
    }
    
    .lg\:col-span-2 {
        grid-column: span 3;
    }
    
    .prose {
        max-width: 100%;
    }
}

/* ============================================
   ANIMATIONS FOR PAGE LOAD
   ============================================ */

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.lg\:col-span-2 {
    animation: slideInFromLeft 0.8s ease-out;
}

.lg\:col-span-1 {
    animation: slideInFromRight 0.8s ease-out 0.2s both;
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .single-post-wrapper {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .post-header,
    .article-content,
    .post-tags,
    .post-share,
    .widget {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .breadcrumb {
        background: #1f2937;
    }
    
    .post-header .post-title {
        background: var(--gradient-accent);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .prose {
        color: #d1d5db;
    }
    
    .prose h2,
    .prose h3 {
        color: #f9fafb;
    }
    
    .prose a {
        color: #60a5fa;
    }
    
    .comment-body {
        background: #374151;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

*:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    border-radius: 0 0 0.5rem 0;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}
