/* ============================================
   CRESANNA BLOG — Enhanced Visual Styles
   ============================================ */

/* --- Reading Progress Bar --- */
.reading-progress {
    position: fixed;
    top: 80px; /* below nav */
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #5B2D8E, #8B5CF6, #C9A84C);
    z-index: 100;
    transition: width 0.15s ease-out;
    border-radius: 0 2px 2px 0;
}

/* --- Floating Table of Contents --- */
.blog-toc {
    position: fixed;
    top: 120px;
    left: max(16px, calc((100vw - 1280px) / 2 - 20px));
    width: 240px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    z-index: 40;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    scrollbar-width: thin;
    scrollbar-color: #E8E6E3 transparent;
}
.blog-toc.visible {
    opacity: 1;
    transform: translateX(0);
}
.blog-toc-inner {
    background: white;
    border: 1px solid #E8E6E3;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
}
.blog-toc h4 {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748B;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E8E6E3;
}
.blog-toc a {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: #64748B;
    text-decoration: none;
    padding: 6px 0 6px 12px;
    border-left: 2px solid transparent;
    transition: all 0.3s ease;
    margin-bottom: 2px;
}
.blog-toc a:hover {
    color: #5B2D8E;
    border-left-color: #E8E4DF;
}
.blog-toc a.active {
    color: #5B2D8E;
    font-weight: 600;
    border-left-color: #5B2D8E;
    background: linear-gradient(90deg, rgba(91,45,142,0.05), transparent);
}
@media (max-width: 1440px) {
    .blog-toc { display: none; }
}

/* --- Mobile TOC (collapsible) --- */
.mobile-toc {
    display: none;
    margin-bottom: 2rem;
}
@media (max-width: 1440px) {
    .mobile-toc { display: block; }
}
.mobile-toc-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 14px 18px;
    background: linear-gradient(135deg, #FDFCFA, #FAF8F4);
    border: 1px solid #E8E6E3;
    border-radius: 14px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #5B2D8E;
    transition: all 0.3s ease;
}
.mobile-toc-toggle:hover {
    border-color: #5B2D8E;
    box-shadow: 0 2px 12px rgba(91,45,142,0.1);
}
.mobile-toc-toggle svg {
    transition: transform 0.3s ease;
}
.mobile-toc-toggle.open svg {
    transform: rotate(180deg);
}
.mobile-toc-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-toc-list.open {
    max-height: 600px;
}
.mobile-toc-list a {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #64748B;
    text-decoration: none;
    padding: 10px 18px;
    border-left: 2px solid #E8E6E3;
    margin-left: 16px;
    transition: all 0.2s ease;
}
.mobile-toc-list a:first-child { margin-top: 12px; }
.mobile-toc-list a:hover,
.mobile-toc-list a.active {
    color: #5B2D8E;
    border-left-color: #5B2D8E;
}

/* --- Scroll Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* stagger children */
.animate-on-scroll.visible .stagger-1 { transition-delay: 0.1s; }
.animate-on-scroll.visible .stagger-2 { transition-delay: 0.2s; }
.animate-on-scroll.visible .stagger-3 { transition-delay: 0.3s; }

/* --- Pull Quotes --- */
.pull-quote {
    position: relative;
    margin: 2.5rem 0;
    padding: 1.75rem 2rem 1.75rem 2.5rem;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.25rem;
    line-height: 1.6;
    color: #1A1530;
    font-style: italic;
    border-left: 4px solid #C9A84C;
    background: linear-gradient(135deg, rgba(201,168,76,0.06), rgba(91,45,142,0.04));
    border-radius: 0 16px 16px 0;
}
.pull-quote::before {
    content: '\201C';
    position: absolute;
    top: -8px;
    left: 12px;
    font-size: 4rem;
    font-family: 'Fraunces', Georgia, serif;
    color: #C9A84C;
    opacity: 0.3;
    line-height: 1;
}

