/* ABC Playground grade pages; intentionally scoped to avoid affecting existing topic pages. */
.abc-grade-page .grade-intro { margin:12px 14px 16px; font-size:14px; line-height:1.6; color:#34434b; }
.abc-grade-page .grade-nav-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; padding:0 14px 20px; }
.abc-grade-page .grade-nav-card { min-height:78px; border:1px solid #d2e0e8; border-radius:9px; padding:13px; background:#fff; text-decoration:none; display:flex; flex-direction:column; gap:7px; transition:border-color .15s,background .15s; }
.abc-grade-page .grade-nav-card:hover,.abc-grade-page .grade-nav-card:focus-visible { border-color:#008eae; background:#f3fbfd; }
.abc-grade-page .grade-nav-card strong { color:#007fa4; font-size:15px; }
.abc-grade-page .grade-nav-card span { color:#526570; font-size:12px; line-height:1.45; }
.abc-grade-page .subject-menu a.grade-current { background:#e4f5f9; color:#007e9d; font-weight:700; border-left:4px solid #008bad; }
.abc-grade-page .grade-featured-body { padding:16px 14px 24px; }
.abc-grade-page .worksheet-subtopic { padding:18px 14px 20px; border-bottom:1px solid #dce2e5; }
.abc-grade-page .worksheet-subtopic h3 { margin:0 0 8px; color:#0089b0; font-size:19px; }
.abc-grade-page .subtopic-description { margin-bottom:15px; font-size:13px; line-height:1.6; }
.abc-grade-page .grade-worksheet-grid { margin-top:12px; }
.abc-grade-page .grade-empty { padding:12px 14px; color:#667; }
@media(max-width:950px){.abc-grade-page .grade-nav-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:520px){.abc-grade-page .grade-nav-grid{grid-template-columns:1fr;}}

/* Match the existing subtopic page dimensions and worksheet previews. */
.page-layout.abc-grade-page {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 0 20px;
    gap: 20px;
    box-sizing: border-box;
}
.abc-grade-page > .subject-sidebar {
    flex: 0 0 220px;
    width: 220px;
    min-width: 0;
}
.abc-grade-page > .subject-content {
    flex: 1 1 auto;
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 0;
    overflow: visible;
}
.abc-grade-page > .subject-content > .content-panel {
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}
/* Same five/four/three/two-column grid as the topic-page layout. */
.abc-grade-page .worksheet-preview-grid.grade-worksheet-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    column-gap: 18px;
    row-gap: 28px;
    padding: 5px 0 0;
    margin-top: 12px;
    width: 100%;
    align-items: start;
}
.abc-grade-page .grade-worksheet-grid .ws_pv_img_cont {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    min-width: 0;
    margin-bottom: 10px;
}
.abc-grade-page .grade-worksheet-grid .ws-preview-image {
    width: 100%;
    text-align: center;
}
.abc-grade-page .grade-worksheet-grid .ws_pv_img {
    display: block;
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto;
    border: 1px solid #000;
}

.abc-grade-page .grade-worksheet-grid .ws-preview-title {
    width: 100%;
    margin-top: 10px;
    /*text-align: center;*/
	text-align: left;
	padding-left: 8px;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 600;
}
.abc-grade-page .grade-worksheet-grid .ws-preview-title a {
    color: #008db3;
    text-decoration: none;
}
.abc-grade-page .grade-worksheet-grid .ws-preview-title a:hover {
    text-decoration: underline;
}

/* Match topic-page section spacing. */
.abc-grade-page .worksheet-subtopic {
    padding: 22px 0 28px;
    border-bottom: 1px solid #ddd;
}
.abc-grade-page .worksheet-subtopic h3 {
    font-size: 22px;
    font-weight: 700;
    color: #008db3;
    margin: 0 0 8px;
}
.abc-grade-page .subtopic-description {
    font-size: 15px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 18px;
    max-width: 900px;
}
@media (max-width: 1200px) {
    .abc-grade-page .worksheet-preview-grid.grade-worksheet-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    .abc-grade-page .worksheet-preview-grid.grade-worksheet-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 700px) {
    .page-layout.abc-grade-page { flex-direction: column; }
    .abc-grade-page > .subject-sidebar,
    .abc-grade-page > .subject-content { width: 100%; flex: none; }
}
@media (max-width: 600px) {
    .abc-grade-page .worksheet-preview-grid.grade-worksheet-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        padding: 10px;
    }
}


/* Topic-page equivalent inner padding and section spacing. */
.abc-grade-page .grade-subtopic-content {
    padding: 10px 20px 25px;
}
.abc-grade-page .grade-subtopic-content .grade-intro {
    margin: 4px 0 10px;
}
.abc-grade-page .grade-subtopic-content .worksheet-subtopic {
    padding: 22px 0 28px;
    scroll-margin-top: 20px;
}
.abc-grade-page .grade-subtopic-content .worksheet-subtopic:last-child {
    border-bottom: none;
}
/* Same heading / right-aligned jump dropdown as topic pages. */
.abc-grade-page .grade-subtopic-nav-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    margin: 0;
}
.abc-grade-page .grade-subtopic-nav-heading span {
    flex: 1 1 auto;
    min-width: 0;
}
.abc-grade-page #grade-subtopic-jump {
    display: block;
    flex: 0 0 230px;
    /*width: 230px;*/
	width: auto;
    margin-left: auto;
    /*padding: 10px 14px;*/
	padding: 6px 14px;
    background-color: #008db3;
    color: #fff;
    border: 2px solid #006f90;
    border-radius: 6px;
    font-family: 'Open Sans', sans-serif;
    /*font-size: 14px;*/
	font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease;
}
.abc-grade-page #grade-subtopic-jump:hover { background-color: #006f90; }
.abc-grade-page #grade-subtopic-jump:focus { outline: 2px solid #0066cc; outline-offset: 2px; }
.abc-grade-page #grade-subtopic-jump option { background: #fff; color: #222; }
.abc-grade-page #grade-subtopic-jump:disabled { opacity: .6; cursor: default; }
@media (max-width: 700px) {
    .abc-grade-page .grade-subtopic-nav-heading { flex-direction: column; align-items: stretch; }
    .abc-grade-page #grade-subtopic-jump { flex: none; width: 100%; margin-left: 0; }
}
@media (max-width: 600px) {
    .abc-grade-page .grade-subtopic-content { padding: 10px 12px 20px; }
}
