/* =====================================================================
   A Moment Book — สไตล์หน้าเว็บ (แปลงจากไฟล์ต้นแบบ A Moment Book.dc.html)
   สี/มุมโค้ง อ่านจากตัวแปร --primary / --accent / --bg (ตั้งค่าได้ในหลังบ้าน)
   ===================================================================== */

:root {
    --primary: #2D8A42;
    --primary-dark: #297235;
    --accent: #FFD98A;
    --bg: #FDFFF7;
    --ink: #1E2620;
    --muted: #6E7A6C;
    --line: rgba(45, 138, 66, .26);
    --r: 14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'IBM Plex Sans Thai Looped', 'Mali', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

::selection {
    background: #CDE7C8;
}

img {
    max-width: 100%;
}

input,
textarea,
button {
    font-family: inherit;
}

input::placeholder,
textarea::placeholder {
    color: #9BA89A;
    letter-spacing: .24em;
    font-size: 12px;
    font-weight: 600;
}

.page {
    min-height: 100vh;
    background: var(--bg);
    overflow-x: clip;
}

/* ---------- animation ---------- */
@keyframes rise {
    from {
        opacity: 0;
        translate: 0 16px
    }

    to {
        opacity: 1;
        translate: 0 0
    }
}

@keyframes marquee {
    from {
        transform: translateX(0)
    }

    to {
        transform: translateX(-50%)
    }
}

@keyframes pop {
    0% {
        opacity: 0;
        transform: scale(.7)
    }

    60% {
        transform: scale(1.06)
    }

    100% {
        opacity: 1;
        transform: scale(1)
    }
}

@keyframes twinkle {

    0%,
    100% {
        opacity: .3;
        transform: scale(.85)
    }

    50% {
        opacity: 1;
        transform: scale(1.15)
    }
}

@keyframes drawline {
    from {
        transform: scaleX(0)
    }

    to {
        transform: scaleX(1)
    }
}

@keyframes wiggle {

    0%,
    100% {
        transform: rotate(-3deg)
    }

    50% {
        transform: rotate(3deg)
    }
}

@keyframes fly {
    0% {
        transform: translate(0, 0) rotate(0)
    }

    60% {
        transform: translate(26px, -18px) rotate(18deg)
    }

    100% {
        transform: translate(60px, -42px) rotate(24deg);
        opacity: 0
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        animation-duration: .01s !important;
        animation-iteration-count: 1 !important
    }
}

/* ---------- header ---------- */
.site-head {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--bg) 93%, transparent);
    border-bottom: 1px solid rgba(45, 138, 66, .16);
    padding: clamp(12px, 1.5vw, 18px) 0;
    transition: padding .3s ease, box-shadow .3s ease, border-color .3s ease;
}

.site-head.is-scrolled {
    padding: 8px 0;
    border-bottom-color: var(--line);
    box-shadow: 0 10px 24px -22px rgba(41, 114, 53, .95);
}

.head-row {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 clamp(14px, 3vw, 34px);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: clamp(8px, 1.6vw, 22px);
}

.brand {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(4px, .8vw, 10px);
    animation: rise .5s both;
}

.brand-logo {
    height: clamp(42px, 5vw, 68px);
    width: auto;
    display: block;
    transition: height .3s ease;
}

.is-scrolled .brand-logo {
    height: clamp(34px, 3.6vw, 46px);
}

.brand-word {
    font-family: 'Mali', cursive;
    font-weight: 700;
    font-size: clamp(20px, 2.3vw, 31px);
    color: var(--primary);
    line-height: 1;
}

.nav-pills-wrap {
    flex: 0 0 auto;
    display: flex;
    gap: 4px;
    padding: 5px;
    border-radius: 999px;
    background: #EEF6EA;
    border: 1px solid rgba(45, 138, 66, .16);
    box-shadow: inset 0 1px 2px rgba(41, 114, 53, .07);
    animation: rise .6s .08s both;
}

.navp {
    padding: 10px clamp(13px, 1.6vw, 22px);
    border-radius: 999px;
    font-size: clamp(13px, 1.15vw, 14.5px);
    font-weight: 600;
    white-space: nowrap;
    color: #5E7060;
    transition: background .28s, color .28s, box-shadow .28s;
}

