/* Little Sprouts – All Books page (shared by books.html and books-ja.html) */
:root {
    --primary: #52B788;
    --primary-dark: #2D6A4F;
    --accent: #FF9F1C;
    --bg-light: #F4F9F4;
    --card-bg: #FFFFFF;
    --text-main: #2B2D42;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Fredoka', sans-serif;
}
html:lang(ja) * {
    font-family: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Comic Sans MS', 'Meiryo', sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---- Header (matches the home page) ---- */
header {
    background: #E8F5E9;
    padding: 20px 20px 36px;
    text-align: center;
    border-bottom: 5px dashed var(--primary);
}
.top-nav {
    display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px;
    padding-top: 10px;
}
.top-nav a {
    color: var(--primary-dark); font-weight: bold; text-decoration: none;
    font-size: 1rem; padding: 6px 16px;
    border: 2px solid var(--primary); border-radius: 20px; background: #fff;
    transition: all 0.2s ease;
}
.top-nav a:hover { background-color: var(--primary); color: #fff; }
.logo-container img { max-width: 220px; height: auto; }
header h1 { color: var(--primary-dark); margin-top: 6px; font-size: 2.2rem; }
.intro { font-size: 1.15rem; color: var(--primary-dark); max-width: 720px; margin: 10px auto 0; }

/* ---- Bundle banner ---- */
.bundles {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
    max-width: 820px; margin: 24px auto 0;
}
.bundle {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: #fff; border: 3px solid var(--accent); border-radius: 18px;
    padding: 16px; text-decoration: none; color: var(--text-main);
    box-shadow: 0 5px 0 #F3C48A; transition: transform 0.1s, box-shadow 0.1s;
}
.bundle:hover { transform: translateY(2px); box-shadow: 0 3px 0 #F3C48A; }
.bundle-name { font-weight: bold; font-size: 1.15rem; color: var(--primary-dark); }
.bundle-note { font-size: 0.9rem; }
.bundle-price { font-weight: bold; font-size: 1.4rem; color: #C77700; }

/* ---- Level chips (sticky) ---- */
.chips-bar {
    position: sticky; top: 0; z-index: 10;
    background: rgba(244, 249, 244, 0.95);
    backdrop-filter: blur(6px);
    border-bottom: 2px solid #DDEEDD;
}
#level-chips {
    display: flex; gap: 8px; overflow-x: auto; padding: 10px 20px;
    max-width: 1100px; margin: 0 auto; scrollbar-width: thin;
}
#level-chips a {
    flex: 0 0 auto; display: flex; align-items: center; gap: 6px;
    padding: 4px 14px 4px 6px; border-radius: 999px;
    border: 2px solid var(--lv); background: #fff; color: var(--text-main);
    font-weight: bold; text-decoration: none; white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
#level-chips a:hover { background: var(--lv); color: #fff; }
#level-chips img { width: 28px; height: 28px; object-fit: contain; }

/* ---- Level sections ---- */
.level { padding: 48px 0 24px; }
.level:nth-child(even) { background: #EAF4F4; }

.level-head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.level-veg {
    width: 110px; height: 120px; object-fit: contain; flex: 0 0 auto;
    background: #fff; border: 4px solid var(--lv); border-radius: 24px; padding: 8px;
}
.level-info h2 { color: var(--lv); font-size: 2rem; line-height: 1.2; }
.level-info .age {
    display: inline-block; font-size: 1rem; vertical-align: middle;
    background: var(--lv); color: #fff; border-radius: 999px; padding: 2px 12px; margin-left: 6px;
}
.level-info p { margin-top: 6px; max-width: 680px; }
.per-book { font-weight: bold; color: #C77700; }

.level-buys { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.buy {
    display: flex; flex-direction: column; justify-content: center;
    background: #fff; border: 2px solid var(--lv); border-radius: 14px;
    padding: 10px 14px; text-decoration: none; color: var(--text-main);
    transition: transform 0.15s;
}
.buy:hover { transform: translateY(-2px); }
.buy-main { background: var(--lv); color: #fff; }
.buy-name { font-weight: bold; }
.buy-note { font-size: 0.85rem; opacity: 0.9; }
.buy-price { font-weight: bold; font-size: 1.15rem; }

.book-grid {
    list-style: none;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
}
.book {
    display: flex; flex-direction: column; height: 100%;
    background: #fff; border-radius: 14px; overflow: hidden;
    border: 2px solid #E3E3E3;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.15s, border-color 0.15s;
}
.book:hover { transform: translateY(-3px); border-color: var(--lv); }
.book-main {
    display: flex; flex-direction: column; flex: 1;
    text-decoration: none; color: var(--text-main);
}
/* Covers are portrait; "contain" keeps the whole cover visible */
.cover {
    aspect-ratio: 5 / 7;
    background: color-mix(in srgb, var(--lv) 10%, #fff);
    padding: 10px;
}
.cover img {
    width: 100%; height: 100%; object-fit: contain; display: block;
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.18));
}
.cover.placeholder { background: color-mix(in srgb, var(--lv) 14%, #fff); }
.cover.placeholder img { padding: 22%; filter: none; }
.book-no {
    align-self: flex-start;
    margin: 10px 12px 0;
    background: var(--lv); color: #fff; font-weight: bold; font-size: 0.8rem;
    padding: 1px 10px; border-radius: 999px;
}
.book-title { font-weight: bold; padding: 6px 12px 2px; line-height: 1.35; flex: 1; }
.book-links {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
    padding: 4px 10px 12px;
}
.book-links a {
    text-align: center; font-weight: bold; font-size: 0.85rem;
    padding: 5px 4px; border-radius: 999px; text-decoration: none;
    border: 2px solid var(--lv); transition: background 0.15s, color 0.15s;
}
.btn-shop { background: var(--lv); color: #fff; }
.btn-shop:hover { filter: brightness(1.08); }
.btn-amazon { background: #fff; color: var(--lv); }
.btn-amazon:hover { background: var(--lv); color: #fff; }
.book-links a:only-child { grid-column: 1 / -1; }

.to-top { text-align: right; margin-top: 16px; }
.to-top a { color: var(--primary-dark); font-size: 0.9rem; }

/* ---- Footer ---- */
.cta-bottom {
    text-align: center; background: #FFE8D6;
    padding: 50px 20px; border-radius: 30px 30px 0 0; margin-top: 30px;
}
.cta-bottom .footer-links { margin: 1em; color: #000; display: inline-block; }

/* ---- Mobile ---- */
@media (max-width: 900px) {
    .book-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    header h1 { font-size: 1.7rem; }
    .container { padding: 0 15px; }
    .bundles { grid-template-columns: 1fr; }
    .level-head { align-items: flex-start; }
    .level-veg { width: 80px; height: 90px; }
    .level-info h2 { font-size: 1.6rem; }
    .level-buys { grid-template-columns: 1fr; }
    .book-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
