/* =====================================================================
   DAILY PICKS  —  page-only styles (/Daily_Pick/daily-picks.css)
   Loaded after ../style.css, so the site header, nav and footer stay
   exactly like every other page. Everything here is scoped to .dp-*,
   .pick* and .history-* classes.
   ===================================================================== */

:root {
    --dp-ink: #1b1a17;
    --dp-muted: #6b665c;
    --dp-faint: #9a948a;
    --dp-rule: #e4dfd5;
    --dp-paper: #ffffff;
    --dp-mat-art: #f3efe7;
    --dp-mat-space: #0b0e1a;
    --dp-mat-photo: #ededeb;
    --dp-accent: #8a2b1d;          /* museum-label red */
    --dp-link: #1b1a17;
    --dp-link-visited: #8a2b1d;
    --dp-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
                Georgia, "Times New Roman", Times, serif;
}

.site-title,
.site-title:visited {
    color: inherit;
    text-decoration: none;
}

/* Undo the shared two-column grid from style.css for this page */
main.dp-main {
    display: block;
    grid-template-columns: none;
    max-width: 1240px;
    width: 100%;
    margin: 6px auto 0;
    font-family: var(--dp-serif);
    color: var(--dp-ink);
}

/* ---------------------------------------------------------------------
   Page heading
   --------------------------------------------------------------------- */

.dp-hero {
    text-align: center;
    padding: 28px 0 34px;
}

.dp-kicker {
    margin: 0 0 6px;
    font-size: 0.8rem;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: var(--dp-accent);
}

.dp-date {
    margin: 0;
    font-size: clamp(1.9rem, 4.2vw, 2.9rem);
    font-style: italic;
    line-height: 1.15;
    color: var(--dp-ink);
}

.dp-intro {
    max-width: 34em;
    margin: 12px auto 0;
    font-size: 1.05rem;
    line-height: 1.55;
    color: var(--dp-muted);
}

.dp-hero::after {
    content: "";
    display: block;
    width: 64px;
    height: 1px;
    margin: 26px auto 0;
    background: var(--dp-accent);
    opacity: 0.6;
}

/* ---------------------------------------------------------------------
   Grid of picture cards
   --------------------------------------------------------------------- */

.dp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 28px;
    align-items: start;
}

.pick,
.history-card {
    background: var(--dp-paper);
    border: 1px solid var(--dp-rule);
    border-radius: 10px;
    padding: 20px 20px 22px;
    box-shadow: 0 1px 2px rgba(40, 30, 10, 0.04), 0 6px 18px rgba(40, 30, 10, 0.05);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.pick:hover {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(40, 30, 10, 0.05), 0 14px 32px rgba(40, 30, 10, 0.09);
}

.pick-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 14px;
}

.pick-num {
    flex: 0 0 auto;
    min-width: 1.6em;
    font-size: 1.05rem;
    font-style: italic;
    color: var(--dp-accent);
}

.pick-label {
    margin: 0;
    font-size: 1.22rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--dp-ink);
}

main.dp-main .pick-source {
    margin: 2px 0 0;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--dp-faint);
    line-height: 1.4;
}

/* ---- The matted "frame" around each picture ---- */

.pick-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 4 / 3;
    padding: 14px;
    margin: 0;
    border: 0;
    border-radius: 6px;
    background: var(--dp-mat-art);
    overflow: hidden;
    cursor: zoom-in;
    font: inherit;
}

.pick--nasa .pick-frame  { background: var(--dp-mat-space); }
.pick--photo .pick-frame { background: var(--dp-mat-photo); }

.pick-frame:disabled { cursor: default; }

.pick-frame:focus-visible {
    outline: 2px solid var(--dp-accent);
    outline-offset: 3px;
}

/* Whole picture always visible — paintings are never cropped */
.pick-frame img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.22);
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.5s ease;
}

.pick.is-loaded .pick-frame img { opacity: 1; }
.pick-frame:not(:disabled):hover img { transform: scale(1.015); }

/* Loading shimmer */
.pick[aria-busy="true"] .pick-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.45) 50%, transparent 80%);
    background-size: 220% 100%;
    animation: dp-shimmer 1.6s linear infinite;
}

.pick--nasa[aria-busy="true"] .pick-frame::before {
    background-image: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.07) 50%, transparent 80%);
}

@keyframes dp-shimmer {
    from { background-position: 120% 0; }
    to   { background-position: -120% 0; }
}

/* If a picture can't be shown at all, keep the card tidy */
.pick-frame.is-empty img { display: none; }
.pick-frame.is-empty::after {
    content: "Picture unavailable";
    font-style: italic;
    font-size: 0.9rem;
    color: var(--dp-faint);
}

/* ---- Museum-style placard under the picture ---- */

.pick-placard {
    padding-top: 16px;
}

main.dp-main .pick-name {
    margin: 0;
    font-size: 1.15rem;
    font-style: italic;
    font-weight: 600;
    line-height: 1.3;
    color: var(--dp-ink);
}

