/*
Theme Name: ClearBeer
Theme URI: https://clearbeer.app
Author: ClearBeer
Author URI: https://clearbeer.app
Description: Heritage-craft WordPress theme for ClearBeer — brewery management software, grain to glass. Bold aperture logo, warm heritage palette (Cellar Ink, Bone, Bright Pour, Bottle Green, Barley Gold), Archivo / Oswald / Spectral type system.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: clearbeer
Tags: business, custom-logo, custom-menu, featured-images, block-styles, wide-blocks, editor-style
*/

/* ============================================================
   ClearBeer — Brand tokens
   ============================================================ */
:root {
  --cb-ink:    #15171A;   /* Cellar Ink   — primary text / dark surfaces */
  --cb-bone:   #EDE7DA;   /* Bone         — light ground / paper         */
  --cb-amber:  #D79A2B;   /* Bright Pour  — primary accent / beer        */
  --cb-amber-ink: #C8891F;/* Amber on light (deeper for contrast)        */
  --cb-green:  #2C5C57;   /* Bottle Green — secondary                    */
  --cb-gold:   #C79A3B;   /* Barley Gold  — tertiary / grain             */

  --cb-canvas: #C9C4B7;
  --cb-muted:  #6f6a5e;
  --cb-muted-2:#8a8474;
  --cb-line:   #cbc4b2;
  --cb-line-2: #ddd5c4;

  --cb-success:#2f7d4e;
  --cb-error:  #b23b2e;

  --cb-font-display: 'Archivo', system-ui, sans-serif;
  --cb-font-expanded:'Archivo Expanded', 'Archivo', system-ui, sans-serif;
  --cb-font-label:   'Oswald', system-ui, sans-serif;
  --cb-font-body:    'Spectral', Georgia, serif;

  --cb-radius:   10px;
  --cb-radius-sm:8px;
  --cb-shadow:   0 6px 18px rgba(0,0,0,.13);
  --cb-wrap:     1180px;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cb-bone);
  color: var(--cb-ink);
  font-family: var(--cb-font-body);
  font-size: 18px;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cb-amber-ink); text-decoration: none; }
a:hover { color: var(--cb-green); }

h1, h2, h3, h4 {
  font-family: var(--cb-font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--cb-ink);
  margin: 0 0 .5em;
}
h1 { font-family: var(--cb-font-expanded); font-size: clamp(38px, 5.4vw, 64px); }
h2 { font-family: var(--cb-font-expanded); font-size: clamp(28px, 3.6vw, 40px); }
h3 { font-size: 24px; }
p { margin: 0 0 1.2em; text-wrap: pretty; }

.cb-kicker {
  font-family: var(--cb-font-label);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
  font-weight: 600;
  color: var(--cb-muted-2);
}

.cb-wrap { max-width: var(--cb-wrap); margin-inline: auto; padding-inline: 24px; }

/* ============================================================
   Buttons
   ============================================================ */
.cb-btn {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--cb-font-label);
  text-transform: uppercase; letter-spacing: .12em; font-weight: 600;
  font-size: 14px;
  padding: 14px 26px; border-radius: 40px;
  background: var(--cb-amber); color: var(--cb-ink);
  border: 2px solid var(--cb-amber);
  transition: transform .15s ease, background .15s ease, color .15s ease;
  cursor: pointer;
}
.cb-btn:hover { background: var(--cb-amber-ink); border-color: var(--cb-amber-ink); color: var(--cb-ink); transform: translateY(-1px); }
.cb-btn--ghost { background: transparent; color: var(--cb-bone); border-color: rgba(237,231,218,.4); }
.cb-btn--ghost:hover { background: rgba(237,231,218,.1); color: var(--cb-bone); border-color: var(--cb-bone); }
.cb-btn--ink { background: var(--cb-ink); border-color: var(--cb-ink); color: var(--cb-bone); }
.cb-btn--ink:hover { background: #000; border-color:#000; color: var(--cb-bone); }

/* ============================================================
   Site header
   ============================================================ */
.cb-site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--cb-ink);
  color: var(--cb-bone);
}
.cb-site-header .cb-wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; gap: 24px;
}
.cb-brand { display: flex; align-items: center; gap: 14px; }
.cb-brand__mark { width: 44px; height: 44px; flex: none; }
.cb-brand__name {
  font-family: var(--cb-font-display); font-weight: 800; font-size: 26px;
  letter-spacing: -0.02em; color: var(--cb-bone);
}
.cb-brand__name b { color: var(--cb-amber); font-weight: 800; }
.cb-brand:hover .cb-brand__name { color: var(--cb-bone); }

