/*
Theme Name: Astris
Theme URI: https://astrispublishing.company
Author: Astris
Description: A theme for Astris Publishing. Books are a custom post type, the basket and Stripe checkout are built in, and Settings then Astris builds every page in one click. No page builder and no plugins required.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: astris
*/


/* Light by design: this page commits to one palette and paints every surface,
   so it looks the same whatever theme the viewer's browser is set to. */
:root{
  --chip-bg:#FFF5E2;
  --chip-line:#DBA845;
  --chip-ink:#8A6116;
  --shadow-sm:0 1px 2px rgba(14,20,23,.05);
  --shadow:0 12px 30px -14px rgba(14,20,23,.22), 0 2px 5px rgba(14,20,23,.05);
}

/* ============ palette ============ */
:root{
  --bg:#FFFFFF; --bg-2:#FAF7FA; --bg-3:#F3ECF3;
  --ink:#170F16; --ink-2:#433842; --muted:#786A76;
  --line:#EDE5EC; --line-2:#DCCFDA;
  --accent:#7B2D6B; --accent-dark:#5D2050; --accent-wash:#F6EAF3;
  --t1:#F0E6F0; --t2:#EDE3F3; --t3:#E6F0E9; --t4:#F7EADF; --t5:#FBE6EC; --t6:#E7EEF3;
}

*{box-sizing:border-box}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:"Instrument Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-size:16.5px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
}
a{color:var(--accent);text-decoration:none}
a:hover{color:var(--accent-dark);text-decoration:underline;text-underline-offset:3px}
:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}

/* ---------------- top bar ---------------- */
.topbar{
  position:sticky;top:0;z-index:20;
  background:rgba(255,255,255,.9);
  backdrop-filter:saturate(1.5) blur(10px);
  -webkit-backdrop-filter:saturate(1.5) blur(10px);
  border-bottom:1px solid var(--line);
}
.topbar-in{
  max-width:1060px;margin:0 auto;padding:22px 28px 13px;
  display:flex;flex-direction:column;align-items:center;gap:13px;
}
.brand{
  display:flex;align-items:center;gap:12px;
  font-weight:700;font-size:33px;letter-spacing:-.025em;
  color:var(--ink);text-decoration:none;
}
.brand:hover{color:var(--ink);text-decoration:none}
.mark{
  width:53px;height:33px;flex:none;
  color:var(--accent);
  overflow:visible;
}
.mark .link{stroke:currentColor;stroke-width:.9;fill:none;opacity:.42;stroke-linecap:round;stroke-linejoin:round}
.mark .star{fill:currentColor}
.nav{display:flex;flex-wrap:wrap;justify-content:center;gap:2px}
.nav a{
  font-size:14.5px;font-weight:500;color:var(--muted);
  padding:6px 12px;border-radius:7px;text-decoration:none;
}
.nav a:hover{color:var(--ink);background:var(--bg-2);text-decoration:none}
.nav a[aria-current="page"]{color:var(--accent);background:var(--accent-wash)}

/* ---------------- frame ---------------- */
main{max-width:1060px;margin:0 auto;padding:0 28px}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.doc{max-width:70ch}

h1{font-size:54px;font-weight:600;letter-spacing:-.035em;line-height:1.06;text-wrap:balance;margin:0 0 20px}
h1 em{font-family:"Instrument Serif",Georgia,serif;font-style:italic;font-weight:400;letter-spacing:-.01em}
h2{font-size:25px;font-weight:600;letter-spacing:-.022em;line-height:1.28;text-wrap:balance;margin:0 0 12px}
h3{font-size:17px;font-weight:600;letter-spacing:-.012em;margin:0 0 5px}
p{margin:0 0 16px}
.lede{font-size:20.5px;line-height:1.55;color:var(--ink-2);margin:0}
.small{font-size:14.5px;line-height:1.6}
.muted{color:var(--muted)}
ul{margin:0 0 16px;padding-left:20px;display:flex;flex-direction:column;gap:8px}

