/* =====================================================================
   EducationalEngine Site Styles — creator-lists.css
   Loaded only on pages that use [pagelist_ext].
   Sections:
     7. Creator cards — Educational Activity Creators page
     8. Creator tiles — front page
   ===================================================================== */


/* =====================================================================
   7. Creator cards — Educational Activity Creators page
      ([pagelist_ext] list with class "creator-list")
      Each tool becomes a card; the whole card is clickable.
   ===================================================================== */
.page-list-ext.creator-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.creator-list .page-list-ext-item {
    position: relative;
    display: grid;
    grid-template-columns: 64px 1fr;
    grid-template-areas:
        "img   title"
        "text  text"
        "cta   cta";
    grid-template-rows: auto 1fr auto;
    column-gap: 16px;
    margin: 0;
    padding: 24px 24px 20px;
    background: #fff;
    border: 1px solid #e3e8ec;
    border-top: 4px solid #2B6E8C;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    overflow: hidden;
}

.creator-list .page-list-ext-item:hover,
.creator-list .page-list-ext-item:focus-within {
    transform: translateY(-4px);
    border-color: #c9d8e0;
    border-top-color: #2B6E8C;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.10);
}

/* Thumbnail: a rounded square icon (the 150px image shown at 64px, crisp on retina) */
.creator-list .page-list-ext-image {
    grid-area: img;
    float: none;
    margin: 0;
    width: 64px;
    height: 64px;
}

.creator-list .page-list-ext-image img {
    display: block;
    width: 64px !important;
    height: 64px !important;
    object-fit: cover;
    border-radius: 12px;
    margin: 0;
}

/* Title, vertically centred next to the icon */
.creator-list .page-list-ext-title {
    grid-area: title;
    align-self: center;
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
}

.creator-list .page-list-ext-title a {
    color: #1c2b36;
    text-decoration: none;
}

.creator-list .page-list-ext-item:hover .page-list-ext-title a {
    color: #2B6E8C;
}

/* The title link stretches over the whole card, so anywhere is clickable */
.creator-list .page-list-ext-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.creator-list .page-list-ext-title a:focus-visible {
    outline: none;
}

.creator-list .page-list-ext-item:has(.page-list-ext-title a:focus-visible) {
    outline: 3px solid #2B6E8C;
    outline-offset: 3px;
}

/* Blurb */
.creator-list .page-list-ext-item-content {
    grid-area: text;
    margin: 16px 0 0;
    color: #4a5866;
    font-size: 0.95rem;
    line-height: 1.6;
}

.creator-list .page-list-ext-item-content p {
    margin: 0 0 0.6em;
}

.creator-list .page-list-ext-item-content p:last-child {
    margin-bottom: 0;
}

/* "Open the tool" line at the bottom of every card */
.creator-list .page-list-ext-item::after {
    content: "Open the tool \2192";
    grid-area: cta;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #edf1f4;
    color: #2B6E8C;
    font-weight: 600;
    font-size: 0.95rem;
    transition: letter-spacing .2s ease;
}

.creator-list .page-list-ext-item:hover::after {
    letter-spacing: 0.02em;
}

/* Keep only the cards in the grid: a theme clearfix (::before/::after) or a
   stray <p>/<br> added by WordPress would otherwise take the first cell */
.page-list-ext.creator-list::before,
.page-list-ext.creator-list::after {
    content: none;
    display: none;
}

.creator-list > :not(.page-list-ext-item) {
    display: none;
}