main.dp-main .pick-byline {
    margin: 4px 0 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--dp-muted);
}

main.dp-main .pick-desc {
    margin: 10px 0 0;
    font-size: 0.93rem;
    line-height: 1.55;
    color: #45413a;
}

main.dp-main .pick-note {
    margin: 10px 0 0;
    padding: 6px 10px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--dp-muted);
    background: #f7f4ee;
    border-left: 2px solid var(--dp-accent);
}

.pick-link,
.history-link,
.history-more,
.history-fallback a {
    display: inline-block;
    margin-top: 14px;
    font-size: 0.9rem;
    color: var(--dp-link);
    text-decoration: underline;
    text-decoration-color: rgba(27, 26, 23, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

.pick-link:visited,
.history-link:visited,
.history-more:visited,
.history-fallback a:visited {
    color: var(--dp-link-visited);
    text-decoration-color: rgba(138, 43, 29, 0.35);
}

.pick-link:hover,
.history-link:hover,
.history-more:hover,
.history-fallback a:hover {
    text-decoration-color: currentColor;
}

/* Placeholder text bars while loading */
.pick[aria-busy="true"] .pick-name {
    color: var(--dp-faint);
    font-weight: normal;
}

/* ---------------------------------------------------------------------
   On This Day — a small timeline
   --------------------------------------------------------------------- */

.history-card {
    margin-top: 28px;
    padding: 22px 26px 24px;
}

.history-list {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
}

.history-item {
    display: grid;
    grid-template-columns: 128px 1fr auto;
    gap: 22px;
    align-items: start;
    padding: 16px 0;
    border-top: 1px solid var(--dp-rule);
}

.history-item:first-child { border-top: 0; }

.history-year {
    font-size: 1.9rem;
    line-height: 1;
    font-variant-numeric: oldstyle-nums;
    color: var(--dp-accent);
}

.history-ago {
    display: block;
    margin-top: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dp-faint);
}

main.dp-main .history-text {
    margin: 0;
    font-size: 1.06rem;
    line-height: 1.55;
    color: var(--dp-ink);
}

.history-link { margin-top: 6px; font-size: 0.85rem; }

.history-thumb {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--dp-rule);
    filter: grayscale(0.15);
}

.history-skeleton .history-year,
.history-skeleton .history-text {
    border-radius: 4px;
    background: linear-gradient(100deg, #f1ede6 20%, #faf8f4 50%, #f1ede6 80%);
    background-size: 220% 100%;
    animation: dp-shimmer 1.6s linear infinite;
}
.history-skeleton .history-year { width: 70px; height: 28px; }
.history-skeleton .history-text { height: 3.1em; }

main.dp-main .history-fallback {
    margin: 6px 0 0;
    font-size: 1rem;
    color: var(--dp-muted);
}

.history-more {
    margin-top: 6px;
    padding-top: 12px;
    border-top: 1px solid var(--dp-rule);
    display: block;
}

.dp-colophon {
    max-width: 40em;
    margin: 30px auto 0;
    text-align: center;
    font-size: 0.85rem !important;
    font-style: italic;
    line-height: 1.5;
    color: var(--dp-faint) !important;
}

/* ---------------------------------------------------------------------
   Lightbox
   --------------------------------------------------------------------- */

.lightbox {
    max-width: min(94vw, 1400px);
    max-height: 94vh;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
}

.lightbox::backdrop {
    background: rgba(12, 10, 8, 0.86);
}

.lightbox figure {
    margin: 0;
    text-align: center;
}

.lightbox img {
    display: block;
    max-width: min(94vw, 1400px);
    max-height: 82vh;
    margin: 0 auto;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox figcaption {
    margin-top: 12px;
    font-family: var(--dp-serif);
    color: #f3efe7;
}

.lightbox-title {
    display: block;
    font-size: 1.1rem;
    font-style: italic;
}

.lightbox-byline {
    display: block;
    margin-top: 2px;
    font-size: 0.85rem;
    color: #bdb6aa;
}

.lightbox-close {
    position: fixed;
    top: 14px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.25); }

/* ---------------------------------------------------------------------
   Small screens
   --------------------------------------------------------------------- */

@media (max-width: 700px) {
    .dp-hero { padding: 16px 0 24px; }
    .dp-grid { gap: 20px; }
    .pick, .history-card { padding: 16px; }

    .history-item {
        grid-template-columns: 1fr auto;
        gap: 6px 14px;
    }
    .history-year { grid-column: 1; font-size: 1.5rem; }
    .history-ago { display: inline; margin-left: 8px; }
    .history-body { grid-column: 1 / -1; grid-row: 2; }
    .history-thumb { grid-column: 2; grid-row: 1; width: 56px; height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
    .pick, .pick-frame img { transition: none; }
    .pick:hover { transform: none; }
    .pick[aria-busy="true"] .pick-frame::before,
    .history-skeleton .history-year,
    .history-skeleton .history-text { animation: none; }
}
