/* HWzone Missed — bell + unread blocks. Light/dark via Foxiz's [data-theme="dark"]. */
.hwm-bell-wrap,
.hwm-panel,
.hw-missed {
    --hwm-bg: #fff;
    --hwm-fg: #1a1d24;
    --hwm-muted: #6b7280;
    --hwm-line: #e5e7eb;
    --hwm-hover: #f3f4f6;
    --hwm-new-bg: rgba(1, 173, 254, .09); /* the site's light blue (#01adfe, Foxiz --g-color) */
    --hwm-accent: var(--g-color, #01adfe);
    --hwm-shadow: 0 10px 30px rgba(0, 0, 0, .15);
}

[data-theme="dark"] .hwm-bell-wrap,
[data-theme="dark"] .hwm-panel,
[data-theme="dark"] .hw-missed {
    --hwm-bg: #1d2026;
    --hwm-fg: #f1f2f4;
    --hwm-muted: #9ca3af;
    --hwm-line: #2e323a;
    --hwm-hover: #262a31;
    --hwm-new-bg: rgba(1, 173, 254, .14);
    --hwm-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

/* ---------- bell ---------- */

.hwm-bell-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin-inline-end: 6px;
}

.hwm-bell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.hwm-bell:hover,
.hwm-bell-wrap.is-open .hwm-bell {
    background: rgba(127, 127, 127, .15);
}

.hwm-bell svg {
    width: 22px;
    height: 22px;
}

.hwm-bell.has-new svg {
    animation: hwm-ring 1.2s ease-in-out 1s 2;
    transform-origin: 50% 10%;
}

@keyframes hwm-ring {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(14deg); }
    30% { transform: rotate(-12deg); }
    45% { transform: rotate(8deg); }
    60% { transform: rotate(-6deg); }
    75% { transform: rotate(2deg); }
}

.hwm-badge {
    position: absolute;
    top: 2px;
    inset-inline-start: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--hwm-muted);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--hwm-bg);
    direction: ltr; /* "9+" */
    unicode-bidi: isolate;
}

.hwm-badge[hidden] {
    display: none;
}

/* Something new since the bell was last opened */
.hwm-badge.is-fresh {
    background: var(--hwm-accent);
    animation: hwm-pulse 2s ease-out 1s 3;
}

@keyframes hwm-pulse {
    0% { box-shadow: 0 0 0 2px var(--hwm-bg), 0 0 0 2px var(--hwm-accent); }
    70% { box-shadow: 0 0 0 2px var(--hwm-bg), 0 0 0 10px transparent; }
    100% { box-shadow: 0 0 0 2px var(--hwm-bg), 0 0 0 10px transparent; }
}

/* ---------- panel ---------- */

.hwm-panel {
    position: fixed; /* top/left set by the script */
    z-index: 99999;
    width: 380px;
    max-height: 80vh; /* the script sets the exact space below the bell */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--hwm-line);
    border-radius: 12px;
    background: var(--hwm-bg);
    color: var(--hwm-fg);
    box-shadow: var(--hwm-shadow);
    text-align: start;
}

.hwm-panel[hidden] {
    display: none;
}

.hwm-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 14px 16px 10px;
    font-size: 17px;
    font-weight: 700;
}

.hwm-mark-all {
    padding: 0;
    border: 0;
    background: none;
    color: var(--hwm-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.hwm-panel-empty {
    padding: 8px 16px 18px;
    color: var(--hwm-muted);
    font-size: 14px;
}

.hwm-panel-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--hwm-line) transparent;
}

.hwm-list {
    margin: 0;
    padding: 0 6px;
    list-style: none;
}

.hwm-mem {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--hwm-line);
}

.hwm-mem-head {
    padding: 0 16px;
    font-size: 15px;
    font-weight: 700;
}

.hwm-mem-sub {
    padding: 2px 16px 6px;
    color: var(--hwm-muted);
    font-size: 12px;
}

.hwm-mem-all {
    display: block;
    padding: 6px 16px 10px;
    color: var(--hwm-accent) !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
}

[data-theme="dark"] .hwm-panel {
    color-scheme: dark;
}

.hwm-otd {
    display: block;
    margin: 2px 6px 6px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--hwm-fg) !important;
    text-decoration: none !important;
}

.hwm-otd:hover {
    background: var(--hwm-hover);
}

.hwm-otd img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1200 / 630;
    margin-bottom: 6px;
    border-radius: 6px;
    object-fit: cover;
}

.hwm-otd-label {
    display: block;
    color: var(--hwm-accent);
    font-size: 12px;
    font-weight: 700;
}

.hwm-otd-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
}

.hwm-list li {
    margin: 0;
    border-radius: 8px;
}

.hwm-list li.is-new {
    background: var(--hwm-new-bg);
}

.hwm-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--hwm-fg) !important;
    text-decoration: none !important;
}

.hwm-item:hover {
    background: var(--hwm-hover);
}

.hwm-item-img {
    flex: 0 0 72px;
    width: 72px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
}

.hwm-item-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.hwm-item-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hwm-item-meta {
    color: var(--hwm-muted);
    font-size: 12px;
}

.hwm-new {
    margin-inline-end: 6px;
    color: var(--hwm-accent);
    font-weight: 700;
}

.hwm-panel-foot {
    display: block;
    padding: 11px 16px;
    border-top: 1px solid var(--hwm-line);
    color: var(--hwm-accent) !important;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none !important;
}

@media (max-width: 767px) {
    .hwm-bell-wrap {
        margin-inline-end: 2px;
    }

    .hwm-panel {
        width: auto;
        max-height: 75vh;
    }
}

/* ---------- blocks ---------- */

.hw-missed[hidden] {
    display: none;
}

.hw-missed {
    margin: 24px 0;
    color: var(--hwm-fg);
    container-type: inline-size;
}

.hwm-block-sub {
    margin: -6px 0 12px;
    color: var(--hwm-muted);
    font-size: 13px;
}

.hwm-sub-link {
    display: block;
    margin-top: 4px;
    color: var(--hwm-accent) !important;
    font-weight: 600;
    text-decoration: none !important;
}

.hwm-block-mem {
    margin-top: 34px;
}

.hwm-mem-foot {
    margin-top: 10px;
    font-size: 14px;
}

/* Homepage spots: start on the same line as the neighbouring column */
.hw-missed[data-ctx="home"] {
    margin-top: 0;
}

.hwm-block-title {
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 700;
}

.hwm-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

@container (min-width: 900px) {
    .hwm-cards {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.hwm-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--hwm-fg) !important;
    text-decoration: none !important;
}

.hwm-card-img {
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 8px;
    background: var(--hwm-hover);
}

.hwm-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.hwm-card:hover .hwm-card-img img {
    transform: scale(1.04);
}

.hwm-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
}

.hwm-card-cat {
    color: var(--hwm-accent);
    font-size: 12px;
    font-weight: 700;
}

.hwm-card-title {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.hwm-card-time {
    color: var(--hwm-muted);
    font-size: 12px;
}

.hwm-more {
    display: inline-block;
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hwm-accent);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

/* Blocks use Foxiz's own heading/list markup; only spacing here */
.hw-missed .block-h {
    margin-bottom: 15px;
}

/* Narrow (mobile, sidebars): one swipeable row */
@container (max-width: 559px) {
    .hwm-cards {
        display: flex;
        gap: 12px;
        margin: 0 -16px;
        padding: 0 16px 6px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .hwm-cards::-webkit-scrollbar {
        display: none;
    }

    .hwm-card {
        flex: 0 0 min(70%, 260px);
        scroll-snap-align: start;
    }
}
