/**
 * Op-Ed Template Styles
 * 
 * Premium styling for the Op-Ed content type featuring:
 * - Full-width hero with featured image
 * - Two-column layout (content + sidebar)
 * - Styled asset sections (infographics, audio, video, quiz)
 * - Modern animations and interactions
 */

/* ============================================
   OP-ED HERO SECTION
   ============================================ */

.oped-hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(135deg, #0A1929 0%, #112240 100%);
    overflow: hidden;
}

.oped-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.oped-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.oped-hero-placeholder {
    background: linear-gradient(135deg, #0A1929 0%, #1e3a5f 50%, #112240 100%);
}

.oped-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top,
            rgba(10, 25, 41, 0.95) 0%,
            rgba(10, 25, 41, 0.7) 40%,
            rgba(10, 25, 41, 0.3) 100%);
    z-index: 2;
}

.oped-hero .container {
    position: relative;
    z-index: 3;
    width: 100%;
    padding: 80px 20px;
}

.oped-hero-content {
    max-width: 800px;
}

.oped-meta-tags {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.oped-category-tag {
    background: var(--primary-color);
    color: white;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.oped-read-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.oped-title {
    font-family: var(--font-heading);
    font-size: 48px;
    font-weight: 700;
    color: white;
    line-height: 1.15;
    margin-bottom: 32px;
    letter-spacing: -1px;
}

.oped-author-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.oped-author-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.oped-author-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.oped-author-name {
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.oped-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}


/* ============================================
   OP-ED CONTENT LAYOUT
   ============================================ */

.oped-content-section {
    padding: 60px 0 80px;
    background: #FAFAFA;
}

.oped-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    align-items: start;
}

/* Main Content Column */
.oped-main-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.oped-article-body {
    padding: 48px;
    font-size: 17px;
    line-height: 1.85;
    color: var(--text-main);
}

.oped-article-body p {
    margin-bottom: 24px;
}

.oped-article-body h2,
.oped-article-body h3,
.oped-article-body h4 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    margin-top: 32px;
    margin-bottom: 16px;
}

.oped-article-body h2 {
    font-size: 28px;
}

.oped-article-body h3 {
    font-size: 22px;
}

.oped-article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 16px 24px;
    margin: 32px 0;
    background: #FFF8F5;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--text-main);
}

.oped-article-body ul,
.oped-article-body ol {
    margin-bottom: 24px;
    padding-left: 24px;
}

.oped-article-body li {
    margin-bottom: 8px;
}

.oped-article-body a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: rgba(255, 90, 0, 0.3);
    transition: text-decoration-color 0.2s;
}

.oped-article-body a:hover {
    text-decoration-color: var(--primary-color);
}


/* ============================================
   OP-ED DIGITAL ASSETS
   ============================================ */

.oped-asset {
    border-top: 1px solid #E5E7EB;
    padding: 32px 48px 40px;
}

.oped-asset-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.oped-asset-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FFF5F0 0%, #FFECE3 100%);
    color: var(--primary-color);
}

.oped-asset-icon.oped-icon-video {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    color: #2563EB;
}

.oped-asset-icon.oped-icon-quiz {
    background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
    color: #16A34A;
}

.oped-asset-header h3 {
    font-family: var(--font-heading);
    font-size: 20px;
    color: var(--secondary-color);
    margin: 0;
}

/* Large Infographic */
.oped-infographic-large .oped-infographic-link {
    display: block;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.oped-infographic-large .oped-infographic-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.oped-infographic-img {
    width: 100%;
    height: auto;
    display: block;
}

.oped-expand-hint {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 25, 41, 0.85);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.3s, transform 0.3s;
}

.oped-infographic-link:hover .oped-expand-hint {
    opacity: 1;
    transform: translateY(0);
}

/* Video Summary */
.oped-video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #000;
}

.oped-video-wrapper iframe,
.oped-video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Quiz Section */
.oped-quiz-wrapper {
    background: linear-gradient(135deg, #F8FAFC 0%, #F1F5F9 100%);
    border-radius: var(--radius-lg);
    padding: 32px;
    min-height: 300px;
    border: 1px solid #E2E8F0;
}

.oped-quiz-wrapper iframe {
    width: 100%;
    min-height: 400px;
    border: none;
    border-radius: var(--radius-md);
}


/* ============================================
   AUTHOR BIO SECTION
   ============================================ */

.oped-author-bio-section {
    border-top: 1px solid #E5E7EB;
    padding: 40px 48px;
    background: #F8FAFC;
}

.oped-bio-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.oped-bio-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.oped-bio-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.oped-bio-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-light);
    font-weight: 600;
}

.oped-bio-info h4 {
    font-family: var(--font-heading);
    font-size: 22px;
    color: var(--secondary-color);
    margin: 0;
}

.oped-bio-text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-light);
    margin: 0;
}


/* ============================================
   OP-ED SIDEBAR
   ============================================ */

.oped-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 100px;
}

