/* ═══════════════════════════════════════════════════════════════════════════

   JCH Unified List Item — jch-listitem.css

   Single CSS file for content-listitem.php template part.
   Drop into child theme and enqueue, OR @import from style.css.

   Covers: topstory_more_element, jch-media-item, archive article list items.

   ═══════════════════════════════════════════════════════════════════════════ */


/* ── Base list item ───────────────────────────────────────────────────────── */

.jch-listitem-list { list-style: none; margin-left: 0; }

.jch-listitem {
    list-style: none;
    margin-bottom: 1em;
    padding-bottom: 1em;
    /* border-bottom: 1px solid #eee; */
    overflow: hidden; /* contain the float */
}


/* ── Thumbnail: float right, topstory pattern ─────────────────────────────── */

.jch-listitem .thumbnail-container {
    float: right;
    margin: 3px 0 0 1em;
}

.jch-listitem .thumbnail-container.no-thumbnail {
    display: none;
}

.jch-listitem .thumbnail-container img {
    height: 8vw;
    width: auto;
    display: block;
    aspect-ratio: 286/235;
    object-fit: cover;
}

.jch-listitem .thumbnail-container .readmore .ccfic {
    display: none;
}


/* ── Content area ─────────────────────────────────────────────────────────── */

.jch-listitem .jch-listitem-content {
    overflow: hidden; /* stay beside the float */
}

/* Title link — suppress theme decoration */
.jch-listitem .jch-listitem-content > a {
    display: block;
    text-decoration: none;
    box-shadow: none;
}


/* ── Date and file size ───────────────────────────────────────────────────── */

.jch-listitem .file-size,
.jch-listitem .posted-on {
    font-size: 0.85em;
    color: #666;
    letter-spacing: -.4px;
}

.posted-on + .file-size {
    margin-left: .5em;
}


/* ── Title (archive / topstory) ───────────────────────────────────────────── */

.jch-listitem h2.entry-title,
.jch-listitem h2.entry-title.media-name {
    font-size: 1.1em;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: inherit;
}

body.category-event .jch-listitem.event h2.entry-title::before, body.category-event .jch-listitem.event h2.entry-title.media-name:before {
    display: none;
}
.jch-listitem h2.entry-title a {
    text-decoration: none;
    box-shadow: none;
    color: inherit;
}


/* ── Excerpt ──────────────────────────────────────────────────────────────── */

.jch-listitem .entry-summary {
    font-size: 0.95em;
    margin-bottom: 0.5em;
}


/* ── Doclib: description, categories, tags ────────────────────────────────── */

.jch-listitem .media-description {
    font-style: italic;
    display: block;
    font-size: 90%;
}

.jch-listitem .media-categories,
.jch-listitem .media-tags {
    width: 100%;
    font-size: 90%;
}

/* Suppress the theme's dashicon ::before on cat/tag links —
   style.css handles the typography via .media-categories .cat-links a
   and .media-tags .tags-links a */
.jch-listitem .cat-links a::before,
.jch-listitem .tags-links a::before {
    display: none;
}

/* Dashicon prefix on the category/tag container itself */
.jch-listitem .media-categories::before {
    content: "\f318";
    font-style: normal;
    font-weight: normal;
    display: inline-block;
    font-family: dashicons;
    margin-left: 0.2em;
    color: #333;
    font-size: 100%;
}

.jch-listitem .media-tags::before {
    content: "#";
    font-style: normal;
    font-weight: normal;
    display: inline-block;
    margin-left: 0.2em;
    color: #333;
}


/* ── Doclib: mime-type icons on title link ────────────────────────────────── */

/* Suppress ::before/::after on thumbnail links — theme adds them to all
   .entry-content a */
.entry-content li.jch-media-item .thumbnail-container a::before,
.entry-content li.jch-media-item .thumbnail-container a::after {
    display: none;
}

/* Suppress the ::after offsite arrow on doclib title links */
.entry-content li.jch-media-item::after,
.entry-content li.jch-media-item .jch-listitem-content > a::after {
    display: none;
}

/* Suppress hover underline on title link */
.entry-content li.jch-media-item .jch-listitem-content > a:hover {
    box-shadow: none;
    text-decoration: none;
}

/* Default mime icon */
.entry-content li.jch-media-item .jch-listitem-content > a::before {
    content: "\f318";
    font-style: normal;
    font-weight: normal;
    display: inline;
    font-family: dashicons;
    color: #888;
    font-size: 100%;
}

/* Per-mime overrides */
.entry-content li.jch-media-item.mime-pdf .jch-listitem-content > a::before {
    content: "\f546";
}

.entry-content li.jch-media-item.mime-msword .jch-listitem-content > a::before {
    content: "\f320";
}

.entry-content li.jch-media-item.mime-mspptx .jch-listitem-content > a::before {
    content: "\f163";
}

.entry-content li.jch-media-item.mime-image .jch-listitem-content > a::before {
    content: "\f128";
}

.entry-content li.jch-media-item.mime-other .jch-listitem-content > a::before {
    content: "\f482";
}

/* Suppress mime icon when thumbnail is shown for image items */
.entry-content ul.has-thumbnail li.jch-media-item.mime-image::before {
    display: none;
}

/* Doclib item spacing */
.entry-content li.jch-media-item {
    margin: 0 0 2em 0;
}

/* Suppress the theme's ::before bullet on the <li> itself */
.entry-content li.jch-media-item::before {
    display: none;
}

/* Media name word wrapping */
.jch-listitem .media-name {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Min-width guard */
.jch-listitem {
    min-width: 0;
}


/* ── Footer ───────────────────────────────────────────────────────────────── */

.jch-listitem .entry-footer {
    font-size: 0.85em;
    color: #666;
}


/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {

    .jch-listitem .thumbnail-container {
        float: none;
        margin: 0 0 0.5em 0;
    }

    .jch-listitem .thumbnail-container img {
        height: auto;
        width: 100%;
        max-height: 30vw;
    }
}