.cb-nav { display: flex; align-items: center; gap: 8px; }
.cb-nav ul { display: flex; list-style: none; margin: 0; padding: 0; gap: 4px; }
.cb-nav a {
  font-family: var(--cb-font-label); text-transform: uppercase;
  letter-spacing: .1em; font-size: 13px; font-weight: 500;
  color: var(--cb-bone); padding: 10px 14px; border-radius: 8px;
  transition: background .15s ease, color .15s ease;
}
.cb-nav a:hover, .cb-nav .current-menu-item > a { background: rgba(237,231,218,.1); color: var(--cb-amber); }
.cb-nav__cta { display: none; }   /* only shown inside the mobile dropdown */
.cb-header-cta { display: flex; align-items: center; gap: 14px; }
.cb-menu-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0; flex: none;
  align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid rgba(237,231,218,.35);
  background: transparent; color: var(--cb-bone); cursor: pointer;
}
.cb-menu-toggle:hover { background: rgba(237,231,218,.1); border-color: var(--cb-bone); }
.cb-menu-toggle svg { width: 22px; height: 22px; display: block; }
.cb-menu-toggle .cb-x { display: none; }
.cb-menu-toggle[aria-expanded="true"] .cb-bars { display: none; }
.cb-menu-toggle[aria-expanded="true"] .cb-x { display: block; }

/* ============================================================
   Hero
   ============================================================ */
.cb-hero {
  background: var(--cb-ink); color: var(--cb-bone);
  padding: 92px 0 104px; position: relative; overflow: hidden;
}
.cb-hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
.cb-hero h1 { color: var(--cb-bone); }
.cb-hero h1 b { color: var(--cb-amber); }
.cb-hero__lead { font-size: 20px; color: #b7b0a2; max-width: 34ch; }
.cb-hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.cb-hero__art {
  aspect-ratio: 1; border-radius: 24px; background: var(--cb-green);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--cb-shadow);
}
.cb-hero__art svg { width: 62%; height: 62%; }
.cb-hero__eyebrow { margin-bottom: 18px; color: var(--cb-gold); }

/* ============================================================
   Sections
   ============================================================ */
