/* Book Covers For All — one-page site, built from the web-2 layout */

@font-face {
  font-family: "DM Sans";
  src: url(../fonts/dmsans-9-normal.woff2) format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url(../fonts/dmsans-9-italic.woff2) format("woff2");
  font-weight: 300 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #231f20;
  --red: #c1272d;
  --band: #808285;
  --grey: #6d6e71;
  --paper: #fff;
  --pad: clamp(20px, 3.4vw, 48px);
  --page: 1440px;
  --col: 890px;
  --text: clamp(17px, 1vw + 9px, 25px);
}

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

html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  font-size: var(--text);
  line-height: 1.55;
}

img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }
b, strong { font-weight: 500; }

a { color: var(--red); text-underline-offset: 0.16em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

h1, h2, h3 { margin: 0; font-weight: 300; line-height: 1.12; letter-spacing: -0.01em; }
h1 { font-size: clamp(38px, 5.6vw, 80px); margin: 0.5em 0 0.4em; }
h2 { font-size: clamp(30px, 3.5vw, 52px); margin: 0 0 0.3em; }
h3 { font-size: clamp(22px, 2.1vw, 32px); font-weight: 400; margin: 0.85em 0 0.12em; }
.dot { color: var(--red); }

/* ---------- Top bar ---------- */

.topbar { background: var(--ink); color: #fff; position: relative; z-index: 20; }
.topbar-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--pad);
  min-height: clamp(64px, 7.2vw, 104px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.topnav { display: flex; gap: clamp(28px, 4.4vw, 64px); }
.topnav a { color: #fff; text-decoration: none; font-weight: 400; font-size: clamp(17px, 1.6vw, 23px); }
.topnav a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 2px; }

.brand { display: flex; align-items: center; gap: 20px; color: #fff; text-decoration: none; margin-left: auto; }
.brand:hover { color: #fff; }
.brand-text { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; letter-spacing: 0.09em; line-height: 1.9; }
.brand-text b { font-weight: 500; }
.brand-text small { font-size: inherit; }
.brand-mark {
  width: clamp(48px, 5.8vw, 84px); aspect-ratio: 1; border-radius: 50%; background: #fff;
  display: grid; place-items: center; flex: none;
}
.brand-mark img { width: 72%; }

.nav-toggle { display: none; }

/* ---------- Text blocks ---------- */

.block {
  max-width: var(--page);
  margin: 0 auto;
  padding: 26px var(--pad) 44px;
}
.block > *, .block .prose, .quotes { max-width: var(--col); }
.block > h1 { max-width: none; }
.intro { padding-top: 0; }
.prose p + p { text-indent: 1.15em; }
.h2-follow { margin-top: 0.75em; }
.block > h3:first-child { margin-top: 0.15em; }  /* a section that opens with a subheading (Page layout & typesetting) */

.callout {
  margin: 1.5em 0 0 -14px;
  border-left: 14px solid var(--red);
  padding: 0.05em 0 0.05em 28px;
  font-size: clamp(20px, 1.4vw + 9px, 30px);
  line-height: 1.32;
}
.intro .callout { max-width: 22em; }

/* Footnote asterisk with a click-to-show tip ("everybody is happy*") */
.nowrap { white-space: nowrap; }
.footnote { position: relative; display: inline-block; }
.footnote-mark {
  font: inherit; line-height: 1; color: var(--red); background: none; border: 0;
  padding: 0 0.08em; margin: 0; cursor: pointer; vertical-align: 0.1em;
}
.footnote-mark:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 2px; }
.footnote-tip {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(calc(-50% + var(--shift, 0px)));
  white-space: nowrap; z-index: 5;
  background: var(--ink); color: #fff; font-size: 15px; line-height: 1.3; letter-spacing: 0.01em;
  padding: 0.55em 0.9em; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}
.footnote-tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; margin-left: calc(-6px - var(--shift, 0px));
  border: 6px solid transparent; border-top-color: var(--ink);
}
.footnote-tip[hidden] { display: none; }

/* ---------- Image strips ---------- */

.strip {
  position: relative;
  margin-top: 28px;
  /* grey band with diagonal rows of small dots, as in the layout */
  background: var(--band) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='15' height='15'%3E%3Cg fill='%2364656a'%3E%3Ccircle cx='1.5' cy='1.5' r='.75'/%3E%3Ccircle cx='4.5' cy='4.5' r='.75'/%3E%3Ccircle cx='7.5' cy='7.5' r='.75'/%3E%3Ccircle cx='10.5' cy='10.5' r='.75'/%3E%3Ccircle cx='13.5' cy='13.5' r='.75'/%3E%3C/g%3E%3C/svg%3E");
  padding: clamp(40px, 3.6vw, 52px) 0 clamp(24px, 2.4vw, 34px);
}
.strip-tag {
  position: absolute;
  z-index: 2;
  top: -9px;
  left: max(var(--pad), calc((100% - var(--page)) / 2 + var(--pad)));
  margin: 0;
  background: var(--ink);
  color: #fff;
  font-size: clamp(16px, 1.45vw, 21px);
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  line-height: 1;
  padding: 0.5em 0.8em 0.48em;
  border-radius: 0 0 10px 10px;   /* square on top, round at the bottom */
}
.strip-tag::after {
  content: ""; display: inline-block; width: 1.25em; height: 0.62em; margin-left: 0.55em; vertical-align: 0.04em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 12' fill='none' stroke='%23c1272d' stroke-width='2.8' stroke-linejoin='miter'%3E%3Cpath d='M1.5 1 6.5 6 1.5 11M10.5 1 15.5 6 10.5 11M19.5 1 24.5 6 19.5 11'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* Without JavaScript the strip is a plain sideways-scrolling row. */
.strip-scroller {
  --h: clamp(240px, 26vw, 380px);
  --gap: clamp(14px, 1.7vw, 24px);
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 var(--pad);
}
.strip-scroller::-webkit-scrollbar { display: none; }

/* With JavaScript it becomes a moving belt (see main.js). */
.strip-scroller.is-moving {
  display: block;
  overflow: hidden;
  padding: 0;
  cursor: grab;
  touch-action: pan-y;
}
.strip-track { display: flex; gap: var(--gap); width: max-content; will-change: transform; }
.strip-scroller.is-dragging { cursor: grabbing; }
.strip-scroller.is-dragging .strip-item { pointer-events: none; }

.strip-item { flex: none; display: block; background: #fff; }
.strip-item img { height: var(--h); width: auto; -webkit-user-drag: none; user-select: none; }

.strip--interiors .strip-scroller { --h: clamp(220px, 28vw, 410px); --gap: clamp(12px, 1.3vw, 18px); }
.strip--interiors .strip-item { box-shadow: 0 1px 3px rgba(0,0,0,0.18); }

.strip--illustrations .strip-scroller { --h: clamp(230px, 26vw, 390px); --gap: clamp(16px, 2vw, 28px); }
.strip--illustrations .strip-item { border-radius: 16px; overflow: hidden; }
.strip--illustrations .strip-item img { width: var(--h); object-fit: cover; }

.strip-empty { color: #fff; padding: 40px var(--pad); }

/* ---------- Testimonials ---------- */

.quotes { margin-top: 2.6em; display: grid; gap: 3.2em; }
.quote {
  margin: 0;
  display: grid;
  grid-template-columns: clamp(80px, 9.5vw, 138px) 1fr;
  column-gap: clamp(18px, 2.2vw, 31px);
}
.quote img { grid-row: span 2; width: 100%; border-radius: 14px; }
.quote figcaption i .title { font-style: normal; }
.quote blockquote { margin: 0; }
.quote figcaption { margin-top: 1.1em; }
.quote figcaption b { display: block; font-size: clamp(21px, 2.1vw, 32px); font-weight: 400; line-height: 1.25; }
.quote figcaption i { display: block; }

/* ---------- Prices ---------- */

.prices {
  margin-top: 2.2em;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(24px, 4.5vw, 64px);
  max-width: var(--col);
}
.price { margin-bottom: 1.9em; }
.price h3 {
  margin: 0 0 0.3em;
  font-size: clamp(19px, 1.85vw, 28px);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 13px;
}
.price h3::before { content: ""; width: 14px; height: 0.95em; background: var(--red); flex: none; }
.price p { padding-left: 27px; line-height: 1.38; margin-bottom: 0.35em; }
.price .amount { font-size: clamp(22px, 2.25vw, 34px); font-weight: 400; margin: 0.45em 0 0.3em; }

/* Six menu items + brand text don't fit side by side below ~960px: keep the round logo only. */
@media (max-width: 960px) { .brand-text { display: none; } }

/* ---------- Footer ---------- */

.footer { margin-top: 40px; }
.footer-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 0 var(--pad);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 345px 104px 219px;
  grid-template-areas: "cta photo nav brand";
  column-gap: 34px;
  align-items: end;
}
/* Class names avoid "cta" and "photo": ad blockers' annoyance filters hide elements named like that. */
.footer-hello { grid-area: cta; padding-bottom: 44px; }
.footer h2 { font-size: clamp(38px, 5vw, 72px); margin: 0 0 0.3em; white-space: nowrap; }
.footer-mail { font-size: clamp(18px, 1vw + 10px, 25px); font-weight: 300; }
.footer-note { font-size: clamp(14px, 0.35vw + 11px, 16.5px); line-height: 1.62; margin-top: 1.3em; max-width: 31em; }
.porto-time { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* The photo stands on the bottom edge of the page, cropped at the waist. */
.footer-portrait { grid-area: photo; width: 305px; height: 390px; object-fit: cover; object-position: top; }

.footer-nav { grid-area: nav; display: flex; flex-direction: column; gap: 0.72em; padding-bottom: 66px; font-size: 18px; line-height: 1.3; }
.footer-nav a { color: var(--ink); text-decoration: none; font-weight: 300; }
.footer-nav a:hover { color: var(--red); }

.footer-brand { grid-area: brand; padding-bottom: 66px; }
.footer-logo { display: flex; gap: 22px; align-items: flex-start; }
.footer-logo img { width: 100px; flex: none; }
.footer-logo p { flex: 1; font-size: 16px; letter-spacing: 0.08em; line-height: 1.2; text-transform: uppercase; font-weight: 400; }
.footer-logo span { display: block; border-bottom: 1.5px solid var(--ink); padding-bottom: 0.3em; margin-bottom: 0.35em; }
.footer-logo small { display: block; font-size: inherit; text-transform: none; font-weight: 300; }
.social { display: flex; gap: 38px; margin-top: 46px; padding-left: 14px; }
.social a { color: var(--grey); display: block; }
.social a:hover { color: var(--red); }
.social svg { display: block; fill: currentColor; }

/* Below 1400px there isn't room for the photo next to the text, so it is hidden. */
@media (max-width: 1399px) {
  .footer-portrait { display: none; }
  .footer-inner { grid-template-columns: minmax(0, 1fr) 130px 210px; grid-template-areas: "cta nav brand"; padding-top: 40px; }
  .footer-hello, .footer-nav, .footer-brand { padding-bottom: 48px; }
  .footer-mail a { display: inline-block; }
}
@media (max-width: 860px) {
  .footer-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "cta cta" "nav brand"; align-items: start; }
  .footer-hello { padding-bottom: 32px; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; grid-template-areas: "cta" "nav" "brand"; }
  .footer-nav { padding-bottom: 32px; }
  .social { padding-left: 4px; }
}

/* ---------- Lightbox ---------- */

.lightbox {
  border: 0; padding: 0; margin: 0;
  width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: rgba(24, 21, 22, 0.94);
  color: #fff;
}
.lightbox::backdrop { background: rgba(24, 21, 22, 0.94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: grid; justify-items: center; gap: 12px; }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100dvh - 90px); width: auto; height: auto; background: #fff; }
.lightbox figcaption { font-size: 15px; letter-spacing: 0.03em; opacity: 0.8; }
.lb-btn {
  position: fixed; border: 0; background: none; color: #fff; cursor: pointer;
  font: 200 84px/1 "DM Sans", sans-serif; padding: 6px 18px 16px; opacity: 0.75;
}
.lb-btn:hover { opacity: 1; }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-close { right: 8px; top: 4px; font-size: 56px; }

/* ---------- Tablet and below ---------- */

@media (max-width: 760px) {
  .topnav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--ink);
    padding: 4px var(--pad) 18px;
    border-top: 1px solid rgba(255,255,255,0.12);
  }
  .topnav.is-open { display: flex; }
  .topnav a { padding: 12px 0; font-size: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 44px; height: 44px; margin-left: -10px; padding: 10px;
    background: none; border: 0; cursor: pointer;
  }
  .nav-toggle span { display: block; height: 2px; background: #fff; transition: transform 0.2s, opacity 0.2s; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .brand-text { font-size: 11px; }

  .prices { grid-template-columns: 1fr; }
  .callout { margin-left: 0; }

  .lightbox img { max-width: 100vw; max-height: calc(100dvh - 120px); }
  .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; }
}

@media (max-width: 420px) {
  .brand-text { display: none; }
  .quote { grid-template-columns: 64px 1fr; align-items: center; }
  .quote img { grid-row: 1; }
  .quote figcaption { grid-row: 1; grid-column: 2; margin-top: 0; }
  .quote blockquote { grid-row: 2; grid-column: 1 / -1; margin-top: 14px; }
}
