/* ============================================
   I Never Read, Shop — Stylesheet
   Minimal / brutalist aesthetic
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: "Times New Roman", Times, serif;
    font-weight: 400;
    line-height: 1.5;
    color: #000;
    background: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #000;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- Site Branding --- */
.site-header {
    position: sticky;
    top: 0;
}

.site-fair {
    position: sticky;
    bottom: 0;
}

.site-header,
.site-fair {
    z-index: 1;
    padding: 0.375rem 1rem;
    text-align: center;
    pointer-events: none;
}

.site-title,
.site-shop,
.site-fair {
    font-size: 42px;
    line-height: 1.2;
}

.site-title,
.site-shop {
    pointer-events: auto;
}

.site-title:hover,
.site-title:focus,
.site-title:active,
.site-shop:hover,
.site-shop:focus,
.site-shop:active {
    text-decoration: none;
}

.site-shop {
    position: fixed;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
}

.site-fair span {
    display: inline-block;
    transform: rotate(180deg);
}

/* --- Main --- */
main {
    flex: 1;
}

.tag-filter,
.site-footer {
    padding-inline: 2rem 4.25rem;
}

/* --- Tag Filter --- */
.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding-block: 1.5rem;
}

.tag-link {
    font-size: 0.8125rem;
    padding: 0.25rem 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.tag-link[aria-current="page"] {
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

/* --- Product List --- */
.product-list {
    width: calc(100% - 8.5rem);
    max-width: 900px;
    margin-inline: auto;
    text-align: center;
}

.product-card {
    padding: 2.5rem 0;
    cursor: pointer;
}

.product-card__image-wrap {
    margin-bottom: 1rem;
}

.product-card__image {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.product-card__info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.product-card__title {
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.product-card__author {
    font-size: 0.875rem;
    color: #666;
}

.product-card__price {
    font-size: 0.875rem;
}

.product-card__sold-out {
    color: #999;
    font-style: italic;
    margin-left: 0.5rem;
}

.order-link {
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.order-link:hover {
    text-decoration-thickness: 2px;
}

.empty-message {
    padding: 4rem 0;
    font-size: 0.875rem;
    color: #666;
}

/* --- Footer --- */
.site-footer {
    padding-block: 2rem;
    margin-top: 2rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* --- Modal Overlay --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 2rem;
}

.modal-overlay[hidden] {
    display: none;
}

.modal {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: #fff;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
}

.modal-close {
    align-self: flex-end;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.modal-close:hover {
    opacity: 0.6;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-body > .order-link {
    align-self: flex-start;
}

/* --- Modal Content --- */
.modal-title {
    font-size: 1.25rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.modal-author {
    font-size: 0.875rem;
    color: #666;
}

.modal-price {
    font-size: 1rem;
}

.modal-sold-out {
    color: #999;
    font-style: italic;
}

.modal-description {
    font-size: 0.875rem;
    line-height: 1.6;
    white-space: pre-line;
}

.modal-media {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-media img {
    width: 100%;
}

.modal-media video {
    width: 100%;
    max-height: 70vh;
}

.embed-wrap {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.embed-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #666;
}

/* --- Responsive --- */
@media (max-width: 767px) {
    .site-title,
    .site-shop,
    .site-fair {
        font-size: 28px;
    }
}

@media (max-width: 600px) {
    .tag-filter,
    .site-footer {
        padding-inline: 1rem 3.25rem;
    }

    .product-list {
        width: calc(100% - 6.5rem);
    }

    .modal {
        padding: 1.5rem 1rem;
        margin: 1rem auto;
    }

    .modal-overlay {
        padding: 1rem;
    }
}
