/* ============================================================
   BookKav — Book detail (premium literary luxury)
   ============================================================ */

/* ---------- EMERALD LIT HERO ---------- */
.bd-hero{position:relative; overflow:hidden; color:#FBF6EA; margin-top:-74px;
  padding:calc(74px + clamp(2.8rem,6vw,4.6rem)) 0 clamp(2.8rem,5vw,4.4rem);
  background:
    radial-gradient(128% 120% at 50% 8%,transparent 50%,rgba(4,20,14,.55) 100%),
    radial-gradient(44% 52% at 88% 4%,rgba(214,172,96,.22),transparent 56%),
    radial-gradient(60% 70% at 2% 100%,rgba(47,123,97,.34),transparent 62%),
    linear-gradient(156deg,#0d3f30 0%,#104a39 46%,#0a3026 100%);}
.bd-hero::after{content:""; position:absolute; inset:0; pointer-events:none; opacity:.05; mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");}
@media (max-width:620px){ .bd-hero{margin-top:-64px; padding-top:calc(64px + 2.6rem);} }
.bd-hero__grid{position:relative; z-index:1; display:grid; grid-template-columns:minmax(240px,330px) 1fr; gap:clamp(2rem,5vw,4.5rem); align-items:start;}
@media (max-width:880px){ .bd-hero__grid{grid-template-columns:1fr; justify-items:center; text-align:center;} }

/* cover stage */
.bd-cover-col{position:sticky; top:90px; display:flex; flex-direction:column; align-items:center; gap:1.1rem; width:100%;}
@media (max-width:880px){ .bd-cover-col{position:static; top:auto; max-width:300px;} }
.bd-cover-stage{position:relative; width:100%; display:grid; place-items:center; padding:.5rem 0;}
.bd-cover-stage::before{content:""; position:absolute; width:78%; height:78%; left:50%; top:46%; transform:translate(-50%,-50%);
  background:radial-gradient(circle,rgba(231,206,148,.32),transparent 70%); filter:blur(34px); z-index:0;}
.bd-cover-stage::after{content:""; position:absolute; left:50%; bottom:-4px; transform:translateX(-50%); width:60%; height:24px;
  background:radial-gradient(ellipse,rgba(0,0,0,.5),transparent 70%); filter:blur(10px); z-index:0;}
.bd-cover-stage .bk-flip-book,.bd-cover-stage [data-book-flip]{position:relative; z-index:1;}
.bd-cover-hint{position:relative; z-index:1; color:rgba(231,206,148,.72); font-size:.78rem; line-height:1.7; text-align:center; max-width:32ch; margin:0;}

/* summary column */
.bd-summary{position:relative; z-index:1; min-width:0; width:100%;}
.bd-breadcrumbs{display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; font-size:.85rem; margin-bottom:1rem;}
@media (max-width:880px){ .bd-breadcrumbs{justify-content:center;} }
.bd-breadcrumbs a{color:rgba(231,206,148,.85);}
.bd-breadcrumbs a:hover{color:#F4E3BC; text-decoration:underline;}
.bd-breadcrumbs span{color:rgba(251,246,234,.4);}
.bd-badges{display:flex; flex-wrap:wrap; gap:.45rem; margin-bottom:1.1rem;}
@media (max-width:880px){ .bd-badges{justify-content:center;} }
.bd-badges span{font-size:.74rem; font-weight:500; padding:.32rem .7rem; border-radius:999px; color:#F4E3BC; background:rgba(231,206,148,.1); border:1px solid rgba(231,206,148,.32);}
.bd-title{font-size:clamp(1.9rem,3.6vw,3rem); font-weight:700; line-height:1.3; color:#FBF6EA; margin:0 0 .5rem;}
.bd-subtitle{font-size:clamp(1rem,1.6vw,1.2rem); color:rgba(251,246,234,.72); margin:0 0 .9rem; line-height:1.6;}
.bd-authors{font-size:.98rem; margin:0 0 1.2rem; color:rgba(251,246,234,.7);}
.bd-authors a{color:#E7C67C; font-weight:500;}
.bd-authors a:hover{text-decoration:underline;}
.bd-lead{color:rgba(251,246,234,.84); line-height:1.95; max-width:60ch; margin:0 0 1.5rem;}
@media (max-width:880px){ .bd-lead{margin-inline:auto;} }

/* stat chips */
.bd-stats{display:grid; grid-template-columns:repeat(4,1fr); gap:.7rem; margin-bottom:1.4rem;}
@media (max-width:560px){ .bd-stats{grid-template-columns:repeat(2,1fr);} }
.bd-stat{padding:.85rem .8rem; border-radius:var(--radius-md); text-align:center; background:linear-gradient(160deg,rgba(255,255,255,.09),rgba(255,255,255,.03)); border:1px solid rgba(231,206,148,.2);}
.bd-stat span{display:block; font-size:.72rem; color:rgba(251,246,234,.62); margin-bottom:.3rem;}
.bd-stat strong{display:block; font-size:1.15rem; font-weight:700; color:#E7CE94; font-family:var(--font-main);}
.bd-stat small{display:block; font-size:.66rem; color:rgba(251,246,234,.5); margin-top:.2rem;}

/* reactions */
.bd-reactions{display:flex; flex-wrap:wrap; gap:.6rem; margin-bottom:1.5rem;}
@media (max-width:880px){ .bd-reactions{justify-content:center;} }
.bd-reactions form{margin:0;}
.bd-react{display:inline-flex; align-items:center; gap:.5rem; padding:.5rem .95rem; border-radius:999px; cursor:pointer; font:inherit; font-size:.88rem; color:rgba(251,246,234,.85); background:rgba(255,255,255,.05); border:1px solid rgba(231,206,148,.22); transition:background .2s var(--ease),border-color .2s var(--ease);}
.bd-react:hover{background:rgba(255,255,255,.1); border-color:rgba(231,206,148,.4);}
.bd-react b{font-weight:700; color:#E7CE94;}
.bd-react.is-active{background:linear-gradient(140deg,rgba(231,206,148,.95),rgba(168,129,45,.92)); color:#0d3f30; border-color:transparent;}
.bd-react.is-active b{color:#0d3f30;}

/* buybox */
.bd-buybox{display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1.2rem; padding:1.3rem 1.5rem; border-radius:var(--radius-lg); background:linear-gradient(160deg,rgba(255,255,255,.12),rgba(255,255,255,.045)); border:1px solid rgba(231,206,148,.34); backdrop-filter:blur(10px); box-shadow:0 22px 50px -28px rgba(0,0,0,.7);}
@media (max-width:880px){ .bd-buybox{justify-content:center; text-align:center;} }
.bd-price{display:flex; align-items:baseline; gap:.5rem; flex-wrap:wrap;}
.bd-price del{color:rgba(251,246,234,.45); font-size:1rem;}
.bd-price strong{font-size:1.9rem; font-weight:800; color:#FBF6EA; font-family:var(--font-main); line-height:1;}
.bd-price>span{color:rgba(231,206,148,.85); font-size:.9rem;}
.bd-actions{display:flex; flex-wrap:wrap; gap:.6rem;}
.bd-actions form{margin:0;}
@media (max-width:880px){ .bd-actions{justify-content:center;} }

/* pdf offers (in hero) */
.bd-pdf-offers{margin-top:1.4rem; padding:1.2rem 1.4rem; border-radius:var(--radius-lg); background:linear-gradient(160deg,rgba(255,255,255,.08),rgba(255,255,255,.03)); border:1px solid rgba(231,206,148,.24);}
.bd-pdf-offers__head{display:flex; align-items:center; gap:.8rem; margin-bottom:1rem;}
@media (max-width:880px){ .bd-pdf-offers__head{text-align:start;} }
.bd-pdf-offers__head>span{flex:none; display:grid; place-items:center; width:46px; height:46px; border-radius:12px; font-family:var(--font-latin); font-weight:700; font-size:.8rem; background:linear-gradient(140deg,var(--bk-brand),#0f4a39); color:#E7CE94; border:1px solid rgba(231,206,148,.3);}
.bd-pdf-offers__head strong{display:block; color:#FBF6EA; font-size:1rem;}
.bd-pdf-offers__head small{display:block; color:rgba(251,246,234,.6); font-size:.78rem; line-height:1.5; margin-top:.2rem;}
.bd-pdf-offers__list{display:flex; flex-direction:column; gap:.6rem;}
.bd-pdf-offer{display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.7rem .9rem; border-radius:var(--radius-md); background:rgba(255,255,255,.04); border:1px solid rgba(231,206,148,.16);}
@media (max-width:560px){ .bd-pdf-offer{flex-direction:column; align-items:flex-start; gap:.4rem; text-align:start;} }
.bd-pdf-offer strong{display:block; color:#F4E3BC; font-size:.92rem;}
.bd-pdf-offer small{display:block; color:rgba(251,246,234,.6); font-size:.76rem; margin-top:.2rem;}
.bd-pdf-offer a{flex:none; color:#E7C67C; font-size:.85rem; font-weight:600; padding:.35rem .75rem; border-radius:8px; border:1px solid rgba(231,206,148,.32); transition:background .2s var(--ease);}
.bd-pdf-offer a:hover{background:rgba(231,206,148,.14);}
.bd-pdf-offer>span{flex:none; color:rgba(251,246,234,.5); font-size:.8rem;}

/* ---------- LIGHT CONTENT SECTIONS ---------- */
.bd-section{padding:clamp(30px,3.6vw,54px) 0;}
.bd-section--inset{background:var(--bk-inset);}
.bd-eyebrow{font-family:var(--font-latin); font-size:.78rem; letter-spacing:.18em; text-transform:uppercase; color:var(--bk-gold-700,#7a5e1f); margin:0 0 .4rem;}
.bd-section__head{display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:1rem 2rem; margin-bottom:clamp(1.3rem,2.4vw,1.9rem);}
.bd-section__head h2{font-size:clamp(1.4rem,2.4vw,1.9rem); font-weight:700; color:var(--bk-heading); margin:0; line-height:1.4;}
.bd-section__head>p{color:var(--bk-muted); font-size:.92rem; line-height:1.8; max-width:46ch; margin:0;}

.bd-two-col{display:grid; grid-template-columns:1.65fr 1fr; gap:clamp(1.2rem,2.5vw,2rem); align-items:start;}
@media (max-width:860px){ .bd-two-col{grid-template-columns:1fr;} }
.bd-card{background:var(--bk-card); border:1px solid var(--bk-border); border-radius:var(--radius-lg); box-shadow:var(--shadow-soft); padding:clamp(1.4rem,3vw,2.1rem);}
.bd-card>h2{font-size:1.3rem; font-weight:700; color:var(--bk-heading); margin:0 0 1rem;}
.bd-prose{color:var(--bk-body); line-height:2;}
.bd-prose h2{margin-bottom:.8rem;}
.bd-prose p{margin:0 0 1rem; color:var(--bk-body); line-height:2;}
.bd-prose p:last-child{margin-bottom:0;}

/* spec dl */
.bd-specs dl{margin:0;}
.bd-specs dl>div{display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.7rem 0; border-bottom:1px solid var(--bk-border);}
.bd-specs dl>div:last-child{border-bottom:0;}
.bd-specs dt{color:var(--bk-muted); font-size:.88rem;}
.bd-specs dd{margin:0; color:var(--bk-heading); font-weight:600; font-size:.92rem; text-align:end;}
.bd-specs dd a{color:var(--bk-brand);}

/* toc */
.bd-toc{margin:0; padding-inline-start:0; list-style:none; counter-reset:toc;}
.bd-toc li{counter-increment:toc; position:relative; padding:.6rem 0 .6rem 2.5rem; border-bottom:1px solid var(--bk-border); color:var(--bk-body); line-height:1.7;}
.bd-toc li:last-child{border-bottom:0;}
.bd-toc li::before{content:counter(toc); position:absolute; inset-inline-start:0; top:.5rem; width:1.8rem; height:1.8rem; display:grid; place-items:center; font-family:var(--font-main); font-size:.78rem; font-weight:700; border-radius:8px; background:color-mix(in srgb,var(--bk-brand) 9%,transparent); color:var(--bk-brand);}

/* editions */
.bd-editions{display:flex; flex-direction:column; gap:.7rem;}
.bd-editions>div{padding:.85rem 1rem; border-radius:var(--radius-md); background:var(--bk-inset); border:1px solid var(--bk-border);}
.bd-editions strong{display:block; color:var(--bk-heading); font-size:.98rem;}
.bd-editions>div>span{display:block; color:var(--bk-body); font-size:.85rem; margin-top:.2rem;}
.bd-editions small{display:block; color:var(--bk-muted); font-size:.78rem; margin-top:.2rem;}

/* pdf spec cards */
.bd-pdf-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:1.2rem;}
.bd-pdf-card{display:flex; flex-direction:column; gap:1rem; background:var(--bk-card); border:1px solid var(--bk-border); border-radius:var(--radius-lg); box-shadow:var(--shadow-soft); padding:clamp(1.3rem,2.5vw,1.7rem);}
.bd-pdf-card>header{display:flex; align-items:center; gap:.8rem;}
.bd-pdf-card>header>span{flex:none; display:grid; place-items:center; width:44px; height:44px; border-radius:12px; font-family:var(--font-latin); font-weight:700; font-size:.78rem; background:linear-gradient(140deg,var(--bk-brand),#0f4a39); color:#E7CE94;}
.bd-pdf-card>header h3{font-size:1.02rem; font-weight:700; color:var(--bk-heading); margin:0;}
.bd-pdf-card>header p{font-size:.8rem; color:var(--bk-muted); margin:.15rem 0 0;}
.bd-pdf-card dl{margin:0;}
.bd-pdf-card dl>div{display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.55rem 0; border-bottom:1px solid var(--bk-border);}
.bd-pdf-card dl>div:last-child{border-bottom:0;}
.bd-pdf-card dt{color:var(--bk-muted); font-size:.83rem;}
.bd-pdf-card dd{margin:0; color:var(--bk-heading); font-weight:600; font-size:.86rem; text-align:end;}
.bd-pdf-card__wide{flex-direction:column !important; align-items:flex-start !important;}
.bd-pdf-card__wide dd{text-align:start;}
.bd-pdf-card>footer{margin-top:auto;}
.bd-pdf-card>footer>span{color:var(--bk-muted); font-size:.85rem;}

/* reviews */
.bd-reviews{display:flex; flex-direction:column; gap:1rem;}
.bd-review{padding:1.2rem 1.3rem; border-radius:var(--radius-md); background:var(--bk-inset); border:1px solid var(--bk-border);}
.bd-review__head{display:flex; align-items:center; justify-content:space-between; gap:1rem; margin-bottom:.5rem;}
.bd-review__head strong{color:var(--bk-heading); font-size:.96rem;}
.bd-review__head span{color:var(--bk-gold-700,#7a5e1f); font-weight:700; font-size:.9rem;}
.bd-review h3{font-size:1rem; font-weight:700; color:var(--bk-heading); margin:0 0 .4rem;}
.bd-review p{color:var(--bk-body); line-height:1.85; margin:0;}
.bd-review__handwrite{margin:.9rem 0 0;}
.bd-review__handwrite img{width:100%; border-radius:var(--radius-md); border:1px solid var(--bk-border);}
.bd-review__handwrite figcaption{font-size:.78rem; color:var(--bk-muted); margin-top:.4rem; text-align:center;}

/* review form */
.bd-form{display:flex; flex-direction:column; gap:.85rem;}
.bd-form label{display:flex; flex-direction:column; gap:.35rem; font-size:.85rem; color:var(--bk-heading); font-weight:600;}
.bd-form input[type=text],.bd-form input[type=file],.bd-form textarea,.bd-form select{width:100%; padding:.7rem .85rem; border-radius:var(--radius-md); border:1px solid var(--bk-border); background:var(--bk-bg); color:var(--bk-heading); font:inherit; font-weight:400;}
.bd-form textarea{min-height:120px; resize:vertical; line-height:1.7;}
.bd-form input:focus,.bd-form textarea:focus,.bd-form select:focus{outline:none; border-color:var(--bk-brand); box-shadow:0 0 0 3px color-mix(in srgb,var(--bk-brand) 14%,transparent);}
.bd-rating-group{display:flex; gap:.4rem; align-items:center; flex-wrap:wrap;}
.bd-form .btn{margin-top:.3rem; align-self:flex-start;}
.bd-login-prompt{color:var(--bk-body); line-height:1.8; margin:0 0 1rem;}
.bd-empty{color:var(--bk-muted); padding:1rem 0; margin:0;}

/* ============================================================
   Bottom sections — polish pass (v2)
   ============================================================ */
/* card header accent (gold tick under each card heading) */
.bd-card>h2,.bd-prose h2{position:relative; padding-bottom:.7rem; margin-bottom:1.1rem; border-bottom:1px solid var(--bk-border);}
.bd-card>h2::after,.bd-prose h2::after{content:""; position:absolute; bottom:-1px; inset-inline-start:0; width:46px; height:2px; border-radius:2px; background:var(--bk-gold);}

/* graceful empty states */
.bd-empty-block{display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; gap:.75rem; min-height:170px; padding:2rem 1rem; margin:0; color:var(--bk-muted);}
.bd-empty-ico{display:grid; place-items:center; width:54px; height:54px; border-radius:16px; background:color-mix(in srgb,var(--bk-gold) 12%,transparent); color:var(--bk-gold-700);}
.bd-empty-ico svg{width:26px; height:26px;}
.bd-empty-block p{margin:0; color:var(--bk-muted); line-height:1.75; max-width:38ch;}

/* review form — rating field + horizontal pills */
.bd-rating-field{display:flex; flex-direction:column; gap:.55rem;}
.bd-rating-field>span{font-size:.85rem; font-weight:600; color:var(--bk-heading);}
.bd-form .bd-rating-group{display:flex; flex-wrap:wrap; gap:.5rem; align-items:center;}
.bd-form .bd-rating-group ul{display:flex; flex-wrap:wrap; gap:.5rem; list-style:none; margin:0; padding:0;}
.bd-form .bd-rating-group li{margin:0; list-style:none;}
.bd-form .bd-rating-group label{flex-direction:row; align-items:center; gap:.4rem; margin:0; padding:.5rem .85rem; border:1px solid var(--bk-border); border-radius:999px; background:var(--bk-bg); cursor:pointer; font-weight:500; font-size:.85rem; color:var(--bk-body); transition:border-color .2s var(--ease),background .2s var(--ease);}
.bd-form .bd-rating-group label:hover{border-color:var(--bk-gold); color:var(--bk-heading);}
.bd-form .bd-rating-group input{margin:0; width:auto; accent-color:var(--bk-brand); cursor:pointer;}

/* inputs crisper on the white card */
.bd-form input[type=text],.bd-form input[type=file],.bd-form textarea,.bd-form select{background:var(--bk-inset);}
.bd-form input[type=text]::placeholder,.bd-form textarea::placeholder{color:var(--bk-muted);}
.bd-form input[type=file]{padding:.6rem .85rem; font-size:.85rem; color:var(--bk-body);}


/* ============================================================
   v3 — comment section + rating + spacing
   ============================================================ */
.bd-empty-block{min-height:150px;}

/* rating: force horizontal pills regardless of Django wrapper (div OR ul) */
.bd-form .bd-rating-group,
.bd-form .bd-rating-group>ul,
.bd-form .bd-rating-group>div{display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin:0; padding:0; list-style:none;}
.bd-form .bd-rating-group li,
.bd-form .bd-rating-group>div>div{margin:0; padding:0; list-style:none; flex:0 0 auto;}
.bd-form .bd-rating-group label{display:inline-flex; flex-direction:row; align-items:center; gap:.4rem; margin:0; padding:.5rem .9rem; border:1px solid var(--bk-border); border-radius:999px; background:var(--bk-bg); cursor:pointer; font-weight:500; font-size:.85rem; color:var(--bk-body); white-space:nowrap; transition:border-color .2s var(--ease),background .2s var(--ease),color .2s var(--ease);}
.bd-form .bd-rating-group label:hover{border-color:var(--bk-gold); color:var(--bk-heading);}
.bd-form .bd-rating-group label:has(input:checked){background:linear-gradient(140deg,var(--bk-brand),#0f4a39); border-color:transparent; color:#FBF6EA;}
.bd-form .bd-rating-group input{margin:0; width:auto; accent-color:var(--bk-brand); cursor:pointer;}

/* review form rhythm + full-width submit */
.bd-form{gap:1rem;}
.bd-form .btn{margin-top:.5rem; align-self:stretch; text-align:center; justify-content:center;}


/* ============================================================
   v4 — flat tight rhythm + premium rating + refined form
   ============================================================ */
/* one calm background, compact spacing (kills the big colour-band gaps) */
.bd-section{padding:clamp(14px,1.6vw,26px) 0;}
.bd-section--inset{background:transparent;}
.bd-card{box-shadow:0 12px 32px -22px rgba(28,37,33,.30),0 1px 2px rgba(28,37,33,.03);}

/* compact, clean empty states (no inherited chip box) */
.bd-editions>div.bd-empty-block{background:transparent; border:0;}
.bd-empty-block{min-height:118px; gap:.6rem; padding:1.3rem 1rem;}
.bd-empty-ico{width:46px; height:46px; border-radius:13px;}
.bd-empty-ico svg{width:22px; height:22px;}

/* ---- premium star rating ---- */
.bd-rating-field{gap:.6rem;}
.bd-rating-field>span{font-size:.82rem; font-weight:600; color:var(--bk-muted);}
.bd-form .bd-rating-group{gap:.55rem;}
.bd-form .bd-rating-group label{position:relative;}
.bd-form .bd-rating-group input{position:absolute; appearance:none; -webkit-appearance:none; width:1px; height:1px; margin:0; opacity:0; pointer-events:none;}
.bd-form .bd-rating-group label{display:inline-flex; align-items:center; gap:.45rem; padding:.58rem 1rem; border:1.5px solid var(--bk-border); border-radius:12px; background:var(--bk-card); cursor:pointer; font-weight:600; font-size:.88rem; color:var(--bk-body); white-space:nowrap; transition:border-color .18s var(--ease),background .18s var(--ease),color .18s var(--ease),transform .18s var(--ease),box-shadow .18s var(--ease);}
.bd-form .bd-rating-group label::before{content:"★"; font-size:1rem; line-height:1; color:var(--bk-gold); transition:color .18s var(--ease);}
.bd-form .bd-rating-group label:hover{border-color:var(--bk-gold); background:color-mix(in srgb,var(--bk-gold) 8%,var(--bk-card)); transform:translateY(-1px);}
.bd-form .bd-rating-group label:has(input:checked){background:linear-gradient(140deg,var(--bk-brand),#0f4a39); border-color:transparent; color:#FBF6EA; box-shadow:0 10px 22px -12px rgba(15,74,57,.6);}
.bd-form .bd-rating-group label:has(input:checked)::before{color:#E7CE94;}

/* ---- refined form fields ---- */
.bd-form-intro{color:var(--bk-body); font-size:.92rem; line-height:1.75; margin:0 0 .2rem;}
.bd-form{gap:1.05rem;}
.bd-form label{gap:.45rem; font-size:.82rem; font-weight:600; color:var(--bk-muted);}
.bd-form input[type=text],.bd-form textarea,.bd-form select{padding:.8rem .95rem; border-radius:12px; border:1.5px solid var(--bk-border); background:var(--bk-card); color:var(--bk-heading); font-size:.95rem; font-weight:400;}
.bd-form textarea{min-height:128px; line-height:1.8;}
.bd-form input:focus,.bd-form textarea:focus,.bd-form select:focus{border-color:var(--bk-brand); box-shadow:0 0 0 3px color-mix(in srgb,var(--bk-brand) 12%,transparent);}
.bd-form .btn{margin-top:.5rem; padding-block:.85rem; font-size:.95rem;}


/* ============================================================
   v5 — independent stacking columns (TOC sits under Summary)
   ============================================================ */
.bd-col-main,.bd-col-side{display:flex; flex-direction:column; gap:clamp(1rem,1.8vw,1.45rem); min-width:0;}

/* ============================================================
   Reviews & ratings — refined panel (Fidibo-inspired)
   ============================================================ */
.bd-reviews-layout{display:grid; grid-template-columns:1.7fr 1fr; gap:clamp(1.2rem,2.5vw,2rem); align-items:start;}
@media (max-width:880px){ .bd-reviews-layout{grid-template-columns:1fr;} }
.bd-reviews-main{min-width:0;}
.bd-reviews-title{font-size:clamp(1.5rem,2.6vw,2rem); font-weight:800; color:var(--bk-heading); margin:0 0 1.3rem; line-height:1.4;}

/* rating summary */
.bd-rating-panel{display:grid; grid-template-columns:auto 1fr; gap:clamp(1.4rem,3vw,2.4rem); align-items:center;
  padding:clamp(1.3rem,2.6vw,1.9rem); margin-bottom:1.4rem; border-radius:var(--radius-lg);
  background:var(--bk-card); border:1px solid var(--bk-border); box-shadow:var(--shadow-soft);}
@media (max-width:560px){ .bd-rating-panel{grid-template-columns:1fr; gap:1.1rem; text-align:center;} }
.bd-rating-score{display:flex; flex-direction:column; align-items:center; gap:.4rem;
  padding-inline-end:clamp(1.4rem,3vw,2.4rem); border-inline-end:1px solid var(--bk-border);}
@media (max-width:560px){ .bd-rating-score{padding-inline-end:0; border-inline-end:0; padding-bottom:1.1rem; border-bottom:1px solid var(--bk-border);} }
.bd-rating-score__num{font-family:var(--font-main); font-size:clamp(2.6rem,6vw,3.4rem); font-weight:800; line-height:1; color:var(--bk-heading);}
.bd-rating-score__stars{position:relative; display:inline-block; font-size:1.15rem; letter-spacing:.1em; line-height:1;}
.bd-stars-track{color:color-mix(in srgb,var(--bk-gold) 26%,transparent);}
.bd-stars-fill{position:absolute; inset-block:0; inset-inline-start:0; width:calc(var(--rating,0)/5*100%); overflow:hidden; white-space:nowrap; color:var(--bk-gold);}
.bd-rating-score__count{font-size:.76rem; color:var(--bk-muted);}

/* distribution bars */
.bd-rating-bars{display:flex; flex-direction:column; gap:.5rem; min-width:0;}
.bd-rating-bar{display:grid; grid-template-columns:2.5rem 1fr 2.7rem; align-items:center; gap:.7rem;}
.bd-rating-bar__star{display:inline-flex; align-items:center; gap:.22rem; font-size:.84rem; font-weight:600; color:var(--bk-body); font-variant-numeric:tabular-nums;}
.bd-rating-bar__star i{color:var(--bk-gold); font-style:normal; font-size:.78rem;}
.bd-rating-bar__track{position:relative; height:9px; border-radius:999px; overflow:hidden; background:color-mix(in srgb,var(--bk-muted) 15%,transparent);}
.bd-rating-bar__track b{position:absolute; inset-block:0; inset-inline-start:0; width:0; border-radius:999px;
  background:linear-gradient(90deg,var(--bk-gold-700,#7a5e1f),var(--bk-gold)); transition:width .85s cubic-bezier(.2,.7,.2,1);}
.bd-rating-bar__pct{font-size:.74rem; color:var(--bk-muted); text-align:end; font-variant-numeric:tabular-nums;}

/* review cards */
.bd-review__top{display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.7rem; margin-bottom:.7rem;}
.bd-review__avatar{display:grid; place-items:center; width:42px; height:42px; border-radius:50%; font-family:var(--font-main); font-weight:800; font-size:1.05rem;
  color:#fff; background:linear-gradient(150deg,var(--bk-brand,#1b755b),color-mix(in srgb,var(--bk-brand,#1b755b) 58%,#000)); flex:0 0 auto;}
.bd-review__who{display:flex; flex-direction:column; gap:.12rem; min-width:0;}
.bd-review__who strong{color:var(--bk-heading); font-size:.94rem; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.bd-review__who time{color:var(--bk-muted); font-size:.72rem;}
.bd-review__stars{display:inline-flex; gap:.04rem; font-size:.9rem;}
.bd-review__stars i{font-style:normal; color:color-mix(in srgb,var(--bk-muted) 28%,transparent);}
.bd-review__stars i.is-on{color:var(--bk-gold);}
.bd-review__title{font-size:1rem; font-weight:700; color:var(--bk-heading); margin:0 0 .35rem;}
.bd-review__body{color:var(--bk-body); line-height:1.9; margin:0;}

/* review form card */
.bd-review-form-card{position:sticky; top:90px;}
@media (max-width:880px){ .bd-review-form-card{position:static; top:auto;} }
.bd-rating-field{display:flex; flex-direction:column; gap:.5rem;}
.bd-rating-field__label{font-size:.85rem; font-weight:600; color:var(--bk-heading);}
.bd-star-rating{display:inline-flex; gap:.2rem;}
.bd-star{font-size:1.75rem; line-height:1; color:color-mix(in srgb,var(--bk-muted) 30%,transparent); background:none; border:0; padding:0 .04rem; cursor:pointer; transition:transform .12s ease, color .12s ease;}
.bd-star:hover{transform:scale(1.12);}
.bd-star.is-on,.bd-star.is-hover{color:var(--bk-gold);}
.bd-rating-group.has-custom-stars > *:not(.bd-star-rating){position:absolute !important; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap;}

/* login prompt */
.bd-review-login{display:flex; flex-direction:column; align-items:center; text-align:center; gap:.9rem; padding:1.4rem .5rem;}
.bd-review-login__ico{display:grid; place-items:center; width:56px; height:56px; border-radius:16px; color:var(--bk-gold-700,#7a5e1f); background:color-mix(in srgb,var(--bk-gold) 12%,transparent);}
.bd-review-login__ico svg{width:28px; height:28px;}
.bd-review-login .bd-login-prompt{margin:0; color:var(--bk-muted); line-height:1.8; max-width:30ch;}

/* Unified library access model on book detail */
.bd-buybox--subscription{border-color:color-mix(in srgb,var(--bk-gold) 34%,var(--bk-border));background:linear-gradient(135deg,color-mix(in srgb,var(--bk-gold) 10%,var(--bk-card)),var(--bk-card));}
.bd-price--subscription{display:grid;gap:.2rem;}
.bd-price--subscription strong{font-size:1.34rem;color:var(--bk-heading);}
.bd-price--subscription span{color:var(--bk-muted);font-size:.88rem;line-height:1.75;}
@media (max-width:640px){.bd-buybox--subscription .bd-actions{display:grid;}.bd-buybox--subscription .btn{width:100%;justify-content:center;}}

/* ============================================================
   Book-detail redesign (v8): 3D cover + light, compact stats,
   flat two-col, prettier reviews
   ============================================================ */

/* ---- 3D cover: glossy light + hover flip-to-back ---- */
.bd-cover-stage .bk-flip-book__inner{transform:rotateY(-13deg) rotateX(3deg); transition:transform .7s cubic-bezier(.2,.85,.25,1);}
.bd-cover-stage .bk-flip-book.has-back:hover .bk-flip-book__inner{transform:rotateY(180deg);}
.bd-cover-stage .bk-flip-book:not(.has-back):hover .bk-flip-book__inner{transform:rotateY(0deg) scale(1.035);}
.bd-cover-stage .bk-flip-book__front::after{content:""; position:absolute; inset:0; z-index:4; pointer-events:none; border-radius:inherit;
  background:linear-gradient(118deg, transparent 30%, rgba(255,255,255,.30) 44%, rgba(255,255,255,.08) 52%, transparent 66%);}
.bd-cover-stage::before{content:""; left:50%; top:46%; transform:translate(-50%,-50%); width:88%; height:88%;
  background:radial-gradient(circle,rgba(231,206,148,.42),transparent 68%); filter:blur(38px);}
.bd-cover-stage::after{content:""; left:50%; bottom:-4px; transform:translateX(-50%); width:64%; height:26px;
  background:radial-gradient(ellipse,rgba(0,0,0,.58),transparent 72%); filter:blur(13px);}
@media (prefers-reduced-motion:reduce){
  .bd-cover-stage .bk-flip-book__inner{transition:none;}
}

/* ---- compact stats: keep price + buy button near the top ---- */
.bd-stats{gap:.5rem; margin-bottom:1rem;}
.bd-stat{padding:.5rem .55rem;}
.bd-stat span{font-size:.64rem; margin-bottom:.1rem;}
.bd-stat strong{font-size:1rem;}
.bd-stat small{font-size:.6rem; margin-top:.05rem;}
.bd-lead{margin-bottom:1.05rem; line-height:1.8;}
.bd-reactions{margin-bottom:1rem;}

/* ---- flat, tighter two-column section ---- */
.bd-two-col{gap:clamp(.85rem,1.8vw,1.3rem);}
.bd-col-main,.bd-col-side{gap:clamp(.8rem,1.4vw,1.05rem);}
.bd-two-col .bd-card{background:var(--bk-inset); border:1px solid var(--bk-border); box-shadow:none; border-radius:var(--radius-md); padding:clamp(1rem,2vw,1.35rem);}
.bd-two-col .bd-card h2{font-size:1.08rem; margin-bottom:.65rem;}
.bd-two-col .bd-specs dl div{padding:.5rem 0;}

/* ---- prettier reviews ---- */
.bd-reviews{gap:1rem;}
.bd-review{position:relative; padding:1.1rem 1.25rem; background:var(--bk-card); border:1px solid var(--bk-border);
  border-inline-start:3px solid color-mix(in srgb,var(--bk-gold) 55%,var(--bk-border)); border-radius:var(--radius-md);
  box-shadow:0 10px 26px -22px rgba(28,37,33,.4); transition:transform .3s var(--ease),box-shadow .3s var(--ease),border-color .3s var(--ease);}
.bd-review:hover{transform:translateY(-2px); box-shadow:0 16px 34px -22px rgba(28,37,33,.5); border-inline-start-color:var(--bk-gold);}
.bd-review__avatar{background:linear-gradient(140deg,var(--bk-gold,#A8812D),var(--bk-brand,#15614A)); box-shadow:0 5px 13px -5px rgba(168,129,45,.55);}
.bd-review__who strong{font-size:.98rem;}
.bd-review__title{font-size:1.04rem;}
.bd-review__body{line-height:1.95;}

/* ============================================================
   Book-detail v9: buybox up, fully flat, tighter, less 3D tilt
   ============================================================ */

/* tighter hero so price/buy/sample sit higher */
.bd-title{font-size:clamp(1.5rem,2.8vw,2.3rem); line-height:1.25; margin-bottom:.4rem;}
.bd-subtitle{margin-bottom:.55rem;}
.bd-authors{margin-bottom:.8rem;}
.bd-badges{margin-bottom:.75rem;}
.bd-lead{margin-bottom:.85rem; line-height:1.72; max-width:62ch;}
.bd-stats{margin-bottom:.85rem;}
.bd-buybox{margin-bottom:1rem;}

/* less 3D tilt on the cover */
.bd-cover-stage .bk-flip-book__inner{transform:rotateY(-7deg) rotateX(1.5deg);}

/* fully flat boxes in the light sections (no shadows, no hover lift) */
.bd-card{box-shadow:none;}
.bd-rating-panel{box-shadow:none;}
.bd-review{box-shadow:none;}
.bd-review:hover{transform:none; box-shadow:none; border-inline-start-color:var(--bk-gold);}

/* tighter + aligned two-column section */
.bd-two-col{gap:clamp(.7rem,1.4vw,1.1rem); align-items:start;}
.bd-col-main,.bd-col-side{gap:clamp(.7rem,1.2vw,.95rem);}
.bd-two-col .bd-card{padding:clamp(.9rem,1.7vw,1.2rem);}
.bd-two-col .bd-card h2{font-size:1.05rem; margin-bottom:.55rem;}
.bd-specs dl>div{padding:.5rem 0;}
.bd-toc li{padding-top:.45rem; padding-bottom:.45rem;}

/* tighter reviews / ratings */
.bd-reviews-layout{gap:clamp(1rem,2vw,1.5rem);}
.bd-reviews-title{margin-bottom:1rem;}
.bd-rating-panel{margin-bottom:1.1rem; padding:clamp(1.1rem,2.2vw,1.5rem);}

/* ============================================================
   Book-detail v10: less header gap, de-boxed summary, passing shine
   ============================================================ */

/* (1) smaller gap between fixed header and hero content */
.bd-hero{padding-top:calc(74px + clamp(1rem,2.2vw,1.6rem)); padding-bottom:clamp(1.8rem,3.5vw,2.8rem);}
@media (max-width:620px){ .bd-hero{margin-top:-64px; padding-top:calc(64px + clamp(.8rem,2vw,1.1rem)); padding-bottom:2rem;} }

/* (2) de-box the summary — stats become a clean divided row, buybox loses its card */
.bd-stats{gap:0; background:none; border:none; margin-bottom:1rem;}
.bd-stat{background:none; border:none; border-radius:0; padding:.3rem .7rem;}
.bd-stat:not(:last-child){border-inline-end:1px solid rgba(231,206,148,.16);}
.bd-buybox{background:none; border:none; box-shadow:none; backdrop-filter:none; border-radius:0;
  padding:1.05rem 0 0; border-top:1px solid rgba(231,206,148,.2); gap:1rem 1.4rem;}

/* (3) cover: one light that sweeps across and passes (not a static highlight) */
.bd-cover-stage .bk-flip-book__front::after{inset:auto; top:-25%; left:-160%; width:55%; height:150%;
  transform:rotate(10deg); border-radius:0; background:linear-gradient(100deg,transparent,rgba(255,255,255,.5) 50%,transparent);
  animation:bdShine 5.5s ease-in-out 1.4s infinite;}
@keyframes bdShine{0%{left:-160%;} 16%,100%{left:170%;}}
@media (prefers-reduced-motion:reduce){ .bd-cover-stage .bk-flip-book__front::after{animation:none; opacity:0;} }

/* ============================================================
   Book-detail v11: flat & aligned reviews / ratings section
   ============================================================ */

/* flat rating panel (sand, no shadow) */
.bd-rating-panel{background:var(--bk-inset); border:1px solid var(--bk-border); box-shadow:none; border-radius:var(--radius-md); padding:clamp(1rem,2.1vw,1.45rem); margin-bottom:1rem;}
.bd-rating-score{border-inline-end-color:color-mix(in srgb,var(--bk-gold) 22%,var(--bk-border));}
.bd-rating-bars{gap:.45rem;}
.bd-rating-bar__track{background:color-mix(in srgb,var(--bk-muted) 12%,transparent);}

/* flat review-form card (sand, no shadow) */
.bd-review-form-card{background:var(--bk-inset); box-shadow:none; border:1px solid var(--bk-border); border-radius:var(--radius-md); padding:clamp(1.1rem,2vw,1.5rem);}

/* flat review cards (sand + subtle gold accent, no shadow, no lift) */
.bd-review{background:var(--bk-inset); box-shadow:none; border:1px solid var(--bk-border);
  border-inline-start:3px solid color-mix(in srgb,var(--bk-gold) 50%,var(--bk-border)); padding:1rem 1.15rem;}
.bd-review:hover{transform:none; box-shadow:none; border-inline-start-color:var(--bk-gold);}
.bd-review__avatar{box-shadow:none;}

/* aligned + tighter spacing */
.bd-reviews-layout{gap:clamp(1rem,2vw,1.6rem); align-items:start;}
.bd-reviews-title{margin:0 0 .9rem;}
.bd-reviews{gap:.8rem;}
.bd-review__top{margin-bottom:.55rem;}

/* ============================================================
   Book-detail v12: clean WHITE flat cards (not sand) + polish
   ============================================================ */

/* white, flat cards everywhere — thin border, whisper shadow, no heavy depth */
.bd-card{background:var(--bk-card); border:1px solid var(--bk-border); box-shadow:0 1px 2px rgba(28,37,33,.04);}
.bd-two-col .bd-card{background:var(--bk-card);}
.bd-rating-panel{background:var(--bk-card); border:1px solid var(--bk-border); box-shadow:0 1px 2px rgba(28,37,33,.04);}
.bd-review-form-card{background:var(--bk-card); border:1px solid var(--bk-border); box-shadow:0 1px 2px rgba(28,37,33,.04);}

/* review cards — white, flat, refined (subtle gold edge) */
.bd-review{background:var(--bk-card); border:1px solid var(--bk-border); box-shadow:0 1px 2px rgba(28,37,33,.04);
  border-inline-start:3px solid color-mix(in srgb,var(--bk-gold) 48%,var(--bk-border)); border-radius:var(--radius-md); padding:1.1rem 1.25rem;}
.bd-review:hover{transform:none; box-shadow:0 1px 2px rgba(28,37,33,.04); border-inline-start-color:var(--bk-gold);}
.bd-review__avatar{background:linear-gradient(145deg,var(--bk-brand,#15614A),var(--bk-brand-700,#124E3B)); color:var(--bk-lux-gold-a,#E7CE94); box-shadow:none; width:40px; height:40px; font-size:1.05rem;}
.bd-review__top{margin-bottom:.55rem; gap:.65rem;}
.bd-review__who strong{color:var(--bk-heading);}
.bd-review__who time{color:var(--bk-muted);}
.bd-review__body{color:var(--bk-body); line-height:1.9;}

/* clean rating bars + crisp form fields on white */
.bd-rating-bars{gap:.5rem;}
.bd-rating-bar__track{background:color-mix(in srgb,var(--bk-muted) 12%,transparent);}
.bd-form input[type=text],.bd-form textarea,.bd-form select{background:var(--bk-card); border-color:color-mix(in srgb,var(--bk-border) 85%,var(--bk-muted));}

/* ============================================================================
   v13 · decorative glowing open-book on the right of the hero (desktop only)
   starts at the very top of the page, large, dim — hidden on tablet/mobile
   ============================================================================ */
.bd-hero__art{
  position:absolute; top:0; bottom:0; right:0;
  width:clamp(380px,44vw,680px); z-index:0; pointer-events:none;
  opacity:.6;
  -webkit-mask-image:linear-gradient(to left, #000 0%, #000 44%, transparent 92%);
          mask-image:linear-gradient(to left, #000 0%, #000 44%, transparent 92%);
}
.bd-hero__art svg{ display:block; width:100%; height:100%; }
/* refined glowing open book, anchored to the right, fading out toward the text;
   hidden on tablet/mobile */
@media (max-width:1024px){ .bd-hero__art{ display:none; } }

/* ============================================================================
   v14 · book-detail refinements
   (1) hero book: dimmer / flush-right / hidden <=1100 (above)
   (2) author line: icon + "نویسنده:" label
   (3) review form moved to the RIGHT, reviews list to the LEFT
   ============================================================================ */

/* (2) author line — icon + label */
.bd-authors__icon{display:inline-block; width:1.1em; height:1.1em; vertical-align:-.2em; color:#E7C67C; margin-inline-end:.4rem;}
.bd-authors__label{color:rgba(251,246,234,.56); font-weight:600; margin-inline-end:.32rem;}

/* (3) form + reviews live in the RIGHT/main column — same width & alignment
       as bd-col-main above (1.65fr 1fr); left column stays empty.
       form on top, reviews below; collapses to full width on mobile. */
.bd-reviews-layout{ grid-template-columns:1.65fr 1fr; align-items:start; }
.bd-review-form-card{ grid-column:1; grid-row:1; order:-1; position:static; top:auto; }
.bd-reviews-main{ grid-column:1; grid-row:2; }
@media (max-width:880px){
  .bd-reviews-layout{ grid-template-columns:1fr; }
  .bd-review-form-card,.bd-reviews-main{ grid-column:1; }
}
