/* Cards section (/cards, /cards/create, saved cards, Past cards thumbnails,
   homepage card slot). Everything is scoped to .ja-cs* / .ja-lt-cardslot.
   The illustrated cards themselves live in iframes (/cards/frame/...). */

.ja-cs { --cs-ink: #2d2722; --cs-soft: #7a6853; --cs-line: #e7d9c4; --cs-orange: #b96336; --cs-paper: #fffdf8; color: var(--cs-ink); }
.ja-cs-kicker { display: block; font: 700 10px/1.5 var(--body, Inter, sans-serif); letter-spacing: .16em; text-transform: uppercase; color: var(--cs-orange); }
.ja-cs-head { margin: 0 0 clamp(14px, 2vw, 24px); }
.ja-cs-head h1 { margin: 6px 0 8px; font: 500 clamp(32px, 3.2vw, 52px)/1.02 var(--serif, Georgia, serif); letter-spacing: -.02em; }
.ja-cs-head h1 em { color: var(--cs-orange); }
.ja-cs-head p { margin: 0; max-width: 58ch; font-size: 14px; line-height: 1.55; color: var(--cs-soft); }

/* The card in an iframe: a 620 × 900 poster that scales with its box. */
.ja-cs-frame { position: relative; width: 100%; aspect-ratio: 620 / 900; border-radius: 8px; overflow: hidden; background: #f1e6d3; box-shadow: 0 14px 30px #3b2a1a2e, 0 2px 0 #fff8 inset; }
.ja-cs-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }

/* ---------- Today's card ---------- */
.ja-cs-today { container-type: inline-size; margin: 0 0 clamp(22px, 3vw, 36px); padding: clamp(14px, 1.6vw, 22px); border: 1px solid var(--cs-line); border-radius: 18px; background: #fbf4ea; }
.ja-cs-today-grid { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr); gap: clamp(14px, 2vw, 26px); align-items: start; }
@container (max-width: 540px) { .ja-cs-today-grid { grid-template-columns: minmax(0, 1fr); } .ja-cs-today-card { width: 100%; max-width: 340px; margin: 0 auto; } }
.ja-cs-today-copy h2 { margin: 6px 0 8px; font: 500 clamp(22px, 2vw, 30px)/1.15 var(--serif, Georgia, serif); }
.ja-cs-today-copy .ja-dc-june { margin: 0 0 12px; }
.ja-cs-today-copy .ja-dc-write { margin: 0; }
.ja-cs-today-copy .ja-dc-paper { max-width: none; }
.ja-cs-today-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.ja-cs-link { display: inline-flex; align-items: center; gap: 3px; font: 600 12px/1.4 var(--body, Inter, sans-serif); color: var(--cs-orange); text-decoration: none; }
.ja-cs-link:hover { text-decoration: underline; color: var(--cs-orange); }
.ja-cs-replay { border: 0; background: none; padding: 0; cursor: pointer; }

/* ---------- Card styles ---------- */
.ja-cs-section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 14px; margin: 0 0 12px; }
.ja-cs-section-head h2 { margin: 0; font: 500 clamp(22px, 2vw, 30px)/1.1 var(--serif, Georgia, serif); }
.ja-cs-section-head p { margin: 0; font-size: 13px; color: var(--cs-soft); }
.ja-cs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: clamp(10px, 1.2vw, 16px); }
.ja-cs-style { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--cs-line); border-radius: 14px; background: var(--cs-paper); overflow: hidden; color: inherit; text-decoration: none; box-shadow: 0 2px 6px #59472f0d; transition: transform .15s, box-shadow .15s; }
.ja-cs-style:hover { transform: translateY(-2px); box-shadow: 0 8px 18px #59472f1f; color: inherit; }
.ja-cs-thumb { display: block; aspect-ratio: 620 / 900; background: #efe4d2; overflow: hidden; }
.ja-cs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ja-cs-style-body { display: grid; gap: 2px; padding: 9px 11px 11px; }
.ja-cs-style-body small { font: 600 9px/1.4 var(--body, Inter, sans-serif); letter-spacing: .12em; text-transform: uppercase; color: #9b836a; }
.ja-cs-style-body strong { font: 600 17px/1.2 var(--serif, Georgia, serif); }
.ja-cs-badge { justify-self: start; margin-top: 2px; padding: 1px 7px; border-radius: 999px; background: #f6e3d6; color: #98502d; font: 700 9px/1.6 var(--body, Inter, sans-serif); letter-spacing: .08em; text-transform: uppercase; }
.ja-cs-cta { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font: 700 12px/1.3 var(--body, Inter, sans-serif); color: var(--cs-orange); }
.ja-cs-note { margin: 14px 0 0; font-size: 12px; color: var(--cs-soft); }

/* ---------- Editor ("Make it yours") and a saved card ---------- */
.ja-cs-editor-preview { display: grid; place-items: start center; padding: clamp(10px, 2vw, 26px); }
.ja-cs-editor-preview .ja-cs-frame { max-width: 520px; }
.ja-cs-panel { color: #2d2722; }
.ja-cs-panel .ja-cs-eyebrow { margin: 0; font: 700 10px/1.5 var(--body, Inter, sans-serif); letter-spacing: .16em; text-transform: uppercase; color: #b96336; }
.ja-cs-panel h1, .ja-cs-panel h2.ja-cs-title { margin: 4px 0 14px; font: 500 clamp(30px, 2.6vw, 42px)/1.05 var(--serif, Georgia, serif); }
.ja-cs-form { display: grid; gap: 4px; }
.ja-cs-form label { margin-top: 8px; font: 600 12px/1.4 var(--body, Inter, sans-serif); color: #4a3b2c; }
.ja-cs-form label small { font-weight: 400; color: #9b836a; margin-left: 4px; }
.ja-cs-form input[type="text"], .ja-cs-form textarea { box-sizing: border-box; width: 100%; padding: 8px 10px; border: 1px solid #e0cfb8; border-radius: 10px; background: #fffdf8; font: 400 14px/1.45 var(--body, Inter, sans-serif); color: #2d2722; resize: vertical; }
.ja-cs-form input[type="text"]:focus, .ja-cs-form textarea:focus { outline: 2px solid #e8c9b2; outline-offset: 1px; }
.ja-cs-stamps { display: flex; gap: 8px; margin: 2px 0 0; padding: 0; border: 0; }
.ja-cs-stamps label { margin: 0; cursor: pointer; }
.ja-cs-stamps .sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.ja-cs-stamps input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ja-cs-stamps img { display: block; width: 46px; height: 54px; object-fit: contain; padding: 3px; border: 2px solid transparent; border-radius: 8px; background: #fbf4ea; }
.ja-cs-stamps input:checked + img { border-color: #b96336; }
.ja-cs-stamps input:focus-visible + img { outline: 2px solid #e8c9b2; }
.ja-cs-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; }
.ja-cs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 18px; border: 1px solid #b65313; border-radius: 999px; background: linear-gradient(180deg, #ffb75af2 0%, #ed8429f5 53%, #b55216fa 100%); box-shadow: inset 0 1px 1px #fff8, 0 3px 0 #8f4b242e; color: #fff; text-shadow: 0 1px 2px #74300880; font: 700 13px/1.2 var(--body, Inter, sans-serif); text-decoration: none; cursor: pointer; }
.ja-cs-btn:hover { filter: brightness(1.08); color: #fff; }
.ja-cs-btn.is-quiet { background: #fffaf3; color: #98502d; text-shadow: none; border-color: #e2c9b1; box-shadow: none; }
.ja-cs-privacy { margin: 12px 0 0; font-size: 12px; color: #7a6853; }
.ja-cs-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 0; padding: 12px 0 0; border-top: 1px dashed #e3d3be; }
.ja-cs-switch span { width: 100%; font: 600 11px/1.4 var(--body, Inter, sans-serif); color: #9b836a; }
.ja-cs-switch a { padding: 3px 10px; border: 1px solid #e7d9c4; border-radius: 999px; background: #fffdf8; font: 600 11px/1.5 var(--body, Inter, sans-serif); color: #6b5844; text-decoration: none; }
.ja-cs-switch a[aria-current="true"] { background: #b96336; border-color: #b96336; color: #fff; }
.ja-cs-flash { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: #eef2e6; color: #4b5d34; font-size: 13px; }
.ja-cs-meta { margin: 0 0 10px; font-size: 13px; color: #7a6853; }
.ja-cs-danger { border: 0; background: none; padding: 0; font: 600 12px/1.4 var(--body, Inter, sans-serif); color: #a3412a; cursor: pointer; }

/* ---------- My Little Book: "Cards I made" ---------- */
.ja-cs-made { margin: 0 0 22px; }
.ja-cs-made h2 { margin: 0 0 10px; font: 500 22px/1.2 var(--serif, Georgia, serif); }
.ja-cs-made-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.ja-cs-made-grid .ja-cs-style-body strong { font-size: 15px; }
.ja-cs-made-empty { margin: 0; font-size: 13px; color: #7a6853; }
.ja-cs-made-subhead { margin: 0 0 8px; font: 500 22px/1.2 var(--serif, Georgia, serif); }

/* ---------- Past cards: a thumbnail of each day's card style ---------- */
.ja-dc-list-item .ja-cs-daythumb { flex: none; width: 46px; aspect-ratio: 620 / 900; border-radius: 4px; overflow: hidden; box-shadow: 0 2px 5px #3b2a1a26; background: #efe4d2; }
.ja-dc-list-item:has(> .ja-cs-daythumb) { grid-template-columns: 46px 64px minmax(0, 1fr) auto; }
@media (max-width: 600px) {
    .ja-dc-list-item:has(> .ja-cs-daythumb) { grid-template-columns: 38px 54px minmax(0, 1fr); }
    .ja-dc-list-item:has(> .ja-cs-daythumb) .ja-dc-list-cta { grid-column: 3; }
}
.ja-dc-list-item .ja-cs-daythumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Homepage cover: June's Little Card slot ---------- */
.ja-lt-cardslot .ja-lt-card-head { min-width: 0; }
.ja-lt-cardslot .ja-lt-card-title { letter-spacing: 0; padding-inline-start: 1px; white-space: nowrap; overflow: visible; text-indent: 0; margin-inline-start: 0; transform: none; }
.ja-lt-cardslot-link { flex: 1 1 auto; display: flex; gap: clamp(8px, .9vw, 12px); align-items: flex-start; min-height: 0; color: inherit; text-decoration: none; }
.ja-lt-cardslot-link:hover { color: inherit; }
.ja-lt-cardslot-thumb { position: relative; flex: none; width: clamp(64px, 5.6vw, 104px); aspect-ratio: 620 / 900; border-radius: 5px; overflow: hidden; background: #efe4d2; box-shadow: 0 6px 14px #3b2a1a2e; transform: rotate(-2deg); transition: transform .2s; }
.ja-lt-cardslot-link:hover .ja-lt-cardslot-thumb { transform: rotate(0) translateY(-2px); }
.ja-lt-cardslot-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; pointer-events: none; }
.ja-lt-cardslot-copy { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ja-lt-cardslot-copy .ja-lt-daily-q { margin: 0; }
.ja-lt-cardslot-copy .ja-lt-daily-done p { margin: 0; }
.ja-lt-cardslot-cta { display: inline-flex; align-items: center; gap: 2px; font: 600 clamp(10px, .8vw, 12px)/1.4 var(--body, Inter, sans-serif); color: #b96336; }
.ja-lt-cardslot-link:hover .ja-lt-cardslot-cta { text-decoration: underline; }

/* The site styles every submit button inside #main; keep these two as designed. */
#main .ja-cs-panel button.ja-cs-btn[type="submit"] { white-space: nowrap; min-inline-size: 0; }
#main .ja-cs-panel button.ja-cs-danger[type="submit"] { min-block-size: 0; min-inline-size: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; text-shadow: none; filter: none; color: #a3412a; font: 600 12px/1.4 var(--body, Inter, sans-serif); }
#main .ja-cs-panel button.ja-cs-danger[type="submit"]:hover { text-decoration: underline; }

/* Cards chapter cover (right page): keep Aurora smaller so the shortcuts show. */
.ja-chapter-cover[aria-label="Cards cover"] > img { width: auto; max-width: 70%; height: clamp(150px, 26vh, 280px); object-fit: contain; margin-inline: auto; }
