/*
Theme Name: Playing Better Guitar
Theme URI: https://playingbetterguitar.com
Author: PlayingBetterGuitar.com
Description: A block theme for new and left-handed guitar players: a guided learning path, a chord library with left/right-handed charts, and a secondary blog. Brand palette: Ivory Cream, Deep Rosewood, Classic Charcoal, Sunburst Amber. Edit colors, fonts and spacing in the Site Editor (Styles) or in theme.json.
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: playing-better-guitar
*/

/* Tokens (mirrors theme.json) */
:root {
  --pbg-ivory: #fdfbf7; --pbg-raised: #f3ede2; --pbg-ink: #2b1e19; --pbg-muted: #4a4a4a;
  --pbg-amber: #e67e22; --pbg-link: #a0520d; --pbg-radius: 10px;
  --pbg-display: "Bricolage Grotesque", "Nunito Sans", system-ui, sans-serif;
}

/* ---------- Layout bands ---------- */
.pbg-band { padding-top: 64px; padding-bottom: 64px; padding-inline: max(24px, calc((100% - 1200px) / 2)); box-sizing: border-box; }
.pbg-band--tight { padding-top: 48px; padding-bottom: 48px; }
.pbg-band--ruled { border-top: 2px solid var(--pbg-ink); border-bottom: 1px solid var(--pbg-muted); }
.pbg-band--raised { border-top: 1px solid var(--pbg-muted); border-bottom: 1px solid var(--pbg-muted); }
.pbg-band > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.pbg-band > .alignwide { max-width: 1200px; }
.pbg-stack > * + * { margin-block-start: 12px; }
.pbg-narrow { max-width: 640px !important; margin-left: 0 !important; margin-right: auto !important; }

/* ---------- Header / footer ---------- */
.pbg-header { border-bottom: 2px solid var(--pbg-ink); padding-top: 32px; padding-bottom: 32px; padding-inline: max(24px, calc((100% - 1200px) / 2)); box-sizing: border-box; }
.pbg-header .wp-block-image { margin: 0; line-height: 0; }
.pbg-header .wp-block-image img { width: 240px; height: auto; display: block; }
.pbg-header .wp-block-navigation { font-weight: 800; }
.pbg-header .wp-block-navigation a { text-decoration: none; color: var(--pbg-link); padding: 4px 0; border-bottom: 2px solid transparent; }
.pbg-header .wp-block-navigation a:hover { border-bottom-color: var(--pbg-amber); }
.pbg-header .wp-block-navigation .current-menu-item > a, .pbg-header .wp-block-navigation [aria-current="page"] { color: var(--pbg-ink); border-bottom-color: var(--pbg-amber); }
.pbg-footer { border-top: 2px solid var(--pbg-muted); padding-top: 48px; padding-bottom: 48px; padding-inline: max(24px, calc((100% - 1200px) / 2)); box-sizing: border-box; }
.pbg-footer a { color: var(--pbg-ivory); text-decoration: none; font-weight: 800; }
.pbg-footer a:hover { text-decoration: underline; }
.pbg-footer .pbg-footer-name { font-family: var(--pbg-display); font-weight: 800; font-size: 20px; line-height: 1.4; margin: 0; }
.pbg-footer .pbg-footer-tag { color: var(--pbg-raised); font-size: 15px; margin: 0; }

/* ---------- Buttons ---------- */
.wp-block-button.is-style-outline .wp-block-button__link { background: transparent; color: var(--pbg-ink); border: 2px solid var(--pbg-ink); }
.wp-block-button.is-style-outline .wp-block-button__link:hover { background: var(--pbg-raised); }
.wp-block-button.pbg-btn-light .wp-block-button__link { background: transparent; color: var(--pbg-ivory); border: 2px solid var(--pbg-ivory); }
.wp-block-button.pbg-btn-light .wp-block-button__link:hover { background: rgba(253,251,247,.12); }
a:focus-visible, button:focus-visible, input:focus-visible + label { outline: 2px solid var(--pbg-ink); outline-offset: 2px; }
.has-deep-rosewood-background-color a:focus-visible { outline-color: var(--pbg-ivory); }

/* ---------- Badges, links, text ---------- */
.pbg-badge { display: inline-flex; align-items: center; width: fit-content; font-size: 13px !important; line-height: 16px !important; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; margin: 0; text-decoration: none; }
.pbg-badge--neutral { background: var(--pbg-raised); color: var(--pbg-ink); border: 1px solid var(--pbg-muted); }
.pbg-badge--ink { background: var(--pbg-ink); color: var(--pbg-ivory); border: 1px solid var(--pbg-ink); }
.pbg-badge--highlight { background: var(--pbg-amber); color: var(--pbg-ink); border: 1px solid var(--pbg-amber); }
.wp-block-post-terms.pbg-badge a { color: inherit; text-decoration: none; }
.pbg-muted { color: var(--pbg-muted); }
.pbg-light-copy { color: var(--pbg-raised); font-size: 17px; max-width: 560px; }
.pbg-small { font-size: 13px; line-height: 1.4; font-weight: 600; color: var(--pbg-muted); }
.pbg-link-strong { font-size: 15px; font-weight: 800; }
.pbg-lede { font-size: 17px; line-height: 1.65; color: var(--pbg-muted); max-width: 560px; }
.pbg-hero-title { font-size: clamp(36px, 5vw, 56px) !important; line-height: 1.07 !important; }

