/* =====================================================================
   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; }
}


/* ---------------------------------------------------------------------
   V & VI — Quote of the Day, Cat Fact of the Day
   --------------------------------------------------------------------- */

.dp-words {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 28px;
    margin-top: 28px;
    align-items: stretch;
}

.words-card {
    background: var(--dp-paper);
    border: 1px solid var(--dp-rule);
    border-radius: 10px;
    padding: 22px 26px 24px;
    box-shadow: 0 1px 2px rgba(40, 30, 10, 0.04), 0 6px 18px rgba(40, 30, 10, 0.05);
}

.words-card[aria-busy="true"] .quote-words,
.words-card[aria-busy="true"] .cat-words { color: var(--dp-faint); }

.quote-body {
    position: relative;
    margin: 6px 0 0;
    padding: 4px 0 0 46px;
}

.quote-body::before {
    content: "\201C";
    position: absolute;
    left: -2px;
    top: -18px;
    font-size: 5rem;
    line-height: 1;
    color: var(--dp-accent);
    opacity: 0.35;
}

main.dp-main .quote-words {
    margin: 0;
    font-size: clamp(1.2rem, 2.1vw, 1.45rem);
    font-style: italic;
    line-height: 1.5;
    color: var(--dp-ink);
    transition: color 0.4s ease;
}

main.dp-main .quote-by {
    /* undo the site-wide <footer> styling (rule line, right alignment) */
    border: 0;
    padding: 0;
    text-align: left;
    margin-top: 12px;
    font-size: 0.98rem;
    color: var(--dp-muted);
    letter-spacing: 0.02em;
}

.cat-body {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 6px;
}

.cat-icon {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    transition: transform 0.4s cubic-bezier(.2, .7, .2, 1);
}
.cat-card:hover .cat-icon { transform: rotate(-6deg) scale(1.05); }

main.dp-main .cat-words {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.6;
    color: var(--dp-ink);
    transition: color 0.4s ease;
}

@media (max-width: 800px) {
    .dp-words { grid-template-columns: 1fr; gap: 20px; margin-top: 20px; }
    .words-card { padding: 16px; }
    .quote-body { padding-left: 34px; }
    .quote-body::before { font-size: 4rem; top: -12px; }
    .cat-icon { width: 54px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
    .cat-icon { transition: none; }
}


/* ---------------------------------------------------------------------
   VII Book · VIII Poem · IX From Wikipedia
   --------------------------------------------------------------------- */

.dp-reads { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

/* Book */
.book-body {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin-top: 4px;
}

.book-cover {
    flex: 0 0 auto;
    display: block;
    width: 116px;
    border-radius: 3px 6px 6px 3px;
    overflow: hidden;
    background: #ece6da;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 8px 18px rgba(40, 30, 10, 0.18);
    transform: rotate(-1.5deg);
    transition: transform 0.4s cubic-bezier(.2, .7, .2, 1), box-shadow 0.4s ease;
}
.book-cover[hidden] { display: none; }
.book-cover img { display: block; width: 100%; height: auto; }
.book-card:hover .book-cover {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 14px 28px rgba(40, 30, 10, 0.22);
}

.book-text { min-width: 0; }

main.dp-main .book-title {
    margin: 0;
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 600;
    line-height: 1.3;
}

main.dp-main .book-author {
    margin: 4px 0 0;
    font-size: 0.95rem;
    color: var(--dp-muted);
}

main.dp-main .book-desc {
    margin: 10px 0 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #45413a;
}

/* Poem */
main.dp-main .poem-title {
    margin: 2px 0 0;
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 600;
    line-height: 1.3;
}

main.dp-main .poem-author {
    margin: 4px 0 0;
    font-size: 0.95rem;
    color: var(--dp-muted);
}

.poem-lines {
    position: relative;
    margin-top: 14px;
    padding-left: 16px;
    border-left: 2px solid rgba(138, 43, 29, 0.25);
}

.poem-lines.is-folded {
    max-height: 22em;
    overflow: hidden;
}
.poem-lines.is-folded::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4em;
    background: linear-gradient(rgba(255, 255, 255, 0), var(--dp-paper));
}

main.dp-main .poem-stanza {
    margin: 0 0 0.9em;
    font-size: 1.02rem;
    line-height: 1.65;
}

.poem-line { display: block; }

.poem-more {
    margin-top: 8px;
    padding: 6px 14px;
    border: 1px solid var(--dp-rule);
    border-radius: 999px;
    background: var(--dp-paper);
    font: inherit;
    font-size: 0.9rem;
    color: var(--dp-ink);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.poem-more:hover { background: var(--dp-ink); color: #fff; border-color: var(--dp-ink); }
.poem-more[hidden] { display: none; }

/* Wikipedia */
.wiki-card {
    margin-top: 28px;
    background: var(--dp-paper);
    border: 1px solid var(--dp-rule);
    border-radius: 10px;
    padding: 22px 26px 24px;
    box-shadow: 0 1px 2px rgba(40, 30, 10, 0.04), 0 6px 18px rgba(40, 30, 10, 0.05);
}

.wiki-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 32px;
    margin-top: 4px;
}
.wiki-card.is-single .wiki-grid { grid-template-columns: 1fr; }

main.dp-main .wiki-kicker {
    margin: 0 0 10px;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dp-accent);
}

.wiki-thumb {
    float: right;
    width: 38%;
    max-width: 200px;
    margin: 4px 0 10px 18px;
    border-radius: 6px;
    overflow: hidden;
    background: #ece6da;
}
.wiki-thumb[hidden] { display: none; }
.wiki-thumb img { display: block; width: 100%; height: auto; }

main.dp-main .wiki-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.3;
}

