/**
 * Magazine homepage layout — featured grid + list + sidebar
 */

.hd-magazine {
    background: #fff;
}

/* ── Featured grid ── */
.hd-magazine-featured {
    padding: 32px 0 40px;
    background: #fff;
}

.hd-magazine-featured__grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 12px;
    align-items: stretch;
}

.hd-magazine-featured__minis {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 12px;
    min-height: 420px;
}

/* ── Magazine cards ── */
.hd-mag-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    min-height: 0;
}

.hd-mag-card--hero {
    min-height: 420px;
}

.hd-mag-card--mini {
    min-height: 0;
}

.hd-mag-card__link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.hd-mag-card__media {
    position: absolute;
    inset: 0;
}

.hd-mag-card__media img,
.hd-mag-card__placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hd-mag-card__placeholder {
    background: linear-gradient(135deg, #1c2024, #3a3f47);
}

.hd-mag-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.88) 0%,
        rgba(0, 0, 0, 0.45) 45%,
        rgba(0, 0, 0, 0.15) 100%
    );
}

.hd-mag-card__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 100%;
    padding: 20px 22px;
}

.hd-mag-card--hero .hd-mag-card__content {
    padding: 28px 28px 24px;
}

.hd-mag-card__badge {
    display: inline-block;
    align-self: flex-start;
    background: #000;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    padding: 5px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.hd-mag-card__title {
    color: #fff;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.25;
}

.hd-mag-card--hero .hd-mag-card__title {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
}

.hd-mag-card--mini .hd-mag-card__title {
    font-size: 15px;
    font-weight: 600;
}

.hd-mag-card__excerpt {
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.55;
    margin: 10px 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hd-mag-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
}

.hd-mag-card__avatar {
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hd-mag-card__author {
    font-weight: 500;
}

.hd-mag-card__dot {
    opacity: 0.6;
}

.hd-mag-card__link:hover .hd-mag-card__title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hd-mag-card__link:hover .hd-mag-card__media img {
    transform: scale(1.03);
}

.hd-mag-card__media img {
    transition: transform 0.35s ease;
}

/* ── Feed section ── */
.hd-magazine-feed {
    padding: 8px 0 64px;
    background: #fff;
}

.hd-magazine-feed__title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: #111;
    letter-spacing: -0.03em;
    margin: 0 0 8px;
    line-height: 1.2;
}

.hd-magazine-feed__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
    align-items: start;
}

.hd-magazine-feed__list {
    border-top: 1px solid #e8e8ec;
}

/* ── List items ── */
.hd-mag-list-item {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 24px;
    padding: 28px 0;
    border-bottom: 1px solid #e8e8ec;
    transition: background 0.15s ease;
}

.hd-mag-list-item__thumb {
    display: block;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    aspect-ratio: 1;
    background: #f0f0f3;
}

.hd-mag-list-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hd-mag-list-item__placeholder {
    width: 100%;
    height: 100%;
    min-height: 160px;
    background: linear-gradient(135deg, #e8e8ec, #d9d9e0);
}

.hd-mag-list-item:hover .hd-mag-list-item__thumb {
    border-color: #f5c518;
    box-shadow: 0 0 0 1px #f5c518;
}

.hd-mag-list-item__title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}

.hd-mag-list-item__title a {
    color: #111;
    text-decoration: none;
    transition: color 0.15s ease;
}

.hd-mag-list-item__title a:hover {
    color: #4766d3;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.hd-mag-list-item__excerpt {
    color: #60646c;
    font-size: 15px;
    line-height: 1.65;
    margin: 0 0 16px;
}

.hd-mag-list-item__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #80838d;
    font-size: 14px;
}

.hd-mag-list-item__avatar {
    border-radius: 50%;
}

.hd-mag-list-item__author {
    font-weight: 500;
    color: #1c2024;
}

.hd-magazine-feed__pagination {
    margin-top: 40px;
}

/* ── Sidebar ── */
.hd-mag-sidebar {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: sticky;
    top: 100px;
}

.hd-mag-sidebar__profile {
    border: 1px solid #e0e1e6;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    background: #fff;
}

.hd-mag-sidebar__profile-brand {
    background: #0a0a0a;
    padding: 28px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hd-mag-sidebar__profile-brand a {
    display: block;
    line-height: 0;
}

.hd-mag-sidebar__profile-brand img {
    max-width: 200px;
    width: 100%;
    height: auto;
}

.hd-mag-sidebar__profile-bio {
    color: #60646c;
    font-size: 14px;
    line-height: 1.7;
    margin: 0;
    padding: 22px 24px 0;
    text-align: center;
}

.hd-mag-sidebar__profile-social {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 24px 24px;
}

.hd-mag-sidebar__profile-social a {
    color: #1c2024;
    font-size: 18px;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.hd-mag-sidebar__profile-social a:hover {
    opacity: 1;
}

.hd-mag-sidebar__popular {
    border: 1px solid #e0e1e6;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.hd-mag-sidebar__popular-title {
    margin: 0;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: #4766d3;
    border-bottom: 3px solid #3451b2;
}

.hd-mag-sidebar__popular-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hd-mag-popular-item {
    position: relative;
}

.hd-mag-popular-item__rank {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5c518;
    color: #1c2024;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.hd-mag-popular-item--featured .hd-mag-popular-item__rank {
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    font-size: 14px;
}

.hd-mag-popular-item__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.hd-mag-popular-item__media {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
}

.hd-mag-popular-item__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hd-mag-popular-item__media-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent 60%);
}

.hd-mag-popular-item__media-title {
    position: absolute;
    left: 12px;
    right: 44px;
    bottom: 12px;
    z-index: 1;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
}

.hd-mag-popular-item__row {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 12px;
    align-items: center;
}

.hd-mag-popular-item__thumb {
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    aspect-ratio: 1;
    background: #f0f0f3;
}

.hd-mag-popular-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hd-mag-popular-item:hover .hd-mag-popular-item__thumb {
    border-color: #f5c518;
}

.hd-mag-popular-item__title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    color: #1c2024;
    margin: 0 0 4px;
}

.hd-mag-popular-item__text time {
    font-size: 12px;
    color: #80838d;
}

.hd-mag-popular-item__meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hd-mag-popular-item__views {
    font-size: 12px;
    font-weight: 600;
    color: #4766d3;
}

.hd-mag-popular-item__link:hover .hd-mag-popular-item__title,
.hd-mag-popular-item__link:hover .hd-mag-popular-item__media-title {
    text-decoration: underline;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
    .hd-magazine-feed__layout {
        grid-template-columns: 1fr;
    }

    .hd-mag-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .hd-magazine-featured__grid {
        grid-template-columns: 1fr;
    }

    .hd-magazine-featured__minis {
        min-height: auto;
        grid-template-columns: 1fr 1fr;
    }

    .hd-mag-card--hero {
        min-height: 320px;
    }

    .hd-mag-list-item {
        grid-template-columns: 120px minmax(0, 1fr);
        gap: 16px;
        padding: 20px 0;
    }

    .hd-mag-list-item__title {
        font-size: 1.05rem;
    }
}

@media (max-width: 520px) {
    .hd-magazine-featured__minis {
        grid-template-columns: 1fr;
    }

    .hd-mag-list-item {
        grid-template-columns: 1fr;
    }

    .hd-mag-list-item__thumb {
        aspect-ratio: 16 / 9;
    }
}
