/* ==========================================================================
   My Epiphany - Explore page (explore.php)
   Everything is prefixed ex- so it can't collide with main.css or Bootstrap 3.
   ========================================================================== */

.ex {
    --ex-blue: #009EE3;
    --ex-blue-dark: #0077AD;
    --ex-red: #8B0404;
    --ex-plum: #87145A;
    --ex-ink: #2f3337;
    --ex-text: #5a5959;
    --ex-muted: #7b8086;
    --ex-line: #dfe3e8;
    --ex-card: #ffffff;
    --ex-soft: #f2f8fc;
    --ex-radius: 10px;
    padding-bottom: 60px;
}

/* main.css makes every link inline-block with a transition; undo that inside the page */
.ex a { display: inline; position: static; transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.ex a:focus-visible, .ex button:focus-visible, .ex select:focus-visible, .ex input:focus-visible {
    outline: 3px solid rgba(0, 158, 227, .45); outline-offset: 2px;
}

.ex-wrap { max-width: 1100px; margin: 0 auto; padding: 0 18px; }

/* ---------------------------------------------------------------- hero + search */
.ex-hero { padding-top: 96px; text-align: center; }
.ex-hero .sec-title { margin-bottom: 18px; }
.ex-hero__lede { max-width: 640px; margin: 0 auto 22px; color: var(--ex-text); font-size: 17px; }

.ex-search {
    position: relative; display: flex; align-items: center;
    max-width: 720px; margin: 0 auto;
    background: #fff; border: 2px solid var(--ex-line); border-radius: 999px;
    box-shadow: 0 6px 22px rgba(0, 60, 100, .08);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ex-search:focus-within { border-color: var(--ex-blue); box-shadow: 0 6px 26px rgba(0, 158, 227, .18); }
.ex-search__icon { position: absolute; left: 20px; color: var(--ex-muted); font-size: 18px; pointer-events: none; }
.ex .ex-search__input {
    flex: 1; min-width: 0; height: 56px; padding: 0 12px 0 52px;
    border: 0; background: transparent; outline: none; box-shadow: none;
    font-size: 18px; color: var(--ex-ink); font-family: inherit;
}
.ex-search__input::-webkit-search-cancel-button { cursor: pointer; }
.ex .ex-search__input:focus-visible { outline: none; }   /* the rounded box shows focus instead */
.ex-search__kbd {
    margin-right: 8px; padding: 1px 8px; border: 1px solid var(--ex-line); border-radius: 5px;
    background: #f6f7f9; color: var(--ex-muted); font: 13px/20px monospace; box-shadow: none;
}
.ex-search__input:focus ~ .ex-search__kbd { display: none; }
.ex .ex-search__btn {
    height: 44px; margin-right: 6px; padding: 0 22px; border: 0; border-radius: 999px;
    background: var(--ex-blue); color: #fff; font-weight: 700; font-size: 15px; cursor: pointer;
}
.ex .ex-search__btn:hover { background: var(--ex-blue-dark); }
.js-ex .ex-search__btn { display: none; }               /* live results: the button isn't needed */
.js-ex .ex-search__input { padding-right: 8px; }

.ex-search__help { margin: 12px auto 0; max-width: 720px; font-size: 14px; color: var(--ex-muted); line-height: 22px; padding: 0; }
.ex-search__help a { color: var(--ex-blue-dark); border-bottom: 1px dotted currentColor; }
.ex-search__help a:hover { color: var(--ex-red); }
.ex-search__tips { white-space: nowrap; }

/* ---------------------------------------------------------------- headings */
.ex .ex-h2 { font-size: 21px; font-weight: 700; color: var(--ex-ink); margin: 0 0 16px; text-transform: none; text-align: left; }

/* ---------------------------------------------------------------- subject cards */
.ex-subjects { margin-top: 46px; }
.ex-subjects__grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.ex .ex-subject {
    display: flex; flex-direction: column; gap: 4px; height: 100%;
    padding: 16px 16px 14px; background: var(--ex-card);
    border: 1px solid var(--ex-line); border-radius: var(--ex-radius);
    text-align: left; color: var(--ex-ink); text-decoration: none;
}
.ex .ex-subject:hover { border-color: var(--ex-blue); box-shadow: 0 6px 18px rgba(0, 60, 100, .10); transform: translateY(-1px); }
.ex-subject__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-bottom: 6px; border-radius: 9px;
    background: var(--ex-soft); color: var(--ex-blue); font-size: 19px;
}
.ex-subject:hover .ex-subject__icon { background: var(--ex-blue); color: #fff; }
.ex-subject__name { font-weight: 700; font-size: 15.5px; line-height: 20px; min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.ex-subject__count { font-size: 13px; color: var(--ex-muted); line-height: 18px; }

/* ---------------------------------------------------------------- results toolbar */
.ex-results { margin-top: 42px; text-align: left; }
.ex-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.ex-tabs { display: inline-flex; background: #e9eef3; border-radius: 999px; padding: 4px; }
.ex .ex-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 7px 16px; border-radius: 999px;
    color: var(--ex-text); font-weight: 600; font-size: 14.5px; text-decoration: none;
}
.ex .ex-tab:hover { color: var(--ex-ink); }
.ex .ex-tab.is-active { background: #fff; color: var(--ex-ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.ex-tab__n { font-weight: 400; color: var(--ex-muted); font-size: 13px; }

.ex-sort { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.ex-sort label { margin: 0; font-weight: 600; font-size: 14px; color: var(--ex-muted); }
.ex .ex-sort select {
    height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--ex-line); border-radius: 8px;
    background: #fff; color: var(--ex-ink); font-size: 14.5px; cursor: pointer;
}
.ex .ex-btn { height: 36px; padding: 0 14px; border: 0; border-radius: 8px; background: var(--ex-blue); color: #fff; }

/* ---------------------------------------------------------------- category chips */
.ex-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 26px; }
.ex .ex-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border: 1px solid var(--ex-line); border-radius: 999px;
    background: #fff; color: var(--ex-text); font-size: 13.5px; line-height: 20px; text-decoration: none;
}
.ex .ex-chip i { color: var(--ex-blue); font-size: 12px; }
.ex .ex-chip:hover { border-color: var(--ex-blue); color: var(--ex-ink); }
.ex .ex-chip.is-active { background: var(--ex-blue); border-color: var(--ex-blue); color: #fff; }
.ex .ex-chip.is-active i { color: #fff; }
.ex-chip__n { color: var(--ex-muted); font-size: 12px; }
.ex-chip.is-active .ex-chip__n { color: rgba(255, 255, 255, .85); }
.ex .ex-chip__x { margin-left: 2px; }

.ex-results__h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ex-results__range { font-size: 14px; font-weight: 400; color: var(--ex-muted); }

/* ---------------------------------------------------------------- result cards */
.ex-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.ex-card {
    position: relative; display: grid; grid-template-columns: 168px 1fr auto; gap: 18px; align-items: start;
    padding: 14px; background: var(--ex-card);
    border: 1px solid var(--ex-line); border-radius: var(--ex-radius);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.ex-card:hover { border-color: #b9dcef; box-shadow: 0 6px 18px rgba(0, 60, 100, .08); }

.ex .ex-card__media {
    position: relative; display: flex; align-items: center; justify-content: center;
    width: 168px; aspect-ratio: 16 / 9; border-radius: 7px; overflow: hidden;
    background: linear-gradient(135deg, #e8f5fc, #d3ecf8); color: var(--ex-blue); font-size: 34px;
}
.ex-card--video .ex-card__media { background: #1d2329; }
.ex-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-card__play {
    position: absolute; inset: 0; margin: auto; width: 38px; height: 38px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0, 0, 0, .55); color: #fff; font-size: 14px; padding-left: 2px;
    transition: background-color .15s ease;
}
.ex-card:hover .ex-card__play { background: var(--ex-red); }
.ex-card__dur {
    position: absolute; right: 6px; bottom: 6px; padding: 0 6px; border-radius: 4px;
    background: rgba(0, 0, 0, .75); color: #fff; font-size: 12px; line-height: 19px;
}

.ex-card__body { min-width: 0; }
.ex .ex-card__meta { margin: 0 0 4px; padding: 0; font-size: 13px; line-height: 20px; color: var(--ex-muted); }
.ex-badge {
    display: inline-block; margin-right: 4px; padding: 0 8px; border-radius: 4px;
    font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 19px;
}
.ex-badge--topic { background: #e3f3fb; color: var(--ex-blue-dark); }
.ex-badge--video { background: #f6e4ea; color: var(--ex-plum); }
.ex .ex-card__cat { color: var(--ex-text); font-weight: 600; }
.ex .ex-card__cat:hover { color: var(--ex-blue-dark); text-decoration: underline; }

.ex .ex-card__title { margin: 0 0 6px; font-size: 18.5px; line-height: 25px; font-weight: 700; text-transform: none; text-align: left; }
.ex .ex-card__title a { color: var(--ex-ink); text-decoration: none; }
.ex .ex-card__title a:hover { color: var(--ex-blue-dark); }
.ex .ex-card__title a::after { content: ""; }       /* keep main.css underline effects off */
.ex .ex-card__intro { margin: 0; padding: 0; font-size: 15px; line-height: 23px; color: var(--ex-text); }

.ex-card__actions { padding-top: 2px; }

/* ---------------------------------------------------------------- empty, pages, footer note */
.ex-empty { padding: 28px; background: #fff; border: 1px dashed var(--ex-line); border-radius: var(--ex-radius); }
.ex-empty p { margin: 0 0 6px; padding: 0; }
.ex-empty a { color: var(--ex-blue-dark); font-weight: 600; }

.ex-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 28px 0 8px; }
.ex .ex-page {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 10px; border-radius: 8px;
    border: 1px solid var(--ex-line); background: #fff; color: var(--ex-ink); font-weight: 600; text-decoration: none;
}
.ex a.ex-page:hover { border-color: var(--ex-blue); color: var(--ex-blue-dark); }
.ex .ex-page.is-current { background: var(--ex-blue); border-color: var(--ex-blue); color: #fff; }
.ex .ex-page--gap { border: 0; background: none; min-width: 20px; color: var(--ex-muted); }

.ex .ex-alt { margin: 26px 0 0; padding: 0; font-size: 14px; color: var(--ex-muted); text-align: center; }
.ex .ex-alt a { color: var(--ex-blue-dark); }

/* While new results load */
.ex-region { transition: opacity .15s ease; }
[data-ex-target].is-loading .ex-region { opacity: .45; }

/* ---------------------------------------------------------------- phones and small tablets */
@media (max-width: 767px) {
    .ex-hero { padding-top: 84px; }
    .ex-hero__lede { font-size: 15.5px; }
    .ex .ex-search__input { height: 50px; font-size: 16px; padding-left: 46px; }
    .ex-search__icon { left: 17px; }
    .ex-search__kbd, .ex-search__tips { display: none; }
    .ex-subjects { margin-top: 32px; }
    .ex-subjects__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .ex .ex-subject {
        display: grid; grid-template-columns: 30px 1fr; column-gap: 9px; row-gap: 0; align-items: center;
        padding: 9px 10px;
    }
    .ex-subject__icon { grid-row: span 2; width: 30px; height: 30px; margin: 0; font-size: 14px; border-radius: 7px; }
    .ex-subject__name { font-size: 13.5px; line-height: 17px; }
    .ex-subject__count { font-size: 11.5px; line-height: 15px; }
    .ex-toolbar { flex-direction: column; align-items: stretch; }
    .ex-tabs { justify-content: space-between; }
    .ex .ex-tab { flex: 1; justify-content: center; padding: 7px 8px; }
    .ex-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -18px; padding-right: 18px; padding-bottom: 4px; scrollbar-width: none; }
    .ex-chips::-webkit-scrollbar { display: none; }
    .ex .ex-chip { flex: 0 0 auto; }
    .ex-card { grid-template-columns: 96px 1fr; gap: 12px; padding: 12px; }
    .ex .ex-card__media { width: 96px; font-size: 24px; }
    .ex-card__body { padding-right: 34px; }
    .ex-card__actions { position: absolute; top: 10px; right: 10px; padding: 0; }
    .ex .ex-card__title { font-size: 16.5px; line-height: 22px; }
    .ex .ex-card__intro { font-size: 14px; line-height: 21px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
    .ex *, .ex *::before, .ex *::after { transition: none !important; }
}
