/*
Theme Name: Guitar Master
Theme URI: https://guitar-master.org/
Author: Guitar-Master.org
Description: Lightweight responsive editorial theme for guitar lessons and tools.
Version: 0.10.7
Requires at least: 7.1
Requires PHP: 8.1
Text Domain: guitar-master
*/

:root {
  --gm-ink: #17201d;
  --gm-muted: #5f6b66;
  --gm-paper: #f7f3ea;
  --gm-card: #fffdf8;
  --gm-night: #151b19;
  --gm-night-soft: #24302c;
  --gm-wood: #b8672f;
  --gm-wood-dark: #8d4722;
  --gm-brass: #e5af4a;
  --gm-line: #d9d1c2;
  --gm-focus: #146c5a;
  --gm-shadow: 0 18px 50px rgb(30 38 34 / 12%);
  --gm-radius: 18px;
  --gm-content: 760px;
  --gm-wide: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--gm-ink);
  background: var(--gm-paper);
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

body.admin-bar .site-header {
  top: 32px;
}

a {
  color: var(--gm-wood-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: #6f3419;
}

:focus-visible {
  outline: 3px solid var(--gm-brass);
  outline-offset: 3px;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

img {
  border-radius: 12px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  z-index: 100000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  clip: auto;
  padding: 12px 16px;
  color: var(--gm-ink);
  background: white;
}

.site-shell {
  width: min(calc(100% - 32px), var(--gm-wide));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  color: #f8f3e8;
  background: rgb(21 27 25 / 96%);
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  backdrop-filter: blur(12px);
}

.header-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: white;
  font-size: 1.05rem;
  font-weight: 780;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--gm-night);
  background: var(--gm-brass);
  border-radius: 52% 52% 58% 42% / 44% 44% 68% 68%;
  transform: rotate(8deg);
  font-size: 0.72rem;
  font-weight: 900;
}

.brand-mark span {
  transform: rotate(-8deg);
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 30px);
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: #f5efe4;
  font-size: 0.94rem;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav .current-menu-item > a {
  color: var(--gm-brass);
}

.nav-toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 10px;
  color: white;
  background: transparent;
  font: inherit;
  font-weight: 700;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(520px, 72vh, 760px);
  display: grid;
  align-items: end;
  color: white;
  background: var(--gm-night);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
  object-position: center 46%;
  filter: contrast(1.05);
}

.hero::after {
  background:
    linear-gradient(90deg, rgb(10 14 13 / 91%) 0%, rgb(10 14 13 / 58%) 52%, rgb(10 14 13 / 15%) 100%),
    linear-gradient(0deg, rgb(10 14 13 / 85%) 0%, transparent 56%);
}

.hero-content {
  max-width: 720px;
  padding-block: clamp(72px, 11vw, 140px) clamp(62px, 8vw, 100px);
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--gm-brass);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1,
.page-title,
.entry-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -0.025em;
}

.hero h1 {
  max-width: 680px;
  font-size: clamp(2.55rem, 7vw, 5.65rem);
}

.hero-copy {
  max-width: 640px;
  margin: 22px 0 30px;
  color: #e4e5df;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.search-submit {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 19px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--gm-night);
  background: var(--gm-brass);
  font: inherit;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.search-submit:hover {
  color: var(--gm-night);
  background: #f2c66e;
}

.button-secondary {
  color: white;
  background: rgb(255 255 255 / 8%);
  border-color: rgb(255 255 255 / 32%);
}

.button-secondary:hover {
  color: white;
  background: rgb(255 255 255 / 15%);
}

.section {
  padding-block: clamp(58px, 8vw, 96px);
}

.section + .section {
  border-top: 1px solid var(--gm-line);
}

.section-heading {
  max-width: 720px;
  margin-bottom: 32px;
}

.section-heading h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1.1;
}

.section-heading p {
  margin: 0;
  color: var(--gm-muted);
  font-size: 1.08rem;
}

