/* =========================================================
   anne-berry.com — site styles
   Type:  Libre Baskerville (headings) / Figtree (body)
   ========================================================= */

:root {
  /* opt out of browser/OS auto-dark-mode dimming — some viewers tint the
     page background but leave images alone, which makes white-background
     artwork read as a visible white square on a greyed page */
  color-scheme: only light;

  /* colour */
  --ink:        #6c5751;   /* text, nav, icons — site-wide */
  --ink-soft:   #6c5751;   /* footer, captions */
  --band:       #ac9c95;   /* mauve/taupe band on book pages */
  --band-ink:   #2f2b29;   /* text on the band */
  --rule:       #e4e1de;
  --page:       #ffffff;

  /* type */
  --font-display: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-body: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --base: 16px;

  /* layout */
  --page-max: 1200px;
  --page-pad: 40px;
  --header-pad: 48px;
  /* side gutter for full-width galleries. Measured off the live
     Squarespace site: gutters are ~4% of viewport on each side
     (~55px at a 1366px viewport, i.e. roughly 1/2 inch). Kept as a
     percentage so it scales with the window the way Squarespace does. */
  --gallery-pad: 4%;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  background: var(--page);
}
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--base);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
}

/* visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--band);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- header ---------- */
.site-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 26px var(--header-pad);
  background: var(--page);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06), 0 6px 14px -12px rgba(0, 0, 0, 0.35);
}

.site-logo { flex: 0 0 auto; }
.site-logo img { width: 345px; height: auto; }

/* nav sits centred and wraps to a second line, as on the current site */
.site-nav {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 4px 28px;
  max-width: 410px;
  margin: 0 auto;
}
.site-nav a {
  text-decoration: none;
  color: var(--ink);
  font-size: 1rem;
  padding: 2px 0;
  border-bottom: 1px solid transparent;
  transition: border-color 0.18s ease;
}
.site-nav a:hover { border-bottom-color: var(--ink); }
.site-nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.site-social {
  flex: 0 0 auto;
  display: flex;
  gap: 44px;
  align-items: center;
}
.site-social a { color: var(--ink); opacity: 0.85; transition: opacity 0.18s ease; }
.site-social a:hover { opacity: 1; }
.site-social svg { width: 24px; height: 24px; }

/* ---------- main ---------- */
.page {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 44px var(--page-pad) 90px;
}

/* Books landing needs a little extra width so three enlarged covers
   still fit across the top row; the cluster stays centred. */
.page.is-books { max-width: 1280px; }

/* Full-width gallery pages: drop the 1200px cap so artwork runs
   to within --gallery-pad of each edge. Text-led sections (About,
   the Words reviews) keep the narrower measure for readability. */
.page.is-wide {
  max-width: none;
  padding-left: var(--gallery-pad);
  padding-right: var(--gallery-pad);
}

/* ---------- strips gallery (justified rows) ----------
   Used on: Illustrations, Black and White, Surface Design,
   China's Adventures. Row height + gap are set per page. */
.strips { display: block; }
.strips-row {
  display: flex;
  width: 100%;
}
.strips-row:last-child { margin-bottom: 0 !important; }

.gallery-item {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
}
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.gallery-item img.is-loaded { opacity: 1; }

/* placeholder tile shown until real artwork is dropped in */
.gallery-item.is-placeholder {
  background: repeating-linear-gradient(
    45deg,
    #f2efec, #f2efec 10px,
    #ece8e4 10px, #ece8e4 20px
  );
}
.gallery-item.is-placeholder::after {
  content: attr(data-label);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a9a29c;
}

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.94);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
}
.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox-figure {
  max-width: 78vw;
  max-height: 88vh;
  margin: 0;
}
.lightbox-figure img {
  max-width: 78vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--ink);
  padding: 14px;
  line-height: 0;
  opacity: 0.55;
  transition: opacity 0.18s ease;
}
.lightbox button:hover { opacity: 1; }
.lightbox svg { width: 26px; height: 26px; }
.lightbox-close { top: 22px; right: 26px; }
.lightbox-prev  { left: 24px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 24px; top: 50%; transform: translateY(-50%); }

body.lightbox-open { overflow: hidden; }