main.dp-main .wiki-desc {
    margin: 4px 0 0;
    font-size: 0.92rem;
    font-style: italic;
    color: var(--dp-muted);
}

main.dp-main .wiki-extract {
    margin: 10px 0 0;
    font-size: 0.98rem;
    line-height: 1.65;
    color: #45413a;
}

.wiki-article::after { content: ""; display: block; clear: both; }

.wiki-potd[hidden] { display: none; }

.wiki-frame { aspect-ratio: 3 / 2; background: #1c1b19; }

main.dp-main .wiki-potd-desc {
    margin: 12px 0 0;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.45;
}

main.dp-main .wiki-potd-credit {
    margin: 4px 0 0;
    font-size: 0.82rem;
    color: var(--dp-faint);
}

.wiki-card .pick-link,
.words-card .pick-link { margin-top: 12px; }

@media (max-width: 800px) {
    .dp-reads { grid-template-columns: 1fr; }
    .wiki-card { padding: 16px; margin-top: 20px; }
    .wiki-grid { grid-template-columns: 1fr; gap: 24px; }
    .book-cover { width: 92px; }
}

@media (prefers-reduced-motion: reduce) {
    .book-cover { transition: none; transform: none; }
}

/* The picture-of-the-day frame reuses .pick-frame, whose image fades in
   only inside a loaded .pick card — show it once it has loaded here too. */
.wiki-card.is-loaded .wiki-frame img { opacity: 1; }
.wiki-frame img { transition: opacity 0.6s ease; }


/* Closing quotation mark, to match the opening one */
main.dp-main .quote-words::after {
    content: "\201D";
    display: inline-block;
    margin-left: 4px;
    font-size: 2.2em;
    line-height: 0;
    vertical-align: -0.42em;
    font-style: normal;
    color: var(--dp-accent);
    opacity: 0.35;
}

/* "More free classics" under the Book of the Day */
.book-card {
    display: flex;
    flex-direction: column;
}

.book-more {
    margin-top: auto;
    padding-top: 20px;
}
.book-more[hidden] { display: none; }

main.dp-main .book-more-label {
    margin: 0 0 10px;
    padding-top: 14px;
    border-top: 1px solid var(--dp-rule);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dp-faint);
}

.book-more-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.book-mini,
.book-mini:visited {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--dp-ink);
    text-decoration: none;
}

.book-mini img {
    display: block;
    width: 100%;
    aspect-ratio: 200 / 281;
    object-fit: cover;
    border-radius: 2px 4px 4px 2px;
    background: #ece6da;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12), 0 5px 12px rgba(40, 30, 10, 0.14);
    transition: transform 0.3s cubic-bezier(.2, .7, .2, 1), box-shadow 0.3s ease;
}

.book-mini:hover img {
    transform: translateY(-3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 10px 20px rgba(40, 30, 10, 0.2);
}

.book-mini span {
    font-size: 0.78rem;
    line-height: 1.3;
    color: var(--dp-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-mini:hover span { color: var(--dp-ink); }

@media (prefers-reduced-motion: reduce) {
    .book-mini img { transition: none; }
}
