/* Colours and fonts carried over from the original Auteur theme settings. */
:root {
  --ink: #222;
  --text: #4a4a4a;
  --muted: #696969;
  --line: #dedcd0;
  --cream: #f4f3ec;
  --paper: #fff;
  --dark: #333;
  --darker: #1f1f1f;
  --on-dark: #e6e6e6;
  --gold: #c5a374;
  --gold-text: #7a5f33;
  --accent: #cf4329;
  --serif: "Libre Baskerville", "Noto Serif Bengali", Georgia, serif;
  --sans: "Nunito Sans", "Noto Sans Bengali", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 400 1rem/1.9 var(--sans);
}

/* Bengali has no true italic, so emphasis uses weight instead. */
em { font-style: normal; font-weight: 600; }

img { display: block; max-width: 100%; height: auto; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

h1, h2, h3 {
  margin: 0 0 .6em;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.4;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.3rem); }
h3 { font-size: 1.1rem; }

ul, ol { margin: 0; padding: 0; list-style: none; }
p { margin: 0 0 1.2em; }

.container { width: min(1200px, 100% - 2rem); margin-inline: auto; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: .5rem 1rem;
  background: var(--paper);
}
.skip-link:focus { top: .5rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: .7em 1.6em;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font: 700 .95rem/1.5 var(--sans);
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s, border-color .2s, color .2s;
}
.btn:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn-outline { border-color: var(--ink); background: transparent; color: var(--ink); }

/* Header */
.site-header { position: sticky; top: 0; z-index: 10; background: #222; }

.bar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 1rem;
  width: min(1200px, 100% - 2rem);
  min-height: 4.5rem;
  margin-inline: auto;
}

.logo {
  margin-right: auto;
  color: #fff;
  font: 400 1.3rem/1.4 var(--serif);
  text-decoration: none;
  white-space: nowrap;
}
.logo:hover { color: var(--gold); }