/* --- Section Icons --- */
.section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(91,45,142,0.08), rgba(139,92,246,0.12));
    margin-bottom: 12px;
}
.section-icon svg {
    width: 20px;
    height: 20px;
    stroke: #5B2D8E;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Interactive Checkboxes --- */
.interactive-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-bottom: 6px;
}
.interactive-check:hover {
    background: rgba(91,45,142,0.04);
}
.interactive-check input[type="checkbox"] {
    display: none;
}
.check-box {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #E8E6E3;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 1px;
}
.interactive-check:hover .check-box {
    border-color: #5B2D8E;
}
.interactive-check.checked .check-box {
    background: #5B2D8E;
    border-color: #5B2D8E;
    transform: scale(1.1);
}
.check-box svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 2.5;
    fill: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.interactive-check.checked .check-box svg {
    opacity: 1;
    transform: scale(1);
}
.check-label {
    font-size: 14px;
    line-height: 1.5;
    color: #2C2C2C;
    transition: color 0.2s ease;
}
.interactive-check.checked .check-label {
    color: #64748B;
}

/* checked counter */
.check-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #E8E6E3;
}
.check-progress-bar {
    flex: 1;
    height: 4px;
    background: #E8E6E3;
    border-radius: 4px;
    overflow: hidden;
}
.check-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5B2D8E, #C9A84C);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    width: 0%;
}
.check-progress-text {
    font-size: 12px;
    color: #64748B;
    white-space: nowrap;
    font-weight: 500;
}

/* --- Enhanced Exercise/Reflection Boxes --- */
.enhanced-box {
    position: relative;
    overflow: hidden;
}
.enhanced-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    border-radius: 4px 0 0 4px;
}
.box-exercise::before {
    background: linear-gradient(180deg, #5B2D8E, #8B5CF6);
}
.box-reflection::before {
    background: linear-gradient(180deg, #C9A84C, #E8B84C);
}
.box-commitment::before {
    background: linear-gradient(180deg, #5B2D8E, #C9A84C);
}
.box-research::before {
    background: linear-gradient(180deg, #64748B, #8B85B3);
}

/* box header icon */
.box-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.box-header-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.box-header-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.box-exercise .box-header-icon {
    background: rgba(91,45,142,0.1);
}
.box-exercise .box-header-icon svg {
    stroke: #5B2D8E;
    fill: none;
}
.box-reflection .box-header-icon {
    background: rgba(201,168,76,0.15);
}
.box-reflection .box-header-icon svg {
    stroke: #C9A84C;
    fill: none;
}
.box-commitment .box-header-icon {
    background: rgba(91,45,142,0.1);
}
.box-commitment .box-header-icon svg {
    stroke: #5B2D8E;
    fill: none;
}

/* --- Drop Cap --- */
.drop-cap::first-letter {
    float: left;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 3.5rem;
    line-height: 0.8;
    padding-right: 12px;
    padding-top: 6px;
    color: #5B2D8E;
    font-weight: 600;
}

/* --- Share Button --- */
.share-fab {
    position: fixed;
    bottom: 90px;
    right: 24px;
    z-index: 50;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.share-fab.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.share-fab-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: white;
    border: 1px solid #E8E6E3;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}
.share-fab-btn:hover {
    border-color: #5B2D8E;
    box-shadow: 0 6px 24px rgba(91,45,142,0.15);
    transform: translateY(-2px);
}
.share-fab-btn svg {
    width: 20px;
    height: 20px;
    stroke: #5B2D8E;
    fill: none;
    stroke-width: 2;
}
.share-menu {
    position: absolute;
    bottom: 56px;
    right: 0;
    background: white;
    border: 1px solid #E8E6E3;
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 180px;
}
.share-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.share-menu a,
.share-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    border: none;
    background: none;
    border-radius: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: #2C2C2C;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease;
}
.share-menu a:hover,
.share-menu button:hover {
    background: #FAF8F4;
}
.share-menu svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* copied tooltip */
.copied-toast {
    position: fixed;
    bottom: 150px;
    right: 24px;
    background: #1A1530;
    color: white;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    padding: 10px 18px;
    border-radius: 10px;
    z-index: 60;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
    pointer-events: none;
}
.copied-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* --- Section Dividers --- */
.section-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 3rem 0 1rem;
}
.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E8E6E3, transparent);
}
.section-divider-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FAF8F4, #E8E4DF);
    display: flex;
    align-items: center;
    justify-content: center;
}
.section-divider-icon svg {
    width: 14px;
    height: 14px;
    stroke: #5B2D8E;
    fill: none;
    stroke-width: 2;
}

