/**
 * Single Post Content Widget - CSS
 *
 * Editorial typography skins for WordPress post content display.
 * Inherits variables from bith-widgets-master.css.
 *
 * @package Bith_Core
 * @since 1.0.0
 */

/* ===========================================
   BASE CONTAINER
   =========================================== */

.bith-post-content {
    position: relative;
    width: 100%;
    font-family: var(--bith-widget-font-primary);
}

.bith-post-content-article {
    width: 100%;
}

.bith-post-content__article-title {
    color: var(--bith-widget-text-heading);
    font-weight: var(--bith-widget-font-bold);
    line-height: var(--bith-widget-leading-tight);
}

.bith-post-content__featured-image {
    margin-bottom: var(--bith-widget-space-8);
}

.bith-post-content__featured-image img {
    width: 100%;
    height: auto;
    border-radius: var(--bith-widget-radius-lg);
}

/* ===========================================
   COMMON TYPOGRAPHY STYLES
   =========================================== */

.bith-post-content-article p {
    color: var(--bith-widget-text-body);
    line-height: var(--bith-widget-leading-relaxed);
    margin-bottom: 1.5em;
}

.bith-post-content-article h2:not(.bith-post-content__article-title) {
    color: var(--bith-widget-text-heading);
    font-weight: var(--bith-widget-font-semibold);
    line-height: var(--bith-widget-leading-tight);
    margin-top: 2.5em;
    margin-bottom: 0.75em;
}

.bith-post-content-article h3 {
    color: var(--bith-widget-text-heading);
    font-weight: var(--bith-widget-font-semibold);
    line-height: var(--bith-widget-leading-snug);
    margin-top: 2em;
    margin-bottom: 0.5em;
}

.bith-post-content-article blockquote {
    padding: 1.5em 2em;
    margin: 2em 0;
    border-left: 4px solid var(--bith-widget-primary);
    background: var(--bith-widget-bg-subtle);
    border-radius: var(--bith-widget-radius-sm);
    color: var(--bith-widget-text-secondary);
}

.bith-post-content-article blockquote cite {
    display: block;
    margin-top: 1em;
    font-size: 0.85em;
    color: var(--bith-widget-text-muted);
    font-style: normal;
}

.bith-post-content-article ul,
.bith-post-content-article ol {
    margin: 1.5em 0;
    padding-left: 2em;
}

.bith-post-content-article li {
    margin-bottom: 0.5em;
    line-height: var(--bith-widget-leading-relaxed);
}

.bith-post-content-article img {
    max-width: 100%;
    height: auto;
    border-radius: var(--bith-widget-radius-md);
    margin: 2em 0;
}

.bith-post-content-article a {
    color: var(--bith-widget-link);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all var(--bith-widget-transition-fast);
}

.bith-post-content-article a:hover {
    color: var(--bith-widget-link-hover);
    border-bottom-color: var(--bith-widget-link-hover);
}

.bith-post-content-article strong {
    font-weight: var(--bith-widget-font-bold);
    color: var(--bith-widget-text-heading);
}

/* ===========================================
   SKIN 1: THE NEW YORKER
   Elegant serif with giant drop cap
   =========================================== */

.bith-post-content--skin-1 .bith-post-content-article {
    font-family: var(--bith-widget-font-serif);
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.85;
}

.bith-post-content--skin-1 .bith-post-content__article-title {
    font-family: var(--bith-widget-font-serif);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    text-align: center;
    margin-bottom: var(--bith-widget-space-8);
    padding-bottom: var(--bith-widget-space-6);
    border-bottom: 1px solid var(--bith-widget-border);
}

.bith-post-content--skin-1 .bith-post-content-article p:first-of-type::first-letter {
    font-family: var(--bith-widget-font-serif);
    font-size: 5.5rem;
    font-weight: var(--bith-widget-font-bold);
    float: left;
    line-height: 0.8;
    margin-right: 0.15em;
    margin-top: 0.1em;
    color: var(--bith-widget-primary);
}

