/* Shared chrome of every page (templates/base.html): font, colours, header with
   hamburger menu, messages, footer, consent banner, pager. Design:
   templates/brandstyft-rund-vollbreit.html. Page styles come after this file:
   startseite.css for the landing page, main.css for all others. */

@font-face {
  font-family: "Switzer";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/switzer-variable.4523d2c62663.woff2") format("woff2");
}

:root {
  --paper: #faf6f0;
  --ink: #261c14;
  --ink-soft: #4a3a2e;
  --muted: #5c4a3c;
  --aubergine: #7a2048;
  --orange: #e75d11;
  --orange-dark: #d04f0b;
  --sand: #f3e3d3;
  --ochre: #d4a373;
  --line: #e3c9a8;
  --sky: #b5e5f6;
  --round: clamp(56px, 9vw, 140px);
  --radius-cta: 4px; /* every button, pill and search field (Startseite = Mass) */
  --pad-x: clamp(24px, 6vw, 72px);
}

* { box-sizing: border-box; }
/* One hover for every CTA on the site: orange ones (filled with --orange or
   main.css's --color-button) and outlined ones (.button--secondary) turn darker. */
:is(button, .button, .btn):not(:disabled):hover { --orange: var(--orange-dark); --color-button: var(--orange-dark); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--paper); color: var(--ink); font: 500 16px/1.4 "Switzer", Arial, sans-serif; }
[hidden] { display: none !important; }
/* Search fields: the hint is lighter than what one types. */
input::placeholder { color: #a8968a; font-weight: 400; opacity: 1; }
.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; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; z-index: 300; }
.skip-link:focus { left: 8px; }

