/*
 * blog.videokiosk.me — standalone styles.
 *
 * Mirrors the main site's public header/footer (src/components/layout/
 * PublicSiteHeader.tsx, PublicSiteFooter.tsx) and design tokens
 * (src/index.css) in plain CSS, so the blog needs no build step and loads
 * none of the app's code. Keep the two visually in step when either changes.
 *
 * The Quickblog rules further down are the same scoped rules reviewed in
 * PR #81 (verified against Quickblog's live listing, a published post, and
 * its embed.css). Quickblog's own Custom CSS setting stays empty: styling is
 * managed here.
 */

:root {
  --color-brand-50: oklch(0.97 0.02 131.49);
  --color-brand-100: oklch(0.93 0.045 131.49);
  --color-brand-200: oklch(0.87 0.08 131.49);
  --color-brand-300: oklch(0.82 0.105 131.49);
  --color-brand-600: oklch(0.54 0.16 131.49);
  --color-brand-700: oklch(0.46 0.15 131.49);
  --color-brand-800: oklch(0.39 0.12 131.49);
  --color-ink: #080605;
  --color-slate-50: oklch(98.4% 0.003 247.858);
  --color-slate-100: oklch(96.8% 0.007 247.896);
  --color-slate-200: oklch(92.9% 0.013 255.508);
  --color-slate-300: oklch(86.9% 0.022 252.894);
  --color-slate-400: oklch(70.4% 0.04 256.788);
  --color-slate-500: oklch(55.4% 0.046 257.417);
  --color-slate-600: oklch(44.6% 0.043 257.281);
  --color-slate-700: oklch(37.2% 0.044 257.287);
  --font-sans:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    'Noto Sans', sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: #fbfcf8;
  color: var(--color-ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--color-brand-600);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.75rem;
  z-index: 50;
  border-radius: 0.375rem;
  background: var(--color-brand-600);
  padding: 0.5rem 1rem;
  font-weight: 500;
  color: #fff;
}

.skip-link:focus {
  left: 0.75rem;
}

/* Buttons (mirror the app's Button sm/primary and ghost variants) */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.5rem;
  background: var(--color-brand-600);
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  background: var(--color-brand-700);
}

.button--ghost {
  background: transparent;
  color: var(--color-slate-700);
}

.button--ghost:hover {
  background: var(--color-slate-100);
  color: var(--color-ink);
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--color-brand-100);
  background: rgb(251 252 248 / 0.9);
  backdrop-filter: blur(8px);
}

.site-header__inner,
.site-footer__grid,
.site-footer__bottom {
  margin-inline: auto;
  max-width: 72rem;
  padding-inline: 1rem;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.site-logo {
  display: inline-flex;
  border-radius: 0.375rem;
}

.site-logo img,
.site-footer img {
  display: block;
  height: 2.25rem;
  width: auto;
}

.site-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-slate-600);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] {
  color: var(--color-ink);
}

.site-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .site-header__inner,
  .site-footer__grid,
  .site-footer__bottom {
    padding-inline: 1.5rem;
  }

  .site-nav {
    display: flex;
  }
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--color-brand-100);
  background: #fff;
}

.site-footer__grid {
  display: grid;
  gap: 2rem;
  padding-block: 3rem;
}

@media (min-width: 640px) {
  .site-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .site-footer__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.site-footer__tagline {
  margin: 0.75rem 0 0;
  max-width: 220px;
  font-size: 0.875rem;
  line-height: 1.43;
  color: var(--color-slate-500);
}

.site-footer__col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.site-footer__col a {
  color: var(--color-slate-600);
  text-decoration: none;
}

.site-footer__col a:hover {
  color: var(--color-ink);
}

.site-footer__heading {
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--color-slate-400);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-top: 1px solid var(--color-brand-100);
  padding-block: 1.5rem;
  font-size: 0.875rem;
  color: var(--color-slate-500);
}

.site-footer__bottom p {
  margin: 0;
}

/* Status messages */

.videokiosk-blog-status__title {
  margin: 0;
  font-weight: 600;
  color: var(--color-ink);
}

.videokiosk-blog-status__body {
  margin: 0.25rem 0 1rem;
  font-size: 0.875rem;
}

/* ---------------------------------------------------------------------- */
/* Page layout and Quickblog embed (scoped rules carried over from PR #81) */
/* ---------------------------------------------------------------------- */

/* Page layout */

.videokiosk-blog-page {
  width: 100%;
  min-height: 60vh;
  background: #ffffff;
  color: var(--color-ink);
}

.videokiosk-blog-container {
  width: min(100% - 2rem, 1200px);
  margin-inline: auto;
  padding-block: 3rem 5rem;
}

/* Loading and error states (rendered by BlogPage, outside #qb-posts) */

.videokiosk-blog-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-inline: auto;
  max-width: 32rem;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--color-slate-600);
}

.videokiosk-blog-status--error {
  gap: 0;
  border: 1px solid var(--color-slate-200);
  border-radius: 0.75rem;
  background: var(--color-slate-50);
}

.videokiosk-blog-spinner {
  width: 1.75rem;
  height: 1.75rem;
  border: 3px solid var(--color-brand-100);
  border-top-color: var(--color-brand-600);
  border-radius: 9999px;
  animation: videokiosk-blog-spin 0.8s linear infinite;
}

@keyframes videokiosk-blog-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .videokiosk-blog-spinner {
    animation: none;
  }
}

/* Quickblog embed root */

#qb-posts {
  width: 100%;
  min-width: 0;
  margin: 0 auto;
  color: var(--color-ink);
  font-family: inherit;
  line-height: 1.65;
}

/* Quickblog floats its banner and content columns; contain them. */
#qb-posts::after {
  content: '';
  display: table;
  clear: both;
}

