* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background-color: white;
    margin-bottom: 4rem;
}

.content {
    display: flex;
    flex-direction: row;
    position: relative;
}

.view-toggle {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 100;
    transition: transform 0.2s;
}

.view-toggle:hover {
    transform: scale(1.1);
}

.recent {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 4.5rem);
    width: 100%;
}

.headlines,
.previews {
    flex: 0 1 50%;
    height: 50%;
    padding: 1rem;
    overflow-y: auto;
}

.headlines {
    background-color: olivedrab;
    border-bottom: 1px solid black;
}

.previews {
    background-color: tomato;
    position: relative;
}

.previews.masonry-mode {
    column-width: 200px;
    column-count: auto;
    gap: 1rem;
    padding: 1rem;
    flex: 1 1 auto;
    height: auto;
    max-height: none;
}

.recent.masonry-mode .headlines {
    flex: 0 0 auto;
    height: auto;
}

.masonry-item {
    position: relative;
    overflow: hidden;
    break-inside: avoid;
    margin-bottom: 1rem;
    max-height: 300px;
}

.masonry-item img,
.masonry-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.masonry-item.highlight {
    filter: drop-shadow(0 0 1rem gold);
}

.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: auto;
    z-index: 1000;
}

.image-modal.active {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    background: white;
    display: flex;
    flex-direction: column;
    max-width: 90vw;
    max-height: 90vh;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 1px solid black;
    flex: 1 1 auto;
    max-height: calc(90vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: black;
}

.modal-track {
    display: flex;
    width: 100%;
}

.modal-slide {
    min-width: 100%;
    display: none;
    flex-shrink: 0;
}

.modal-slide.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-media {
    max-width: 90vw;
    max-height: calc(90vh - 100px);
    display: block;
}

.modal-media img,
.modal-media video {
    max-width: 90vw;
    max-height: calc(90vh - 100px);
    display: block;
}

.modal-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.modal-carousel-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.modal-carousel-prev {
    left: 0.5rem;
}

.modal-carousel-next {
    right: 0.5rem;
}

.modal-context {
    padding: 1.5rem;
    border-top: 1px solid black;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.modal-context .modal-description {
    order: -1;
    margin-bottom: 0.5rem;
}

.modal-context h3 {
    order: 1;
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1.3;
    margin: 0;
}

.modal-context a {
    order: 2;
    font-size: 0.8rem;
    color: slateblue;
    text-decoration: none;
    transition: color 0.2s;
}

.modal-context a:hover {
    color: slateblue;
    text-decoration: underline;
}

.modal-description {
    font-size: 0.9rem;
    line-height: 1.3;
    color: black;
    margin: 0;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    color: white;
    background: black;
    border: 1px solid black;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: background 0.2s;
}

.modal-close:hover {
    background: black;
}

.features {
    width: 25rem;
    min-height: calc(100vh - 4.5rem);
    padding: 1rem;
    background: orange;
    border-right: 1px solid black;
    overflow-y: auto;
}

.feature-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed black;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.feature-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.feature-avatar-desc {
    background-color: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    border: 1px solid black;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feature-text-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.feature-item img,
.feature-item video {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid black;
}

.feature-carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 1px solid black;
}

.carousel-track {
    display: flex;
    width: 100%;
}

.carousel-slide {
    min-width: 100%;
    display: none;
}

.carousel-slide.active {
    display: block;
}

.carousel-media {
    width: 100%;
    height: auto;
    display: block;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.9);
}

.carousel-prev {
    left: 0.5rem;
}

.carousel-next {
    right: 0.5rem;
}

.curator-avatar {
    min-width: 1.5rem;
    max-width: 1.5rem;
    min-height: 1.5rem;
    max-height: 1.5rem;
    display: block;
}

.feature-date {
    display: none;
}

.feature-item h3 {
    font-size: 1rem;
    text-transform: uppercase;
    font-weight: 400;
    line-height: 1.3;
}

.feature-title-link {
    text-transform: uppercase;
    font-size: 1rem !important;
    font-weight: 400;
    color: black !important;
    text-decoration: none;
}


.feature-text-container {
    background-color: rgba(255, 255, 255, 0.75);
    padding: 1rem;
    border: 1px solid black;
}

.feature-text-container>a:hover {
    color: slateslateblue;
}

.feature-source-link {
    font-size: 0.8rem;
    color: slateslateblue;
    text-decoration: none;
    transition: color 0.2s;
}

.feature-source-link:hover {
    color: slateblue;
    text-decoration: underline;
}

.feature-description {
    font-size: 1rem;
    line-height: 1.3;
    color: darkgreen;
}

.feature-item a {
    font-size: 0.8rem;
    color: slateblue;
    text-decoration: none;
    transition: color 0.2s;
}

.feature-item a:hover {
    color: slateblue;
    text-decoration: underline;
}

.fm-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: gold;
    border: 1px solid black;
    z-index: 9999;
}

