/* Würth digital catalogue page. Würth CI: red, black, white; Würth Sans; 20px grid; sharp corners;
   no shadows or gradients. The brand box: white logo background in its upper left corner, the red
   area protrudes right and below, white text only. Self-contained: relative paths, no CDN. */
/* Thai from Würth Thailand (Würth Thailand's own corporate font, its "Website" WOFF2 files), Latin from
   Würth Sans Global: split by unicode-range so the browser picks per character. */
@font-face { font-family: 'WuerthGlobal'; src: url('book.woff2') format('woff2'); font-weight: 400; unicode-range: U+0000-0DFF, U+0E80-200A, U+200E-10FFFF; }
@font-face { font-family: 'WuerthGlobal'; src: url('demibold.woff2') format('woff2'); font-weight: 700; unicode-range: U+0000-0DFF, U+0E80-200A, U+200E-10FFFF; }
@font-face { font-family: 'WuerthGlobal'; src: url('th-book.woff2') format('woff2'); font-weight: 400; unicode-range: U+0E00-0E7F, U+200B-200D; }
@font-face { font-family: 'WuerthGlobal'; src: url('th-bold.woff2') format('woff2'); font-weight: 700; unicode-range: U+0E00-0E7F, U+200B-200D; }
@font-face { font-family: 'WuerthGlobalCond'; src: url('black-cond.woff2') format('woff2'); font-weight: 800; unicode-range: U+0000-0DFF, U+0E80-200A, U+200E-10FFFF; }
@font-face { font-family: 'WuerthGlobalCond'; src: url('th-xbc.woff2') format('woff2'); font-weight: 800; unicode-range: U+0E00-0E7F, U+200B-200D; }

:root {
  --red: #cc0000;
  --black: #000000;
  --white: #ffffff;
  --grey-1: #f2f2f2;
  --grey-2: #bfbfbf;
  --grey-6: #666666;
  --cyan: #0093dd;
  --gu: 20px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--white); color: var(--black); font-family: 'WuerthGlobal', Arial, sans-serif; font-size: 15px; line-height: 1.5; }
body.locked { overflow: hidden; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.wrap { max-width: 1200px; margin: 0 auto; padding: calc(2 * var(--gu)) var(--gu) calc(4 * var(--gu)); }

/* Hero: the brand box on a grey band, the catalogue covers beside it. */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); background: var(--grey-1); min-height: calc(17 * var(--gu)); overflow: hidden; }
.box { position: relative; background: var(--red); color: var(--white); align-self: start; }
.plate { display: inline-block; vertical-align: top; background: var(--white); }
.plate img { display: block; width: calc(14 * var(--gu)); max-width: 100%; height: auto; }
.box-text { padding: var(--gu) calc(2 * var(--gu)) calc(2 * var(--gu)); }
.box h1 { margin: 0; font-family: 'WuerthGlobalCond', 'Arial Narrow', sans-serif; font-weight: 800; font-size: 52px; line-height: 1; text-transform: uppercase; overflow-wrap: anywhere; }
.box p { margin: calc(var(--gu) / 2) 0 0; font-size: 18px; }
.covers { position: relative; }
/* Keven 2026-11-11: a made picture fills the whole hero behind the brand box and the covers. */
.hero.has-photo { background: url('hero.jpg') center / cover no-repeat; }
.covers img { position: absolute; top: calc(2 * var(--gu)); width: 30%; aspect-ratio: 1 / 1.414; object-fit: cover; background: var(--white); border: 1px solid var(--grey-2); }

.intro { margin: calc(2 * var(--gu)) 0 0; max-width: 60em; white-space: pre-line; }
.all { margin: calc(2 * var(--gu)) 0 0; font-family: 'WuerthGlobalCond', 'Arial Narrow', sans-serif; font-weight: 800; font-size: 34px; line-height: 1.1; text-transform: uppercase; }

/* One section per category: a name and a rule, then the cards. */
.section { margin-top: calc(2 * var(--gu)); }
.section h3 { display: flex; align-items: center; gap: var(--gu); margin: 0 0 var(--gu); font-size: 18px; font-weight: 700; text-transform: uppercase; }
.section h3::after { content: ''; flex: 1; border-top: 1px solid var(--grey-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--gu); }
.card { display: flex; flex-direction: column; color: inherit; text-decoration: none; border: 1px solid var(--grey-2); background: var(--white); }
.card:hover { border-color: var(--black); }
.card .cover { display: block; width: 100%; aspect-ratio: 1 / 1.414; object-fit: contain; background: var(--grey-1); }

/* The popup (Keven 2026-11-11): no sheet. A dark, see-through ground over the page; the book floats
   on it, as large as the window allows; Close floats in the top right corner. */
.modal { position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, 0.82); }
.modal[hidden] { display: none; }
.sheet { position: relative; width: 100%; height: 100%; }
.m-bar { position: absolute; top: var(--gu); right: var(--gu); z-index: 1; }
/* The book's name is on the book's own screen; this one is for screen readers. */
.m-bar h2 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#m-close { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0; background: var(--white); color: var(--black); border: 1px solid var(--white); border-radius: 0; cursor: pointer; }
#m-close:hover { background: var(--black); color: var(--white); }
#m-frame { display: block; width: 100%; height: 100%; border: 0; background: transparent; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .covers { display: none; }
  .box h1 { font-size: 40px; }
  .m-bar { top: 10px; right: 12px; }
  /* Two catalogues a row on a phone, not one huge cover. */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: calc(var(--gu) / 2); }
  .wrap { padding: var(--gu) calc(var(--gu) * 0.75) calc(3 * var(--gu)); padding-bottom: calc(3 * var(--gu) + env(safe-area-inset-bottom)); }
  .all { font-size: 28px; }
}
@media (prefers-reduced-motion: no-preference) {
  .card { transition: border-color 0.15s ease; }
}

/* A book's short description under its title (the AI's, or the user's). */