.bith-post-content--skin-1 .bith-post-content-article p {
    text-align: justify;
    hyphens: auto;
}

.bith-post-content--skin-1 .bith-post-content-article h2:not(.bith-post-content__article-title) {
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    text-align: center;
}

.bith-post-content--skin-1 .bith-post-content-article h3 {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    font-style: italic;
}

.bith-post-content--skin-1 .bith-post-content-article blockquote {
    font-style: italic;
    font-size: 1.15em;
    border-left-width: 3px;
    padding-left: 1.5em;
    margin-left: 1em;
    background: transparent;
}

/* ===========================================
   SKIN 2: MODERN SANS
   Clean sans-serif style
   =========================================== */

.bith-post-content--skin-2 .bith-post-content-article {
    font-family: var(--bith-widget-font-primary);
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.75;
}

.bith-post-content--skin-2 .bith-post-content__article-title {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: var(--bith-widget-font-extrabold);
    letter-spacing: var(--bith-widget-tracking-tight);
    margin-bottom: var(--bith-widget-space-8);
}

.bith-post-content--skin-2 .bith-post-content-article h2:not(.bith-post-content__article-title) {
    font-size: clamp(1.5rem, 3vw, 1.875rem);
    font-weight: var(--bith-widget-font-extrabold);
    letter-spacing: var(--bith-widget-tracking-tight);
}

.bith-post-content--skin-2 .bith-post-content-article h3 {
    font-size: clamp(1.15rem, 2.5vw, 1.375rem);
    font-weight: var(--bith-widget-font-bold);
}

.bith-post-content--skin-2 .bith-post-content-article blockquote {
    font-size: 1.25em;
    font-weight: var(--bith-widget-font-medium);
    background: var(--bith-widget-gradient-subtle);
    border-radius: var(--bith-widget-radius-sm);
}

/* ===========================================
   SKIN 3: READING PROGRESS BAR
   Fixed progress indicator
   =========================================== */

.bith-post-content--skin-3 {
    padding-top: 50px;
    position: relative;
}

.bith-post-content__progress-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--bith-widget-border);
    z-index: var(--bith-widget-z-sticky);
    display: flex;
    align-items: center;
}

.bith-post-content__progress-bar {
    height: 100%;
    width: 0%;
    background: var(--bith-widget-gradient-duo);
    transition: width 0.1s var(--bith-widget-ease-out);
}

.bith-post-content__progress-percentage {
    position: absolute;
    right: 12px;
    top: 12px;
    font-size: var(--bith-widget-text-xs);
    font-weight: var(--bith-widget-font-semibold);
    color: var(--bith-widget-text-muted);
    background: var(--bith-widget-surface);
    padding: 4px 8px;
    border-radius: 4px;
    box-shadow: var(--bith-widget-shadow-sm);
}

.bith-post-content--skin-3 .bith-post-content-article {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.75;
}

.bith-post-content--skin-3 .bith-post-content__article-title {
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    margin-bottom: var(--bith-widget-space-6);
}

/* ===========================================
   SKIN 4: INTERACTIVE BLOCKQUOTES
   Tweetable quotes with icons
   =========================================== */

.bith-post-content--skin-4 .bith-post-content-article {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.75;
}

.bith-post-content--skin-4 .bith-post-content__article-title {
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    margin-bottom: var(--bith-widget-space-6);
}

.bith-post-content--skin-4 .bith-post-content-article blockquote {
    position: relative;
    background: var(--bith-widget-surface);
    padding: 2.5em 2em 2em 5em;
    margin: 2.5em 0;
    border-radius: var(--bith-widget-radius-lg);
    border-left-width: 5px;
    box-shadow: var(--bith-widget-shadow-md);
    overflow: hidden;
    transition: transform var(--bith-widget-transition-normal),
        box-shadow var(--bith-widget-transition-normal);
}

.bith-post-content--skin-4 .bith-post-content-article blockquote:hover {
    transform: translateY(-3px);
    box-shadow: var(--bith-widget-shadow-xl);
}