.navp:hover {
    color: var(--primary-dark);
}

.navp.is-active {
    background: var(--primary);
    color: var(--bg);
    box-shadow: 0 6px 14px -8px rgba(41, 114, 53, .9);
}

.head-tag {
    min-width: 0;
    font-size: clamp(10px, .8vw, 12.5px);
    letter-spacing: .02em;
    font-weight: 600;
    line-height: 1.7;
    color: color-mix(in srgb, var(--primary) 85%, transparent);
    white-space: nowrap;
    text-align: right;
    overflow: hidden;
}

@media (max-width:720px) {
    .head-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 0 14px;
    }

    .head-tag {
        font-size: 11px;
        text-align: center;
    }
}

/* ---------- marquee ---------- */
.marquee {
    padding: 11px 0;
    background: var(--primary);
    color: var(--bg);
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid var(--primary-dark);
}

.marquee-track {
    display: inline-block;
    animation: marquee 32s linear infinite;
    font-size: clamp(10.5px, .85vw, 12.5px);
    letter-spacing: .06em;
    font-weight: 500;
}

.mq-item {
    padding: 0 22px;
}

.mq-star {
    padding: 0 22px;
    color: var(--accent);
}

/* ---------- layout ---------- */
.wrap {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 clamp(18px, 3vw, 34px);
}

.section {
    max-width: 1220px;
    margin: 0 auto;
    padding: clamp(38px, 5vw, 64px) clamp(18px, 3vw, 34px) 0;
}

.sec-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: clamp(18px, 2.4vw, 28px);
}

.sec-title {
    font-family: 'Mali', cursive;
    font-weight: 700;
    font-size: clamp(30px, 4.4vw, 46px);
    line-height: 1.5;
    margin: 0;
    color: var(--primary);
    position: relative;
    isolation: isolate;
    display: inline-block;
}

.sec-title span.underline {
    position: absolute;
    left: -2px;
    right: -2px;
    bottom: 6px;
    height: 11px;
    background: var(--accent);
    border-radius: 999px;
    z-index: 0;
    transform-origin: left;
    animation: drawline .8s .35s both;
}

.sec-title span.txt {
    position: relative;
    z-index: 1;
}

.sec-sub {
    margin: 2px 0 0;
    font-size: clamp(13px, 1.1vw, 15px);
    color: var(--muted);
}

/* ---------- rail ---------- */
.rail-row {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.4vw, 18px);
}

.rail-btn {
    flex: 0 0 clamp(44px, 3.6vw, 48px);
    height: clamp(44px, 3.6vw, 48px);
    border-radius: 50%;
    border: 1.5px solid rgba(45, 138, 66, .4);
    background: #fff;
    color: var(--primary);
    font-size: 16px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background .22s, transform .2s;
}

.rail-btn:hover {
    background: #EAF3E6;
    transform: scale(1.08);
}

.rail {
    flex: 1;
    display: flex;
    gap: clamp(16px, 2vw, 30px);
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    /* padding บน 18px — overflow-x:auto ทำให้แกนตั้งถูกตัดด้วย
       ถ้าไม่เผื่อไว้ ป้าย "ใหม่!" ที่ล้นขึ้นไปจะโดนตัดหัว */
    padding: 18px 2px 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rail::-webkit-scrollbar {
    display: none;
}

.see-all {
    display: flex;
    justify-content: flex-end;
    padding: 4px 0 0;
}

.see-all a {
    background: none;
    border: 0;
    padding: 10px 2px;
    font-size: 11px;
    letter-spacing: .3em;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    border-bottom: 2px dotted rgba(45, 138, 66, .55);
    transition: letter-spacing .25s, color .25s;
}

.see-all a:hover {
    letter-spacing: .4em;
    color: var(--primary-dark);
}

/* ---------- book card ---------- */
.book-card {
    position: relative;
    z-index: 1;
    flex: 0 0 clamp(148px, 17vw, 196px);
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform .32s cubic-bezier(.2, .8, .3, 1);
    animation: rise .6s both;
    display: block;
    color: inherit;
}

.book-card.has-badge {
    z-index: 2;
}

.book-card:hover {
    z-index: 3;
}

.book-card:hover {
    transform: translateY(-9px) rotate(-1.2deg);
    color: inherit;
}

.book-card:hover .book-cover {
    border-color: var(--primary);
    box-shadow: 0 22px 34px -20px rgba(41, 114, 53, .85);
}

.book-card:hover .book-title {
    color: var(--primary-dark);
}

.book-cover {
    transition: box-shadow .32s, border-color .32s;
}

.book-title {
    transition: color .25s;
}

.book-cover-wrap {
    position: relative;
    margin-bottom: 14px;
}

.book-cover-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--r);
    background: #E8F3E4;
    transform: rotate(-2.4deg);
}