.btn{
  display:inline-block;
  background:var(--accent);color:#fff;
  font-size:15.5px;font-weight:600;
  padding:11px 22px;border-radius:9px;
  border:0;cursor:pointer;font-family:inherit;
  margin-top:26px;
}
.btn:hover{background:var(--accent-dark);color:#fff;text-decoration:none}
.btn.ghost{background:none;color:var(--accent);border:1px solid var(--line-2);padding:10px 21px}
.btn.ghost:hover{background:var(--accent-wash);color:var(--accent-dark)}

/* ---------------- home ---------------- */
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

.t1{background:var(--t1)}.t2{background:var(--t2)}.t3{background:var(--t3)}
.t4{background:var(--t4)}.t5{background:var(--t5)}.t6{background:var(--t6)}

.label{
  font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.13em;
  color:var(--muted);margin:0 0 22px;
}

/* the homepage shelf */
.intro{padding:74px 0 0;text-align:center}
.intro p{
  font-family:"Petrona",Georgia,"Times New Roman",serif;
  font-size:clamp(33px,5.2vw,52px);
  font-weight:500;
  line-height:1.14;
  letter-spacing:-.012em;
  text-wrap:balance;
  color:var(--ink);
  margin:0 auto;
  max-width:19ch;
}

.shelf{
  margin:44px 0 0;padding-top:40px;border-top:1px solid var(--line);
  display:grid;grid-template-columns:repeat(auto-fit,minmax(158px,1fr));gap:30px 20px;
}
.mini{display:flex;flex-direction:column;gap:9px;cursor:pointer}
.mini-art{
  display:block;width:100%;aspect-ratio:2/3;object-fit:cover;
  border-radius:3px;background:var(--bg-2);
  box-shadow:var(--shadow-sm);
  transition:box-shadow .25s ease, transform .25s ease;
}
.mini:hover .mini-art{box-shadow:var(--shadow);transform:translateY(-3px)}
@media (prefers-reduced-motion:reduce){.mini-art{transition:none}.mini:hover .mini-art{transform:none}}
.mini-meta{display:flex;flex-direction:column;gap:2px}
.mini-meta b{font-size:14px;font-weight:600;line-height:1.3;letter-spacing:-.012em;text-wrap:balance}
.mini-meta em{font-style:normal;font-size:12.5px;color:var(--muted)}
.mini-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:8px}
.mini-price{font-size:13.5px;font-weight:600;font-variant-numeric:tabular-nums}
.add-cart.sm{width:32px;height:28px;border-radius:7px}
.add-cart.sm svg{width:16px;height:16px}

.shelf-more{margin-top:40px;text-align:center}
.shelf-more .btn{margin-top:0}

/* ---------------- library ---------------- */
.page-head{padding:72px 0 0;max-width:60ch}
.page-head h1{font-size:42px}
.page-head .lede{font-size:19px}

.subject{padding:52px 0 0;border-top:1px solid var(--line);margin-top:52px}
.subject:first-of-type{border-top:0;margin-top:36px;padding-top:0}
.subject-head{display:flex;align-items:baseline;gap:14px;flex-wrap:wrap;margin-bottom:20px}
.subject-head h2{margin:0}
.subject-head span{font-size:14.5px;color:var(--muted)}

.books{display:grid;grid-template-columns:repeat(auto-fit,minmax(226px,1fr));gap:20px}
.book{
  border:1px solid var(--line);border-radius:13px;overflow:hidden;
  background:var(--bg);box-shadow:var(--shadow-sm);
  display:flex;flex-direction:column;
  transition:box-shadow .25s ease, transform .25s ease;
}
.book:hover{box-shadow:var(--shadow);transform:translateY(-2px)}
@media (prefers-reduced-motion:reduce){.book{transition:none}.book:hover{transform:none}}
.book-art{
  display:block;width:100%;aspect-ratio:2/3;object-fit:cover;
  background:var(--bg-2);
}
.book-body{padding:16px 18px 18px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:6px;flex:1}
.book-body h3{margin:0;font-size:16px;line-height:1.3;letter-spacing:-.015em;text-wrap:balance}
.book-body p{margin:0;font-size:14px;line-height:1.55;color:var(--muted)}
.book-body p.by{font-size:13px;color:var(--ink-2);margin-bottom:4px}
.book-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;padding-top:6px}
.book-price{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums}
.book-buy{
  font-size:13.5px;font-weight:600;color:var(--accent);
  border:1px solid var(--line-2);border-radius:7px;padding:5px 12px;
  background:none;cursor:pointer;font-family:inherit;
}
.book-buy:hover{background:var(--accent-wash);border-color:var(--accent)}
.add-cart{
  display:inline-flex;align-items:center;justify-content:center;
  width:38px;height:33px;
  color:var(--accent);
  border:1px solid var(--line-2);border-radius:8px;
  background:none;cursor:pointer;
  transition:background .18s ease, border-color .18s ease;
}
.add-cart:hover{background:var(--accent-wash);border-color:var(--accent)}
.add-cart svg{width:18px;height:18px;display:block}
@media (prefers-reduced-motion:reduce){.add-cart{transition:none}}

/* ---------------- documents ---------------- */
.clauses{display:flex;flex-direction:column;gap:38px;margin-top:46px}
.clause h2{font-size:19px;margin-bottom:8px}
.clause h2 .num{color:var(--accent);font-variant-numeric:tabular-nums;margin-right:9px;font-weight:600}
.clause p:last-child,.clause ul:last-child{margin-bottom:0}

