/* ============================================================
   style.css — PianoSheetPlus
   Theme: Elegant Editorial — kem ngà + đen + accent vàng đồng
   ============================================================ */

/* ── Variables ── */
:root {
  --bg:           #faf9f6;
  --bg-card:      #ffffff;
  --bg-dark:      #1a1814;
  --text:         #1a1814;
  --text-muted:   #6b6560;
  --text-light:   #9e9893;
  --accent:       #b8965a;
  --accent-hover: #9e7e48;
  --accent-light: #f5eddf;
  --border:       #e8e3dc;
  --border-dark:  #d0c8be;
  --shadow-sm:    0 2px 8px rgba(26,24,20,.06);
  --shadow-md:    0 6px 24px rgba(26,24,20,.10);
  --shadow-lg:    0 16px 48px rgba(26,24,20,.14);
  --radius:       12px;
  --radius-sm:    8px;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --max-w:        1200px;
  --header-h:     68px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Container ── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,249,246,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-h);
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  flex-shrink: 0;
}
.logo svg { color: var(--accent); }
.logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.logo-text em { color: var(--accent); font-style: italic; }

.main-nav {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.main-nav a {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.main-nav a:hover, .main-nav a.active {
  background: var(--accent-light);
  color: var(--accent);
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1.5px solid var(--border-dark);
  border-radius: 24px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.header-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184,150,90,.15);
}
.header-search input {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: .9rem;
  font-family: var(--font-body);
  color: var(--text);
  width: 220px;
  outline: none;
}
.header-search input::placeholder { color: var(--text-light); }
.header-search button {
  padding: 8px 14px 8px 8px;
  color: var(--text-muted);
  transition: color .15s;
}
.header-search button:hover { color: var(--accent); }

.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
  padding: 8px;
}
.mobile-menu-btn span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .2s;
}
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 24px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.mobile-nav a { font-weight: 500; padding: 6px 0; }
.mobile-search {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.mobile-search input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid var(--border-dark);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: .9rem;
  outline: none;
  background: var(--bg-card);
}
.mobile-search button {
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 600;
}
.mobile-nav.open { display: flex; }

/* ── Hero ── */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  background: linear-gradient(160deg, var(--bg) 60%, var(--accent-light) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-eyebrow {
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 16px;
}
.hero-title em { color: var(--accent); font-style: italic; }
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 480px;
  margin-inline: auto;
}
.hero-search {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 2px solid var(--border-dark);
  border-radius: 48px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: border-color .2s, box-shadow .2s;
}
.hero-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(184,150,90,.18);
}
.hero-search input {
  flex: 1;
  border: none;
  padding: 14px 20px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: transparent;
  color: var(--text);
  outline: none;
}
.hero-search input::placeholder { color: var(--text-light); }
.hero-search button {
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: .95rem;
  font-family: var(--font-body);
  border-radius: 0 44px 44px 0;
  transition: background .15s;
}
.hero-search button:hover { background: var(--accent-hover); }

/* ── Section titles ── */
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 8px;
}
.total-count {
  font-size: .85rem;
  color: var(--text-muted);
}

/* ── Tag section ── */
.tag-section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border);
}
.tag-section .section-title { margin-bottom: 20px; }
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Tags ── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--accent-light);
  color: var(--accent-hover);
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 600;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.tag:hover { background: var(--accent); color: #fff; }
.tag-cloud-item { font-size: .82rem; padding: 5px 12px; }
.tag-count {
  background: rgba(0,0,0,.08);
  border-radius: 12px;
  padding: 1px 6px;
  font-size: .72rem;
}
.tag-lg { font-size: .85rem; padding: 6px 14px; }

/* ── Sheet section ── */
.sheet-section { padding: 56px 0 72px; }
.sheet-section .section-title { margin-bottom: 0; }

/* ── Sheet grid ── */
.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.sheet-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

/* ── Sheet card ── */
.sheet-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.sheet-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--accent-light);
  display: block;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .3s;
}
.sheet-card:hover .card-img-wrap img { transform: scale(1.04); }
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26,24,20,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.sheet-card:hover .card-overlay { opacity: 1; }
.card-view-btn {
  background: #fff;
  color: var(--text);
  padding: 8px 18px;
  border-radius: 24px;
  font-size: .85rem;
  font-weight: 600;
}

