.hgi-player {
    margin: 0 auto 18px;
    width: 100%;
}

.hgi-frame-wrap {
    position: relative;
    width: 100%;
    height: 0;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.hgi-frame-wrap iframe.hgi-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.hgi-player:fullscreen .hgi-frame-wrap,
.hgi-player.is-full .hgi-frame-wrap {
    height: 100vh !important;
    padding-top: 0 !important;
    border-radius: 0;
}

.hgi-toolbar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.hgi-btn {
    display: inline-block;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #f7f7f7;
    color: #1d2327;
    cursor: pointer;
}

.hgi-btn:hover {
    background: #eee;
}

.hgi-grid {
    display: grid;
    grid-template-columns: repeat(var(--hgi-cols, 4), minmax(0, 1fr));
    gap: 14px;
}

.hgi-card {
    display: block;
    text-decoration: none;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: transform .15s ease, box-shadow .15s ease;
}

.hgi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.hgi-card-thumb {
    display: block;
    aspect-ratio: 16 / 10;
    background: #f2f2f2;
    overflow: hidden;
}

.hgi-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hgi-nothumb {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 13px;
    color: #777;
    padding: 8px;
    text-align: center;
}

.hgi-card-title {
    display: block;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1d2327;
}

/* ---- archive / taxonomy listing ---- */

.hgi-archive-header {
    margin-bottom: 18px;
}

.hgi-archive-title {
    margin: 0 0 4px;
}

.hgi-archive-count {
    margin: 0 0 12px;
    color: #666;
    font-size: 13px;
}

/* Categories and tags are always separate, labelled blocks. */

.hgi-term-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 10px 0 16px;
    padding: 10px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.hgi-bar-label {
    flex: 0 0 100%;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #777;
}

.hgi-tag-section {
    margin-top: 26px;
}

.hgi-tag-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.hgi-tag {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    background: #f7f7f7;
    color: #333;
    font-size: 13px;
    text-decoration: none;
}

.hgi-tag:hover {
    background: #eef3f8;
}

.hgi-tag.is-active {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.hgi-tag-count {
    opacity: .65;
    font-size: 12px;
}

/* Category chips: blue. Tag chips: neutral grey. Never the same colour, so a
   visitor can always tell which list is which. */
.hgi-tag-cat {
    background: #eef4fb;
    border-color: #cfdff1;
    color: #185fa5;
    font-weight: 500;
}

.hgi-tag-cat:hover {
    background: #dceaf8;
}

.hgi-tag-term {
    background: #f6f6f6;
    border-color: #e0e0e0;
    color: #444;
}

.hgi-tag-term:hover {
    background: #ececec;
}

.hgi-tag-cat.is-active,
.hgi-tag-cat.is-active:hover {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.hgi-tag-term.is-active,
.hgi-tag-term.is-active:hover {
    background: #1d2327;
    border-color: #1d2327;
    color: #fff;
}

.hgi-cat-bar,
.hgi-cat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.hgi-cat-bar .hgi-tag {
    background: #eef4fb;
    border-color: #d3e2f2;
    color: #185fa5;
    font-weight: 500;
}

.hgi-cat-bar-sub {
    margin-top: -4px;
    padding-left: 12px;
    border-left: 3px solid #e0e0e0;
}

.hgi-cat-bar .hgi-tag.is-active,
.hgi-cat-bar .hgi-tag.is-active:hover {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

.hgi-cat-list {
    flex-direction: column;
    align-items: flex-start;
}

.hgi-breadcrumb {
    margin: 4px 0 10px;
    font-size: 13px;
}

.hgi-cats,
.hgi-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
}

.hgi-cats-label,
.hgi-tags-label {
    font-size: 13px;
    color: #555;
}

.hgi-pagination {
    margin-top: 20px;
}

.hgi-pagination ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hgi-pagination li {
    margin: 0;
}

.hgi-pagination a,
.hgi-pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
}

.hgi-pagination .current span {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

@media (max-width: 900px) {
    .hgi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .hgi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}