/* Header */
.top { width: 100%; max-width: 1360px; margin: 0 auto; padding: 20px clamp(16px, 4vw, 40px) 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.top a { color: var(--ink); text-decoration: none; }
.top a:hover { color: var(--aubergine); }
.logo { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.logo img { display: block; height: 44px; width: auto; }
/* Claim and what the shop is, centred in the header:
   "du willst lesen | Buchshop & Magazin | hier findest du". Brown of logo.svg. */
.top__tag { flex: 1 1 auto; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; font-size: 15px; font-weight: 500; color: #483e37; }
.top__tag > * + * { border-left: 1.5px solid var(--orange); margin-left: 12px; padding-left: 12px; }
.top__tag strong { font-weight: 700; }
.top__nav { display: flex; align-items: center; gap: 20px; margin-left: auto; font-size: 17px; font-weight: 600; }
/* Search field in the header (every page but the landing page and /suche). */
.top__search { flex: 1 1 260px; max-width: 520px; display: flex; align-items: center; gap: 6px; background: #fff; border: 1.5px solid var(--ochre); border-radius: var(--radius-cta); padding: 4px 4px 4px 18px; }
.top__search:focus-within { border-color: var(--orange); }
.top__search input[type="search"] { flex: 1; min-width: 0; margin: 0; padding: 8px 0; border: 0; background: transparent; font-size: 16px; outline: none; }
.top__search button { flex: none; padding: 10px 18px; }
@media (max-width: 760px) {
  .top__search { order: 3; flex-basis: 100%; max-width: none; }
  .top__tag { order: 4; flex-basis: 100%; font-size: 13px; }
}
.cart-link { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
.cart-link .icon { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* The count sits on the bag, top right: an orange circle. */
.cart-link__count { position: absolute; top: 0; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--orange); color: #fff; font: 700 12px/20px "Switzer", Arial, sans-serif; text-align: center; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 48px; height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: flex-end; gap: 6px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary span { display: block; height: 4px; width: 36px; background: var(--orange); border-radius: 2px; }
.menu ul { position: absolute; right: 0; top: 52px; z-index: 250; /* above the consent banner */ margin: 0; padding: 12px 0; list-style: none; min-width: 240px; background: var(--paper); border: 1.5px solid var(--ochre); border-radius: 16px; box-shadow: 0 12px 30px rgb(38 28 20 / 18%); }
.menu li a, .menu li button { display: block; width: 100%; padding: 8px 20px; text-decoration: none; text-align: left; }
.menu li a:hover, .menu li button:hover { background: var(--sand); }
.menu form { margin: 0; }
.menu button { cursor: pointer; border: 0; border-radius: 0; background: none; color: var(--ink); font: inherit; }
.menu__search { font-size: 19px; font-weight: 700; }
.menu__head { padding: 10px 20px 4px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--aubergine); }
.menu .menu__head a { display: inline; padding: 0; color: inherit; }
.menu .menu__head a:hover { background: none; text-decoration: underline; }
.menu small { font-size: 12px; color: var(--muted); }
.menu__sep { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
/* Konto: same dropdown as the hamburger, the word "Konto" as its trigger. */
.konto-menu summary { width: auto; height: 44px; flex-direction: row; align-items: center; gap: 4px; }
.konto-menu summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); }
.konto-menu[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.konto-menu ul { top: 48px; min-width: 220px; font-weight: 500; }
/* Phones: logo, Konto, cart and menu on one row, the search field below. */
@media (max-width: 480px) {
  .top { gap: 12px; padding: 12px 16px; }
  .logo { min-width: 0; }
  .logo img { height: 32px; }
  .top__nav { gap: 12px; }
}

/* Covers without an image (partials/cover.html): title and author on aubergine. */
.cover__blank { aspect-ratio: 2 / 3; width: 100%; border-radius: 4px; background: var(--aubergine); color: var(--paper); padding: 10px; font-size: 13px; line-height: 1.15; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; text-align: left; }
.cover__blank small { font-size: 10px; opacity: .85; }

/* Messages (after a redirect: "Abgemeldet." …) */
.messages { list-style: none; width: 100%; max-width: 1240px; margin: 0 auto 16px; padding: 0 clamp(16px, 4vw, 40px); display: grid; gap: 8px; }
.messages__item { border-radius: 4px; padding: 12px 18px; font-size: 14px; background: var(--sand); border: 1px solid var(--line); }
.messages__item--error { background: rgb(179 38 30 / 8%); border-color: rgb(179 38 30 / 30%); color: #b3261e; }
.messages__item--success { background: rgb(47 111 78 / 8%); border-color: rgb(47 111 78 / 30%); color: #2f6f4e; }

/* Numbered pages of a result list */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.pager__n { cursor: pointer; min-width: 44px; height: 44px; padding: 0 8px; border: 1px solid var(--ochre); background: transparent; border-radius: var(--radius-cta); font-size: 17px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.pager__n:hover { border-color: var(--orange); }
.pager__n[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* Footer */
.foot { margin-top: auto; padding: 28px var(--pad-x); max-width: 1240px; width: 100%; margin-inline: auto; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; font-size: 15px; color: var(--ink); }
.foot a { color: var(--ink); text-underline-offset: 3px; }
.foot a:hover { color: var(--aubergine); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }

/* Consent banner (static/js/modules/consent.js). Sticky, not fixed: at the end
   of the page it sits below the content instead of hiding e.g. "Zur Kasse". */
.consent-banner { position: sticky; bottom: 0; z-index: 200; background: var(--ink); color: #fff; padding: 16px 24px; }
.consent-banner a { color: #fff; }
.consent-banner__inner { max-width: 1240px; margin-inline: auto; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.consent-banner p { margin: 0; max-width: 40rem; font-size: 14px; }
.consent-banner__purposes { display: flex; flex-wrap: wrap; gap: 12px; font-size: 13px; }
.consent-banner__purposes label { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.consent-banner__purposes input { width: auto; margin: 0; }
.consent-banner__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.consent-banner button { cursor: pointer; border: 0; border-radius: var(--radius-cta); padding: 10px 16px; background: var(--orange); color: #fff; font: 700 14px/1 "Switzer", Arial, sans-serif; }
.consent-banner .button--secondary { background: transparent; border: 1px solid #fff; }
.consent-banner .button--secondary:hover { background: rgb(255 255 255 / 12%); }

/* After "In den Warenkorb": a toast with the way to checkout. Stays while
   hovered or focused, otherwise fades after a few seconds. CSS only (CSP). */
.cart-toast { position: fixed; z-index: 260; right: 16px; bottom: 16px; max-width: calc(100% - 32px); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; background: var(--paper); border: 1.5px solid var(--ochre); border-radius: 16px; box-shadow: 0 12px 30px rgb(38 28 20 / 18%); animation: cart-toast 9s ease forwards; }
.cart-toast:hover, .cart-toast:focus-within { animation-play-state: paused; }
.cart-toast .button { background: var(--orange); color: #fff; border-radius: var(--radius-cta); padding: 10px 18px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.cart-toast a:not(.button) { color: var(--ink); }
@keyframes cart-toast { 0% { opacity: 0; transform: translateY(12px); } 4%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .cart-toast { animation-name: cart-toast-still; } @keyframes cart-toast-still { 0%, 90% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } } }

/* Search type-ahead (partials/search_field.html): header, landing page and /suche. */
.typeahead { position: relative; }
.typeahead__list { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; margin: 0; padding: 4px 0; list-style: none; text-align: left; background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-cta); box-shadow: 0 8px 22px rgb(38 28 20 / 14%); }
.typeahead__list:empty { display: none; }
.typeahead .typeahead__list a { display: flex; justify-content: space-between; gap: 12px; padding: 8px 20px; color: var(--ink); text-decoration: none; }
.typeahead .typeahead__list [aria-selected="true"] a, .typeahead .typeahead__list a:hover { background: var(--paper); }
.typeahead__kind { flex: none; color: var(--muted); font-size: 0.85em; }

/* Das gelbe Zetteli: a book with magazin content (templates/web/partials/zetteli.html). */
.zetteli { align-self: flex-start; display: block; width: fit-content; background: #ffe24a; color: var(--ink) !important; font-size: 13px; font-weight: 700; line-height: 1.2; padding: 5px 9px; border-radius: 2px; box-shadow: 1px 2px 4px rgb(0 0 0 / 18%); transform: rotate(-2deg); text-decoration: none; margin-bottom: 4px; }
.zetteli:hover { transform: rotate(0); text-decoration: underline; }
