
/* ============================================================
   EduHub responsive layout
   Replaces old w3largescreen.css for this site
   Uses container queries instead of screen-width guessing
   ============================================================ */

/* ---------- Shared page shells ---------- */

.w3-hub-shell,
.w3-article-shell,
.w3-article-shell-narrow {
    width: 100%;
    max-width: none;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    box-sizing: border-box;
}

.w3-article-shell-narrow {
    max-width: 980px;
}

.w3-column-right,
.w3-hub-rail,
.w3-article-rail,
.w3-article-main {
    min-width: 0;
}

/* ---------- Home / library two-column layout ---------- */

.w3-hub-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1200px) {
    .w3-hub-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .w3-hub-layout {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1025px) {
    .w3-hub-rail-sticky,
    .w3-article-rail-sticky {
        position: sticky;
        top: 16px;
        align-self: start;
    }
}

/* ---------- Home / library grid driven by container width ---------- */

.w3-hub-grid-wrap {
    container-type: inline-size;
    width: 100%;
    min-width: 0;
}

.w3-hub-grid {
    display: grid;
    gap: 16px;
    align-items: stretch;
    grid-template-columns: 1fr;
}

@container (min-width: 460px) {
    .w3-hub-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (min-width: 760px) {
    .w3-hub-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@container (min-width: 1040px) {
    .w3-hub-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@container (min-width: 1320px) {
    .w3-hub-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@container (min-width: 1600px) {
    .w3-hub-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.w3-hub-grid > .home-card {
    min-width: 0;
    height: 100%;
}

/* ---------- Card internals ---------- */

.w3-hub-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.w3-hub-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    flex-shrink: 0;
}

.w3-hub-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    margin-top: 8px;
    margin-bottom: 6px;
    min-height: 2.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.w3-hub-card-excerpt {
    font-size: 0.85rem;
    line-height: 1.35;
    min-height: 4.05em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.w3-hub-meta {
    font-size: 0.75rem;
    line-height: 1.35;
    min-height: 1.35em;
    margin-top: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.w3-hub-pinrow {
    min-height: 1.8em;
    margin-top: 6px;
    flex-shrink: 0;
}

/* ---------- Article page layout ---------- */

.w3-article-layout-wrap {
    container-type: inline-size;
    width: 100%;
    min-width: 0;
}

.w3-article-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}

@container (min-width: 1100px) {
    .w3-article-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        gap: 32px;
    }
}

@container (min-width: 1400px) {
    .w3-article-layout {
        grid-template-columns: minmax(0, 1fr) 360px;
    }
}

.w3-article-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.w3-article-content {
    font-size: 1rem;
    line-height: 1.65;
    min-width: 0;
}

.w3-article-content img {
    max-width: 100%;
    height: auto;
}

.w3-article-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.w3-article-content iframe,
.w3-article-content video,
.w3-article-content embed,
.w3-article-content object {
    max-width: 100%;
    width: 100%;
}

.w3-article-content h1,
.w3-article-content h2,
.w3-article-content h3,
.w3-article-content h4 {
    line-height: 1.25;
}

.w3-article-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.cms-unread-card {
    background: #f5fbff !important;
    border: 2px solid #b7d8e8 !important;
}

.cms-unread-title {
    font-weight: 700;
}

.cms-unread-flag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.2;
    background: #d9edf7;
    color: #245269;
    border: 1px solid #bcdff1;
}

.cms-pop-unread {
    border-left: 3px solid #d6eaf5 !important;
    padding-left: 9px !important;
}
