/*
 * Art of the Day: the header slot item and the dialog it opens.
 *
 * A global stylesheet, not a .razor.css file, because every element here is made by
 * wwwroot/js/headerSlot.art.js and Blazor's scoped CSS only reaches markup a component wrote.
 * Font sizes that depend on the slot's box are set inline by that script.
 */

/* ---- the header item ---------------------------------------------------------------------- */

/* The box the banner (wwwroot/lib/art-of-the-day/art-of-the-day.css) is mounted in. It fills
   the slot, and the banner sizes itself from this box's height. */
.aa-art {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
}

.aa-art .aotd {
    border-radius: inherit;
    /* the site's italic serif, loaded by headerSlot.art.js */
    --aotd-serif: 'Cormorant Garamond', Georgia, serif;
}

/* While the painting is on its way, and when there is none: the title alone, in the banner's look. */
.aa-art-wait {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: #1d1912;
    color: #f4ead2;
    container-type: size;
}

.aa-art-wait-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: 30px;
    font-size: 34cqh;
    line-height: 1;
    white-space: nowrap;
}

.aa-art-wait-sub {
    font-family: 'Josefin Sans', 'Segoe UI', sans-serif;
    font-size: 11px;
    font-size: 13cqh;
    letter-spacing: 0.08em;
    color: #d4a945;
}

/* ---- the dialog --------------------------------------------------------------------------- */

html.aa-art-open {
    overflow: hidden;
}

.aa-art-dialog {
    width: 90vw;
    height: 88vh;
    max-width: 1400px;
    max-height: none;
    padding: 0;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: #f4ecdc;
    /* the close button sits on the card's corner, half outside it */
    overflow: visible;
}

.aa-art-dialog::backdrop {
    background: rgba(10, 8, 6, 0.85);
    backdrop-filter: blur(3px);
}

.aa-art-dialog[open] {
    animation: aa-art-pop 0.4s cubic-bezier(.2, 1.2, .4, 1);
}

/* Never scrolls, so the close button pinned to it stays put; only the notes do. The painting
   takes the larger share; on a narrow screen the notes go underneath it. */
.aa-art-card {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(240px, 1fr);
    gap: 20px;
    padding: 20px;
    border-radius: 14px;
    background: radial-gradient(ellipse at 30% 40%, #26201a 0%, #14110f 75%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(226, 196, 106, 0.25);
}

.aa-art-view {
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aa-art-full {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 0 0 1px rgba(244, 236, 220, 0.2), 0 10px 30px rgba(0, 0, 0, 0.6);
}

.aa-art-info {
    min-height: 0;
    overflow-y: auto;
    scrollbar-color: rgba(226, 196, 106, 0.45) transparent;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.aa-art-kicker {
    font-family: 'Josefin Sans', 'Segoe UI', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #e2c46a;
}

.aa-art-kicker-date {
    letter-spacing: 0.04em;
    text-transform: none;
    font-weight: 400;
    color: #b8ab8f;
}

.aa-art-title {
    margin: 0;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: clamp(1.4rem, 2.4vw, 2.1rem);
    line-height: 1.15;
    color: #fbf5e6;
}

.aa-art-artist {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 600;
    font-size: 1.25rem;
    color: #d8ccb2;
}

.aa-art-notes {
    margin: 6px 0 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #e6dcc8;
}

.aa-art-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 4px;
}

.aa-art-link {
    color: #e2c46a;
    text-decoration: none;
}

.aa-art-link:hover,
.aa-art-link:focus-visible {
    text-decoration: underline;
}

.aa-art-credit {
    margin-top: auto;
    padding-top: 10px;
    font-size: 0.8rem;
    color: #a2967c;
}

@keyframes aa-art-pop {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* Narrow screens: painting on top, notes underneath with the rest of the height. */
@media (max-width: 760px) {
    .aa-art-dialog { width: calc(100vw - 32px); height: calc(100vh - 48px); }
    .aa-art-card {
        grid-template-columns: minmax(0, 1fr);
        /* the painting row is only as tall as the painting needs, up to just over half the screen */
        grid-template-rows: auto minmax(0, 1fr);
        gap: 12px;
        padding: 16px 12px 12px;
    }
    .aa-art-full { max-height: 55vh; }
}

@media (prefers-reduced-motion: reduce) {
    .aa-art-dialog[open] { animation: none; }
}
