/* Styles for pages built in the admin's page editor: red and black on a
   grainy paper background. Every block's class starts with "kk-". Modules
   add their own blocks' styles (modules/{id}/assets/*.css). */

:root {
  --red: #e0402d;
  --black: #1a1a1a;
  --paper: #f2f1ef;
  --muted: #555;
  --grain-size: 420px;
  --grain-density: 0.1;
  /* Settings > Fonts sets these in uploads/theme.css */
  --font-body: Arial, Helvetica, sans-serif;
  --font-heading: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--black);
  background-color: var(--paper);
  line-height: 1.5;
}

/* The whole page area. Its background is the page's own (set in the page
   editor) or, with kk-bg-default, the site default from Settings
   (assets/theme.css). --fg is the text colour: dark, or white on dark
   backgrounds (kk-text-light). */
.kk-canvas {
  /* a Section band reaches the window edges, which can poke out by the
     scrollbar's width */
  overflow-x: clip;
  --fg: var(--black);
  --fg-muted: var(--muted);
  position: relative;
  min-height: 100vh;
  background: var(--paper);
  color: var(--fg);
}
.kk-text-light { --fg: #fff; --fg-muted: rgba(255, 255, 255, 0.75); }

/* the headings font (Settings > Fonts), for big type everywhere */
.kk-heading, .kk-title-text, .kk-text h1, .kk-text h2, .kk-text h3,
.kk-live-banner, .kk-site-brand {
  font-family: var(--font-heading);
}

/* fonts and weights picked in rich text (kk-font-{id} classes come from
   assets/theme.css) */
.kk-w-100 { font-weight: 100; }
.kk-w-200 { font-weight: 200; }
.kk-w-300 { font-weight: 300; }
.kk-w-400 { font-weight: 400; }
.kk-w-500 { font-weight: 500; }
.kk-w-600 { font-weight: 600; }
.kk-w-700 { font-weight: 700; }
.kk-w-800 { font-weight: 800; }
.kk-w-900 { font-weight: 900; }

/* paper grain, same as the book club page; kk-no-texture turns it off */
.kk-canvas::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: var(--grain-size) var(--grain-size);
  opacity: var(--grain-density);
  pointer-events: none;
  z-index: 0;
}
.kk-no-texture::before { display: none; }

.kk-page {
  /* page width and side padding, also used by Section bands */
  --page-max: 1100px;
  --page-pad: 40px;
  position: relative;
  z-index: 1;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px var(--page-pad) 60px;
}

.kk-page.kk-width-wide { --page-max: 1300px; }

.kk-block { margin: 0 0 48px; }
.kk-block:last-child { margin-bottom: 0; }

.kk-heading {
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.05;
  letter-spacing: 0.5px;
  margin: 0 0 14px;
}

.kk-page a { color: var(--red); }

/* words given the accent colour with the red "A" in rich text */
.kk-page .kk-accent { color: var(--red); }
/* rich text titles are wrapped in paragraphs; keep them tight */
.kk-heading p, .kk-title-text p { margin: 0; }
.kk-page img { max-width: 100%; display: block; }

/* ---------- Hero ---------- */
.kk-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
.kk-hero.kk-has-image { grid-template-columns: 3fr 2fr; }
.kk-hero .kk-heading { font-size: clamp(36px, 6vw, 64px); color: var(--fg); }
.kk-hero .kk-heading .kk-accent { color: var(--red); }
.kk-hero-text { font-size: 18px; max-width: 640px; margin: 0 0 22px; }
.kk-hero-text p { margin: 0 0 0.6em; }
.kk-hero-text p:last-child { margin-bottom: 0; }
.kk-hero-image img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}
.kk-hero.kk-align-center { text-align: center; }
.kk-hero.kk-align-center .kk-hero-text { margin-left: auto; margin-right: auto; }