/* ---------- Cards and grids ---------- */
.pbg-card { background: var(--pbg-ivory); border: 1px solid var(--pbg-muted); border-radius: var(--pbg-radius); padding: 24px; display: flex; flex-direction: column; gap: 12px; box-sizing: border-box; }
.pbg-card--active { border: 2px solid var(--pbg-ink); }
.pbg-card--raised { background: var(--pbg-raised); }
.pbg-card > * { margin-block: 0; }
.pbg-card h3 { margin: 0; }
.pbg-card p { font-size: 15px; line-height: 1.6; color: var(--pbg-muted); }
.pbg-card ul { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.6; }
.pbg-card .pbg-badge { color: inherit; }
.pbg-card .pbg-badge--ink { color: var(--pbg-ivory); }
.pbg-card .wp-block-buttons { margin-top: auto; }
.pbg-card .pbg-card-link { margin-top: auto; font-size: 15px; font-weight: 800; color: var(--pbg-link); }
.pbg-card ul a { color: var(--pbg-link); }

/* ---------- Milestones (learning path) ---------- */
.pbg-milestones { list-style: none; margin: 0; padding: 0; display: flex; }
.pbg-milestones li { flex: 1; position: relative; text-align: center; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--pbg-muted); padding-top: 36px; }
.pbg-milestones li::before { content: ""; position: absolute; top: 13px; left: -50%; right: 50%; height: 2px; background: var(--pbg-muted); }
.pbg-milestones li:first-child::before { display: none; }
.pbg-milestones li::after { content: attr(data-step); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; box-sizing: border-box; border-radius: 999px; border: 2px solid var(--pbg-muted); background: var(--pbg-ivory); color: var(--pbg-muted); font-size: 13px; line-height: 24px; font-weight: 800; z-index: 1; }
.pbg-milestones li[data-state="active"] { color: var(--pbg-ink); font-weight: 800; }
.pbg-milestones li[data-state="active"]::after { background: var(--pbg-amber); border-color: var(--pbg-ink); color: var(--pbg-ink); }

/* ---------- Chord diagrams and tiles ---------- */
.pbg-chord { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; background: var(--pbg-ivory); border: 1px solid var(--pbg-muted); border-radius: 4px; margin: 0; }
.pbg-chord svg { display: block; }
.pbg-chord svg.lefty { transform: scaleX(-1); }
.pbg-chord .string, .pbg-chord .fret { stroke: var(--pbg-muted); stroke-width: 1.5; }
.pbg-chord .nut { stroke: var(--pbg-ink); stroke-width: 5; }
.pbg-chord .dot { fill: var(--pbg-ink); }
.pbg-chord .dot--root { fill: var(--pbg-amber); stroke: var(--pbg-ink); stroke-width: 2; }
.pbg-chord .mark { fill: none; stroke: var(--pbg-ink); stroke-width: 1.5; }
.pbg-chord .x { stroke: var(--pbg-muted); stroke-width: 1.5; }
.pbg-chord figcaption, .pbg-chord .name { font-family: var(--pbg-display); font-weight: 800; font-size: 22px; line-height: 26px; }
.pbg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.pbg-tile { box-sizing: border-box; min-height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: var(--pbg-ivory); border: 1px solid var(--pbg-muted); border-radius: var(--pbg-radius); color: var(--pbg-ink) !important; text-decoration: none !important; font-family: var(--pbg-display); font-weight: 800; font-size: 28px; line-height: 34px; }
.pbg-tile small { font-family: var(--wp--preset--font-family--nunito-sans); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--pbg-muted); }
.pbg-tile:hover { border-color: var(--pbg-ink); border-width: 2px; }
.pbg-chordcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 16px; }
.pbg-chordcards .pbg-chordcard { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; background: var(--pbg-ivory); border: 1px solid var(--pbg-muted); border-radius: var(--pbg-radius); color: var(--pbg-ink) !important; text-decoration: none !important; font-family: var(--pbg-display); font-weight: 800; font-size: 22px; line-height: 26px; }
.pbg-chordcards .pbg-chordcard:hover { border: 2px solid var(--pbg-ink); padding: 15px; }
.pbg-chordcards svg { display: block; width: 120px; height: auto; }
.pbg-chordcards small { font-family: var(--wp--preset--font-family--nunito-sans); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--pbg-muted); }
.pbg-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pbg-pill { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 8px 16px; background: var(--pbg-ivory); border: 1px solid var(--pbg-muted); border-radius: 999px; color: var(--pbg-ink) !important; font-weight: 800; font-size: 15px; text-decoration: none !important; }
.pbg-pill:hover { border: 2px solid var(--pbg-ink); padding: 7px 15px; }
.pbg-chip { display: inline-flex; align-items: center; min-height: 44px; box-sizing: border-box; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-decoration: none !important; background: var(--pbg-raised); color: var(--pbg-ink) !important; border: 1px solid var(--pbg-muted); }
.pbg-chip--active { background: var(--pbg-ink); color: var(--pbg-ivory) !important; }

