/* WhalesBlog Custom Styles - Based on Figma Design */

/* Import Inter font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

:root {
    --whales-primary-color: #040404;
    --whales-secondary-color: #52525B;
    --whales-tertiary-color: #71717A;
    --whales-border-color: #E4E4E7;
    --whales-label-bg: rgba(115, 115, 115, 0.08);
    --whales-white: #FFFFFF;
    --whales-gray-bg: #F3F4F6;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
}

/* ============================================
   Categories Dropdown in Navigation
   ============================================ */

.gh-categories-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 24px; /* Add spacing between menu items */
}

.gh-categories-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.dropdown-arrow {
    transition: transform 0.2s ease;
}

.gh-categories-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.categories-dropdown-menu {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    width: 288px;
    background: var(--whales-white);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0px 0px 32px 0px rgba(77, 52, 133, 0.05);
    border: 1px solid var(--whales-border-color);
    /* Hidden by default */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

/* Create invisible bridge between trigger and dropdown */
.categories-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
    background: transparent;
}

/* Show dropdown on hover */
.gh-categories-dropdown:hover .categories-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.dropdown-item:last-child {
    margin-bottom: 0;
}

.dropdown-item:hover {
    background: rgba(30, 201, 119, 0.1);
}

.dropdown-item:hover .dropdown-item-text {
    color: #1EC977;
}

.dropdown-item-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
    color: var(--whales-secondary-color);
}

.dropdown-icon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.dropdown-item-text {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 16px;
    line-height: 1.5;
    color: var(--whales-primary-color);
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Latest Posts Header */
.latest-posts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0 24px;
    border-top: 1px solid var(--whales-border-color);
}

.latest-posts-title {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 28px;
    line-height: 1.286;
    color: var(--whales-primary-color);
    margin: 0;
}

.view-all-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: var(--whales-primary-color);
    opacity: 0.7;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.view-all-link:hover {
    opacity: 1;
}

.view-all-link svg {
    width: 20px;
    height: 20px;
}

/* Post Feed Grid - Override Casper default */
.post-feed {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 24px !important;
    margin: 0;
    padding: 0;
    position: relative;
    justify-content: flex-start;
}

/* Post Card - WhalesBlog Style */
.post-card.whales-card {
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    background: var(--whales-white);
    box-shadow: none;
    border: none;
    margin: 0;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    /* Fixed width from Figma design */
    width: 100%;
    grid-column: span 1 !important;
}

.post-card.whales-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Post Card Image */
.post-card.whales-card .post-card-image-link {
    display: block;
    position: relative;
    width: 100%;
    height: 216px;
    overflow: hidden;
    background: var(--whales-gray-bg);
    margin: 0 !important;
}

/* Remove Casper's default ::after pseudo element */
.post-card.whales-card .post-card-image-link::after {
    display: none !important;
}

.post-card.whales-card .post-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Post Card Content */
.post-card.whales-card .post-card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px;
    background: var(--whales-white);
    height: 172px;
    box-sizing: border-box;
}

/* Post Card Label/Tag */
.post-card.whales-card .post-card-label {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: var(--whales-label-bg);
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 12px;
    line-height: 1.333;
    color: var(--whales-secondary-color);
    width: fit-content;
    height: 28px;
    box-sizing: border-box;
}

/* Post Card Title */
.post-card.whales-card .post-card-title {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 20px;
    line-height: 1.4;
    color: var(--whales-primary-color);
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    height: 56px;
}

.post-card.whales-card .post-card-content-link {
    text-decoration: none;
    color: inherit;
}

.post-card.whales-card .post-card-content-link:hover .post-card-title {
    color: var(--ghost-accent-color, #3eb0ef);
}

/* Post Card Meta */
.post-card.whales-card .post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 16px;
    margin: 0;
}

.post-card.whales-card .post-card-meta-date,
.post-card.whales-card .post-card-meta-length {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.333;
    color: var(--whales-tertiary-color);
    margin: 0;
}

.post-card.whales-card .post-card-meta-separator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--whales-border-color);
}

