/* Magazine V2 Layout Styles */

.myfoly-magazine-v2 {
    font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--myfoly-text-color, #333);
}

.myfoly-magazine-v2 a {
    text-decoration: none;
    color: inherit;
}

.mag-section {
    margin-bottom: 60px;
}

.mag-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.mag-section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    padding-right: 20px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mag-section-header h2 a {
    display: inline-block;
    color: var(--myfoly-ink, #17181c);
    background: color-mix(in srgb, var(--myfoly-accent, #e63946) 10%, transparent);
    padding: 6px 16px;
    border-left: 4px solid var(--myfoly-accent, #e63946);
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
}

.mag-section-header h2 a:hover {
    color: var(--myfoly-accent, #e63946);
    background: color-mix(in srgb, var(--myfoly-accent, #e63946) 18%, transparent);
}

.mag-line {
    flex-grow: 1;
    height: 4px;
    background-color: var(--myfoly-accent, #e63946);
    border-radius: 2px;
}

.mag-media {
    overflow: hidden;
    position: relative;
    border-radius: 8px;
}

.mag-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    display: block;
}

article:hover .mag-media img {
    transform: scale(1.05);
}

.mag-placeholder {
    background: #e2e8f0;
    width: 100%;
    height: 100%;
}

.mag-meta {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 10px;
    display: flex;
    gap: 15px;
}

/* HERO SECTION */
.mag-hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(3, 1fr);
    gap: 20px;
    height: 600px;
}

.mag-hero-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.mag-hero-item > a {
    display: block;
    width: 100%;
    height: 100%;
}

.mag-hero-item .mag-media {
    border-radius: 0;
    height: 100%;
}

.hero-main {
    grid-column: 1 / 2;
    grid-row: 1 / -1;
}

.hero-side {
    grid-column: 2 / 3;
}

.mag-hero-item .mag-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 60%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 30px;
    color: #fff;
}

.mag-hero-item .mag-title {
    color: #fff;
    margin: 10px 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

.hero-main .mag-title {
    font-size: 2.5rem;
}

.mag-hero-item .mag-meta {
    color: #cbd5e1;
}

/* CATEGORY 1 (1 large, 3 grid) */
.mag-cat1-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.cat1-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: repeat(3, auto);
    gap: 20px;
}

.cat1-grid .mag-grid-item a {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 20px;
    align-items: center;
}

.cat1-grid .mag-media {
    height: 120px;
}

.mag-title-large {
    font-size: 1.8rem;
    margin: 15px 0 10px;
    font-weight: 700;
}

.mag-title-small {
    font-size: 1.2rem;
    margin: 0 0 10px;
    font-weight: 600;
}

.mag-title-medium {
    font-size: 1.4rem;
    margin: 15px 0 10px;
    font-weight: 700;
}

/* ADS PLACEHOLDER */
.mag-ad-placeholder {
    width: 100%;
    max-width: 728px;
    height: 90px;
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* STANDARD GRID (CAT 2) */
.mag-standard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.mag-standard-grid .mag-media {
    aspect-ratio: 4/3;
}

/* LIST LAYOUT (CAT 3) */
.mag-list-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.mag-list-link {
    display: flex;
    gap: 30px;
    align-items: center;
}

.mag-media-small {
    width: 250px;
    height: 250px;
    flex-shrink: 0;
}

/* SUBSCRIPTION */
.mag-subscribe {
    background: var(--myfoly-accent, #e63946);
    padding: 60px 20px;
    border-radius: 12px;
    text-align: center;
    color: #fff;
}

.mag-subscribe-inner {
    max-width: 600px;
    margin: 0 auto;
}

.mag-subscribe h2 {
    color: #fff;
    font-size: 2rem;
    margin-bottom: 10px;
}

.mag-subscribe p {
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.mag-subscribe-form {
    display: flex;
    gap: 10px;
}

.mag-subscribe-form input {
    flex-grow: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
}

.mag-subscribe-form button {
    padding: 15px 30px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.mag-subscribe-form button:hover {
    background: #111;
}

.mag-subscribe-note {
    font-size: 0.85rem !important;
    opacity: 0.8;
    margin-top: 15px !important;
    margin-bottom: 0 !important;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .mag-hero-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 400px repeat(3, 200px);
        height: auto;
    }
    .hero-main {
        grid-column: 1 / -1;
        grid-row: 1 / 2;
    }
    .hero-side {
        grid-column: 1 / -1;
    }
    .mag-cat1-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mag-list-link {
        flex-direction: column;
    }
    .mag-media-small {
        width: 100%;
        height: 250px;
    }
    .mag-subscribe-form {
        flex-direction: column;
    }
}
