.tooth-mag-widget *,
.tooth-mag-widget *::before,
.tooth-mag-widget *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.tooth-mag-widget {
    --tooth-header: #162A4D;
    --tooth-text: #203442;
    --tooth-text-muted: #4E7582;
    --tooth-bg: #FFFFFF;
    --tooth-border: #E5E7EB;
    --tooth-badge-bg: #D7E63A;
    --tooth-badge-text: #203442;
    --tooth-radius: 8px;
    --tooth-radius-sm: 4px;
    --tooth-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    --tooth-gap: 20px;
    --tooth-gap-sm:10px;

    color: var(--tooth-text);
    background: var(--tooth-bg);


}


.tooth-mag-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;

}



.tooth-mag-header__title {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 1.5rem;
    font-weight: bold;
}

.tooth-mag-header__more {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--tooth-header);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s ease;
}


.tooth-mag-header__arrow {
    font-size: 1.3rem;
    line-height: 1;
}

/* body layout */
.tooth-mag-body {
    display: grid;
    grid-template-columns: 1fr 33%;
    gap: var(--tooth-gap);
    align-items: start;
}

/* main grid – 2 columns */
.tooth-mag-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--tooth-gap);
}

/* card base */
.tooth-mag-card {
    background: var(--tooth-bg);
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.tooth-mag-card:hover {
    transform: translateY(-2px);
}

/* main card */
.tooth-mag-card--main {
    display: flex;
    flex-direction: column;
    gap: var(--tooth-gap);
}

.tooth-mag-card__thumb-link {
    display: block;
    overflow: hidden;
}

.tooth-mag-card__thumb-wrap {
    position: relative;
    padding-bottom: 56.25%;
    overflow: hidden;
    background: var(--tooth-border);
}

.tooth-mag-card__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    border-radius: var(--tooth-radius);
}

/* content padding for main card */
.tooth-mag-card--main .tooth-mag-badge,
.tooth-mag-card--main .tooth-mag-meta,
.tooth-mag-card--main .tooth-mag-card__excerpt {
    padding-right: 16px;
    padding-left: 16px;
}

.tooth-mag-card--main .tooth-mag-card__title {
    margin-top: 8px;
    height: 50px;
}

.tooth-mag-card--main .tooth-mag-card__excerpt {
    margin-top: 8px;
}

/* side card */
.tooth-mag-card--side {
    padding: 10px 0;
}

/* badge */
.tooth-mag-badge {
    display: inline-block;
    background: var(--tooth-badge-bg);
    color: var(--tooth-badge-text);
    border-radius: var(--tooth-radius);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 3px 10px;
    text-decoration: none;
    transition: background 0.2s ease;
    max-width: max-content;
}

.tooth-mag-badge--small {
    font-size: 0.7rem;
    padding: 2px 8px;
}

/* titles */
.tooth-mag-card__title {
    font-size: 1.05rem;
    font-weight: bold;
    line-height: 1.5;
    color: var(--tooth-text);
    display: -webkit-box !important;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tooth-mag-card__title a {
    color: inherit;
    text-decoration: none;
}

.tooth-mag-card__title--side {
    font-size: 0.95rem;
    margin-top: 8px;
    line-clamp: 1;
    -webkit-line-clamp: 1;
}

/* meta row */
.tooth-mag-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--tooth-text-muted);
    flex-wrap: wrap;
    height:18px;
}

.tooth-mag-meta__author {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tooth-mag-meta__avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.tooth-mag-meta__reading-time {
    display: flex;
    align-items: center;
    gap: 4px;
}

.tooth-mag-meta__icon {
    flex-shrink: 0;
    opacity: 0.7;
}

/* excerpt */
.tooth-mag-card__excerpt {
    font-size: 0.85rem;
    color: var(--tooth-text);
    line-height: 1.7;
    margin-top: 6px;
    display: -webkit-box !important;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tooth-mag-card__excerpt--side {
    margin-top: 8px;
    height: 42px;
}

/* side panel */
.tooth-mag-side {
    border-right: 1px solid var(--tooth-header);
    padding-right: 18px;
}

.tooth-mag-side__list {
    list-style: none;
}

.tooth-mag-side__list li {
    margin-right: 0 !important;
}

.tooth-mag-card.tooth-mag-card--side .tooth-mag-meta {
    margin-top: 20px;
}

.tooth-mag-side__nav-button .swiper-slide {
    text-align: center;
}

.tooth-mag-side__intro {
    margin-bottom: 20px;
}

.tooth-mag-side__footer {
    margin-top: 15px;
    padding: 0 80px;
}

.tooth-mag-side__nav-icon {
    cursor: pointer;
}

.tooth-mag-side__nav-button .swiper-slide:not(.swiper-slide-thumb-active) {
    opacity: 0.3;
}


/* fade-in for scroll animation */
.tooth-mag-card {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tooth-mag-card--visible {
    opacity: 1;
    transform: translateY(0);
}

