/**
 * Single Post Styles
 * The Porto Life WordPress Theme
 */

/* Reset and Base Styles */
.article-single {
    font-family: "Georgia", "Times New Roman", serif;
    line-height: 1.7;
    color: var(--color-text-primary);
    background: var(--color-bg);
}

/* Article container uses common container from main.css */

/* Article Header */
.article-header {
    max-width: 800px;
    margin: 0 auto 1rem;
    text-align: center;
    padding-top: 2rem;
}

.article-categories {
    margin-bottom: 1rem;
}

/* Category pills use common styles from main.css */

.article-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    background: #f0f0f0;
    padding: 1rem 1.5rem;
    border-radius: 8px;
}

.article-subtitle {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #666;
    font-style: italic;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-weight: 500;
}

/* Article Meta */
.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.meta-primary .author-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar-small {
    border-radius: 50%;
    overflow: hidden;
    width: 40px;
    height: 40px;
}

.author-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-name a {
    color: #1a1a1a;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.author-title {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

.meta-secondary {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: #666;
}

/* Article Share Styles - Toggle-based Share Component */

/* Article Share Container */
.article-share {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Share Toggle Button */
.share-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #e1e5e9;
    cursor: pointer;
    color: #666;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    font-family: inherit;
}

.share-toggle:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
    color: #374151;
}

.share-toggle:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.share-toggle svg {
    flex-shrink: 0;
}

.share-text {
    font-family: inherit;
}

/* Share Icons Horizontal Layout - Compact Design */
.share-icons {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0.4rem;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.share-icons.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Share Icon Buttons - Compact Size */
.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 5px;
    text-decoration: none;
    color: #6b7280;
    background: #f8f9fa;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    cursor: pointer;
    font-family: inherit;
    font-size: 0;
    position: relative;
}

.share-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: transparent;
}

.share-icon:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.share-icon svg {
    flex-shrink: 0;
    transition: color 0.2s ease;
    width: 16px;
    height: 16px;
}

/* Copy feedback tooltip */
.copy-feedback {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: #111827;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
    pointer-events: none;
}

.copy-feedback::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #111827;
}

.share-copy.copied .copy-feedback {
    opacity: 1;
    visibility: visible;
}

/* Platform-specific hover colors */
.share-icon[href*="facebook"]:hover {
    background: #1877f2;
    color: white;
}

.share-icon[href*="twitter"]:hover {
    background: #000;
    color: white;
}

.share-icon[href*="linkedin"]:hover {
    background: #0077b5;
    color: white;
}

.share-icon[href*="whatsapp"]:hover {
    background: #25d366;
    color: white;
}

.share-icon[href*="telegram"]:hover,
.share-icon[href*="t.me"]:hover {
    background: #0088cc;
    color: white;
}

.share-icon[href*="pinterest"]:hover {
    background: #e60023;
    color: white;
}

.share-icon[href*="reddit"]:hover {
    background: #ff4500;
    color: white;
}

.share-icon[href*="mailto"]:hover {
    background: #34495e;
    color: white;
}

