/* SETTINGS */

:root {
    --gradient-opacity: 0.3;
}
::selection {
    background-color: #9a82a2;
    color: white;
}

/* BACKGROUND */

:root { --gradient-x: 0%; --gradient-y: 50%; }
#background {
    z-index: -1;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: rgba(153, 162, 255, var(--gradient-opacity));
    background-image: 
        radial-gradient(at calc(37% + var(--gradient-x)) calc(71% + var(--gradient-y)), hsla(284,91%,61%,var(--gradient-opacity1)) 0px, transparent 50%),
        radial-gradient(at calc(83% + var(--gradient-x)) calc(3% + var(--gradient-y)), hsla(328,83%,66%,var(--gradient-opacity2)) 0px, transparent 50%),
        radial-gradient(at calc(38% + var(--gradient-x)) calc(42% + var(--gradient-y)), hsla(213,89%,70%,var(--gradient-opacity1)) 0px, transparent 50%),
        radial-gradient(at calc(7% + var(--gradient-x)) calc(51% + var(--gradient-y)), hsla(279,71%,79%,var(--gradient-opacity2)) 0px, transparent 50%),
        radial-gradient(at calc(72% + var(--gradient-x)) calc(4% + var(--gradient-y)), hsla(141,83%,60%,var(--gradient-opacity1)) 0px, transparent 50%),
        radial-gradient(at calc(75% + var(--gradient-x)) calc(6% + var(--gradient-y)), hsla(245,60%,66%,var(--gradient-opacity2)) 0px, transparent 50%),
        radial-gradient(at calc(24% + var(--gradient-x)) calc(53% + var(--gradient-y)), hsla(59,73%,71%,var(--gradient-opacity1)) 0px, transparent 50%);
}
#grain { width: 100%; height: 100%; }
body {
    background-color: rgb(44, 62, 80);
    margin: 0;
    overflow-x: hidden;
}

/* CONTAINER */
.container {
    position: relative;
    width: min(960px, 100% - 40px);
    margin: 0 auto;
    padding-top: 30px;
    padding-bottom: 40px;
    z-index: 0;
    container-type: inline-size;
}

img {
    width: 100%;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* TAGBAR */
#tagbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid white;
    border-bottom: 1px solid white;
    margin-top: 2cqw;
    /* margin-bottom: 5cqw; */
}

#tagbar span {
    flex: 1;
    text-align: center;
    font-size: 1.5cqw;
    color: white;
    font-family: 'Arial', sans-serif;
    cursor: pointer;
    padding: 1.5cqw 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}
@media (hover: hover) and (pointer: fine) {
    #tagbar span:hover {
        background-color: rgba(255, 255, 255, 0.8);
        color: #4d5c82;
    }
}
#tagbar span.active {
    background-color: white;
    color: #4d5c82;
}

/* ROWS */
.row {
    display: flex;
    background-color: white;
    padding: 0 2cqw 0 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2cqw;
    height: 12.5cqw;
    border-radius: 0.5cqw;
    transition: transform 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}
@media (hover: hover) and (pointer: fine) {
    .row:hover {
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
        transform: scale(1.05);
    }
}
.row.filtered { 
    height: 0;
    margin-bottom: 0;
    opacity: 0;
    padding: 0;
}
.row.no-link { cursor: default; }
.row-img {
    flex: 0 0 auto;
    width: 26.75cqw; /* fixed 2.14:1 frame so every card lines up */
    height: 12.5cqw;
    background: #555;
    overflow: hidden;
    border-radius: 0.5cqw 0 0 0.5cqw;
}
.row-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.row-content {
    flex-grow: 1;
    font-family: 'Arial', sans-serif;
    padding: 2.4cqw 3.1cqw;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.row-content h3 {
    font-size: 1.8cqw;
    font-weight: 500;
    color: #333;
    padding: 0;
    margin: 0;
}
.row-content p {
    font-size: 1.5cqw;
    line-height: 1.5;
    color: #666;
    padding: 0;
    margin: 0;
}

h2 {
    color: white;
    font-size: 2.5cqw;
    font-weight: 500;
    font-family: 'Arial', sans-serif;
    padding: 0;
    margin: 4cqw 0 2cqw 0;
    overflow: hidden;
}

/* HEADER (split version is only used on narrow screens) */
.header-split { display: none; }
/* Filtering transition classes */
.row.filtering {
    transition: transform 0.3s ease, height 0.4s ease, margin-bottom 0.4s ease, opacity 0.3s ease;
}

h2.filtering {
    transition: height 0.4s ease, margin 0.4s ease, opacity 0.3s ease;
}

h2.filtered {
    height: 0;
    margin: 0;
    opacity: 0;
}

/* ------------------------------------------------------------------
   NARROW / PORTRAIT LAYOUT
   Desktop keeps the original fixed-proportion design (everything in cqw).
   Below 700px of container width, cards stack image-over-text and type
   switches to fixed readable sizes so portrait phones work properly.
------------------------------------------------------------------- */
@container (max-width: 700px) {
    .header-full { display: none; }
    .header-split { display: block; padding: 8px 0 4px; }
    .header-split .title { display: block; width: 100%; }
    .header-split .greeting { display: block; width: 78%; margin-top: 14px; }

    #tagbar {
        flex-wrap: wrap;
        margin-top: 16px;
    }
    #tagbar span {
        flex: 0 0 33.333%;
        font-size: 13px;
        padding: 11px 0;
    }

    h2 {
        font-size: 19px;
        line-height: 1.3;
        margin: 30px 0 12px 0;
    }

    .row {
        flex-direction: column;
        height: auto;
        max-height: 1200px;
        padding: 0;
        margin-bottom: 16px;
        border-radius: 8px;
    }
    .row.filtered { max-height: 0; }
    .row.filtering {
        transition: transform 0.3s ease, max-height 0.4s ease, margin-bottom 0.4s ease, opacity 0.3s ease;
    }
    .row-img {
        width: 100%;
        height: 46.72cqw; /* same 2.14:1 frame as desktop */
        border-radius: 8px 8px 0 0;
    }
    .row-content {
        padding: 14px 16px 16px;
        gap: 8px;
        justify-content: flex-start;
    }
    .row-content h3 {
        font-size: 16px;
        line-height: 1.35;
    }
    .row-content p {
        font-size: 14px;
        line-height: 1.5;
    }
}

.archive-footer { text-align: center; padding: 32px 16px 48px; }
#archive-open { font: 13px ui-monospace, monospace; letter-spacing: .18em; color: #ddd; background: #101010cc; border: 1px solid #777; border-radius: 4px; padding: 14px 22px; cursor: pointer; }
#archive-open:hover, #archive-open:focus-visible { color: #3dff7a; border-color: #3dff7a; outline: 2px solid #3dff7a; outline-offset: 4px; }