.book-cover {
    position: relative;
    aspect-ratio: 5/7;
    border-radius: var(--r);
    overflow: hidden;
    border: 1.5px solid var(--line);
    background: #EAF3E6;
    box-shadow: 0 14px 26px -20px rgba(41, 114, 53, .7);
    display: grid;
    place-items: center;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cover-empty {
    font-size: 12px;
    color: #8FA48D;
    letter-spacing: .1em;
}

.badge-new {
    position: absolute;
    top: -12px;
    right: -8px;
    /* วรรณยุกต์ไทยลอยสูงกว่าตัวอักษรละติน ต้องเผื่อ line-height + padding บน
       ไม่งั้นไม้เอกบนคำว่า "ใหม่" จะไปชนขอบป้ายจนดูเหมือนโดนบัง */
    padding: 4px 13px 6px;
    line-height: 1.65;
    border-radius: 999px;
    background: var(--accent);
    border: 1.5px solid var(--ink);
    font-family: 'Mali', cursive;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    transform: rotate(7deg);
    box-shadow: 2px 2px 0 var(--ink);
    animation: pop .5s .5s both;
    z-index: 2;
}

.book-title {
    font-family: 'Mali', cursive;
    font-weight: 600;
    font-size: clamp(15px, 1.4vw, 19px);
    margin: 0 0 4px;
    line-height: 1.5;
    min-height: 2.9em;
    text-wrap: pretty;
    color: var(--ink);
}

.book-author {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--muted);
}

.book-price-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.book-price {
    font-family: 'Mali', cursive;
    font-weight: 600;
    font-size: 16px;
    color: var(--primary);
}

.book-price-sub {
    font-size: 11.5px;
    color: #98A296;
}

/* ---------- author card ---------- */
.author-card {
    flex: 0 0 clamp(150px, 16vw, 192px);
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform .3s;
    animation: rise .6s both;
    display: block;
    color: inherit;
}

.author-card:hover {
    transform: translateY(-6px);
    color: inherit;
}

.author-card:hover .author-name {
    color: var(--primary-dark);
}

.author-name {
    transition: color .25s;
}

.author-photo {
    aspect-ratio: 1/1;
    border-radius: 20px;
    overflow: hidden;
    border: 1.5px solid var(--line);
    background: #EAF3E6;
    box-shadow: 0 14px 24px -20px rgba(41, 114, 53, .8);
    margin-bottom: 14px;
    transition: border-radius .35s, transform .35s;
    display: grid;
    place-items: center;
}

.author-card:hover .author-photo {
    border-radius: 50%;
    transform: rotate(3deg);
}

.author-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.author-name {
    font-family: 'Mali', cursive;
    font-weight: 600;
    font-size: clamp(16px, 1.5vw, 20px);
    margin: 0 0 5px;
    color: var(--ink);
}

.author-note {
    margin: 0 0 8px;
    font-size: 12.5px;
    line-height: 1.7;
    color: var(--muted);
    text-wrap: pretty;
}

.author-count {
    font-size: 12px;
    letter-spacing: .12em;
    font-weight: 600;
    color: var(--primary);
}