.oped-sidebar-block {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

.oped-sidebar-block h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    color: var(--secondary-color);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Small Infographic */
.oped-infographic-small img {
    width: 100%;
    border-radius: var(--radius-md);
    transition: transform 0.3s;
}

.oped-infographic-small a:hover img {
    transform: scale(1.02);
}

/* Audio Player */
.oped-audio-summary {
    background: linear-gradient(135deg, #0A1929 0%, #112240 100%);
}

.oped-audio-summary h4 {
    color: white;
}

.oped-audio-summary h4 svg {
    color: var(--primary-color);
}

.oped-audio-player audio {
    width: 100%;
    border-radius: var(--radius-md);
}

.oped-audio-player audio::-webkit-media-controls-panel {
    background: rgba(255, 255, 255, 0.1);
}

/* Share Buttons */
.oped-share-buttons {
    display: flex;
    gap: 12px;
}

.oped-share-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F3F4F6;
    color: var(--text-main);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.oped-share-btn:hover {
    transform: translateY(-2px);
}

.oped-share-twitter:hover {
    background: #000;
    color: white;
}

.oped-share-linkedin:hover {
    background: #0077B5;
    color: white;
}

.oped-share-email:hover {
    background: var(--primary-color);
    color: white;
}

.oped-share-copy:hover,
.oped-share-copy.copied {
    background: #10B981;
    color: white;
}

/* Related Articles */
.oped-related-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
    transition: background 0.2s;
}

.oped-related-item:last-child {
    border-bottom: none;
}

.oped-related-item:hover {
    background: #FAFAFA;
    margin: 0 -12px;
    padding: 12px;
    border-radius: var(--radius-md);
}

.oped-related-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
}

.oped-related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.oped-placeholder-thumb {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #E5E7EB 0%, #D1D5DB 100%);
}

.oped-related-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.oped-related-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--secondary-color);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.oped-related-date {
    font-size: 12px;
    color: var(--text-light);
}

.oped-no-related {
    color: var(--text-light);
    font-size: 14px;
    font-style: italic;
}


/* ============================================
   POST NAVIGATION
   ============================================ */

.oped-navigation {
    background: white;
    border-top: 1px solid #E5E7EB;
    padding: 40px 0;
}

.oped-nav-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.oped-nav-link {
    padding: 24px;
    border-radius: var(--radius-lg);
    background: #F8FAFC;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.oped-nav-link:hover {
    background: #F1F5F9;
    transform: translateY(-2px);
}

.oped-nav-prev {
    text-align: left;
}

.oped-nav-next {
    text-align: right;
    margin-left: auto;
}

.oped-nav-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.oped-nav-next .oped-nav-label {
    justify-content: flex-end;
}

.oped-nav-title {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--secondary-color);
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 1024px) {
    .oped-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .oped-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .oped-audio-summary {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .oped-hero {
        min-height: 400px;
    }

    .oped-title {
        font-size: 32px;
    }

    .oped-article-body {
        padding: 32px 24px;
        font-size: 16px;
    }

    .oped-asset {
        padding: 24px;
    }

    .oped-author-bio-section {
        padding: 32px 24px;
    }

    .oped-sidebar {
        grid-template-columns: 1fr;
    }

    .oped-audio-summary {
        grid-column: span 1;
    }

    .oped-nav-wrapper {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .oped-nav-next {
        text-align: left;
    }

    .oped-nav-next .oped-nav-label {
        justify-content: flex-start;
        flex-direction: row-reverse;
    }
}

@media (max-width: 480px) {
    .oped-hero .container {
        padding: 48px 16px;
    }

    .oped-title {
        font-size: 28px;
    }

    .oped-meta-tags {
        flex-wrap: wrap;
    }

    .oped-author-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .oped-bio-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .oped-share-buttons {
        flex-wrap: wrap;
    }

}

/* ============================================
   QUIZ BUILDER WIDGET
   ============================================ */
.quiz-widget {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
    border: 1px solid #e5e7eb;
}

.quiz-widget-header {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #112240 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quiz-widget-header h4 {
    margin: 0;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quiz-widget-body {
    padding: 24px;
}

.quiz-question {
    display: none;
    animation: fadeIn 0.4s;
}

.quiz-question.active {
    display: block;
}

.quiz-question-text {
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.4;
}

/* Flashcard App Styles */
.flashcard-container {
    perspective: 1000px;
    margin-top: 20px;
}

.flashcard-inner {
    position: relative;
    width: 100%;
    min-height: 200px;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.flashcard-inner.is-flipped {
    transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border-radius: var(--radius-md);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.flashcard-front {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    color: var(--secondary-color);
    font-weight: 600;
}

.flashcard-back {
    background: #fff5f0;
    border: 1px solid var(--primary-color);
    color: var(--secondary-color);
    transform: rotateY(180deg);
    line-height: 1.6;
}

.quiz-next-btn {
    margin-top: 24px;
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.quiz-next-btn:hover {
    background: #e65100;
}

.quiz-progress {
    margin-top: 20px;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.quiz-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s;
}

/* Redesigned Premium Subscribe */
.premium-subscribe {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #112240 100%);
    border-radius: var(--radius-lg);
    padding: 60px 40px;
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    margin: 40px 0;
}

.premium-subscribe::before {
    content: '✉️';
    position: absolute;
    top: -20px;
    right: -20px;
    font-size: 150px;
    opacity: 0.15;
    transform: rotate(15deg);
    pointer-events: none;
}

.premium-subscribe h2 {
    color: white;
    font-size: 36px;
    margin-bottom: 16px;
}

.premium-subscribe p {
    color: #cbd5e1;
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 32px;
}

.premium-subscribe .subscribe-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.premium-subscribe input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #1f2937;
}

.premium-subscribe .btn-primary {
    padding: 16px 32px;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(255, 90, 0, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .premium-subscribe {
        padding: 40px 20px;
    }

    .premium-subscribe h2 {
        font-size: 28px;
    }

    .premium-subscribe .subscribe-form {
        flex-direction: column;
    }
}