/* Hide old post card styles */
.post-card.whales-card .post-card-tags,
.post-card.whales-card .post-card-primary-tag,
.post-card.whales-card .post-card-featured,
.post-card.whales-card .post-card-excerpt,
.post-card.whales-card .post-card-header {
    display: none;
}

/* Responsive Design */
@media (max-width: 1240px) {
    .post-feed {
        grid-template-columns: 1fr 1fr  !important;
        justify-content: center;
    }
}

@media (max-width: 840px) {
    .post-feed {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        justify-content: center;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .post-card.whales-card {
        width: 100%;
        max-width: 100%;
    }
    
    .post-card.whales-card .post-card-image-link {
        width: 100%;
        height: auto;
        padding-bottom: 56.25%; /* 16:9 aspect ratio for responsive */
        position: relative;
    }
    
    .latest-posts-header {
        padding: 32px 0 20px;
    }
    
    .latest-posts-title {
        font-size: 24px;
    }
    
    .view-all-link {
        font-size: 14px;
    }
    
    .post-card.whales-card .post-card-content {
        padding: 20px;
    }
    
    .post-card.whales-card .post-card-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .latest-posts-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .categories-section {
        padding-top: 40px;
    }
    
    .categories-title {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .post-card.whales-card .post-card-content {
        padding: 16px;
        gap: 10px;
    }
}

/* Dark Mode Support */
.dark-mode .post-card.whales-card {
    background: #1a1a1a;
}

.dark-mode .post-card.whales-card .post-card-content {
    background: #1a1a1a;
}

.dark-mode .latest-posts-title,
.dark-mode .post-card.whales-card .post-card-title {
    color: var(--whales-white);
}

.dark-mode .view-all-link {
    color: var(--whales-white);
}

.dark-mode .post-card.whales-card .post-card-label {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.dark-mode .post-card.whales-card .post-card-meta-date,
.dark-mode .post-card.whales-card .post-card-meta-length {
    color: rgba(255, 255, 255, 0.6);
}

/* Pagination Styles */
.pagination {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--whales-border-color);
}

/* ============================================
   Featured Hero Section - 9 Featured Posts
   ============================================ */

.featured-hero {
    padding-top: 48px;
    padding-bottom: 40px;
}

.featured-hero-grid {
    display: flex;
    gap: 24px;
    align-items: stretch;
    height: 612px; /* 2 small cards (296px each) + gap 20px = 612px */
}

/* Left Column - 2 Small Cards */
.featured-left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.featured-card-small {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    background: var(--whales-white);
    height: 296px; /* Fixed height from Figma */
    flex-shrink: 0;
}

.featured-card-small .featured-card-image {
    display: block;
    width: 100%;
    flex: 1; /* Image takes remaining space after content */
    position: relative;
    overflow: hidden;
    background: var(--whales-gray-bg);
    border-radius: 8px 8px 0 0;
    min-height: 0; /* Allow flex shrink */
}

.featured-card-small .featured-card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-card-content-small {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    background: var(--whales-white);
    border: 1px solid #F4F4F5;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.featured-card-title-small {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 18px;
    line-height: 1.556;
    color: var(--whales-primary-color);
    margin: 0;
    /* Limit to 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-card-title-small:hover {
    color: var(--ghost-accent-color, #3eb0ef);
}

/* Center Column - 1 Large Card */
.featured-card-large {
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    background: var(--whales-white);
    width: 600px;
    flex-shrink: 0;
}

.featured-card-image-large {
    display: block;
    width: 100%;
    height: 332px;
    position: relative;
    overflow: hidden;
    background: var(--whales-gray-bg);
    border-radius: 8px 8px 0 0;
}

.featured-card-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-card-content-large {
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: var(--whales-white);
    border: 1px solid #F4F4F5;
    border-top: none;
    border-radius: 0 0 8px 8px;
    flex: 1;
}

.featured-card-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.featured-card-title-large {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 28px;
    line-height: 1.286;
    color: var(--whales-primary-color);
    margin: 0;
}

.featured-card-title-large:hover {
    color: var(--ghost-accent-color, #3eb0ef);
}

.featured-card-excerpt {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.5;
    color: var(--whales-tertiary-color);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-divider {
    border: none;
    border-top: 1px solid #F4F4F5;
    margin: 0 0 20px 0;
}

.featured-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1px;
    flex-wrap: wrap;
    margin-top: auto;
}

.featured-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.author-avatar-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    background: #E5E7EB;
    border: 1.86px solid var(--whales-white);
}

.author-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-avatar-placeholder svg {
    width: 24px;
    height: 24px;
    opacity: 0.5;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.author-name {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 18px;
    line-height: 1.556;
    color: var(--whales-primary-color);
    margin: 0;
}

.featured-tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(115, 115, 115, 0.08);
    backdrop-filter: blur(10px);
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 12px;
    line-height: 1.333;
    color: var(--whales-secondary-color);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Right Column - 6 List Items */
.featured-right-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

.featured-list-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.featured-list-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.featured-list-title {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 14px;
    line-height: 1.429;
    color: var(--whales-primary-color);
    margin: 0;
    /* Limit to 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-list-title:hover {
    color: var(--ghost-accent-color, #3eb0ef);
}

.featured-list-thumb {
    display: block;
    width: 68px;
    height: 68px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--whales-gray-bg);
    border: 1px solid #F4F4F5;
    box-sizing: border-box;
    position: relative;
}

.featured-list-thumb img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-list-divider {
    border: none;
    border-top: 1px solid var(--whales-border-color);
    margin: 0;
}

/* ============================================
   Categories Section
   ============================================ */

.categories-section {
    padding-top: 60px;
    padding-bottom: 40px;
}

.categories-title {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 28px;
    line-height: 1.286;
    color: var(--whales-primary-color);
    margin: 0 0 20px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(282px, 1fr));
    gap: 24px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--whales-white);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.category-card:hover {
    border-color: var(--ghost-accent-color, #3eb0ef);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.category-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: rgba(30, 201, 119, 0.1);
    border-radius: 9999px;
    color: #1EC977;
    padding: 10px;
}

.category-icon svg {
    width: 20px;
    height: 20px;
}

.category-icon-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.category-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.category-name {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 18px;
    line-height: 1.556;
    color: var(--whales-primary-color);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-count {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.429;
    color: var(--whales-tertiary-color);
}

/* Featured Card Meta */
.featured-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.429;
    color: var(--whales-tertiary-color);
    margin: 0;
}

.featured-card-meta time,
.featured-card-meta span {
    margin: 0;
}

.featured-card-meta .meta-separator {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--whales-border-color);
    flex-shrink: 0;
}

/* Responsive Featured Hero */
@media (max-width: 1200px) {
    .featured-hero-grid {
        flex-direction: column;
        gap: 24px;
        height: auto !important; /* Remove fixed height */
    }

    .featured-card-large {
        width: 100% !important;
        max-width: 100% !important;
    }

    .featured-left-column {
        flex-direction: row;
        gap: 24px;
    }

    .featured-card-small {
        flex: 1;
        height: auto !important; /* Remove fixed height */
        min-height: 280px;
    }
}

@media (max-width: 768px) {
    .featured-hero {
        padding-top: 24px !important;
        padding-bottom: 24px !important;
    }
    
    .featured-hero .inner {
        padding: 0 max(4vmin, 20px) !important;
    }

    .featured-hero-grid {
        gap: 20px !important;
        height: auto !important;
    }

    .featured-left-column {
        flex-direction: column;
        gap: 20px !important;
    }
    
    .featured-card-small {
        width: 100% !important;
        height: auto !important;
        min-height: 240px !important;
    }
    
    .featured-card-small .featured-card-image {
        height: 180px !important;
        flex: none !important;
    }
    
    .featured-card-title-small {
        font-size: 16px !important;
        line-height: 1.5 !important;
        -webkit-line-clamp: 2 !important; /* Reduce to 2 lines on mobile */
    }

    .featured-card-large {
        width: 100% !important;
    }

    .featured-card-image-large {
        height: 200px !important;
    }

    .featured-card-title-large {
        font-size: 20px !important;
        line-height: 1.4 !important;
    }
    
    .featured-card-excerpt {
        font-size: 14px !important;
        line-height: 1.5 !important;
        -webkit-line-clamp: 2 !important;
    }
    
    .featured-card-content-large {
        padding: 12px !important;
    }

    .featured-card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .featured-divider {
        margin: 12px 0 !important;
    }
    
    .author-avatar-wrapper {
        width: 40px !important;
        height: 40px !important;
    }
    
    .author-name {
        font-size: 13px !important;
    }
    
    .featured-tag-badge {
        font-size: 11px !important;
        padding: 4px 10px !important;
    }
    
    .featured-right-column {
        gap: 16px !important;
    }

    .featured-list-item {
        gap: 12px !important;
        padding: 12px 0 !important;
    }
    
    .featured-list-title {
        font-size: 14px !important;
        line-height: 1.4 !important;
    }

    .featured-list-thumb {
        width: 60px !important;
        height: 60px !important;
        flex-shrink: 0 !important;
    }
    
    .featured-card-meta {
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .featured-hero {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }
    
    .featured-hero-grid {
        gap: 16px !important;
    }
    
    .featured-card-small {
        min-height: 220px !important;
    }
    
    .featured-card-small .featured-card-image {
        height: 160px !important;
    }
    
    .featured-card-title-small {
        font-size: 15px !important;
    }
    
    .featured-card-image-large {
        height: 180px !important;
    }
    
    .featured-card-title-large {
        font-size: 18px !important;
    }
    
    .featured-card-excerpt {
        font-size: 13px !important;
    }
    
    .featured-list-thumb {
        width: 56px !important;
        height: 56px !important;
    }
    
    .featured-list-title {
        font-size: 13px !important;
    }
}

/* Dark Mode for Featured Hero */
.dark-mode .featured-card-small,
.dark-mode .featured-card-large {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .featured-card-title-small,
.dark-mode .featured-card-title-large,
.dark-mode .featured-list-title,
.dark-mode .author-name {
    color: var(--whales-white);
}

.dark-mode .featured-card-excerpt,
.dark-mode .featured-card-meta {
    color: rgba(255, 255, 255, 0.6);
}

.dark-mode .featured-divider,
.dark-mode .featured-list-divider {
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .featured-tag-badge {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.dark-mode .categories-title {
    color: var(--whales-white);
}

.dark-mode .category-card {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .category-card:hover {
    border-color: var(--ghost-accent-color, #3eb0ef);
}

.dark-mode .category-name {
    color: var(--whales-white);
}

.dark-mode .category-count {
    color: rgba(255, 255, 255, 0.6);
}

/* Dark Mode - Dropdown Menu */
.dark-mode .categories-dropdown-menu {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0px 0px 32px 0px rgba(0, 0, 0, 0.5);
}

.dark-mode .dropdown-item:hover {
    background: rgba(30, 201, 119, 0.15);
}

.dark-mode .dropdown-item-text {
    color: var(--whales-white);
}

.dark-mode .dropdown-item:hover .dropdown-item-text {
    color: #1EC977;
}

/* ============================================
   Post Header - Whales Blog Style
   ============================================ */

.article-header-whales {
    margin-bottom: 40px;
    background: var(--whales-white);
}

.article-header-container {
    display: flex;
    gap: 40px;
    padding: 24px 24px;
    background: var(--whales-white);
    border-radius: 8px;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    background: var(--whales-white);
}

.article-header-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    min-width: 0;
    min-height: 290px; /* Min height to match image */
}

.article-tag-list {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
    order: 1;
}

.article-tag-badge {
    display: inline-flex;
    padding: 4px 12px;
    background: var(--whales-label-bg);
    border-radius: 999px;
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 12px;
    line-height: 1.333;
    color: var(--whales-secondary-color);
}

.article-title-whales {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 36px;
    line-height: 1.222;
    color: var(--whales-primary-color);
    margin: 0;
    /* Limit to 4 lines max */
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(36px * 1.222 * 4);
    /* Flex order */
    order: 2;
    flex: 1;
}

.article-subtitle-whales {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 20px;
    line-height: 1.5;
    color: var(--whales-secondary-color);
    margin: 8px 0 0;
    /* Limit to 3 lines max */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Flex order */
    order: 3;
}

.article-author-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    order: 4;
    margin-top: auto;
}

.author-avatar-wrapper {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    background: var(--whales-gray-bg);
    border: 1.86px solid var(--whales-white);
}

.author-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-avatar-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-avatar-placeholder svg {
    width: 24px;
    height: 24px;
    opacity: 0.5;
}

.author-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.author-name-text {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 18px;
    line-height: 1.556;
    color: var(--whales-primary-color);
}

.author-meta-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.429;
    color: var(--whales-tertiary-color);
}

.meta-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--whales-border-color);
}

.article-header-image {
    width: 524px;
    min-width: 524px;
    height: 290px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: var(--whales-gray-bg);
}

.article-header-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive */
@media (max-width: 991px) {
    .article-header-whales {
        margin-top: 24px !important;
        margin-bottom: 32px !important;
        padding: 0 max(4vmin, 20px) !important;
    }
    
    .article-header-container {
        flex-direction: column !important;
        padding: 20px !important;
        gap: 24px !important;
        max-width: 100% !important;
    }
    
    .article-header-content {
        width: 100% !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    .article-header-image {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        aspect-ratio: 524 / 290;
        order: -1 !important;
    }
    
    .article-title-whales {
        font-size: 28px !important;
        line-height: 1.3 !important;
    }
    
    .article-subtitle-whales {
        font-size: 18px !important;
        line-height: 1.4 !important;
    }
}

@media (max-width: 768px) {
    .article-header-whales {
        margin-top: 0 !important;
        margin-bottom: 24px !important;
    }
    
    .article-header-container {
        padding: 16px !important;
        gap: 20px !important;
        border-radius: 0 !important;
    }
    
    .article-title-whales {
        font-size: 24px !important;
    }
    
    .article-subtitle-whales {
        font-size: 16px !important;
    }
    
    .author-avatar-wrapper {
        width: 40px !important;
        height: 40px !important;
    }
    
    .author-name-text {
        font-size: 14px !important;
    }
    
    .author-meta-info {
        font-size: 12px !important;
    }
    
    .article-tag-badge {
        font-size: 11px !important;
        padding: 4px 10px !important;
    }
}

@media (max-width: 480px) {
    .article-header-container {
        padding: 12px !important;
    }
    
    .article-title-whales {
        font-size: 20px !important;
    }
    
    .article-subtitle-whales {
        font-size: 14px !important;
    }
}

/* Dark Mode */
.dark-mode .article-header-container {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
}

.dark-mode .article-title-whales {
    color: var(--whales-white);
}

.dark-mode .article-subtitle-whales {
    color: rgba(255, 255, 255, 0.7);
}

.dark-mode .author-name-text {
    color: var(--whales-white);
}

.dark-mode .article-tag-badge {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.dark-mode .author-meta-info {
    color: rgba(255, 255, 255, 0.6);
}

.dark-mode .meta-dot {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Table of Contents (TOC)
   ============================================ */

.article-content-wrapper {
    display: flex;
    gap: 40px;
    max-width: 1440px;
    padding: 0 24px;
    margin: 0 auto;
    align-items: flex-start;
}

.article-toc {
    width: 272px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}

.toc-sticky {
    position: sticky;
    top: 100px;
    padding-top: 8px;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.toc-label {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 12px;
    line-height: 1.333;
    color: #71717A;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc-progress-container {
    margin-bottom: 24px;
}

.toc-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(30, 201, 119, 0.2);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.toc-progress-bar {
    height: 100%;
    background: #16A34A;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 16px;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toc-item {
    display: block;
    padding: 8px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.toc-item-text {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.429;
    color: var(--whales-primary-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toc-item:hover {
    background: rgba(115, 115, 115, 0.05);
}

.toc-item.active {
    background: rgba(115, 115, 115, 0.08) !important;
}

.toc-item.active .toc-item-text {
    font-weight: 550 !important;
    color: #15171A !important;
}

.article-content-main {
    flex: 1;
    min-width: 0;
}

/* Responsive */
@media (max-width: 1256px) {
    .featured-sidebar {
        display: none;
    }
    
    .article-content-wrapper {
        max-width: 888px; /* 272 + 40 + 576 */
    }
}

@media (max-width: 991px) {
    /* Hide TOC sidebar earlier to prevent layout breaking */
    .article-toc {
        display: none !important;
        visibility: hidden !important;
        position: absolute !important;
        left: -9999px !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    .article-content-wrapper {
        max-width: 100% !important;
        padding: 0 max(4vmin, 20px) !important;
        display: block !important;
    }
    
    .article-content-main {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Show Must Read at bottom on tablet */
    .featured-sidebar {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 40px 0 0 0 !important;
        position: relative !important;
        top: auto !important;
    }
    
    .featured-sidebar-sticky {
        position: relative !important;
        top: auto !important;
        padding: 0 !important;
    }
}

/* Dark Mode */
.dark-mode .toc-item-text {
    color: var(--whales-white);
}

.dark-mode .toc-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dark-mode .toc-item.active {
    background: rgba(255, 255, 255, 0.1) !important;
}

.dark-mode .toc-item.active .toc-item-text {
    color: #FFFFFF !important;
}

/* ============================================
   Featured Posts Sidebar
   ============================================ */

.featured-sidebar {
    width: 272px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
}

.featured-sidebar-sticky {
    position: sticky;
    top: 100px;
    padding-top: 8px;
}

.featured-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.featured-sidebar-label {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 12px;
    line-height: 1.333;
    color: #71717A;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.featured-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 468px;
    overflow-y: auto;
}

.featured-sidebar-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.featured-sidebar-item:hover {
    opacity: 0.8;
}

.featured-sidebar-title {
    font-family: 'Inter', sans-serif;
    font-weight: 550;
    font-size: 14px;
    line-height: 1.429;
    color: var(--whales-primary-color);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.featured-sidebar-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    line-height: 1.333;
    color: #71717A;
}

.featured-sidebar-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #E4E4E7;
    flex-shrink: 0;
}

.featured-sidebar-divider {
    width: 100%;
    height: 1px;
    background: #E4E4E7;
}

/* Dark Mode */
.dark-mode .featured-sidebar-title {
    color: var(--whales-white);
}

.dark-mode .featured-sidebar-meta {
    color: rgba(255, 255, 255, 0.6);
}

.dark-mode .featured-sidebar-dot {
    background: rgba(255, 255, 255, 0.2);
}

.dark-mode .featured-sidebar-divider {
    background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Read More Section
   ============================================ */

.read-more-wrap {
    margin-top: max(8vmin, 64px);
    padding: 0 max(4vmin, 20px);
}

.read-more-header {
    max-width: 1200px;
    margin: 0 auto 40px;
}

.read-more-title {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 32px;
    line-height: 1.25;
    color: #15171A;
    margin: 0;
}

.read-more-wrap .read-more {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 32px !important;
    grid-gap: 32px !important;
    max-width: 1200px;
    margin: 0 auto;
}

.read-more-wrap .read-more .post-card {
    margin: 0;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    border-radius: 8px;
    overflow: hidden;
    background: var(--whales-white);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.read-more-wrap .read-more .post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.read-more-wrap .read-more .post-card.whales-card {
    display: flex !important;
    flex-direction: column !important;
}

.read-more-wrap .read-more .post-card.whales-card .post-card-image-link {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16/9 !important;
    padding-bottom: 0 !important;
}

.read-more-wrap .read-more .post-card.whales-card .post-card-content {
    padding: 24px !important;
    flex: 1 !important;
}

.read-more-wrap .read-more .post-card.whales-card .post-card-title {
    font-size: 20px !important;
    margin: 0 !important;
}

.read-more-wrap .read-more .post-card-tags {
    display: none !important;
}

/* Tablet */
@media (max-width: 1024px) {
    .read-more-wrap .read-more {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
        grid-gap: 24px !important;
    }
    
    .read-more-wrap .read-more .post-card:nth-child(3) {
        display: none !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .read-more-wrap {
        margin-top: max(6vmin, 48px);
    }
    
    .read-more-header {
        margin-bottom: 32px;
    }
    
    .read-more-title {
        font-size: 28px;
    }
    
    .read-more-wrap .read-more {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        grid-gap: 20px !important;
    }
    
    .read-more-wrap .read-more .post-card:nth-child(2),
    .read-more-wrap .read-more .post-card:nth-child(3) {
        display: block !important;
    }
    
    .read-more-wrap .read-more .post-card.whales-card .post-card-content {
        padding: 20px !important;
    }
    
    .read-more-wrap .read-more .post-card.whales-card .post-card-title {
        font-size: 18px !important;
    }
}

@media (max-width: 480px) {
    .read-more-wrap {
        padding: 0 max(4vmin, 16px);
    }
    
    .read-more-title {
        font-size: 24px;
    }
    
    .read-more-header {
        margin-bottom: 24px;
    }
    
    .read-more-wrap .read-more .post-card.whales-card .post-card-content {
        padding: 16px !important;
    }
    
    .read-more-wrap .read-more .post-card.whales-card .post-card-title {
        font-size: 16px !important;
    }
}

/* Dark Mode */
.dark-mode .read-more-title {
    color: var(--whales-white);
}

.dark-mode .read-more-wrap .read-more .post-card {
    background: #1a1a1a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dark-mode .read-more-wrap .read-more .post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.dark-mode .read-more-wrap .read-more .post-card.whales-card .post-card-content {
    background: #1a1a1a !important;
}

/* ============================================
   TOC Mobile Dropdown - MOBILE ONLY
   ============================================ */

/* Hidden by default - ONLY for mobile/tablet */
.toc-dropdown-mobile {
    display: none;
}

/* Show on tablet and mobile screens */
@media (max-width: 991px) {
    .toc-dropdown-mobile {
        display: block;
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--color-bg);
        margin: 0 auto 24px;
        max-width: 1200px;
        padding: 16px max(4vmin, 20px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }
    
    .toc-dropdown-trigger {
        display: flex;
        align-items: center;
        gap: 8px;
        width: 100%;
        padding: 12px 16px;
        background: var(--whales-white);
        border: 1px solid #E4E4E7;
        border-radius: 8px;
        font-family: 'Inter', sans-serif;
        font-weight: 550;
        font-size: 14px;
        line-height: 1.429;
        color: var(--whales-primary-color);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .toc-dropdown-icon,
    .toc-dropdown-arrow {
        flex-shrink: 0;
        width: 16px;
        height: 16px;
        color: var(--whales-primary-color);
    }
    
    .toc-dropdown-arrow {
        transition: transform 0.3s ease;
    }
    
    .toc-dropdown-trigger[aria-expanded="true"] .toc-dropdown-arrow {
        transform: rotate(180deg);
    }
    
    .toc-dropdown-label {
        flex: 1;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .toc-dropdown-menu {
        margin-top: 8px;
        padding: 0 16px;
        background: var(--whales-white);
        border: 1px solid #E4E4E7;
        border-radius: 8px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    }
    
    .toc-dropdown-menu.active {
        max-height: 600px;
        opacity: 1;
        padding: 16px;
    }
    
    .toc-list-mobile {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin-top: 16px;
    }
    
    /* Dark mode for mobile */
    .dark-mode .toc-dropdown-mobile {
        background: #15171A;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .dark-mode .toc-dropdown-trigger {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
        color: var(--whales-white);
    }
    
    .dark-mode .toc-dropdown-menu {
        background: #1a1a1a;
        border-color: rgba(255, 255, 255, 0.1);
    }
    
    .dark-mode .toc-dropdown-icon,
    .dark-mode .toc-dropdown-arrow {
        color: var(--whales-white);
    }
}