/* ---------- grid (หน้ารวม) ---------- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(clamp(148px, 17vw, 196px), 1fr));
    gap: clamp(18px, 2.4vw, 32px);
}

.grid .book-card,
.grid .author-card {
    flex: none;
    width: 100%;
}

.toolbar {
    display: flex;
    gap: clamp(10px, 1.4vw, 16px);
    flex-wrap: wrap;
    align-items: flex-end;
    margin-bottom: clamp(18px, 2.4vw, 28px);
    padding: clamp(14px, 1.8vw, 20px);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: clamp(16px, 2vw, 22px);
    box-shadow: 0 18px 30px -34px rgba(41, 114, 53, .9);
}

.tb-field {
    flex: 0 1 190px;
    min-width: 150px;
}

.tb-grow {
    flex: 2 1 280px;
}

.tb-narrow {
    flex: 0 1 120px;
    min-width: 110px;
}

.tb-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tb-label {
    display: block;
    margin: 0 0 6px 4px;
    font-size: 11px;
    letter-spacing: .22em;
    font-weight: 600;
    color: var(--muted);
}

.field {
    width: 100%;
    min-height: 50px;
    padding: 13px 16px;
    font-size: 14.5px;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid rgba(45, 138, 66, .3);
    border-radius: 14px;
    transition: border-color .25s, box-shadow .25s;
}

.field::placeholder {
    letter-spacing: normal;
    font-size: 14px;
    font-weight: 400;
}

.field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

.btn-pill {
    padding: 14px 26px;
    border-radius: 999px;
    border: 0;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    letter-spacing: .1em;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 3px 4px 0 var(--primary-dark);
    transition: transform .2s, box-shadow .2s;
}

.btn-pill:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 6px 0 var(--primary-dark);
    color: #fff;
}

.btn-pill:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--primary-dark);
}

.btn-ghost {
    display: inline-block;
    padding: 13px 24px;
    border-radius: 999px;
    border: 1.5px dashed rgba(45, 138, 66, .55);
    background: #fff;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background .22s, transform .22s;
}

.btn-ghost:hover {
    background: #EAF3E6;
    transform: translateY(-2px);
}

/* ---------- แบ่งหน้า ---------- */
.pager-wrap {
    padding: clamp(26px, 3vw, 40px) 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 16px 28px -30px rgba(41, 114, 53, .95);
}

.pager a,
.pager span {
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 14.5px;
    font-weight: 600;
    color: var(--primary);
    transition: background .2s, color .2s, transform .2s;
}

.pager a:hover {
    background: #EAF3E6;
    transform: translateY(-2px);
}

.pager .is-current {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 16px -10px rgba(41, 114, 53, .95);
}

.pager .is-disabled {
    color: #B9C4B7;
}

.pager .pager-gap {
    min-width: 24px;
    padding: 0 2px;
    color: #A9B5A7;
    font-weight: 400;
}

.pager-info {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
    text-align: center;
}

@media (max-width:520px) {

    .pager a,
    .pager span {
        min-width: 38px;
        height: 38px;
        padding: 0 8px;
        font-size: 13.5px;
    }
}

.empty {
    padding: 46px 0;
    text-align: center;
    color: var(--muted);
    font-size: 15px;
}

/* ---------- contact ---------- */
.contact-card {
    position: relative;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: clamp(20px, 2.4vw, 30px);
    padding: clamp(20px, 3vw, 38px);
    display: flex;
    gap: clamp(18px, 2.4vw, 34px);
    flex-wrap: wrap;
    box-shadow: 0 24px 40px -36px rgba(41, 114, 53, .9);
}

.contact-doodle {
    position: absolute;
    top: -13px;
    right: 30px;
    font-size: 22px;
    color: var(--accent);
    animation: twinkle 3s ease-in-out infinite;
}

.contact-col-msg {
    flex: 2 1 300px;
}

.contact-col-info {
    flex: 1 1 210px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-col-send {
    flex: 1 1 200px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    justify-content: center;
}

.contact-card textarea {
    width: 100%;
    min-height: clamp(160px, 20vw, 212px);
    resize: vertical;
    padding: 16px;
    font-size: 15px;
    line-height: 1.85;
    color: var(--ink);
    background: var(--bg);
    border: 1.5px solid rgba(45, 138, 66, .3);
    border-radius: 18px;
    transition: border-color .25s, background .25s;
}

.contact-card input[type=text],
.contact-card input[type=email] {
    width: 100%;
    padding: 15px 16px;
    font-size: 15px;
    color: var(--ink);
    background: var(--bg);
    border: 1.5px solid rgba(45, 138, 66, .3);
    border-radius: 14px;
    transition: border-color .25s, background .25s;
}

.contact-card textarea:focus,
.contact-card input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}