.panel{border:1px solid var(--line);border-radius:13px;background:var(--bg-2);padding:8px 26px;margin-bottom:18px}
.kv{display:grid;grid-template-columns:186px minmax(0,1fr);font-size:15.5px}
.kv dt{
  font-size:12.5px;text-transform:uppercase;letter-spacing:.09em;
  color:var(--muted);font-weight:600;padding:15px 18px 15px 0;border-bottom:1px solid var(--line);
}
.kv dd{margin:0;padding:14px 0;border-bottom:1px solid var(--line)}
.kv > :nth-last-child(1), .kv > :nth-last-child(2){border-bottom:0}

.tbc{
  font-size:.92em;font-weight:500;color:var(--chip-ink);background:var(--chip-bg);
  border:1px dashed var(--chip-line);padding:1px 7px;border-radius:5px;white-space:nowrap;
}
.note{background:var(--accent-wash);border-radius:10px;padding:16px 20px;font-size:15px;color:var(--ink-2);margin-top:20px}
.note p:last-child{margin:0}

table{border-collapse:collapse;width:100%;font-size:15px;margin:8px 0 0}
.tablewrap{overflow-x:auto}
th,td{text-align:left;padding:12px 18px 12px 0;border-bottom:1px solid var(--line);vertical-align:top}
th{font-size:12px;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);font-weight:600;border-bottom:1px solid var(--line-2)}

.updated{font-size:13.5px;color:var(--muted);margin:56px 0 0;padding-top:18px;border-top:1px solid var(--line)}

/* ---------------- footer ---------------- */
footer{border-top:1px solid var(--line);margin-top:96px;background:var(--bg-2)}
.footer-in{
  max-width:1060px;margin:0 auto;padding:48px 28px 40px;
  display:grid;grid-template-columns:1fr 1fr 1.2fr 1.3fr;gap:36px 32px;
  font-size:14.5px;color:var(--muted);
}
.foot-col{display:flex;flex-direction:column;align-items:flex-start;gap:9px}
.foot-col h4{margin:0 0 2px;font-size:12px;font-weight:600;text-transform:uppercase;letter-spacing:.09em;color:var(--ink)}
.foot-col p{margin:0;line-height:1.6;max-width:34ch}
.foot-col a{
  font-size:14.5px;color:var(--muted);text-decoration:none;
}
.foot-col a:hover{color:var(--accent);text-decoration:underline;text-underline-offset:3px}
.foot-brand{display:flex;align-items:center;gap:9px;font-weight:700;font-size:17px;letter-spacing:-.02em;color:var(--ink);margin-bottom:2px;text-decoration:none}
.foot-brand:hover{color:var(--ink);text-decoration:none}
.foot-brand .mark{width:30px;height:19px}
.footer-base{border-top:1px solid var(--line)}
.footer-base span{display:block;max-width:1060px;margin:0 auto;padding:18px 28px 40px;font-size:13.5px;color:var(--muted)}

@media (max-width:760px){
  main,.topbar-in,.footer-in{padding-left:20px;padding-right:20px}
  .topbar-in{padding:18px 20px 10px;gap:10px}
  .brand{font-size:25px}
  .mark{width:41px;height:26px}
  .intro{padding-top:44px}
  h1{font-size:38px}
  .page-head h1{font-size:32px}
  .lede{font-size:18px}
  .shelf{gap:24px 14px;grid-template-columns:repeat(auto-fit,minmax(132px,1fr))}
  .kv{grid-template-columns:1fr}
  .kv dt{padding-bottom:0;border-bottom:0}
  .kv dd{padding-top:2px}
  .panel{padding:6px 20px}
  .footer-in{grid-template-columns:1fr 1fr;gap:30px 24px;padding:36px 20px 28px}
  .foot-about{grid-column:1 / -1}
  .footer-base span{padding:16px 20px 34px}
}


/* ================= WordPress additions ================= */

/* the theme never prints a page title: every page carries its own headline
   inside the content, so anything WordPress or a plugin injects is hidden */
.page .entry-title,
.page-title,
.wp-block-post-title{display:none}

.screen-reader-text{
  position:absolute;width:1px;height:1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;
}