.bith-post-content--skin-4 .bith-post-content-article blockquote::before {
    content: "\201C";
    position: absolute;
    left: -15px;
    top: -10px;
    font-size: 100px;
    font-family: var(--bith-widget-font-serif);
    color: var(--bith-widget-primary);
    opacity: 0.08;
}

.bith-post-content--skin-4 .bith-post-content-article blockquote p {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: var(--bith-widget-font-medium);
    line-height: 1.6;
    margin-bottom: 1em;
    position: relative;
    z-index: 1;
}

.bith-post-content--skin-4 .bith-post-content-article blockquote cite {
    position: relative;
    z-index: 1;
}

/* Tweet Button */
.bith-tweet-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-left: 12px;
    font-size: var(--bith-widget-text-xs);
    font-weight: var(--bith-widget-font-medium);
    color: var(--bith-widget-surface);
    background: #1DA1F2;
    border: none;
    border-radius: var(--bith-widget-radius-full);
    cursor: pointer;
    transition: all var(--bith-widget-transition-bounce);
}

.bith-tweet-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(29, 161, 242, 0.4);
}

.bith-tweet-button.tweeted {
    background: var(--bith-widget-success);
}

.bith-tweet-button svg {
    width: 16px;
    height: 16px;
}

/* ===========================================
   SKIN 5: SIDEBAR INTEGRATION (TOC)
   70% content with sticky sidebar
   =========================================== */

.bith-post-content__sidebar-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--bith-widget-space-8);
}

@media (min-width: 900px) {
    .bith-post-content__sidebar-layout {
        grid-template-columns: 1fr 280px;
    }
}

.bith-post-content--skin-5 .bith-post-content-article {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.75;
}

.bith-post-content--skin-5 .bith-post-content__article-title {
    font-size: clamp(1.6rem, 4vw, 2.25rem);
    margin-bottom: var(--bith-widget-space-6);
}

.bith-post-content--skin-5 .bith-post-content-article h2:not(.bith-post-content__article-title) {
    padding-top: 1em;
    border-top: 1px solid var(--bith-widget-border);
}

/* Sidebar TOC */
.bith-post-content__sidebar-toc {
    display: none;
}

@media (min-width: 900px) {
    .bith-post-content__sidebar-toc {
        display: block;
    }
}

.bith-post-content__toc-wrapper {
    position: sticky;
    top: 20px;
    background: var(--bith-widget-surface);
    border-radius: var(--bith-widget-radius-lg);
    padding: var(--bith-widget-space-4);
    box-shadow: var(--bith-widget-shadow-md);
}

.bith-post-content__toc-title {
    font-size: var(--bith-widget-text-sm);
    font-weight: var(--bith-widget-font-bold);
    text-transform: uppercase;
    letter-spacing: var(--bith-widget-tracking-wide);
    color: var(--bith-widget-text-muted);
    margin-bottom: var(--bith-widget-space-3);
    padding-bottom: var(--bith-widget-space-3);
    border-bottom: 1px solid var(--bith-widget-border);
}

.bith-post-content__toc-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bith-post-content__toc-nav li {
    margin-bottom: 0.5em;
}

.bith-post-content__toc-nav li.bith-toc-subitem {
    margin-left: 1em;
}

.bith-post-content__toc-link {
    display: block;
    font-size: var(--bith-widget-text-sm);
    color: var(--bith-widget-text-secondary);
    padding: 6px 10px;
    border-radius: 6px;
    transition: all var(--bith-widget-transition-fast);
    position: relative;
    text-decoration: none;
}

.bith-post-content__toc-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--bith-widget-primary);
    border-radius: 2px;
    transition: height var(--bith-widget-transition-fast);
}

.bith-post-content__toc-link:hover,
.bith-post-content__toc-link.active {
    color: var(--bith-widget-primary);
    background: rgba(var(--bith-widget-primary-rgb), 0.08);
}

.bith-post-content__toc-link.active::before {
    height: 60%;
}

.bith-post-content__toc-progress {
    margin-top: var(--bith-widget-space-3);
    height: 4px;
    background: var(--bith-widget-border-light);
    border-radius: 2px;
    overflow: hidden;
}