.card-body {
  padding: 12px 14px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.card-title {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a:hover { color: var(--accent); }
.card-author {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  color: var(--text-muted);
}
.card-author a:hover { color: var(--accent); }
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-actions {
  display: flex;
  border-top: 1px solid var(--border);
}
.btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 6px;
  font-size: .78rem;
  font-weight: 600;
  font-family: var(--font-body);
  transition: background .15s, color .15s;
}
.btn-print {
  color: var(--accent-hover);
  border-right: 1px solid var(--border);
}
.btn-print:hover { background: var(--accent-light); color: var(--accent); }
.btn-midi { color: var(--text-muted); }
.btn-midi:hover { background: #f0f7ff; color: #2563eb; }

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 40px;
}
.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: .9rem;
  font-weight: 500;
  border: 1.5px solid var(--border-dark);
  color: var(--text-muted);
  background: var(--bg-card);
  transition: background .15s, color .15s, border-color .15s;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-dots { padding: 0 4px; color: var(--text-light); }

/* ── Page header ── */
.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 48px 0 28px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
  flex-wrap: wrap;
  gap: 8px;
}
.page-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
}
.page-heading em { color: var(--accent); font-style: italic; }

/* ── Search bar (search page) ── */
.search-bar {
  display: flex;
  max-width: 600px;
  margin: 0 auto 40px;
  gap: 10px;
}
.search-bar input {
  flex: 1;
  padding: 12px 18px;
  border: 2px solid var(--border-dark);
  border-radius: 10px;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--bg-card);
  color: var(--text);
  outline: none;
  transition: border-color .2s;
}
.search-bar input:focus { border-color: var(--accent); }
.search-bar button {
  padding: 12px 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: .95rem;
  transition: background .15s;
}
.search-bar button:hover { background: var(--accent-hover); }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
}
.empty-state p { margin-bottom: 12px; }
.empty-state a { color: var(--accent); font-weight: 600; }

/* ── Tags grid (tags.php) ── */
.tags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding-bottom: 64px;
}
.tag-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tag-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.tag-card-name { font-weight: 600; font-size: .9rem; }
.tag-card-count { font-size: .78rem; color: var(--text-muted); }

/* ── Detail page ── */
.detail-page { padding: 32px 0 72px; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-light); }

.detail-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  margin-bottom: 64px;
}

.detail-cover-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 3/4;
  background: var(--accent-light);
}
.detail-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: .92rem;
  transition: background .15s, transform .1s;
}
.btn-action:hover { transform: translateY(-1px); }
.btn-action-primary { background: var(--accent); color: #fff; }
.btn-action-primary:hover { background: var(--accent-hover); }
.btn-action-secondary { background: #1d4ed8; color: #fff; }
.btn-action-secondary:hover { background: #1e40af; }
.btn-action-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border-dark);
}
.btn-action-outline:hover { border-color: var(--accent); color: var(--accent); }

.detail-meta {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: .84rem;
}
.meta-row:not(:last-child) { border-bottom: 1px solid var(--border); }
.meta-label { color: var(--text-muted); }
.meta-value { font-weight: 500; }
.meta-value a:hover { color: var(--accent); }

.detail-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 28px;
}

.sheet-preview-box {
  background: var(--accent-light);
  border: 2px dashed var(--border-dark);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.preview-placeholder svg { margin: 0 auto 16px; opacity: .4; }
.preview-placeholder p { font-size: .95rem; margin-bottom: 8px; }
.preview-note { font-size: .85rem; opacity: .8; }

.detail-body {
  margin-top: 28px;
  line-height: 1.8;
  color: var(--text-muted);
  font-size: .95rem;
}

.related-section { margin-top: 16px; }
.related-section .section-title { margin-bottom: 24px; }

/* ── Footer ── */
.site-footer {
  background: var(--bg-dark);
  color: rgba(255,255,255,.7);
  padding: 56px 0 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.footer-brand .logo { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: .88rem; line-height: 1.7; }
.footer-links { display: flex; flex-direction: column; gap: 6px; }
.footer-links h4 {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.footer-links a {
  font-size: .88rem;
  transition: color .15s;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 16px 0;
  text-align: center;
  font-size: .8rem;
}
.footer-bottom a { color: var(--accent); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .header-search, .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }

  .hero { padding: 48px 0 40px; }

  .sheet-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .sheet-section, .related-section { padding: 32px 0 48px; }

  .detail-layout {
    grid-template-columns: 1fr;
  }
  .detail-cover-wrap {
    max-width: 200px;
    margin: 0 auto;
  }
  .detail-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .btn-action { flex: 1; min-width: 140px; }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .tags-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
}

@media (max-width: 480px) {
  .container { padding: 0 14px; }

  .sheet-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .sheet-card { font-size: .9rem; }
  .card-body  { padding: 10px 10px 6px; }
  .card-title { font-size: .88rem; }

  .btn { font-size: .72rem; padding: 8px 4px; gap: 3px; }
  .btn svg { width: 13px; height: 13px; }

  .hero-title { font-size: 1.6rem; }
  .hero-sub   { font-size: .92rem; }
}