.skip-link{
  position:absolute;left:-9999px;top:0;z-index:99;
  background:var(--accent);color:#fff;padding:10px 16px;border-radius:0 0 8px 0;
}
.skip-link:focus{left:0;color:#fff}

/* basket link in the masthead */
.basket-link{
  position:relative;display:inline-flex;align-items:center;gap:7px;
  font-size:14.5px;font-weight:500;color:var(--muted);
  padding:6px 12px;border-radius:7px;text-decoration:none;
}
.basket-link:hover{color:var(--ink);background:var(--bg-2);text-decoration:none}
.basket-link svg{width:17px;height:17px}
.basket-count{
  min-width:19px;height:19px;padding:0 5px;
  display:inline-grid;place-items:center;
  background:var(--accent);color:#fff;
  font-size:11.5px;font-weight:700;line-height:1;border-radius:100px;
  font-variant-numeric:tabular-nums;
}
.basket-count[hidden]{display:none}

/* toast shown when a book is added */
.toast{
  position:fixed;left:50%;bottom:26px;transform:translateX(-50%) translateY(12px);
  background:var(--ink);color:#fff;
  font-size:14.5px;font-weight:500;
  padding:11px 20px;border-radius:10px;
  box-shadow:0 14px 34px -12px rgba(0,0,0,.45);
  opacity:0;pointer-events:none;transition:opacity .22s ease, transform .22s ease;
  z-index:80;max-width:calc(100vw - 40px);
}
.toast.on{opacity:1;transform:translateX(-50%) translateY(0)}
@media (prefers-reduced-motion:reduce){.toast{transition:none}}

.add-cart[disabled]{opacity:.55;cursor:default}

/* ---------------- single book ---------------- */
.book-single{
  padding:64px 0 0;
  display:grid;grid-template-columns:320px minmax(0,1fr);gap:56px;align-items:start;
}
.book-single .cover{
  width:100%;border-radius:5px;display:block;
  box-shadow:var(--shadow);
}
.book-single h1{font-size:40px;margin-bottom:8px}
.book-single .by{font-size:16px;color:var(--muted);margin:0 0 26px}
.book-single .blurb{font-size:17.5px;line-height:1.65;color:var(--ink-2);max-width:56ch}
.book-single .buy{
  display:flex;align-items:center;gap:16px;flex-wrap:wrap;
  margin-top:30px;padding-top:26px;border-top:1px solid var(--line);
}
.book-single .buy .price{font-size:24px;font-weight:600;font-variant-numeric:tabular-nums}
.book-single .buy .btn{margin-top:0}
.book-single .note{margin-top:20px}

/* ---------------- basket ---------------- */
.basket{padding:64px 0 0;max-width:760px}
.basket h1{font-size:42px;margin-bottom:26px}
.basket-empty{font-size:18px;color:var(--muted)}
.basket-row{
  display:grid;grid-template-columns:64px minmax(0,1fr) auto;gap:20px;align-items:center;
  padding:18px 0;border-bottom:1px solid var(--line);
}
.basket-row:first-of-type{border-top:1px solid var(--line)}
.basket-row img{width:64px;border-radius:3px;display:block;box-shadow:var(--shadow-sm)}
.basket-row .t{font-weight:600;font-size:16px;letter-spacing:-.012em}
.basket-row .a{font-size:13.5px;color:var(--muted)}
.basket-row .right{display:flex;align-items:center;gap:16px}
.basket-row .line{font-size:16px;font-weight:600;font-variant-numeric:tabular-nums}
.qty{display:flex;align-items:center;gap:6px}
.qty button{
  width:28px;height:28px;border:1px solid var(--line-2);border-radius:7px;
  background:none;color:var(--ink);font:inherit;font-size:15px;line-height:1;cursor:pointer;
}
.qty button:hover{background:var(--bg-2);border-color:var(--accent)}
.qty span{min-width:20px;text-align:center;font-variant-numeric:tabular-nums;font-size:14.5px}
.basket-remove{
  background:none;border:0;padding:0;cursor:pointer;font:inherit;
  font-size:13.5px;color:var(--muted);text-decoration:underline;text-underline-offset:3px;
}
.basket-remove:hover{color:var(--accent)}
.basket-total{
  display:flex;align-items:baseline;justify-content:space-between;gap:20px;
  padding:24px 0 0;font-size:20px;font-weight:600;
}
.basket-total span:last-child{font-variant-numeric:tabular-nums}
.basket-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:8px}
.basket-note{font-size:14px;color:var(--muted);margin-top:18px}
.basket-error{
  background:#FCEBEA;border:1px solid #E9C0BC;color:#8A2B22;
  border-radius:10px;padding:14px 18px;font-size:15px;margin-bottom:24px;
}

@media (max-width:760px){
  .book-single{grid-template-columns:1fr;gap:26px;padding-top:36px}
  .book-single .cover{max-width:230px}
  .book-single h1{font-size:30px}
  .basket-row{grid-template-columns:52px minmax(0,1fr);gap:14px}
  .basket-row img{width:52px}
  .basket-row .right{grid-column:1 / -1;justify-content:space-between}
}