.bith-post-content__toc-progress-bar {
    height: 100%;
    width: 15%;
    background: var(--bith-widget-gradient-duo);
    border-radius: 2px;
    transition: width var(--bith-widget-transition-normal);
}

/* ===========================================
   SKIN 6: IMAGE BREAKOUT
   Wide images with negative margins
   =========================================== */

.bith-post-content--skin-6 .bith-post-content-article {
    font-size: clamp(1rem, 2vw, 1.1rem);
    line-height: 1.75;
}

.bith-post-content--skin-6 .bith-post-content__article-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    letter-spacing: var(--bith-widget-tracking-tight);
    margin-bottom: var(--bith-widget-space-6);
}

.bith-post-content--skin-6 .bith-post-content-article blockquote {
    font-size: 1.2em;
    font-style: italic;
    padding-left: 1.5em;
    border-left-width: 3px;
    background: transparent;
}

/* Image Breakout Effect */
.bith-post-content--skin-6 .bith-post-content-article figure,
.bith-post-content--skin-6 .bith-post-content-article .wp-block-image {
    margin: 2.5em 0;
    margin-left: -10%;
    width: 120%;
    max-width: 100vw;
    position: relative;
}

@media (max-width: 900px) {

    .bith-post-content--skin-6 .bith-post-content-article figure,
    .bith-post-content--skin-6 .bith-post-content-article .wp-block-image {
        margin-left: 0;
        width: 100%;
    }
}

.bith-post-content--skin-6 .bith-post-content-article figure img,
.bith-post-content--skin-6 .bith-post-content-article .wp-block-image img {
    width: 100%;
    height: auto;
    border-radius: var(--bith-widget-radius-lg);
    box-shadow: var(--bith-widget-shadow-xl);
    transition: transform var(--bith-widget-transition-slow);
}

.bith-post-content--skin-6 .bith-post-content-article figure:hover img,
.bith-post-content--skin-6 .bith-post-content-article .wp-block-image:hover img {
    transform: scale(1.01);
}

.bith-post-content--skin-6 .bith-post-content-article figcaption {
    text-align: center;
    font-size: var(--bith-widget-text-sm);
    color: var(--bith-widget-text-secondary);
    margin-top: 1em;
    padding: 0 10%;
    font-style: italic;
}

/* ===========================================
   SKIN 7: DARK MODE READER
   Optimized for night reading
   =========================================== */

.bith-post-content--skin-7 {
    background-color: #1a1a2e;
    border-radius: var(--bith-widget-radius-lg);
    padding: var(--bith-widget-space-8);
}

.bith-post-content--skin-7 .bith-post-content-article {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.85;
    color: #c9d1d9;
}

.bith-post-content--skin-7 .bith-post-content__article-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: #f0f6fc;
    letter-spacing: -0.01em;
    margin-bottom: var(--bith-widget-space-6);
}

.bith-post-content--skin-7 .bith-post-content-article p {
    color: #c9d1d9;
}

.bith-post-content--skin-7 .bith-post-content-article h2:not(.bith-post-content__article-title) {
    font-size: clamp(1.3rem, 3vw, 1.625rem);
    color: #e6edf3;
    font-weight: var(--bith-widget-font-semibold);
}

.bith-post-content--skin-7 .bith-post-content-article h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.25rem);
    color: #d0d7de;
    font-weight: var(--bith-widget-font-semibold);
}

.bith-post-content--skin-7 .bith-post-content-article blockquote {
    font-size: 1.1em;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.03);
    border-left-color: #6366f1;
}

.bith-post-content--skin-7 .bith-post-content-article blockquote cite {
    color: #8b949e;
}

.bith-post-content--skin-7 .bith-post-content-article a {
    color: #6366f1;
}

.bith-post-content--skin-7 .bith-post-content-article a:hover {
    color: #818cf8;
    border-bottom-color: #818cf8;
}

