/* ============================================
   MASONRY LAYOUT STYLES - MAGAZINE GRID
   Include this file AFTER migrated_styles.css
   ============================================ */

/* Base Topic Card */
.topic-card {
    background: #ffffff;
    border: 1px solid #e8e4dd;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    text-decoration: none;
    color: inherit;
    position: relative;
    height: 100%;
}

/* Masonry card size variations */
.topic-card.card-large {
    grid-column: span 2;
    grid-row: span 2;
}

.topic-card.card-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.topic-card.card-tall {
    grid-column: span 1;
    grid-row: span 2;
}

.topic-card.card-small {
    grid-column: span 1;
    grid-row: span 1;
}

/* Hover accent bar */
.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1f5a9f, #4fa8df);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.topic-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(31, 90, 159, 0.18);
    border-color: rgba(31, 90, 159, 0.2);
}

.topic-card:hover::before {
    transform: scaleX(1);
}

/* Image Wrapper */
.topic-card-image-wrapper {
    width: 100%;
    height: 180px;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f0f0f0, #e0e0e0);
}

/* Large card gets taller image area */
.topic-card.card-large .topic-card-image-wrapper {
    height: 300px;
}

.topic-card.card-tall .topic-card-image-wrapper {
    height: 200px;
}

.topic-card.card-wide .topic-card-image-wrapper {
    height: 160px;
}

.topic-card.card-small .topic-card-image-wrapper {
    height: 140px;
}

.topic-card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.topic-card:hover .topic-card-image-wrapper img {
    transform: scale(1.1);
}

/* Content Area */
.topic-card-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    min-height: 0;
}

.topic-card-content h3 {
    font-family: 'Merriweather', serif;
    font-size: 1.05em;
    color: #0a1f3a;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.topic-card:hover .topic-card-content h3 {
    color: #1f5a9f;
}

.topic-card-content p {
    color: #555555;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    letter-spacing: 0.2px;
}

/* See More Button */
.see-more-container {
    display: flex;
    justify-content: center;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.see-more-btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #1f5a9f 0%, #0f3a6a 100%);
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    letter-spacing: 0.4px;
    box-shadow: 0 4px 12px rgba(31, 90, 159, 0.25);
    position: relative;
    overflow: hidden;
}

.see-more-btn::before {
    content: '→';
    position: absolute;
    right: 1.5rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.see-more-btn:hover::before {
    opacity: 1;
    right: 1rem;
}

.see-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(31, 90, 159, 0.35);
    padding-right: 3rem;
}

/* Topic Grid - Magazine Style */
.main-content .topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
    grid-auto-rows: minmax(200px, auto);
    grid-auto-flow: dense;
}

@media (min-width: 768px) {
    .main-content .topic-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .main-content .topic-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .main-content .topic-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.75rem;
    }

    .topic-card.card-large,
    .topic-card.card-wide {
        grid-column: span 2;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .main-content .topic-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .topic-card.card-large,
    .topic-card.card-wide,
    .topic-card.card-tall,
    .topic-card.card-small {
        grid-column: span 1;
        grid-row: span 1;
    }

    .topic-card-image-wrapper {
        height: 180px;
    }

    .topic-card-content {
        padding: 1.5rem;
    }

    .topic-card-content h3 {
        font-size: 1.15em;
    }

    .topic-card-content p {
        font-size: 0.9rem;
    }
}

/* ============================================
   ARTICLE CARD MASONRY - BLOGS PAGE
   ============================================ */

/* Article Card Size Variations */
.article-card.card-large {
    grid-column: span 2;
    grid-row: span 2;
}

.article-card.card-wide {
    grid-column: span 2;
    grid-row: span 1;
}

.article-card.card-tall {
    grid-column: span 1;
    grid-row: span 2;
}

.article-card.card-small {
    grid-column: span 1;
    grid-row: span 1;
}

/* Article Image Height Variations */
.article-card.card-large .article-image-container {
    aspect-ratio: auto;
    height: 300px;
}

.article-card.card-tall .article-image-container {
    aspect-ratio: auto;
    height: 200px;
}

.article-card.card-wide .article-image-container {
    aspect-ratio: auto;
    height: 160px;
}

.article-card.card-small .article-image-container {
    aspect-ratio: auto;
    height: 140px;
}

/* Article Card Hover Effect Enhancement */
.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #1f5a9f, #4fa8df);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.article-card:hover::before {
    transform: scaleX(1);
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(31, 90, 159, 0.18);
    border-color: rgba(31, 90, 159, 0.2);
}

/* Responsive - Tablet for Article Cards */
@media (max-width: 1024px) {

    .article-card.card-large,
    .article-card.card-wide {
        grid-column: span 2;
    }

    .article-card.card-tall {
        grid-row: span 2;
    }
}

/* Responsive - Mobile for Article Cards */
@media (max-width: 768px) {

    .article-card.card-large,
    .article-card.card-wide,
    .article-card.card-tall,
    .article-card.card-small {
        grid-column: span 1;
        grid-row: span 1;
    }

    .article-card.card-large .article-image-container,
    .article-card.card-tall .article-image-container,
    .article-card.card-wide .article-image-container,
    .article-card.card-small .article-image-container {
        height: 200px;
    }
}