/* ---------- Left / right-handed toggle (no JS needed; hand.js remembers the choice) ---------- */
.pbg-hand-toggle { position: relative; display: inline-flex; border: 2px solid var(--pbg-ink); border-radius: var(--pbg-radius); overflow: hidden; }
.pbg-hand-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pbg-hand-toggle label { font-size: 15px; font-weight: 800; padding: 12px 24px; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; cursor: pointer; background: var(--pbg-ivory); color: var(--pbg-ink); }
body:has(#h-l:checked) label[for="h-l"], body:has(#h-r:checked) label[for="h-r"] { background: var(--pbg-ink); color: var(--pbg-ivory); }
body:has(#h-l:focus-visible) label[for="h-l"], body:has(#h-r:focus-visible) label[for="h-r"] { outline: 2px solid var(--pbg-ink); outline-offset: 2px; }
body:has(#h-l:checked) .for-r, body:has(#h-r:checked) .for-l { display: none !important; }

/* ---------- Chord page ---------- */
.pbg-handchart { border: 1px solid var(--pbg-muted); border-radius: var(--pbg-radius); overflow: hidden; background: var(--pbg-ivory); line-height: 0; }
.pbg-handchart svg { display: block; width: 100%; height: auto; }
.pbg-fingerkey { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 15px; line-height: 24px; }
.pbg-fingerkey li { display: flex; align-items: center; gap: 8px; }
.pbg-fingerkey b { flex-shrink: 0; width: 28px; height: 28px; box-sizing: border-box; border-radius: 999px; background: var(--pbg-ink); color: var(--pbg-ivory); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.pbg-fingerkey b.t { background: transparent; color: var(--pbg-ink); border: 2px solid var(--pbg-ink); }
.pbg-video video, .pbg-video .wp-block-video video { width: 100%; height: auto; border: 1px solid var(--pbg-muted); border-radius: var(--pbg-radius); background: var(--pbg-ivory); }
.pbg-breadcrumb { font-size: 15px; line-height: 24px; color: var(--pbg-muted); margin: 0; }
.pbg-breadcrumb a { color: var(--pbg-link); }

/* ---------- Blog ---------- */
.pbg-post-meta { font-size: 15px; color: var(--pbg-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.pbg-post-meta .wp-block-post-author-name, .pbg-post-meta .wp-block-post-author-name a { color: var(--pbg-ink); font-weight: 800; text-decoration: none; }
.pbg-postcard { border-top: 2px solid var(--pbg-ink); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.pbg-postcard > * { margin-block: 0; }
.pbg-postcard .wp-block-post-title a { text-decoration: none; color: var(--pbg-ink); }
.pbg-postcard .wp-block-post-title a:hover { text-decoration: underline; }
.pbg-entry > * + * { margin-block-start: 24px; }
.pbg-entry p, .pbg-entry li { font-size: 18px; line-height: 1.65; }
.pbg-entry h2 { margin-top: 40px; }
.pbg-callout { background: var(--pbg-raised); border: 1px solid var(--pbg-muted); border-radius: var(--pbg-radius); padding: 24px; }
.pbg-callout--try { background: var(--pbg-ivory); border: 2px solid var(--pbg-ink); }
.pbg-callout h3, .pbg-callout p { margin: 0; }
.wp-block-post-featured-image img { border-radius: var(--pbg-radius); border: 1px solid var(--pbg-muted); }
.wp-block-query-pagination { gap: 16px; font-weight: 800; }

/* ---------- Responsive ---------- */
@media (max-width: 781px) {
  .pbg-band { padding-top: 48px; padding-bottom: 48px; }
  .pbg-milestones li { font-size: 12px; }
  .pbg-header .wp-block-image img { width: 200px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------- Dark bands: keep headings and links readable ---------- */
.has-deep-rosewood-background-color :is(h1, h2, h3, h4, p) { color: var(--pbg-ivory); }
.has-deep-rosewood-background-color p.pbg-light-copy { color: var(--pbg-raised); }
.has-deep-rosewood-background-color a:not(.wp-block-button__link) { color: var(--pbg-ivory); }
.pbg-header, .pbg-footer { width: 100%; }
body { margin: 0; }