/* ---------- footer ---------- */
.site-footer {
  padding: 40px var(--page-pad) 64px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.site-footer p { margin: 0 0 16px; }
.footer-social {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.footer-social a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
}
.footer-social .is-email,
.footer-social .is-instagram { background: var(--ink); }
.footer-social svg { width: 17px; height: 17px; }

/* ---------- provisional small-screen handling ----------
   Mobile treatment is still to be designed; this keeps the
   page usable in the meantime rather than being final. */

/* ---------- tablets (iPad portrait and similar) ----------
   Keeps the full desktop navigation, just scaled to fit. */
@media (min-width: 781px) and (max-width: 1024px) {
  :root { --page-pad: 28px; --header-pad: 28px; }
  .site-logo img { width: 260px; }
  .site-nav { max-width: 360px; gap: 4px 22px; }
  .site-nav a { font-size: 0.92rem; }
  .site-social { gap: 26px; }
  .site-social svg { width: 22px; height: 22px; }

  .book-grid { gap: 50px 34px; }
  .book-grid .book-link { flex: 0 0 290px; width: 290px; }
  .category-row { gap: 30px; padding: 44px 0 60px; }
  .category .thumb { width: 158px; height: 158px; }
  .reviews { gap: 30px 40px; }
  .seals { gap: 40px; }
  .seals .seal { width: 76px; height: 76px; }
  .about-intro { gap: 40px; }
}

/* ---------- hamburger toggle (phones only) ---------- */
.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 10px;
  cursor: pointer;
  color: var(--ink);
  line-height: 0;
}
.nav-toggle svg { width: 26px; height: 26px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* ---------- phones and small tablets ---------- */
@media (max-width: 780px) {
  :root { --page-pad: 18px; --header-pad: 18px; }

  .site-header {
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 14px var(--header-pad);
  }
  .site-logo { flex: 1 1 auto; }
  .site-logo img { width: 208px; }

  .nav-toggle { display: block; flex: 0 0 auto; order: 3; }

  /* nav becomes a panel that drops below the header bar */
  .site-nav {
    order: 4;
    flex: 1 0 100%;
    max-width: none;
    flex-direction: column;
    align-items: center;
    gap: 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.28s ease;
  }
  .site-nav.is-open { max-height: 60vh; }
  .site-nav a {
    width: 100%;
    text-align: center;
    padding: 13px 0;
    font-size: 1.02rem;
    border-bottom: 0;
  }
  .site-nav a + a { border-top: 1px solid var(--rule); }
  .site-nav a[aria-current="page"] {
    border-bottom: 0;
    font-weight: 600;
  }
  .site-nav a:first-child { margin-top: 12px; border-top: 1px solid var(--rule); }

  /* social icons move next to the hamburger */
  .site-social { order: 2; flex: 0 0 auto; gap: 20px; margin-right: 14px; }
  .site-social svg { width: 21px; height: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   Page-specific components
   ========================================================= */

/* ---------- book page title band ---------- */
.band {
  background: var(--band);
  padding: 30px var(--header-pad);
}
.band-inner {
  max-width: var(--page-max);
  margin: 0 auto;
}
.band h1 {
  color: var(--band-ink);
  font-size: 1.65rem;
  line-height: 1.3;
}
.band p {
  margin: 6px 0 0;
  color: var(--band-ink);
  font-size: 0.8rem;
  opacity: 0.9;
}
.band.is-centred .band-inner { text-align: center; }
.band.is-centred h1 { font-size: 1.5rem; }

/* ---------- masonry gallery ---------- */
.masonry { position: relative; }
.masonry .gallery-item { display: block; position: absolute; top: 0; left: 0; }

/* ---------- Books landing ---------- */
.book-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 64px 48px;
  padding: 50px 0 60px;
}
.book-grid .book-link {
  display: block;
  text-decoration: none;
  flex: 0 0 360px;
  width: 360px;
}
.book-grid img { width: 100%; height: auto; }
.book-grid .book-note {
  margin: 18px 0 0;
  font-style: italic;
  font-size: 0.9rem;
}

.cover-placeholder {
  aspect-ratio: 1 / 1;
  background: repeating-linear-gradient(45deg,#f2efec,#f2efec 10px,#ece8e4 10px,#ece8e4 20px);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a9a29c;
  text-align: center;
  padding: 10px;
  box-shadow: 6px 6px 16px -8px rgba(0,0,0,0.4);
}

/* ---------- Words: awards + reviews ---------- */
.seals {
  display: flex;
  justify-content: center;
  gap: 70px;
  flex-wrap: wrap;
  padding: 54px 0 40px;
}
.seals .seal { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; }
.seals .is-placeholder {
  background: repeating-linear-gradient(45deg,#f2efec,#f2efec 8px,#ece8e4 8px,#ece8e4 16px);
}

.reviews {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 40px 70px;
  align-items: start;
  padding: 20px 0 40px;
}
.reviews blockquote { margin: 0 0 46px; }
.reviews blockquote p { margin: 0 0 10px; font-size: 1.05rem; }
.reviews cite {
  font-style: italic;
  font-size: 0.9rem;
}
.reviews cite a { text-decoration: underline; }
.reviews .review-cover { align-self: center; }
.reviews .review-cover .cover-placeholder { box-shadow: none; }

/* ---------- Design landing ---------- */
.category-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 60px 0 80px;
  max-width: 980px;
  margin: 0 auto;
}
.category {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 34px;
  text-decoration: none;
}
.category .thumb {
  width: 182px;
  height: 182px;
  border-radius: 50%;
  object-fit: cover;
  background: repeating-linear-gradient(45deg,#f2efec,#f2efec 10px,#ece8e4 10px,#ece8e4 20px);
}
.category .label {
  border: 1px solid var(--ink);
  border-radius: 999px;
  padding: 11px 30px;
  font-size: 0.9rem;
  transition: background 0.2s ease, color 0.2s ease;
}
.category:hover .label { background: var(--ink); color: #fff; }

/* ---------- About ---------- */
.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 56px;
  align-items: start;
  padding: 20px 0 70px;
}
.about-intro img { width: 100%; height: auto; }
.about-intro .portrait {
  display: block;
}
.about-intro p { margin: 0 0 20px; }
.about-intro .seeking { font-weight: 700; font-style: italic; }

.spot {
  display: block;
  margin: 0 auto;
  width: 190px;
  height: auto;
}

.list-block { padding: 60px 0 10px; }
.list-block h2 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 400; margin: 0 0 14px; }
.list-block ul { margin: 0; padding-left: 22px; }
.list-block li { margin-bottom: 10px; }

@media (max-width: 780px) {
  /* books landing: fixed-width covers, centred, wrapping naturally */
  .book-grid { gap: 34px 20px; padding: 30px 0 40px; }
  .book-grid .book-link { flex-basis: 42%; width: 42%; max-width: 220px; }
  .book-grid .book-note { font-size: 0.82rem; }

  /* design categories: 2 across, third centred below */
  .category-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 34px 20px;
    padding: 34px 0 50px;
  }
  .category { gap: 20px; }
  .category .thumb { width: 100%; max-width: 160px; height: auto; aspect-ratio: 1; }
  .category .label { padding: 9px 22px; font-size: 0.85rem; }
  .category:last-child { grid-column: 1 / -1; }

  /* words page */
  .reviews { grid-template-columns: 1fr; gap: 30px; }
  .reviews .review-cover { max-width: 300px; margin: 0 auto; }
  .reviews blockquote { margin-bottom: 32px; }
  .reviews blockquote p { font-size: 1rem; }
  .seals { gap: 26px; padding: 34px 0 26px; }
  .seals .seal { width: 62px; height: 62px; }

  /* about */
  .about-intro { grid-template-columns: 1fr; gap: 28px; padding: 10px 0 40px; }
  .about-intro .portrait { max-width: 420px; }
  .list-block { padding: 40px 0 0; }
  .spot { width: 150px; }

  /* bands */
  .band { padding: 22px var(--header-pad); }
  .band h1 { font-size: 1.35rem; }
  .band.is-centred h1 { font-size: 1.25rem; }

  .page { padding: 26px var(--page-pad) 60px; }
  .page.is-wide { padding-left: var(--gallery-pad); padding-right: var(--gallery-pad); }

  /* lightbox sizing on small screens */
  .lightbox-figure, .lightbox-figure img { max-width: 90vw; max-height: 78vh; }
  .lightbox-prev { left: 2px; }
  .lightbox-next { right: 2px; }
  .lightbox-close { top: 12px; right: 12px; }
}