.cb-section { padding: 84px 0; }
.cb-section--bone { background: var(--cb-bone); }
.cb-section--canvas { background: var(--cb-canvas); }
.cb-section--green { background: var(--cb-green); color: var(--cb-bone); }
.cb-section--green h2, .cb-section--green h3 { color: var(--cb-bone); }
.cb-section__head { max-width: 640px; margin-bottom: 44px; }
.cb-section__head p { color: var(--cb-muted); }
.cb-section--green .cb-section__head p { color: #cfe0dc; }

.cb-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cb-card {
  background: var(--cb-bone); border: 1px solid var(--cb-line);
  border-radius: var(--cb-radius); padding: 32px;
}
.cb-section--bone .cb-card { background: #fff; }
.cb-card__icon {
  width: 52px; height: 52px; border-radius: 12px; background: var(--cb-ink);
  display: flex; align-items: center; justify-content: center; margin-bottom: 18px;
}
.cb-card__icon svg { width: 30px; height: 30px; }
.cb-card h3 { font-family: var(--cb-font-display); font-size: 21px; }
.cb-card p { font-size: 16px; color: var(--cb-muted); margin: 0; }

.cb-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.cb-step { position: relative; padding-top: 18px; }
.cb-step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--cb-font-label); font-weight: 600; font-size: 14px;
  letter-spacing: .1em; color: var(--cb-gold);
}
.cb-step h3 { font-size: 19px; margin: 10px 0 6px; }
.cb-step p { font-size: 15px; color: var(--cb-muted); margin: 0; }
.cb-section--green .cb-step p { color: #cfe0dc; }

/* CTA band */
.cb-cta {
  background: var(--cb-amber); color: var(--cb-ink);
  border-radius: 16px; padding: 56px; text-align: center;
}
.cb-cta h2 { color: var(--cb-ink); }
.cb-cta p { color: #5c451a; max-width: 48ch; margin-inline: auto; }

/* ============================================================
   Content (posts/pages)
   ============================================================ */
.cb-main { padding: 64px 0; }
.cb-content { max-width: 760px; margin-inline: auto; }
.cb-content .entry-title { margin-bottom: 8px; }
.cb-meta { font-family: var(--cb-font-label); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--cb-muted-2); margin-bottom: 28px; }
.cb-content img { border-radius: var(--cb-radius-sm); margin: 24px 0; }
.cb-content blockquote {
  border-left: 4px solid var(--cb-amber); margin: 28px 0; padding: 6px 0 6px 24px;
  font-style: italic; color: var(--cb-ink);
}
.cb-content h2 { margin-top: 1.6em; }
.cb-content code { background: #00000010; padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.cb-content pre { background: var(--cb-ink); color: var(--cb-bone); padding: 20px; border-radius: var(--cb-radius-sm); overflow: auto; }

/* Post grid (index/archive) */
.cb-posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.cb-post {
  background: #fff; border: 1px solid var(--cb-line); border-radius: var(--cb-radius);
  overflow: hidden; display: flex; flex-direction: column;
}
.cb-post__thumb { aspect-ratio: 16/10; background: var(--cb-canvas); overflow: hidden; }
.cb-post__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cb-post__body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cb-post h3 { font-size: 20px; margin: 0; }
.cb-post .cb-meta { margin: 0; }
.cb-post p { font-size: 15px; color: var(--cb-muted); margin: 0; }
.cb-readmore { margin-top: auto; font-family: var(--cb-font-label); text-transform: uppercase; letter-spacing: .1em; font-size: 13px; font-weight: 600; }

/* Pagination */
.cb-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 48px; }
.cb-pagination .page-numbers {
  font-family: var(--cb-font-label); font-weight: 500; letter-spacing: .06em;
  padding: 10px 15px; border-radius: 8px; border: 1px solid var(--cb-line); color: var(--cb-ink);
}
.cb-pagination .page-numbers.current, .cb-pagination .page-numbers:hover { background: var(--cb-ink); color: var(--cb-bone); border-color: var(--cb-ink); }

/* ============================================================
   Footer
   ============================================================ */
.cb-site-footer { background: var(--cb-ink); color: #b7b0a2; padding: 64px 0 32px; }
.cb-site-footer .cb-brand__name { font-size: 22px; }
.cb-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.cb-site-footer h4 { font-family: var(--cb-font-label); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: var(--cb-bone); margin: 0 0 16px; }
.cb-site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cb-site-footer a { color: #b7b0a2; font-family: var(--cb-font-label); text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.cb-site-footer a:hover { color: var(--cb-amber); }
.cb-footer-tagline { font-family: var(--cb-font-body); font-style: italic; font-size: 15px; color: #8f887b; max-width: 30ch; margin-top: 14px; }
.cb-colophon { border-top: 1px solid rgba(237,231,218,.12); padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; font-family: var(--cb-font-label); text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }

/* WP required */
.screen-reader-text { position: absolute !important; clip: rect(1px,1px,1px,1px); width:1px; height:1px; overflow:hidden; }
.alignwide { max-width: 1180px; } .alignfull { max-width: 100%; }
.wp-caption-text { font-size: 13px; color: var(--cb-muted); }
.sticky, .gallery-caption, .bypostauthor { }

/* ============================================================
   Block-based homepage (the "ClearBeer Homepage" pattern)
   Scoped to .cb-home so it matches the PHP layout.
   ============================================================ */
.cb-home { }
.cb-home > .wp-block-group { margin-block: 0; }
.cb-home .cb-p-kicker {
  font-family: var(--cb-font-label); text-transform: uppercase; letter-spacing: .28em;
  font-size: 12px; font-weight: 600; color: var(--cb-muted-2); margin: 0 0 16px;
}
.cb-home .cb-p-kicker--gold { color: var(--cb-gold); }
.cb-home .cb-p-kicker--dark { color: #5c451a; }

/* Hero */
.cb-home .cb-p-hero { padding: 92px 24px 104px; }
.cb-home .cb-p-hero h1 { font-family: var(--cb-font-expanded); font-size: clamp(38px,5.4vw,64px); font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--cb-bone); margin: 0 0 .4em; }
.cb-home .cb-p-hero .cb-p-lead { font-size: 20px; color: #b7b0a2; max-width: 34ch; }

/* Section shell */
.cb-home .cb-p-section { padding: 84px 24px; }
.cb-home .cb-p-section h2 { font-family: var(--cb-font-expanded); font-size: clamp(28px,3.6vw,40px); font-weight: 800; letter-spacing: -.02em; color: var(--cb-ink); margin: 0 0 .4em; }
.cb-home .cb-p-green h2 { color: var(--cb-bone); }
.cb-home .cb-p-sub { color: var(--cb-muted); max-width: 640px; margin: 0 0 40px; }

/* Feature cards */
.cb-home .cb-p-cards { margin-bottom: 20px; gap: 22px; }
.cb-home .cb-p-card {
  background: #fff; border: 1px solid var(--cb-line); border-radius: var(--cb-radius);
  padding: 32px; height: 100%;
}
.cb-home .cb-p-card h3 { font-family: var(--cb-font-display); font-size: 21px; font-weight: 800; margin: 0 0 8px; }
.cb-home .cb-p-card p { font-size: 16px; color: var(--cb-muted); margin: 0; }

/* Steps */
.cb-home .cb-p-steps { gap: 20px; }
.cb-home .cb-p-step-n { font-family: var(--cb-font-label); font-weight: 600; font-size: 14px; letter-spacing: .1em; color: var(--cb-gold); margin: 0 0 10px; }
.cb-home .cb-p-green h3 { color: var(--cb-bone); font-size: 19px; margin: 0 0 6px; }
.cb-home .cb-p-green p { font-size: 15px; color: #cfe0dc; margin: 0; }

/* CTA band */
.cb-home .cb-p-ctaband { padding: 84px 24px; }
.cb-home .cb-p-cta { border-radius: 16px; padding: 56px; text-align: center; }
.cb-home .cb-p-cta h2 { color: var(--cb-ink); }
.cb-home .cb-p-cta-sub { color: #5c451a; max-width: 48ch; margin-inline: auto; }

/* Buttons inside the pattern (core buttons) */
.cb-home .wp-block-button__link {
  font-family: var(--cb-font-label); text-transform: uppercase; letter-spacing: .12em;
  font-weight: 600; font-size: 14px; padding: 14px 26px; border-radius: 40px;
}
.cb-home .wp-block-button.is-style-outline .wp-block-button__link {
  color: var(--cb-bone); border: 2px solid rgba(237,231,218,.4); background: transparent;
}
@media (max-width: 900px) {
  .cb-home .cb-p-cards, .cb-home .cb-p-steps { gap: 16px; }
}
@media (max-width: 782px) {
  .cb-home .cb-p-hero { padding: 60px 24px 72px; }
  .cb-home .cb-p-section, .cb-home .cb-p-ctaband { padding: 60px 24px; }
  .cb-home .cb-p-cta { padding: 36px 24px; }
}


/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .cb-hero__grid { grid-template-columns: 1fr; gap: 36px; }
  .cb-hero__art { max-width: 320px; }
  .cb-features, .cb-posts { grid-template-columns: 1fr 1fr; }
  .cb-steps { grid-template-columns: 1fr 1fr; }
  .cb-footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  /* Header collapses to brand + hamburger only */
  .cb-site-header .cb-wrap { height: 64px; gap: 12px; }
  .cb-brand__mark { width: 38px; height: 38px; }
  .cb-brand__name { font-size: 22px; }
  .cb-nav { display: none; }
  .cb-header-demo { display: none; }        /* demo CTA lives in the hero + menu, not the bar */
  .cb-menu-toggle { display: inline-flex; }

  /* Dropdown panel */
  .cb-nav.is-open {
    display: flex; flex-direction: column; gap: 4px;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--cb-ink); padding: 12px 24px 20px;
    border-top: 1px solid rgba(237,231,218,.12);
    box-shadow: 0 18px 30px rgba(0,0,0,.35);
  }
  .cb-nav.is-open ul { flex-direction: column; gap: 2px; width: 100%; }
  .cb-nav.is-open a { display: block; padding: 14px 12px; font-size: 15px; }
  .cb-nav.is-open .cb-nav__cta { margin-top: 8px; display: block; }
  .cb-nav.is-open .cb-btn { width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
  .cb-features, .cb-posts, .cb-steps, .cb-footer-grid { grid-template-columns: 1fr; }
  .cb-cta { padding: 36px 24px; }
  .cb-section { padding: 60px 0; }
  .cb-hero { padding: 60px 0 72px; }
  .cb-hero__actions .cb-btn { width: 100%; justify-content: center; }
}