@media (max-width: 600px) {
    .page-list-ext.creator-list {
        gap: 16px;
        margin: 20px 0;
    }
    .creator-list .page-list-ext-item {
        grid-template-columns: 56px 1fr;
        padding: 20px 18px 16px;
    }
    .creator-list .page-list-ext-image,
    .creator-list .page-list-ext-image img {
        width: 56px !important;
        height: 56px !important;
    }
    .creator-list .page-list-ext-title {
        font-size: 1.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .creator-list .page-list-ext-item,
    .creator-list .page-list-ext-item::after {
        transition: none;
    }
    .creator-list .page-list-ext-item:hover,
    .creator-list .page-list-ext-item:focus-within {
        transform: none;
    }
}


/* =====================================================================
   8. Creator tiles — front page
      [pagelist_ext child_of="114" show_content="0" image_width="600"
       image_height="450" class="creators-home-page"]
      Featured image fills the tile; the title sits on a dark gradient.
   ===================================================================== */
.page-list-ext.creators-home-page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1200px;
    margin: 32px auto;
}

@media (max-width: 900px) {
    .page-list-ext.creators-home-page {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Keep only the tiles in the grid (theme clearfix, stray <p>/<br>) */
.page-list-ext.creators-home-page::before,
.page-list-ext.creators-home-page::after {
    content: none;
    display: none;
}

.creators-home-page > :not(.page-list-ext-item) {
    display: none;
}

.creators-home-page .page-list-ext-item {
    position: relative;
    aspect-ratio: 4 / 3;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    background: #1c2b36;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: transform .2s ease, box-shadow .2s ease;
}

.creators-home-page .page-list-ext-item:hover,
.creators-home-page .page-list-ext-item:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.18);
}

/* Featured image fills the tile */
.creators-home-page .page-list-ext-image,
.creators-home-page .page-list-ext-image a {
    position: absolute;
    inset: 0;
    float: none;
    margin: 0;
    width: auto;
    height: auto;
    display: block;
}

.creators-home-page .page-list-ext-image img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    margin: 0;
    transition: transform .4s ease;
}

.creators-home-page .page-list-ext-item:hover .page-list-ext-image img {
    transform: scale(1.05);
}

/* Title on a gradient at the bottom */
.creators-home-page .page-list-ext-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 56px 20px 18px;
    background: linear-gradient(to top, rgba(12, 22, 30, 0.88) 0%, rgba(12, 22, 30, 0.55) 55%, rgba(12, 22, 30, 0) 100%);
    font-size: 1.3rem;
    line-height: 1.25;
}

.creators-home-page .page-list-ext-title a {
    color: #fff;
    text-decoration: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.creators-home-page .page-list-ext-title a::before {
    content: "";
    display: block;
    width: 36px;
    height: 4px;
    margin-bottom: 10px;
    border-radius: 2px;
    background: #7cc3df;
    transition: width .2s ease;
}

.creators-home-page .page-list-ext-item:hover .page-list-ext-title a::before {
    width: 56px;
}

/* The title link covers the whole tile, so anywhere is clickable */
.creators-home-page .page-list-ext-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.creators-home-page .page-list-ext-title a:focus-visible {
    outline: none;
}

.creators-home-page .page-list-ext-item:has(.page-list-ext-title a:focus-visible) {
    outline: 3px solid #2B6E8C;
    outline-offset: 3px;
}

/* In case show_content="0" is left off */
.creators-home-page .page-list-ext-item-content {
    display: none;
}

/* Phones: two smaller square-ish tiles per row */
@media (max-width: 600px) {
    .page-list-ext.creators-home-page {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin: 20px 0;
    }
    .creators-home-page .page-list-ext-item {
        aspect-ratio: 1 / 1;
        border-radius: 12px;
    }
    .creators-home-page .page-list-ext-title {
        padding: 40px 12px 12px;
        font-size: 1rem;
    }
    .creators-home-page .page-list-ext-title a::before {
        width: 24px;
        height: 3px;
        margin-bottom: 7px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .creators-home-page .page-list-ext-item,
    .creators-home-page .page-list-ext-image img,
    .creators-home-page .page-list-ext-title a::before {
        transition: none;
    }
    .creators-home-page .page-list-ext-item:hover,
    .creators-home-page .page-list-ext-item:focus-within,
    .creators-home-page .page-list-ext-item:hover .page-list-ext-image img {
        transform: none;
    }
}