/* Blog banner: Quickblog's own heading ("VideoKiosk Blog"). */

#qb-posts .qb-banner {
  padding: 0 0 2rem;
  color: var(--color-ink);
}

#qb-posts .qb-banner > h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-ink);
}

/* Empty state: Quickblog's "Nothing Found" text, until posts are published. */

#qb-posts p.qb-notingfound {
  margin: 0;
  padding: 3rem 1.5rem;
  border: 1px dashed var(--color-brand-200);
  border-radius: 0.75rem;
  background: var(--color-brand-50);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-slate-600);
}

/* Post cards and article pages */

/* Listing card title. Quickblog clamps it to two lines with an inline 62px height. */
#qb-posts .qb-post-title {
  font-size: 1.375rem;
}

#qb-posts .qb-post-title,
#qb-posts .qb-one-column h1,
#qb-posts .qb-two-column h1,
#qb-posts .qb-three-column h1 {
  color: var(--color-ink);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

#qb-posts .qb-one-column p,
#qb-posts .qb-two-column p,
#qb-posts .qb-three-column p {
  color: var(--color-slate-600);
}

#qb-posts .qb-blog-img,
#qb-posts .qb-image-div {
  border-radius: 12px;
}

#qb-posts .qb-blog-img img,
#qb-posts img.qb-post-image,
#qb-posts .qb-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

/* Fixed-height card thumbnails keep Quickblog's cropping. */
#qb-posts .qb-image-div img {
  height: 100%;
}

/* Article body: scoped prose (Tailwind preflight strips heading/list defaults). */

#qb-posts .qb-content {
  max-width: 72ch;
  margin-inline: auto;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-slate-700);
}

#qb-posts .qb-content h1,
#qb-posts .qb-content h2,
#qb-posts .qb-content h3,
#qb-posts .qb-content h4 {
  color: var(--color-ink);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 2.25rem 0 0.75rem;
}

#qb-posts .qb-content h1 {
  font-size: 1.75rem;
}

#qb-posts .qb-content h2 {
  font-size: 1.5rem;
}

#qb-posts .qb-content h3 {
  font-size: 1.25rem;
}

#qb-posts .qb-content h4 {
  font-size: 1.0625rem;
}

#qb-posts .qb-content > :first-child {
  margin-top: 0.5rem;
}

#qb-posts .qb-content p {
  margin: 0 0 1.1em;
  color: var(--color-slate-700);
}

#qb-posts .qb-content ul,
#qb-posts .qb-content ol {
  margin: 0 0 1.25em;
  padding-left: 1.5rem;
}

#qb-posts .qb-content ul {
  list-style: disc;
}

#qb-posts .qb-content ol {
  list-style: decimal;
}

#qb-posts .qb-content li {
  margin: 0.4em 0;
  padding-left: 0.25rem;
}

#qb-posts .qb-content li::marker {
  color: var(--color-brand-600);
}

#qb-posts .qb-content strong {
  font-weight: 600;
  color: var(--color-ink);
}

#qb-posts .qb-content img {
  margin: 1.75rem auto;
}

#qb-posts .qb-content blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--color-brand-300) !important;
  color: var(--color-slate-600);
}

/* Links and hover states */

#qb-posts a {
  color: var(--color-brand-700);
  text-decoration-color: var(--color-brand-600);
  text-underline-offset: 3px;
}

#qb-posts a:hover {
  color: var(--color-brand-600);
}

#qb-posts .qb-one-column h1 a,
#qb-posts .qb-two-column h1 a,
#qb-posts .qb-three-column h1 a {
  color: inherit;
}

/* Quickblog's default pink/blue accents → VideoKiosk brand */

#qb-posts ul.qb-breadcrumb li a {
  color: var(--color-brand-700);
}

#qb-posts .qb-author ul li a::after {
  color: var(--color-brand-600);
}

/*
 * Buttons: "Read More" on listing cards and Back to Blog / Prev / Next on
 * articles. Quickblog writes their colors inline from its dashboard button
 * settings (black, square), so matching the brand here needs !important.
 * If those settings are changed to brand green in Quickblog instead, these
 * overrides can be removed.
 */
#qb-posts .qbCustomClass button {
  background-color: var(--color-brand-600) !important;
  border-color: var(--color-brand-600) !important;
  border-radius: 0.5rem !important;
  padding: 0.5rem 1.25rem !important;
  font-size: 0.9375rem !important;
  font-weight: 600 !important;
}

#qb-posts .qbCustomClass:hover button {
  background-color: var(--color-brand-700) !important;
  border-color: var(--color-brand-700) !important;
}

#qb-posts .qb-pagination-section .inherback {
  width: auto;
  background-color: var(--color-brand-600) !important;
  border-radius: 0.5rem !important;
}

#qb-posts .qb-pagination-section .inherback a {
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

#qb-posts .qb-search-bar input {
  border: 1px solid var(--color-slate-300);
  font-size: 1rem;
}

#qb-posts .qb-search-bar input:focus-visible {
  outline: 2px solid var(--color-brand-600);
  outline-offset: 2px;
}

/* Keyboard accessibility */

#qb-posts a:focus-visible,
#qb-posts button:focus-visible {
  outline: 2px solid var(--color-brand-600);
  outline-offset: 3px;
}

/* Tablet and mobile */

@media (max-width: 768px) {
  .videokiosk-blog-container {
    width: min(100% - 1.5rem, 1200px);
    padding-block: 2rem 3rem;
  }

  #qb-posts {
    overflow-wrap: anywhere;
  }

  #qb-posts .qb-banner {
    padding: 0 0 1.5rem;
  }
}

@media (max-width: 480px) {
  .videokiosk-blog-container {
    width: min(100% - 1rem, 1200px);
  }
}