.learning-grid,
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.learning-card,
.post-card {
  min-width: 0;
  padding: 26px;
  background: var(--gm-card);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  box-shadow: 0 1px 0 rgb(255 255 255 / 70%) inset;
}

.learning-card {
  position: relative;
  padding-top: 72px;
}

.learning-step {
  position: absolute;
  top: 24px;
  left: 26px;
  color: var(--gm-wood);
  font-family: Georgia, serif;
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.learning-card h3,
.learning-card h2,
.post-card h2,
.post-card h3 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  line-height: 1.23;
}

.learning-card p,
.post-card p {
  margin: 0;
  color: var(--gm-muted);
}

.learning-card h2 a {
  color: var(--gm-ink);
  text-decoration: none;
}

.learning-card h2 a:hover {
  color: var(--gm-wood-dark);
}

.post-card a {
  color: var(--gm-ink);
  text-decoration: none;
}

.post-card a:hover {
  color: var(--gm-wood-dark);
}

.post-meta,
.entry-meta {
  margin: 0 0 12px;
  color: var(--gm-muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.content-wrap {
  width: min(calc(100% - 32px), var(--gm-content));
  margin-inline: auto;
  padding-block: clamp(48px, 8vw, 92px);
}

.content-wrap-wide {
  width: min(calc(100% - 32px), var(--gm-wide));
}

.entry-header {
  margin-bottom: 36px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 22px;
  color: var(--gm-muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--gm-muted);
}

.breadcrumbs [aria-current="page"] {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-title,
.page-title {
  font-size: clamp(2.35rem, 6vw, 4.7rem);
  overflow-wrap: anywhere;
}

.entry-content {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2vw, 1.2rem);
}

.entry-content > * {
  max-width: 100%;
}

.entry-content h2,
.entry-content h3 {
  margin: 1.8em 0 0.55em;
  line-height: 1.2;
}

.entry-content h2 {
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.entry-content h3 {
  font-size: clamp(1.35rem, 3vw, 1.75rem);
}

.entry-content table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

.entry-content th,
.entry-content td {
  padding: 10px 12px;
  border: 1px solid var(--gm-line);
}

.entry-content blockquote {
  margin: 28px 0;
  padding: 8px 0 8px 24px;
  border-left: 4px solid var(--gm-brass);
  color: #46504c;
}

.entry-content img {
  margin-block: 18px;
  box-shadow: var(--gm-shadow);
}

.migration-note {
  margin: 26px 0;
  padding: 16px 18px;
  border: 1px solid #d9aa55;
  border-radius: 12px;
  background: #fff4d7;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 0.95rem;
}

.song-tools {
  position: sticky;
  z-index: 20;
  top: 88px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 22px;
  margin: 26px 0 34px;
  padding: 14px 16px;
  border: 1px solid var(--gm-line);
  border-radius: 14px;
  background: rgb(255 253 248 / 96%);
  box-shadow: 0 10px 30px rgb(30 38 34 / 8%);
  backdrop-filter: blur(10px);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 0.9rem;
}

.song-tools > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.song-tools span {
  margin-right: 3px;
  color: var(--gm-muted);
  font-weight: 700;
}

.song-tools button {
  min-width: 40px;
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid #bdb4a5;
  border-radius: 9px;
  color: var(--gm-ink);
  background: white;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.song-tools button:hover {
  border-color: var(--gm-wood);
  background: #fff7e8;
}

.song-tools-status {
  margin-left: auto;
  color: var(--gm-wood-dark);
  font-weight: 750;
}

.song-sheet {
  font-size: calc(clamp(1.08rem, 2vw, 1.2rem) * var(--song-scale, 1));
}

.song-sheet strong {
  color: var(--gm-wood-dark);
}

.related-posts {
  margin-top: 64px;
  padding-top: 40px;
  border-top: 1px solid var(--gm-line);
}

.related-posts h2 {
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.15;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.related-grid article {
  padding: 18px;
  border: 1px solid var(--gm-line);
  border-radius: 14px;
  background: var(--gm-card);
}

.related-grid h3,
.related-grid p {
  margin: 0;
}

.tool-intro {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--gm-muted);
  font-size: 1.1rem;
}

.music-tool {
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  background: var(--gm-card);
  box-shadow: var(--gm-shadow);
}

.tuner-display {
  display: grid;
  justify-items: center;
  margin-bottom: 26px;
}

.tuner-note {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(5rem, 18vw, 9rem);
  font-weight: 700;
  line-height: 1;
}

.tuner-frequency,
.tuner-hint,
.tool-status {
  color: var(--gm-muted);
}

.tuner-meter {
  position: relative;
  height: 12px;
  margin-block: 20px;
  border-radius: 99px;
  background: linear-gradient(90deg, #b8672f, #e5af4a 45%, #3d8c70 50%, #e5af4a 55%, #b8672f);
}

.tuner-meter span {
  position: absolute;
  top: -8px;
  left: calc(50% - 3px);
  width: 6px;
  height: 28px;
  border-radius: 6px;
  background: var(--gm-night);
  transform: translateX(-50%);
  transition: left 100ms linear;
}

.tuner-meter span.is-tuned {
  background: #176b54;
}

.tempo-value {
  display: block;
  margin-bottom: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 14vw, 7rem);
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.tempo-value span {
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 1rem;
}

.tempo-range {
  width: 100%;
  min-height: 44px;
  accent-color: var(--gm-wood);
}

.metronome-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.metronome-controls select {
  min-width: 64px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid #b8b0a3;
  border-radius: 10px;
  background: white;
  font: inherit;
}

.button-light {
  border-color: var(--gm-line);
  background: white;
}

.beat-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 28px;
  margin-top: 28px;
}

.beat-dots span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gm-line);
}

.beat-dots span.is-active {
  background: var(--gm-wood);
  box-shadow: 0 0 0 6px rgb(184 103 47 / 14%);
}

.tool-note {
  margin-top: 24px;
  padding: 18px 20px;
  border-left: 4px solid var(--gm-brass);
  background: #fff9eb;
}

.related-grid h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  line-height: 1.3;
}

.related-grid h3 a {
  color: var(--gm-ink);
  text-decoration: none;
}

.related-grid p {
  margin-top: 9px;
  color: var(--gm-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-field {
  min-width: 0;
  flex: 1;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #b8b0a3;
  border-radius: 12px;
  background: white;
  font: inherit;
}

.pagination {
  margin-top: 36px;
}

.site-footer {
  padding-block: 40px;
  color: #ced5d1;
  background: var(--gm-night);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--gm-brass);
}

@media (max-width: 860px) {
  body.admin-bar .site-header {
    top: 46px;
  }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 16px;
    left: 16px;
    display: none;
    padding: 18px;
    border: 1px solid rgb(255 255 255 / 14%);
    border-radius: 0 0 16px 16px;
    background: var(--gm-night);
    box-shadow: var(--gm-shadow);
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    align-items: stretch;
    flex-direction: column;
    gap: 4px;
  }

  .site-nav a {
    display: block;
    padding: 11px 8px;
  }

  .learning-grid,
  .post-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .hero::after {
    background: linear-gradient(0deg, rgb(10 14 13 / 92%) 0%, rgb(10 14 13 / 38%) 100%);
  }
}

@media (max-width: 560px) {
  .site-shell,
  .content-wrap,
  .content-wrap-wide {
    width: min(calc(100% - 24px), var(--gm-wide));
  }

  .hero {
    min-height: 610px;
  }

  .hero-content {
    padding-bottom: 56px;
  }

  .button-row,
  .search-form,
  .footer-row {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .search-submit {
    width: 100%;
  }

  .song-tools {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  .song-tools > div {
    justify-content: space-between;
  }

  .song-tools-status {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