.contact-note {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.7;
    color: #8A947F;
}

.cap-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.cap-q {
    font-family: 'Mali', cursive;
    font-weight: 600;
    font-size: 19px;
    white-space: nowrap;
}

.cap-input {
    width: 82px;
    padding: 12px 10px;
    font-size: 16px;
    text-align: center;
    color: var(--ink);
    background: var(--bg);
    border: 1.5px solid rgba(45, 138, 66, .3);
    border-radius: 12px;
}

.btn-submit {
    padding: 16px 24px;
    border-radius: 999px;
    border: 0;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    letter-spacing: .26em;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 4px 5px 0 var(--primary-dark);
    transition: transform .2s, box-shadow .2s;
}

.btn-submit:hover:not(:disabled) {
    transform: translate(-2px, -2px);
    box-shadow: 6px 7px 0 var(--primary-dark);
}

.btn-submit:active:not(:disabled) {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--primary-dark);
}

.btn-submit:disabled {
    opacity: .7;
    cursor: progress;
}

.msg-ok {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--primary);
    animation: pop .4s both;
}

.msg-bad {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: #C4553F;
    animation: pop .4s both;
}

.hp-field {
    position: absolute;
    left: -9999px;
    opacity: 0;
    height: 0;
    width: 0;
}

.spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
    vertical-align: -2px;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* ---------- book detail ---------- */
.back-link {
    background: none;
    border: 0;
    padding: 6px 0;
    font-size: 14px;
    color: var(--muted);
    cursor: pointer;
    display: inline-block;
    transition: color .2s, transform .2s;
}

.back-link:hover {
    color: var(--primary);
    transform: translateX(-3px);
}

.detail {
    display: flex;
    gap: clamp(24px, 4vw, 56px);
    flex-wrap: wrap;
    padding: clamp(16px, 2vw, 26px) 0 0;
    align-items: flex-start;
}

.detail-left {
    flex: 1 1 320px;
    max-width: 480px;
    animation: rise .6s both;
}

.detail-right {
    flex: 1.15 1 340px;
    animation: rise .7s .1s both;
}

.label-sp {
    margin: 0 0 10px;
    font-size: 11px;
    letter-spacing: .3em;
    font-weight: 600;
    color: var(--muted);
}

.detail-cover-wrap {
    position: relative;
}

.detail-cover-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--r);
    background: var(--accent);
    transform: rotate(-2.4deg);
}

.detail-cover {
    position: relative;
    aspect-ratio: 5/7;
    border-radius: var(--r);
    overflow: hidden;
    border: 1.5px solid var(--line);
    background: #EAF3E6;
    box-shadow: 0 24px 40px -30px rgba(41, 114, 53, .85);
    display: grid;
    place-items: center;
}

.detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookmark {
    position: absolute;
    top: -8px;
    right: 22px;
    width: 34px;
    height: 58px;
    background: var(--accent);
    border: 1.5px solid var(--primary-dark);
    border-bottom: 0;
    border-radius: 6px 6px 0 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
    transform-origin: top center;
    animation: wiggle 4.5s ease-in-out infinite;
    z-index: 2;
}

.fmt-tabs {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.tab {
    padding: 11px 20px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .06em;
    border: 1.5px solid rgba(45, 138, 66, .3);
    background: #fff;
    color: #5C6A5B;
    transition: background .25s, color .25s, transform .2s, box-shadow .25s;
}

.tab.is-on {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 10px 18px -12px rgba(45, 138, 66, .95);
}

.author-box {
    margin: 0 0 22px;
    background: #E8F3E4;
    border: 1.5px solid var(--line);
    border-radius: 24px;
    padding: clamp(18px, 2.2vw, 26px);
    display: flex;
    gap: clamp(14px, 2vw, 22px);
    align-items: center;
    flex-wrap: wrap;
    transition: transform .3s, box-shadow .3s;
    color: inherit;
}

.author-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 30px -26px rgba(41, 114, 53, .95);
    color: inherit;
}