.nav-toggle {
  order: 1;
  padding: .3rem .8rem;
  border: 1px solid #777;
  background: none;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.site-nav { display: none; order: 2; width: 100%; padding-bottom: 1rem; }
.site-nav.is-open { display: block; }
.site-nav a { display: block; padding: .45rem 0; color: #ddd; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--gold); }

@media (min-width: 900px) {
  .bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 2.5rem; }
  .logo { grid-area: 1 / 2; margin: 0; font-size: 1.5rem; }
  .nav-toggle { display: none; }
  .site-nav { display: contents; }
  .site-nav ul { display: flex; gap: 2rem; }
  .nav-left { grid-area: 1 / 1; justify-content: flex-end; }
  .nav-right { grid-area: 1 / 3; }
}

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 6rem); }
.section-cream { background: var(--cream); }
.section-dark { background: var(--dark); color: var(--on-dark); }
.section-dark h2 { color: #fff; }
.section-heading { margin-bottom: 2.5rem; text-align: center; }
.section-heading h2 { margin: 0; }
.section-action { margin: 2.5rem 0 0; text-align: center; }

.kicker { margin: 0 0 .4rem; color: var(--gold-text); font-weight: 700; font-size: .95rem; }
.section-dark .kicker { color: var(--gold); }

.page-title { padding-block: clamp(2rem, 5vw, 3.5rem); background: var(--cream); }
.page-title h1 { margin: 0; }

.prose { max-width: 70ch; }

/* Home */
.hero {
  display: grid;
  align-items: end;
  min-height: clamp(26rem, 62vw, 54rem);
  padding-bottom: 1.5rem;
  background: linear-gradient(to bottom, transparent 55%, var(--dark)), var(--dark) url("../img/hero-sm.webp") center top / cover no-repeat;
  color: #fff;
  text-align: center;
}
.hero h1 { margin-bottom: .4rem; color: #fff; }

@media (min-width: 701px) {
  .hero { background-image: linear-gradient(to bottom, transparent 55%, var(--dark)), url("../img/hero.webp"); }
}

.jobs { display: flex; flex-wrap: wrap; justify-content: center; gap: .1rem 1.2rem; color: var(--gold); }
.jobs li + li::before { content: "·"; margin-right: 1.2rem; }

.intro { padding-top: 2.5rem; }
.intro-grid { display: grid; gap: 3rem; }
.intro-grid .kicker { margin-top: 2.5rem; }

.portrait { margin: 0; max-width: 26rem; justify-self: center; }
.portrait blockquote {
  margin: 1.5rem 0 0;
  padding: 1.5rem;
  border: 2px solid rgb(255 255 255 / .3);
  color: #fff;
  font: 400 1.2rem/1.9 var(--serif);
  text-align: center;
}
.portrait blockquote p { margin: 0; }
.portrait blockquote p::before { content: "“"; color: var(--gold); }
.portrait blockquote p::after { content: "”"; color: var(--gold); }

@media (min-width: 900px) {
  .intro-grid { grid-template-columns: 3fr 2fr; align-items: start; }
}

.praise { background: var(--darker) url("../img/feather.webp") center / cover no-repeat; }
.praise-grid { display: grid; gap: 3rem; }
.praise blockquote { margin: 0; text-align: center; }
.praise blockquote p { color: #fff; font: 400 1.15rem/1.95 var(--serif); }
.praise cite { display: block; color: var(--gold); font-style: normal; font-weight: 600; }
.praise blockquote span { font-size: .9rem; }

@media (min-width: 800px) { .praise-grid { grid-template-columns: 1fr 1fr; } }

/* Rails: native scroll-snap, arrows are only an extra */
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(10.5rem, calc((100% - 7.5rem) / 6));
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x proximity;
}
.rail > li { scroll-snap-align: start; }
.rail-wide { grid-auto-columns: minmax(16rem, calc((100% - 3rem) / 3)); }

.rail-nav { display: flex; justify-content: center; gap: .5rem; margin-top: 1rem; }
.rail-nav[hidden] { display: none; }
.rail-nav button {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-size: 1.1rem;
  cursor: pointer;
}
.rail-nav button:hover { background: var(--ink); color: #fff; }

/* Book cards */
.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 45%), 1fr)); gap: 2.5rem 1.5rem; }
.book-grid > li[hidden] { display: none; }

.book-card { text-align: center; }
.book-card :is(h2, h3) { margin: .9rem 0 .3rem; font-size: 1.05rem; line-height: 1.6; }
.book-card :is(h2, h3) a { color: var(--ink); text-decoration: none; }
.book-card :is(h2, h3) a:hover { color: var(--accent); }
.book-card .price { margin: 0 0 .3rem; }

.book-cover { display: block; aspect-ratio: 2 / 3; }
.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom;
  filter: drop-shadow(0 6px 10px rgb(0 0 0 / .28));
  transition: transform .25s;
}
.book-cover:hover img { transform: translateY(-4px); }

.price { color: var(--ink); }
.price del { color: var(--muted); font-size: .9em; }
.out-of-stock { color: var(--muted); }
.buy-link { font-size: .9rem; font-weight: 700; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-bottom: 2.5rem; }
.filters[hidden] { display: none; }
.filters button {
  padding: .4em 1.1em;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

/* Book page */
.breadcrumb { display: flex; flex-wrap: wrap; font-size: .95rem; }
.breadcrumb li + li::before { content: "/"; margin-inline: .5rem; color: var(--muted); }
.breadcrumb a { color: var(--ink); }

.book-detail { display: grid; gap: 2.5rem; align-items: start; }
.book-detail-cover { width: min(20rem, 100%); justify-self: center; box-shadow: 0 12px 28px rgb(0 0 0 / .25); }

.book-facts { margin: 0 0 1.5rem; padding-block: 1rem; border-block: 1px solid var(--line); }
.book-facts > div { display: flex; gap: .75rem; }
.book-facts dt { min-width: 5rem; color: var(--muted); }
.book-facts dd { margin: 0; }
.book-facts .price { font-size: 1.15rem; }

.buy-heading { margin: 2rem 0 1rem; font-size: 1.2rem; }
.buy-buttons { display: flex; flex-wrap: wrap; gap: .6rem; }

@media (min-width: 800px) {
  .book-detail { grid-template-columns: 20rem 1fr; gap: 4rem; }
}

/* Articles */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 2.5rem 2rem; }