.share-copy:hover {
    background: #6366f1;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .share-icons {
        gap: 6px;
        right: auto;
        left: 0;
        min-width: 180px;
        padding: 0.3rem;
    }

    .share-icon {
        width: 28px;
        height: 28px;
    }

    .share-icon svg {
        width: 14px;
        height: 14px;
    }

    .copy-feedback {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

    .share-text {
        display: none;
    }

    .share-toggle {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .share-icons {
        gap: 5px;
        min-width: 160px;
    }

    .share-icon {
        width: 26px;
        height: 26px;
    }

    .share-icon svg {
        width: 13px;
        height: 13px;
    }
}
.share-icon:nth-child(1):hover { /* Facebook */
    background-color: #1877f2;
    color: white;
}

.share-icon:nth-child(2):hover { /* Twitter/X */
    background-color: #000;
    color: white;
}

.share-icon:nth-child(3):hover { /* LinkedIn */
    background-color: #0077b5;
    color: white;
}

.share-icon:nth-child(4):hover { /* WhatsApp */
    background-color: #25d366;
    color: white;
}

.share-icon:nth-child(5):hover { /* Telegram */
    background-color: #0088cc;
    color: white;
}

.share-icon:nth-child(6):hover { /* Pinterest */
    background-color: #e60023;
    color: white;
}

.share-icon:nth-child(7):hover { /* Reddit */
    background-color: #ff4500;
    color: white;
}

.share-icon:nth-child(8):hover { /* Email */
    background-color: #ea4335;
    color: white;
}

.share-icon:nth-child(9):hover { /* Copy Link */
    background-color: #333;
    color: white;
}

/* Copy Link Feedback */
.copy-feedback {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.copy-feedback::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.copy-feedback.show {
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
    .share-icons {
        gap: 12px;
        justify-content: center;
    }

    .share-icon {
        width: 40px;
        height: 40px;
    }

    .share-icon svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 400px) {
    .share-icons {
        gap: 10px;
    }

    .share-icon {
        width: 36px;
        height: 36px;
    }

    .share-icon svg {
        width: 16px;
        height: 16px;
    }
}

/* Hero Image */
.article-hero-image {
    margin: 2rem;
    width: 100%;
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-height: 70vh; /* Limit height to 70% of viewport */
    min-height: 300px; /* Minimum height for mobile */
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.12);
    background: #f5f5f5; /* Fallback background */
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop image to fit container */
    object-position: center center; /* Center the crop */
    transition: transform 0.3s ease;
    display: block;
}

/* Hover effect for interactivity */
.hero-image-wrapper:hover .hero-image {
    transform: scale(1.02);
}

/* Different aspect ratios for different screen sizes */
@media (min-width: 1200px) {
    .hero-image-wrapper {
        max-height: 500px; /* Fixed height for desktop */
        aspect-ratio: 16/9; /* Wide aspect ratio */
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .hero-image-wrapper {
        max-height: 400px; /* Medium height for tablets */
        aspect-ratio: 3/2;
    }
}

@media (max-width: 767px) {
    .hero-image-wrapper {
        max-height: 250px; /* Smaller height for mobile */
        aspect-ratio: 4/3;
        border-radius: 8px;
    }

    .article-hero-image {
        margin: 1.5rem -15px 2rem -15px; /* Full width on mobile */
        width: calc(100% + 30px);
    }
}

.hero-caption {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.caption-credit {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #999;
}

/* Article Body */
.article-body {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 4rem;
    margin-bottom: 4rem;
}

.article-content {
    max-width: 700px;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Drop Cap */
.article-content .first-paragraph:first-letter {
    float: left;
    font-size: 4em;
    line-height: 0.8;
    padding: 0.1em 0.1em 0 0;
    font-weight: bold;
    color: #333;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    font-weight: 700;
    margin: 2.5rem 0 1rem 0;
    color: #1a1a1a;
}

.article-content h2 {
    font-size: 1.8rem;
    line-height: 1.3;
}

.article-content h3 {
    font-size: 1.5rem;
    line-height: 1.4;
}

.article-content blockquote {
    border-left: 4px solid #333;
    padding-left: 2rem;
    margin: 2rem 0;
    font-style: italic;
    font-size: 1.2rem;
    color: #444;
}

.article-content p {
    margin-bottom: 1.5rem;
}

/* Sidebar */
.article-sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.toc-widget,
.related-articles-sidebar {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.toc-widget h3,
.related-articles-sidebar h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #333;
}

.related-item-small {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.related-item-small:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.related-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-title {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.related-title a {
    color: #333;
    text-decoration: none;
}

.related-title a:hover {
    color: #666;
}

.related-date {
    font-size: 0.8rem;
    color: #999;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .article-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .article-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .article-container {
        padding: 0 15px;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .meta-secondary {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .article-header {
        padding-top: 1rem;
    }

    .article-title {
        font-size: 2rem;
    }

    .article-content .first-paragraph:first-letter {
        font-size: 3em;
    }
}

/* ===================================
   Post Navigation
   =================================== */
.post-navigation {
    padding: 2rem 0;
    margin: 2rem 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}

.nav-previous,
.nav-next {
    display: flex;
    flex-direction: column;
}

.nav-next {
    text-align: right;
}

[dir="rtl"] .nav-next {
    text-align: left;
}

[dir="rtl"] .nav-previous {
    text-align: right;
}

.nav-label {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--spacing-sm);
}

.post-navigation a {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-bg-alt);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--color-border);
}

.post-navigation a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--color-accent);
}

.nav-thumbnail img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.nav-content {
    flex: 1;
}

.nav-content h4 {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    color: var(--color-text-primary);
    margin: 0;
    line-height: 1.4;
}

.post-navigation .nav-arrow-prev::after,
.post-navigation .nav-arrow-next::after {
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
        font-size: 1.5rem;
    color: var(--color-accent);
}

[dir="rtl"] .post-navigation .nav-arrow-prev::after,
[dir="rtl"] .post-navigation .nav-arrow-next::after {
    margin-left: 0;
    margin-right: 0.5rem;
}

.post-navigation .nav-arrow-prev::after {
    content: '←';
}

[dir="rtl"] .post-navigation .nav-arrow-prev::after {
    content: '→';
}

.post-navigation .nav-arrow-next::after {
    content: '→';
}

[dir="rtl"] .post-navigation .nav-arrow-next::after {
    content: '←';
}

.post-navigation .nav-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

.nav-next a {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-previous a {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-next a {
    flex-direction: row;
}

/* ===================================
   Related Posts Section
   =================================== */
.related-posts {
    background: var(--color-bg-alt);
    padding: var(--spacing-xxl) 0;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {

    .post-navigation .nav-wrapper {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .nav-next {
        text-align: left;
    }

    [dir="rtl"] .nav-next {
        text-align: right;
    }

}