/* Child Pages - List View (Default) */
.child-pages {
    margin: 2em 0;
}

.child-pages .cc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.child-pages-list .cc-list li {
    margin-bottom: 1em;
}

.child-pages-list .cc-list li a {
    display: block;
    padding: 12px 15px;
    text-decoration: none;
    color: #0c3a46;
    font-weight: 600;
    line-height: 1.25;
}

.child-pages-list .cc-list li p {
    margin: 8px 0 0;
    font-weight: normal;
    color: #666;
    font-size: 0.9em;
}

.child-pages-grid ul.cc-list:not([class*=" "]) {
    display: block;
    margin: 0 20px;
    list-style: disc;
}

/* Child Pages - Grid View */
.child-pages-grid .cc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 22px;
    /* Beat theme `ul { align-items: baseline }` — baseline shifts shorter cards up when image heights differ */
    align-items: stretch;
    justify-items: stretch;
}

/* Themes often set `ul { align-items: baseline }` inside .entry-content — force grid stretch */
.entry-content .child-pages-grid .cc-list {
    align-items: stretch;
    justify-items: stretch;
}

/* 2 Column Grid */
.child-pages-grid .cc-list.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 3 Column Grid */
.child-pages-grid .cc-list.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* 4 Column Grid */
.child-pages-grid .cc-list.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* 5 Column Grid */
.child-pages-grid .cc-list.cols-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Responsive: Adjust columns on tablets */
@media (max-width: 1024px) {
    .child-pages-grid .cc-list.cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .child-pages-grid .cc-list.cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Responsive: 2 columns on smaller tablets */
@media (max-width: 768px) {
    .child-pages-grid .cc-list.cols-5,
    .child-pages-grid .cc-list.cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Responsive: 1 column on mobile */
@media (max-width: 640px) {
    .child-pages-grid .cc-list.cols-2,
    .child-pages-grid .cc-list.cols-3,
    .child-pages-grid .cc-list.cols-4,
    .child-pages-grid .cc-list.cols-5 {
        grid-template-columns: 1fr;
    }
}

/* Grid Item Styling (exclude list view: ul.cc-list.default) */
.child-pages-grid .cc-list:not(.default) > li {
    margin: 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    align-items: stretch;
    align-self: stretch;
}

.child-pages-grid .cc-list:not(.default) li a.child-page-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    text-decoration: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
    color: inherit;
    position: relative;
}

/* Image sits above text; natural aspect ratio (no background crop) */
.child-pages-grid .cc-list li a.child-page-card .child-page-card-media {
    display: block;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.child-pages-grid .cc-list li a.child-page-card .child-page-card-media img.child-page-thumb {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
}

.child-pages-grid .cc-list li a.child-page-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
}

/* Content wrapper - base styles */
.child-page-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 18px 20px 15px;
    background: #fff;
    position: relative;
    border-radius: 8px;
}

.child-pages-grid .cc-list li a.child-page-card.has-image .child-page-content {
    border-radius: 0 0 8px 8px;
}

/* Title styling */
.child-page-title {
    display: block;
    color: #0c3a46;
    font-weight: 600;
    line-height: 1.25;
    margin: 0 0 6px 0;
    font-size: 1em;
}

/* Excerpt styling */
.child-page-excerpt {
    display: block;
    color: #666;
    font-weight: normal;
    font-size: 0.9em;
    line-height: 1.4;
    margin: 0;
}

.entry-content a.child-page-card .child-page-title {
    text-decoration: underline;
}
.entry-content a.child-page-card {
    text-decoration: none !important;
}