.fm-player audio {
    width: 100%;
    height: 32px;
}

.headline-item {
    display: block;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.headline-item a {
    color: black;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.headline-description-text {
    color: darkgreen;
    font-size: 1rem;
    display: inline;
}

.headline-favicon {
    padding-left: 0.5rem;
    min-width: 1rem;
    height: 1rem;
    display: inline-block;
    vertical-align: -0.15em;
    transition: transform 0.2s;
    cursor: pointer;
}

.headline-favicon:hover {
    transform: scale(1.2);
}

.preview-item {
    position: absolute;
    cursor: pointer;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.2s, transform 0.2s;
    animation: floatAround 16s ease-in-out infinite;
    max-width: 200px;
    max-height: 200px;
}

.preview-item img,
.preview-item video {
    max-width: 200px;
    max-height: 200px;
    display: block;
}

.preview-item:hover {
    opacity: 1;
    z-index: 999 !important;
}

.preview-item.highlight {
    opacity: 1;
    z-index: 999;
}

.preview-item.paused {
    animation: none !important;
}

.preview-item:nth-child(1) {
    animation-delay: 0s;
}

.preview-item:nth-child(2) {
    animation-delay: 2s;
}

.preview-item:nth-child(3) {
    animation-delay: 4s;
}

.preview-item:nth-child(4) {
    animation-delay: 6s;
}

.preview-item:nth-child(5) {
    animation-delay: 8s;
}

.preview-item:nth-child(6) {
    animation-delay: 1s;
}

.preview-item:nth-child(7) {
    animation-delay: 3s;
}

.preview-item:nth-child(8) {
    animation-delay: 5s;
}

@keyframes floatAround {
    0% {
        transform: translate(0, 0);
    }

    15% {
        transform: translate(45px, -35px);
    }

    30% {
        transform: translate(55px, 10px);
    }

    45% {
        transform: translate(35px, 40px);
    }

    60% {
        transform: translate(-30px, 30px);
    }

    75% {
        transform: translate(-50px, -15px);
    }

    90% {
        transform: translate(-25px, -35px);
    }

    100% {
        transform: translate(0, 0);
    }
}

::selection {
    background-color: slateblue;
    color: white;
}

.resize-handle {
    position: absolute;
    background: rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 999;
}

.window-draggable:hover .resize-handle {
    opacity: 0.5;
}

.resize-handle:hover {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.3) !important;
}

.resize-nw,
.resize-ne,
.resize-sw,
.resize-se {
    width: 12px;
    height: 12px;
}

.resize-nw {
    top: 0;
    left: 0;
    cursor: nw-resize;
}

.resize-ne {
    top: 0;
    right: 0;
    cursor: ne-resize;
}

.resize-sw {
    bottom: 0;
    left: 0;
    cursor: sw-resize;
}

.resize-se {
    bottom: 0;
    right: 0;
    cursor: se-resize;
}

.resize-n,
.resize-s {
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 8px;
}

.resize-n {
    top: 0;
    cursor: n-resize;
}

.resize-s {
    bottom: 0;
    cursor: s-resize;
}

.resize-e,
.resize-w {
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 20px;
}

.resize-e {
    right: 0;
    cursor: e-resize;
}

.resize-w {
    left: 0;
    cursor: w-resize;
}

.window-draggable {
    cursor: grab;
}

.window-draggable.dragging {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
    cursor: grabbing;
}

.window-draggable.resizing {
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}