.bith-post-content--skin-7 .bith-post-content-article ::selection {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

/* ===========================================
   SKIN 8: FOCUS MODE
   Paragraph highlighting on scroll
   =========================================== */

.bith-post-content--skin-8 .bith-post-content-article {
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 1.8;
}

.bith-post-content--skin-8 .bith-post-content__article-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: var(--bith-widget-space-6);
    opacity: 1 !important;
}

.bith-post-content--skin-8 .bith-post-content-article h2:not(.bith-post-content__article-title) {
    font-size: clamp(1.4rem, 3vw, 1.75rem);
    margin-top: 2.5em;
}

.bith-post-content--skin-8 .bith-post-content-article h3 {
    font-size: clamp(1.15rem, 2.5vw, 1.35rem);
}

/* Focus Elements */
.bith-post-content--skin-8 .bith-focus-element {
    transition: opacity 0.5s var(--bith-widget-ease-out),
        transform 0.5s var(--bith-widget-ease-out);
}

.bith-post-content--skin-8.focus-active .bith-focus-element {
    opacity: 0.35;
}

.bith-post-content--skin-8.focus-active .bith-focus-element.in-focus {
    opacity: 1;
    position: relative;
}

.bith-post-content--skin-8.focus-active .bith-focus-element.in-focus::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--bith-widget-gradient-duo);
    border-radius: 2px;
    animation: bith-focus-pulse 2s ease-in-out infinite;
}

@keyframes bith-focus-pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

/* Focus Toggle Button */
.bith-post-content__focus-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: var(--bith-widget-text-sm);
    font-weight: var(--bith-widget-font-medium);
    color: var(--bith-widget-text-secondary);
    background: var(--bith-widget-surface);
    border-radius: var(--bith-widget-radius-full);
    box-shadow: var(--bith-widget-shadow-md);
    transition: all var(--bith-widget-transition-bounce);
    z-index: var(--bith-widget-z-sticky);
    border: none;
    cursor: pointer;
}

.bith-post-content__focus-toggle:hover {
    color: var(--bith-widget-primary);
    box-shadow: var(--bith-widget-shadow-lg);
    transform: translateY(-2px);
}

.bith-post-content__focus-toggle.active {
    background: var(--bith-widget-gradient-duo);
    color: white;
}

.bith-post-content__focus-icon {
    width: 18px;
    height: 18px;
}

/* ===========================================
   RESPONSIVE ADJUSTMENTS
   =========================================== */
@media (max-width: 768px) {
    .bith-post-content--skin-1 .bith-post-content-article p:first-of-type::first-letter {
        font-size: 4rem;
    }

    .bith-post-content--skin-4 .bith-post-content-article blockquote {
        padding: 2em 1.5em 1.5em 3.5em;
    }

    .bith-post-content--skin-4 .bith-post-content-article blockquote::before {
        font-size: 70px;
        left: -10px;
        top: -5px;
    }

    .bith-post-content__focus-toggle {
        bottom: 10px;
        right: 10px;
        padding: 8px 14px;
        font-size: var(--bith-widget-text-xs);
    }
}

/* ===========================================
   PRINT STYLES
   =========================================== */
@media print {

    .bith-post-content__progress-container,
    .bith-post-content__sidebar-toc,
    .bith-post-content__focus-toggle,
    .bith-tweet-button {
        display: none !important;
    }

    .bith-post-content--skin-7 {
        background: #fff !important;
    }

    .bith-post-content--skin-7 .bith-post-content-article,
    .bith-post-content--skin-7 .bith-post-content__article-title,
    .bith-post-content--skin-7 .bith-post-content-article h2,
    .bith-post-content--skin-7 .bith-post-content-article h3 {
        color: #333 !important;
    }
}

/* ===========================================
   ACCESSIBILITY
   =========================================== */
@media (prefers-reduced-motion: reduce) {

    .bith-post-content *,
    .bith-post-content *::before,
    .bith-post-content *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.bith-post-content__focus-toggle:focus-visible,
.bith-post-content-article a:focus-visible {
    outline: 2px solid var(--bith-widget-primary);
    outline-offset: 2px;
}