.article-card a { display: block; color: inherit; text-decoration: none; }
.article-card h3 { margin: .25rem 0 .5rem; line-height: 1.6; }
.article-card a:hover h3 { color: var(--accent); }

.article-media {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  margin-bottom: 1rem;
  overflow: hidden;
  background: var(--cream);
}
.article-media img { width: 100%; height: 100%; object-fit: cover; }
.article-source-mark { color: var(--gold-text); font: 400 1.15rem/1.4 var(--serif); }
.article-source { color: var(--muted); font-size: .85rem; }
.article-read { color: var(--accent); font-size: .95rem; font-weight: 700; }

/* About */
.about-grid { display: grid; gap: 3rem; }
.pull {
  margin-block: 2rem;
  padding-left: 1.25rem;
  border-left: 3px solid var(--gold);
  color: var(--ink);
  font: 400 1.15rem/1.95 var(--serif);
}
.about-side { max-width: 24rem; }
.about-side dl { margin: 1.5rem 0 0; }

dt { color: var(--muted); font-size: .9rem; }
dd { margin: 0 0 1rem; color: var(--ink); }

@media (min-width: 900px) {
  .about-grid { grid-template-columns: 3fr 2fr; align-items: start; }
  .about-side { justify-self: end; }
}

/* Gallery: columns keep each photo's own shape, so faces don't get cropped */
.gallery-grid { columns: 2 10rem; column-gap: 1rem; }
.gallery-grid li { margin-bottom: 1rem; break-inside: avoid; }
.gallery-grid a { display: block; overflow: hidden; }
.gallery-grid img { width: 100%; transition: transform .3s; }
.gallery-grid a:hover img { transform: scale(1.03); }

@media (min-width: 700px) { .gallery-grid { columns: 3; } }
@media (min-width: 1000px) { .gallery-grid { columns: 4; } }

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.lightbox[open] { display: grid; place-items: center; }
.lightbox::backdrop { background: rgb(0 0 0 / .9); }
.lightbox img { max-width: 94vw; max-height: 86dvh; width: auto; }
.lightbox button {
  position: fixed;
  width: 3rem;
  height: 3rem;
  border: 0;
  background: rgb(0 0 0 / .55);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
}
.lightbox button:hover { background: var(--accent); }
.lightbox-prev { left: .5rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: .5rem; top: 50%; transform: translateY(-50%); }
.lightbox-close { right: .5rem; top: .5rem; }

/* Contact */
.contact-grid { display: grid; gap: 3rem; }
.contact-form { display: grid; gap: 1.1rem; max-width: 40rem; }
.contact-form h2, .contact-form p { margin: 0; }
.contact-form label { display: grid; gap: .3rem; color: var(--ink); font-weight: 600; }
.contact-form input, .contact-form textarea {
  width: 100%;
  padding: .7rem .8rem;
  border: 1px solid #8a8a8a;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
}
.contact-form .btn { justify-self: start; }
.form-status:empty { display: none; }

@media (min-width: 800px) { .contact-grid { grid-template-columns: 1fr 2fr; } }

.not-found { text-align: center; }

/* Footer */
.site-footer { padding-top: 4rem; background: var(--darker); color: #b5b5b5; }
.site-footer h2 { margin-bottom: 1rem; color: #fff; font-size: 1.15rem; }
.site-footer p { margin: 0 0 .4rem; }
.site-footer a { color: #d8d8d8; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer li { padding-block: .15rem; }

.footer-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 2.5rem; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 2rem;
  margin-top: 3rem;
  padding-block: 1.25rem;
  border-top: 1px solid #444;
  font-size: .9rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