.author-box-photo {
    flex: 0 0 clamp(120px, 11vw, 140px);
    aspect-ratio: 1/1;
    border-radius: 20px;
    overflow: hidden;
    border: 1.5px solid rgba(45, 138, 66, .3);
    background: var(--bg);
    display: grid;
    place-items: center;
}

.author-box-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-box-body {
    flex: 1 1 200px;
}

.author-box-name {
    font-family: 'Mali', cursive;
    font-weight: 600;
    font-size: clamp(19px, 2vw, 24px);
    line-height: 1.5;
    margin: 0 0 6px;
    color: var(--primary-dark);
}

.author-box-note {
    margin: 0 0 10px;
    font-size: 13.5px;
    line-height: 1.75;
    color: #4A5A4B;
    text-wrap: pretty;
}

.author-box-more {
    font-size: 12.5px;
    letter-spacing: .1em;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 1.5px dotted rgba(45, 138, 66, .6);
}

h1.detail-title {
    font-family: 'Mali', cursive;
    font-weight: 700;
    font-size: clamp(28px, 3.6vw, 46px);
    line-height: 1.5;
    margin: 0 0 6px;
    text-wrap: pretty;
}

.detail-by {
    margin: 0 0 22px;
    font-size: 15px;
    color: var(--muted);
}

.detail-by a {
    font-weight: 600;
    border-bottom: 1.5px dotted rgba(45, 138, 66, .6);
}

.spec {
    margin: 0 0 24px;
    display: grid;
    grid-template-columns: minmax(92px, 120px) 1fr;
}

.spec dt {
    padding: 12px 0;
    font-size: 13.5px;
    color: var(--muted);
    border-top: 1px solid rgba(45, 138, 66, .22);
}

.spec dd {
    padding: 12px 0;
    margin: 0;
    font-size: 14.5px;
    border-top: 1px solid rgba(45, 138, 66, .22);
}

.spec .last {
    border-bottom: 1px solid rgba(45, 138, 66, .22);
}

.price-big {
    font-family: 'Mali', cursive;
    font-weight: 700;
    font-size: clamp(22px, 2.4vw, 28px);
    color: var(--primary);
}

.price-label {
    font-size: 12.5px;
    color: #98A296;
}

/* แถวราคา + ปุ่มสลับ รูปเล่ม/อีบุ๊ก อยู่บรรทัดเดียวกัน */
.price-cell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.price-main {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    min-width: 0;
}

.fmt-tabs-sm {
    margin-top: 0;
    gap: 6px;
    flex: 0 0 auto;
}

.fmt-tabs-sm .tab {
    padding: 8px 15px;
    font-size: 12px;
}