/* red variant: the whole block becomes a red panel with light text */
.kk-hero.kk-style-red {
  background: var(--red);
  color: #fff;
  padding: 48px 40px;
  border-radius: 6px;
}
.kk-hero.kk-style-red .kk-heading,
.kk-hero.kk-style-red .kk-heading .kk-accent { color: #fff; }

/* ---------- Text ---------- */
.kk-text { font-size: 17px; }
.kk-text.kk-width-narrow { max-width: 720px; margin-left: auto; margin-right: auto; }
.kk-text.kk-align-center { text-align: center; }
.kk-text h1, .kk-text h2, .kk-text h3 {
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 1.2em 0 0.4em;
}
.kk-text h1 { font-size: 40px; }
.kk-text h2 { font-size: 30px; color: var(--red); }
.kk-text h3 { font-size: 22px; }
/* Puck wraps rich text in a .rich-text div */
.kk-text-body .rich-text > :first-child { margin-top: 0; }
.kk-text-body .rich-text > :last-child { margin-bottom: 0; }
.kk-text blockquote {
  margin: 1em 0;
  padding-left: 16px;
  border-left: 4px solid var(--red);
  font-weight: 700;
}

/* ---------- Image + text ---------- */
.kk-image-text {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 36px;
  align-items: center;
}
.kk-image-text.kk-image-right .kk-image-text-image { order: 2; }
/* no image picked yet: let the text use the full width */
.kk-image-text:has(.kk-image-text-image:empty) { grid-template-columns: 1fr; }
.kk-image-text-image:empty { display: none; }
.kk-image-text-image img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

/* ---------- Buttons ---------- */
.kk-buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.kk-buttons.kk-align-center { justify-content: center; }
.kk-buttons.kk-align-right { justify-content: flex-end; }
.kk-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: 30px;
  border: 3px solid transparent;
}
.kk-page a.kk-btn--red, .kk-btn--red { background: var(--red); color: #fff; }
.kk-page a.kk-btn--black, .kk-btn--black { background: var(--black); color: #fff; }
.kk-page a.kk-btn--outline, .kk-btn--outline { background: transparent; color: var(--fg); border-color: var(--fg); }
.kk-btn:hover { filter: brightness(1.1); }

/* icons from the page editor's picker; they take the colour of the text */
.kk-icon { display: inline-flex; flex-shrink: 0; }
.kk-icon svg { width: 1.3em; height: 1.3em; display: block; }
.kk-hero.kk-style-red a.kk-btn--red { background: #fff; color: var(--red); }

/* ---------- Twitch live banner (same shape as the book club page) ---------- */
.kk-live-banner {
  position: relative;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-size: 22px;
  font-weight: 900;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
  padding: 10px;
  min-height: 250px;
  border-radius: 50% 53% 61% 55% / 52% 58% 52% 56%;
}
.kk-live-banner .kk-badge {
  display: block;
  width: fit-content;
  background: #fff;
  color: var(--black);
  padding: 6px 8px;
  margin: -10px -10px 40px 0;
  border-radius: 63% 37% 42% 58% / 52% 61% 39% 48%;
}
.kk-page a.kk-live-link {
  color: #fff;
  text-decoration: none;
  line-height: 40px;
}

/* ---------- Site menu and footer (Settings, added by page.php) ---------- */
.kk-site-header, .kk-site-footer { position: relative; z-index: 2; }
.kk-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 1300px;
  margin: 0 auto;
  padding: 18px 40px 0;
}
.kk-site-brand {
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 0.5px;
  color: var(--red);
  text-decoration: none;
}
.kk-site-nav { display: flex; flex-wrap: wrap; gap: 6px 26px; }
.kk-site-nav a {
  color: var(--fg);
  font-weight: 800;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 3px solid transparent;
}
.kk-site-nav a:hover, .kk-site-nav a[aria-current="page"] { border-bottom-color: var(--red); }
.kk-site-menu-btn {
  display: none;
  border: none;
  background: none;
  color: var(--fg);
  padding: 4px;
  cursor: pointer;
}
.kk-site-icon { width: 26px; height: 26px; display: block; }
.kk-site-footer {
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 40px 40px;
  text-align: center;
  font-size: 14px;
  color: var(--fg-muted);
}
.kk-site-footer p { margin: 10px 0 0; }
.kk-site-social { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }
.kk-site-social a { color: var(--fg); display: inline-flex; }
.kk-site-social a:hover { color: var(--red); }

/* ---------- Section (holds other blocks on its own background) ---------- */
.kk-section { position: relative; color: var(--fg); }
.kk-section-inner { position: relative; z-index: 1; }
.kk-section-inner > :first-child { margin-top: 0; }
.kk-section-inner > :last-child { margin-bottom: 0; }
/* paper grain on top, unless turned off (or no background of its own) */
.kk-section:not(.kk-no-texture):not(.kk-section-plain)::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: var(--grain-size) var(--grain-size);
  opacity: var(--grain-density);
  pointer-events: none;
  border-radius: inherit;
}
/* on dark or coloured backgrounds (light text), red headings and links
   would vanish into a red background, so they take the text colour */
.kk-section.kk-text-light .kk-text h2,
.kk-section.kk-text-light .kk-text-body h2 { color: var(--fg); }
.kk-page .kk-section.kk-text-light a:not(.kk-btn) { color: var(--fg); }
.kk-pad-small { padding-top: 24px; padding-bottom: 24px; }
.kk-pad-medium { padding-top: 48px; padding-bottom: 48px; }
.kk-pad-large { padding-top: 88px; padding-bottom: 88px; }
/* band: background from window edge to window edge, content lined up with
   the rest of the page */
.kk-section--band { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }
.kk-section--band > .kk-section-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}
.kk-section--card { border-radius: 10px; padding-left: 36px; padding-right: 36px; }

