:root {
    color-scheme: light dark;
    --top-section-height: 200px;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font-family:
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        sans-serif;
}
#offline-indicator {
    display: none;
}
#offline-indicator.offline {
    display: block;
    background: rgb(229, 109, 37, 0.75);
    color: white;
    padding: 2px 0px;
    font-size: 9px;
    text-align: center;
}

header {
    padding: 0.5em;
    border-bottom: 1px solid #ccc;
    max-width: 90%;
    margin: 0 auto;
    text-align: center;
}
header h1 {
    margin: 0;
    font-size: 18px;
}
h1 a,
h1 a:visited {
    text-decoration: none;
    color: inherit;
}
search {
    padding: 1em;
    border-right: 1px solid #ccc;
    height: 160px;
    align-content: center;
}
search form {
    display: flex;
    gap: 8px;
}
search input {
    flex: 1;
}
#reader-controls {
    display: grid;
    grid-template-columns: 420px 1fr;
    align-items: center;
    border-bottom: 1px solid #ccc;
}
main {
    display: grid;
    grid-template-columns: 420px 1fr;
    height: calc(100vh - var(--top-section-height));
}
#results {
    overflow-y: auto;
    border-right: 1px solid #ccc;
    height: calc(100vh - var(--top-section-height));
}
#reader {
    height: auto;
    display: flex;
    flex-direction: column;
}
#entry-meta {
    padding: 1em;
    height: 160px;
    width: 100%;
}
#entry-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}
#nav-status {
    font-size: 12px;
    margin: 1em 0 0 0;
    height: 1em;
}
#nav-status.empty {
    opacity: 0;
}
#nav-status.set {
    opacity: 0.7;
    transition: opacity 1s ease;
}
#nav-title {
    font-weight: 600;
    overflow: hidden;
    display: block;
}
#nav-feed {
    font-size: 12px;
    opacity: 0.7;
    display: block;
    margin-bottom: 1em;
}
#content {
    width: 100%;
    height: 100%;
    border: 0;
}
.entry {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}
.entry:hover {
    background: rgba(0, 0, 0, 0.05);
}
.entry.unread {
    border-left: 4px solid rgb(229, 109, 37, 0.75);
}
.title {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}
.feed {
    font-size: 12px;
    opacity: 0.7;
}
.date {
    font-size: 12px;
    opacity: 0.7;
}
.muted {
    opacity: 0.7;
    font-size: 12px;
}
.entry-controls {
    float: right;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-wrap: nowrap;
}
.star,
.unread-btn,
.read-btn {
    padding: 0px;
    display: inline-block;
    cursor: pointer;
    opacity: 0.7;
    background: none;
    border: none;
}
.unstarred svg {
    fill: none;
}
.starred {
    color: gold;
    opacity: 0.7;
}
.star svg {
    width: 16px;
    height: 16px;
    margin: 5px;
}

button,
.button {
    cursor: pointer;
    padding: 6px 10px;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.unread-btn svg,
.read-btn svg {
    width: 16px;
    height: 16px;
    margin: 5px;
}

/* Tags */
.entry .tags {
    grid-column: 1 / 3;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.entry .tag {
    font-size: 0.8rem;
    padding: 0 0.55rem 0 0;
    border-radius: 9999px;
    user-select: none;
}

.entry .tag:is(:hover, :focus-visible) {
    filter: contrast(1.15);
    outline: none;
}
.entry-controls {
    margin-left: 8px;
}

/* Full-screen reader when body.reading is set */
@media (max-width: 800px) {
    main {
        grid-template-columns: 1fr;
        height: calc(100vh - var(--top-section-height));
    }
    #reader-controls {
        grid-template-columns: 1fr;
    }
    body #reader {
        display: none;
    }
    body #entry-meta {
        display: none;
    }
    body.reading #entry-meta {
        display: block;
    }
    body.reading search {
        display: none;
    }
    body.reading #reader {
        display: block;
        height: calc(100vh - var(--top-section-height));
    }
    body.reading #results {
        display: none;
    }
}