@media (max-width:520px) {
    .price-cell {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ปุ่มสั่งซื้อของรูปแบบที่ไม่ได้เลือก ให้จางลง */
[data-buy].is-dim {
    background: #fff;
    color: var(--primary);
    border: 1.5px solid rgba(45, 138, 66, .35);
    box-shadow: none;
}

.blurb {
    position: relative;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 24px;
    padding: clamp(22px, 2.4vw, 30px);
}

.blurb::before {
    content: '“';
    position: absolute;
    top: -16px;
    left: 22px;
    font-family: 'Mali', cursive;
    font-size: 52px;
    color: var(--accent);
    line-height: 1;
}

.blurb p.body {
    margin: 0;
    font-size: clamp(14.5px, 1.3vw, 16.5px);
    line-height: 2;
    color: #3C483C;
    text-wrap: pretty;
    white-space: pre-line;
}

/* ---------- author detail ---------- */
.au-head {
    display: flex;
    gap: clamp(24px, 4vw, 56px);
    flex-wrap: wrap;
    padding: clamp(18px, 2.4vw, 30px) 0 0;
    align-items: flex-start;
}

.au-left {
    position: relative;
    flex: 0 1 300px;
    animation: rise .6s both;
}

.au-doodle {
    position: absolute;
    top: -12px;
    right: 4px;
    font-size: 20px;
    color: #F2A08F;
    animation: twinkle 3.4s ease-in-out infinite;
    z-index: 2;
}

.au-photo {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 26px;
    overflow: hidden;
    border: 1.5px solid var(--line);
    background: #EAF3E6;
    box-shadow: 0 22px 34px -28px rgba(41, 114, 53, .95);
    display: grid;
    place-items: center;
}

.au-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.au-count {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    margin-top: 18px;
    padding: 9px 17px;
    border-radius: 999px;
    background: var(--accent);
    font-size: 13px;
    font-weight: 600;
    color: #4A3A14;
}

.au-social {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.au-social a,
.foot-social a {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    border: 1.5px solid var(--line);
    color: var(--primary);
    transition: background .25s, transform .25s, color .25s, box-shadow .25s;
}

.au-social a:hover {
    background: var(--primary);
    color: var(--bg);
    transform: translateY(-4px) rotate(-4deg);
    box-shadow: 0 12px 18px -14px rgba(41, 114, 53, 1);
}

.au-right {
    flex: 1 1 340px;
    animation: rise .7s .1s both;
}

h1.au-name {
    font-family: 'Mali', cursive;
    font-weight: 700;
    font-size: clamp(32px, 4.4vw, 52px);
    line-height: 1.45;
    margin: 0 0 24px;
    color: var(--primary);
}

.au-bio {
    columns: 2 260px;
    column-gap: 34px;
    max-width: 760px;
}

.au-bio p {
    margin: 0 0 14px;
    font-size: clamp(14.5px, 1.3vw, 16.5px);
    line-height: 2;
    color: #3C483C;
    text-wrap: pretty;
    white-space: pre-line;
}

.chip-back {
    background: #E8F3E4;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--primary-dark);
    transition: background .22s, transform .2s;
}

.chip-back:hover {
    background: #D8EBD3;
    transform: translateY(-2px);
}

/* ---------- footer ---------- */
.site-foot {
    background: var(--primary);
    color: #EAF3E6;
    border-top: 1px solid var(--primary-dark);
    margin-top: clamp(40px, 5vw, 66px);
}

.foot-inner {
    max-width: 1220px;
    margin: 0 auto;
    padding: clamp(30px, 3.6vw, 50px) clamp(18px, 3vw, 34px) clamp(22px, 2.4vw, 30px);
    display: flex;
    gap: clamp(24px, 4vw, 54px);
    flex-wrap: wrap;
    align-items: flex-start;
}

.foot-brand {
    flex: 1 1 260px;
}

.foot-name {
    font-family: 'Mali', cursive;
    font-weight: 700;
    font-size: clamp(24px, 2.6vw, 32px);
    line-height: 1.4;
    color: var(--bg);
}

.foot-name span {
    color: var(--accent);
}

.foot-tagline {
    margin: 8px 0 0;
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 600;
    line-height: 1.8;
    color: rgba(253, 255, 247, .8);
}

.foot-social {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.foot-social a {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(253, 255, 247, .12);
    border: 1px solid rgba(253, 255, 247, .25);
    color: #EAF3E6;
}

.foot-social a:hover {
    background: var(--accent);
    color: #4A3A14;
    transform: translateY(-3px);
}

.foot-menu {
    flex: 0 1 180px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.foot-menu a {
    font-size: 14px;
    color: #EAF3E6;
    transition: color .2s, transform .2s;
}

.foot-menu a:hover {
    color: var(--accent);
    transform: translateX(3px);
}

.foot-label {
    margin: 0 0 2px;
    font-size: 11px;
    letter-spacing: .26em;
    font-weight: 600;
    color: rgba(253, 255, 247, .6);
}

.foot-contact {
    flex: 1 1 230px;
}

.foot-mail {
    margin: 0 0 6px;
    font-size: 14px;
    line-height: 1.9;
}

.foot-mail a {
    color: var(--bg);
}

.foot-sub {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.9;
    color: rgba(253, 255, 247, .75);
}

.foot-map {
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 clamp(18px, 3vw, 34px) 18px;
}

.foot-map iframe {
    border-radius: 16px;
    display: block;
}

.foot-bottom {
    max-width: 1220px;
    margin: 0 auto;
    padding: 18px clamp(18px, 3vw, 34px) clamp(26px, 3vw, 38px);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: rgba(253, 255, 247, .7);
    border-top: 1px solid rgba(253, 255, 247, .16);
}

/* ---------- แถบขอความยินยอมคุกกี้ ---------- */
.cookie-bar {
    position: fixed;
    z-index: 60;
    bottom: clamp(14px, 2.2vw, 26px);
    max-width: 460px;
    opacity: 0;
    transform: translateY(24px) scale(.98);
    transition: opacity .42s cubic-bezier(.2, .8, .3, 1), transform .42s cubic-bezier(.2, .8, .3, 1);
}

.cookie-bar.is-in {
    opacity: 1;
    transform: none;
}

.cookie-bar.is-out {
    opacity: 0;
    transform: translateY(16px) scale(.98);
    pointer-events: none;
}

.cookie-pos-left {
    left: clamp(14px, 2.2vw, 26px);
}

.cookie-pos-right {
    right: clamp(14px, 2.2vw, 26px);
}

.cookie-pos-center {
    left: 50%;
    transform: translate(-50%, 24px) scale(.98);
}

.cookie-pos-center.is-in {
    transform: translate(-50%, 0);
}

.cookie-pos-center.is-out {
    transform: translate(-50%, 16px) scale(.98);
}

.cookie-pos-bar {
    left: clamp(14px, 2.2vw, 26px);
    right: clamp(14px, 2.2vw, 26px);
    max-width: none;
}

.cookie-card {
    position: relative;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: clamp(18px, 2.2vw, 24px);
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: clamp(18px, 2.2vw, 26px);
    box-shadow: 0 26px 44px -28px rgba(41, 114, 53, .85);
}

/* เส้นสี accent บาง ๆ ด้านบนการ์ด */
.cookie-card::before {
    content: '';
    position: absolute;
    top: -1.5px;
    left: 26px;
    right: 26px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent);
}

.cookie-pos-bar .cookie-card {
    align-items: center;
    flex-wrap: nowrap;
}

@media (max-width:820px) {
    .cookie-pos-bar .cookie-card {
        flex-wrap: wrap;
    }
}

.cookie-emoji {
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    font-size: 24px;
    border-radius: 50%;
    background: #EAF3E6;
    border: 1.5px solid rgba(45, 138, 66, .22);
    animation: bob 3.6s ease-in-out infinite;
}

@keyframes bob {

    0%,
    100% {
        translate: 0 0;
        rotate: -3deg
    }

    50% {
        translate: 0 -4px;
        rotate: 4deg
    }
}

.cookie-body {
    flex: 1 1 220px;
    min-width: 0;
}

.cookie-title {
    font-family: 'Mali', cursive;
    font-weight: 700;
    font-size: clamp(17px, 1.7vw, 20px);
    line-height: 1.5;
    margin: 0 0 6px;
    color: var(--primary);
}

.cookie-text {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.85;
    color: #4A5A4B;
    text-wrap: pretty;
}

.cookie-link {
    display: inline-block;
    margin-top: 8px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--primary);
    border-bottom: 1.5px dotted rgba(45, 138, 66, .55);
    transition: letter-spacing .25s;
}

.cookie-link:hover {
    letter-spacing: .1em;
}

.cookie-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.cookie-pos-bar .cookie-actions {
    width: auto;
}

.cookie-btn {
    flex: 1 1 auto;
    padding: 13px 22px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .06em;
    white-space: nowrap;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s, background .22s, color .22s;
}

.cookie-accept {
    border: 0;
    background: var(--primary);
    color: #fff;
    box-shadow: 3px 4px 0 var(--primary-dark);
}

.cookie-accept:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 6px 0 var(--primary-dark);
}

.cookie-accept:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--primary-dark);
}

.cookie-reject {
    border: 1.5px solid rgba(45, 138, 66, .35);
    background: #fff;
    color: #5C6A5B;
}

.cookie-reject:hover {
    background: #EAF3E6;
    color: var(--primary-dark);
    transform: translateY(-2px);
}

@media (max-width:520px) {
    .cookie-bar {
        left: 10px;
        right: 10px;
        bottom: 10px;
        max-width: none;
    }

    .cookie-pos-center {
        left: 10px;
        transform: translateY(24px) scale(.98);
    }

    .cookie-pos-center.is-in {
        transform: none;
    }

    .cookie-btn {
        flex: 1 1 100%;
    }
}