/* ---------- Page title ---------- */
.kk-block.kk-title { margin-bottom: 16px; }
.kk-title { position: relative; z-index: 1; }
.kk-title.kk-align-center { text-align: center; }
.kk-title-row {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}
.kk-title.kk-align-left .kk-title-row { justify-content: flex-start; }
.kk-title-icon { display: inline-flex; color: var(--red); flex-shrink: 0; }
.kk-title-icon svg { width: 64px; height: 64px; display: block; }
.kk-title-text {
  font-size: 56px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0;
  color: var(--fg);
}
.kk-title-text .kk-accent { color: var(--red); }
.kk-title.kk-size-medium .kk-title-text { font-size: 40px; }
.kk-title.kk-size-medium .kk-title-icon svg { width: 46px; height: 46px; }
.kk-title-sub { font-size: 18px; font-weight: 700; margin: 10px 0 0; }

@media (max-width: 800px) {
  .kk-page { --page-pad: 18px; padding: 24px var(--page-pad) 40px; }
  .kk-section--card { padding-left: 20px; padding-right: 20px; }
  .kk-pad-medium { padding-top: 36px; padding-bottom: 36px; }
  .kk-pad-large { padding-top: 56px; padding-bottom: 56px; }
  .kk-hero.kk-has-image,
  .kk-image-text { grid-template-columns: 1fr; }
  .kk-image-text.kk-image-right .kk-image-text-image { order: 0; }
  .kk-hero.kk-style-red { padding: 32px 22px; }

  .kk-site-header { padding: 14px 18px 0; }
  .kk-site-menu-btn { display: inline-flex; }
  .kk-site-nav { display: none; width: 100%; flex-direction: column; gap: 0; padding-bottom: 8px; }
  .kk-site-header.is-open .kk-site-nav { display: flex; }
  .kk-site-nav a { padding: 10px 0; border-bottom: 1px solid rgba(127, 127, 127, 0.25); }
  .kk-site-footer { padding: 20px 18px 32px; }

  .kk-title-text { font-size: 38px; }
  .kk-title-icon svg { width: 48px; height: 48px; }
}

/* Coming soon (inc/coming-soon.php): the page visitors see, centred, and the
   bar logged-in admins see above the real pages */
.kk-coming-soon .kk-page {
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.kk-coming-soon-bar {
  position: relative;
  z-index: 10;
  padding: 8px 16px;
  background: #1a1a1a;
  color: #fff;
  font: 14px/1.4 system-ui, sans-serif;
  text-align: center;
}
.kk-coming-soon-bar a { color: #fff; text-decoration: underline; }