/* --- Smooth Anchor Scrolling --- */
html { scroll-behavior: smooth; }

/* --- Reading Estimate Badge --- */
.reading-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(91,45,142,0.08);
    border-radius: 20px;
    font-size: 13px;
    color: #5B2D8E;
    font-weight: 500;
}
.reading-badge svg {
    width: 14px;
    height: 14px;
    stroke: #5B2D8E;
    fill: none;
}

/* --- Hamburger Mobile Menu --- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    z-index: 60;
}
.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #2C2C2C;
    border-radius: 2px;
    transition: all 0.3s ease;
}
.mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(26,21,48,0.5);
    backdrop-filter: blur(4px);
    z-index: 49;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.mobile-nav-overlay.open {
    opacity: 1;
}
.mobile-nav-panel {
    position: fixed;
    top: 0;
    right: -300px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 55;
    padding: 100px 24px 24px;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -8px 0 32px rgba(0,0,0,0.1);
}
.mobile-nav-panel.open {
    right: 0;
}
.mobile-nav-panel a {
    display: block;
    padding: 14px 0;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    color: #2C2C2C;
    text-decoration: none;
    border-bottom: 1px solid #E8E6E3;
    transition: color 0.2s ease;
}
.mobile-nav-panel a:hover {
    color: #5B2D8E;
}
.mobile-nav-panel a.active {
    color: #5B2D8E;
    font-weight: 600;
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
}

/* --- Subtle hover lift on boxes --- */
.bg-pearl.rounded-2xl,
.bg-champagne-light.rounded-2xl {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.bg-pearl.rounded-2xl:hover,
.bg-champagne-light.rounded-2xl:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* ============================================
   RELATED ARTICLES — Enhanced Cards
   ============================================ */

.related-section {
    position: relative;
    overflow: hidden;
}
.related-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #5B2D8E, #C9A84C);
    border-radius: 3px;
}

.related-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
}
.related-header-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(91,45,142,0.08), rgba(201,168,76,0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.related-header-icon svg {
    width: 22px;
    height: 22px;
    stroke: #5B2D8E;
    fill: none;
    stroke-width: 1.5;
}

/* Enhanced Related Card */
.related-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #E8E6E3;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.related-card:hover {
    border-color: #5B2D8E;
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(91,45,142,0.12);
}

/* top gradient banner */
.related-card-banner {
    height: 6px;
    background: linear-gradient(90deg, #5B2D8E, #8B5CF6, #C9A84C);
    opacity: 0;
    transition: opacity 0.4s ease;
}
.related-card:hover .related-card-banner {
    opacity: 1;
}

.related-card-body {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.related-card-category {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #C9A84C;
    margin-bottom: 12px;
}
.related-card-category::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #C9A84C;
}

.related-card-title {
    font-family: 'Fraunces', Georgia, serif;
    font-size: 1.2rem;
    line-height: 1.4;
    color: #1A1530;
    margin-bottom: 12px;
    transition: color 0.3s ease;
}
.related-card:hover .related-card-title {
    color: #5B2D8E;
}

.related-card-excerpt {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #64748B;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid #E8E6E3;
}

.related-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #5B2D8E;
}
.related-card-readmore svg {
    width: 16px;
    height: 16px;
    stroke: #5B2D8E;
    fill: none;
    stroke-width: 2;
    transition: transform 0.3s ease;
}
.related-card:hover .related-card-readmore svg {
    transform: translateX(4px);
}

.related-card-time {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: 4px;
}
.related-card-time svg {
    width: 14px;
    height: 14px;
    stroke: #64748B;
    fill: none;
    stroke-width: 2;
}

/* staggered entrance */
.related-card.animate-on-scroll {
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.related-card.animate-on-scroll:nth-child(2) {
    transition-delay: 0.15s;
}
