/**
 * HAH Shell — fullwidth layout (demo + production sync).
 * Tokens inherit from brand-tokens.css (--hah-*).
 * Source of truth for homepage / list chrome; keep demo HTML on the same classes.
 */
:root {
  --hah-shell-bg: var(--hah-bg, #f7f8fa);
  --hah-shell-surface: var(--hah-surface, #fff);
  --hah-shell-surface-2: var(--hah-surface-muted, #eef1f4);
  --hah-shell-text: var(--hah-ink, #1a1c1e);
  --hah-shell-muted: var(--hah-ink-muted, #5c636a);
  --hah-shell-line: var(--hah-border, #e3e6ea);
  --hah-shell-red: var(--hah-brand, #d83030);
  --hah-shell-red-dark: var(--hah-brand-hover, #b82525);
  --hah-shell-red-soft: #fff1f0;
  --hah-shell-shadow: 0 8px 24px rgba(26, 28, 30, 0.05);
  --hah-shell-pad: 28px;
  --hah-shell-radius: var(--hah-radius, 10px);
  --hah-shell-sidebar: 350px;
}

@media (min-width: 1500px) {
  :root {
    --hah-shell-pad: 42px;
    --hah-shell-sidebar: 390px;
    --hah-page-gutter: 42px;
    --hah-page-gutter-lg: 42px;
  }
}

@media (max-width: 720px) {
  :root {
    --hah-shell-pad: 14px;
    --hah-page-gutter: 14px;
    --hah-page-gutter-lg: 14px;
  }
}

/* ---------- Shared wrappers ---------- */
.hah-wrap {
  width: 100%;
  max-width: none;
  padding-left: var(--hah-shell-pad);
  padding-right: var(--hah-shell-pad);
  margin: 0 auto;
}

.hah-shell body,
body.hah-shell {
  background: var(--hah-shell-bg);
  color: var(--hah-shell-text);
}

/* Beat Bootstrap container caps — cùng pad với hero (.hah-wrap) */
body.hah-shell .container,
body.hah-shell .container-sm,
body.hah-shell .container-md,
body.hah-shell .container-lg,
body.hah-shell .container-xl,
body.hah-shell .container-xxl,
body.hah-shell .hah-wrap.container {
  max-width: none !important;
  width: 100%;
  padding-left: var(--hah-shell-pad) !important;
  padding-right: var(--hah-shell-pad) !important;
}

/* Child page chrome (lists / singles / archives) */
.hah-page {
  padding-top: 18px;
  padding-bottom: 40px;
}

.hah-crumb-wrap {
  padding-top: 14px;
  padding-bottom: 0;
}

.hah-breadcrumbs {
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--hah-shell-muted);
}

.hah-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hah-breadcrumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.hah-breadcrumbs li:not(:last-child)::after {
  content: "/";
  color: #a1a1aa;
  margin-left: 0.2rem;
  font-weight: 600;
}

.hah-breadcrumbs a {
  color: var(--hah-shell-muted);
  text-decoration: none;
  font-weight: 600;
}

.hah-breadcrumbs a:hover {
  color: var(--hah-shell-red);
}

.hah-breadcrumbs [aria-current="page"] {
  color: var(--hah-shell-text);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(48ch, 70vw);
}

body.hah-shell .hah-page .page-header {
  border-bottom: 1px solid var(--hah-shell-line) !important;
  padding-bottom: 12px;
  margin-bottom: 18px !important;
}

body.hah-shell .hah-page .page-title,
body.hah-shell .hah-page h1.page-title {
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hah-shell-text);
  margin: 0;
}

/* Practice / tab stages: cùng gutter với hero */
body.hah-shell .song-page-full,
body.hah-shell .tab-page-full {
  padding-left: var(--hah-shell-pad) !important;
  padding-right: var(--hah-shell-pad) !important;
}

/* ---------- Header restyle (keep autocomplete DOM) ---------- */
body.hah-shell #site-header {
  background: rgba(255, 255, 255, 0.94) !important;
  border-bottom: 1px solid var(--hah-shell-line) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0;
}

body.hah-shell #site-header .header-desktop {
  min-height: 68px;
  gap: 18px;
}

body.hah-shell #site-header .header-search-form .form-control {
  height: 42px;
  border-radius: 11px;
  background: var(--hah-shell-surface-2);
  border-color: var(--hah-shell-line);
}

body.hah-shell #site-header .btn-primary {
  border-radius: 9px;
  font-weight: 800;
}

body.hah-shell #site-header .navbar-nav .nav-link {
  font-weight: 700;
  color: #3f3f46;
  border-radius: 8px;
  padding: 8px 9px;
}

body.hah-shell #site-header .navbar-nav .nav-link:hover {
  background: #f4f4f5;
  color: var(--hah-shell-text);
}

/* ---------- Hero (centered manifesto) ---------- */
.hah-hero {
  background: var(--hah-shell-surface);
  border-bottom: 1px solid var(--hah-shell-line);
}

.hah-hero-in {
  position: relative;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0;
  padding: 34px 0 40px;
}

.hah-hero-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hah-kicker {
  color: var(--hah-shell-red);
  text-transform: uppercase;
  font-weight: 850;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.hah-hero h1 {
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  line-height: 1.2;
  margin: 8px 0 12px;
  letter-spacing: -0.02em;
  color: var(--hah-shell-text);
  font-weight: 800;
  max-width: 20em;
}

.hah-hero p {
  max-width: 52ch;
  color: #52525b;
  font-size: 16px;
  margin: 0 auto 18px;
  line-height: 1.5;
}

.hah-hero-search {
  display: flex;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  gap: 8px;
}

.hah-hero-search input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--hah-shell-line);
  border-radius: 11px;
  padding: 0 14px;
  outline: none;
  background: #fff;
  text-align: left;
}

.hah-hero-search input:focus {
  border-color: #d1d5db;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}

.hah-hero-visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(96px, 14vw, 140px);
  color: var(--hah-shell-red);
  opacity: 0.06;
  user-select: none;
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.hah-btn {
  border: 1px solid var(--hah-shell-line);
  background: #fff;
  padding: 9px 13px;
  border-radius: 9px;
  font-weight: 800;
  color: var(--hah-shell-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.hah-btn:hover {
  color: var(--hah-shell-text);
  text-decoration: none;
}

.hah-btn-primary,
a.hah-btn-primary {
  background: var(--hah-shell-red);
  color: #fff !important;
  border-color: var(--hah-shell-red);
}

.hah-btn-primary:hover,
a.hah-btn-primary:hover {
  background: var(--hah-shell-red-dark);
  border-color: var(--hah-shell-red-dark);
  color: #fff !important;
}

.hah-hero-search .hah-btn {
  height: 46px;
  padding: 0 16px;
  white-space: nowrap;
}

/* ---------- Content shell ---------- */
.hah-content-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--hah-shell-sidebar);
  gap: 24px;
  padding-top: 26px;
  padding-bottom: 40px;
}

.hah-main,
.hah-sidebar {
  min-width: 0;
}

.hah-section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 0 0 12px;
}

.hah-section-head h2 {
  font-size: 23px;
  margin: 0;
  font-weight: 800;
  color: var(--hah-shell-text);
}

.hah-section-head p {
  margin: 2px 0 0;
  color: var(--hah-shell-muted);
}

/* List/archive page titles = same scale as home section heads */
.hah-page-title,
.hah-section-head .hah-page-title,
h1.hah-page-title {
  font-size: 23px;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--hah-shell-text);
  line-height: 1.25;
}

.hah-archive-desc,
.hah-page-intro {
  color: var(--hah-shell-muted);
  font-size: 14px;
  margin: 0 0 14px;
  max-width: 65ch;
}

.hah-page-intro p:last-child {
  margin-bottom: 0;
}

.hah-empty {
  padding: 18px;
  color: var(--hah-shell-muted);
  font-size: 14px;
}

.hah-list-ad {
  padding: 12px 18px;
  border-bottom: 1px solid var(--hah-shell-line);
  background: var(--hah-shell-surface);
}

/* Pagination — shell */
.hah-pagination {
  margin-top: 18px;
}

.hah-pagination .page-numbers,
.hah-pagination ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  justify-content: center;
}

.hah-pagination li {
  margin: 0;
}

.hah-pagination a.page-numbers,
.hah-pagination span.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--hah-shell-line);
  border-radius: 9px;
  background: #fff;
  color: var(--hah-shell-text);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.hah-pagination a.page-numbers:hover {
  border-color: rgba(var(--hah-brand-rgb, 216, 48, 48), 0.35);
  color: var(--hah-shell-red);
}

.hah-pagination span.page-numbers.current {
  background: var(--hah-shell-red);
  border-color: var(--hah-shell-red);
  color: #fff;
}

/* Sidebar widgets → match .hah-side */
body.hah-shell .hah-sidebar .widget {
  background: var(--hah-shell-surface);
  border: 1px solid var(--hah-shell-line);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 0 0 14px;
  box-shadow: none;
}

body.hah-shell .hah-sidebar .widget-title,
body.hah-shell .hah-sidebar h2,
body.hah-shell .hah-sidebar h3 {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 10px;
  color: var(--hah-shell-text);
}

body.hah-shell .hah-sidebar a {
  color: var(--hah-shell-text);
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
}

body.hah-shell .hah-sidebar a:hover {
  color: var(--hah-shell-red);
}

body.hah-shell .hah-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

body.hah-shell .hah-sidebar li {
  padding: 7px 0;
  border-bottom: 1px solid var(--hah-shell-line);
  font-size: 13.5px;
}

body.hah-shell .hah-sidebar li:last-child {
  border-bottom: 0;
}

.hah-link {
  color: var(--hah-shell-red);
  font-weight: 800;
  text-decoration: none;
}

.hah-link:hover {
  color: var(--hah-shell-red-dark);
}

/* ---------- Quick strip ---------- */
.hah-quick-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.hah-quick-card {
  background: var(--hah-shell-surface);
  border: 1px solid var(--hah-shell-line);
  border-radius: 11px;
  padding: 15px;
  min-height: 98px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.hah-quick-card:hover {
  border-color: rgba(var(--hah-brand-rgb, 216, 48, 48), 0.35);
  background: #fffafa;
  color: inherit;
  text-decoration: none;
}

.hah-quick-card b {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}

.hah-quick-card span {
  color: var(--hah-shell-muted);
  font-size: 12.5px;
}

/* ---------- Song list ---------- */
.hah-song-list {
  background: var(--hah-shell-surface);
  border: 1px solid var(--hah-shell-line);
  border-radius: 12px;
  overflow: hidden;
}

.hah-song {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--hah-shell-line);
  transition: background 0.16s ease;
  text-decoration: none;
  color: inherit;
}

.hah-song:last-child {
  border-bottom: 0;
}

.hah-song:hover {
  background: #fffafa;
  color: inherit;
  text-decoration: none;
}

.hah-song-title {
  font-size: 16px;
  font-weight: 850;
  margin-bottom: 5px;
  color: var(--hah-shell-text);
}

.hah-song:hover .hah-song-title {
  color: var(--hah-shell-red);
}

.hah-song-desc {
  font-size: 13px;
  color: #52525b;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hah-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--hah-shell-muted);
  font-size: 12.5px;
}

.hah-tags {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.hah-tag {
  padding: 5px 8px;
  border-radius: 7px;
  background: #f4f4f5;
  color: #52525b;
  font-weight: 750;
  font-size: 12px;
}

.hah-tag-red {
  background: var(--hah-shell-red-soft);
  color: var(--hah-shell-red-dark);
}

/* ---------- Sidebar ranks ---------- */
.hah-side {
  background: var(--hah-shell-surface);
  border: 1px solid var(--hah-shell-line);
  border-radius: 12px;
  padding: 17px;
  margin-bottom: 16px;
}

.hah-side h3 {
  font-size: 15px;
  margin: 0 0 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  border: 0;
  padding: 0;
}

.hah-rank {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 9px;
  padding: 9px 0;
  border-top: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}

.hah-rank:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.hah-rank:hover {
  color: inherit;
  text-decoration: none;
}

.hah-rank:hover .hah-rank-title {
  color: var(--hah-shell-red);
}

.hah-num {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: #f4f4f5;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 850;
  color: #71717a;
}

.hah-rank:nth-of-type(-n+3) .hah-num {
  background: var(--hah-shell-red-soft);
  color: var(--hah-shell-red);
}

.hah-rank-title {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.4;
}

.hah-rank small {
  color: var(--hah-shell-muted);
  display: block;
  margin-top: 2px;
}

/* ---------- Footer ---------- */
body.hah-shell .site-footer,
.hah-footer {
  border-top: 1px solid #35393f;
  background: #2c3138;
  color: #d4d4d8;
  padding: 26px var(--hah-shell-pad);
  margin-top: 0;
  text-align: left;
}

.hah-footer-in {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  width: 100%;
}

.hah-footer p,
body.hah-shell .site-footer .footer-description,
body.hah-shell .site-footer .footer-note {
  margin: 4px 0;
  color: #a1a1aa;
  text-align: left;
}

.hah-footer-links,
body.hah-shell .site-footer .footer-nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.hah-footer-links a,
body.hah-shell .site-footer .footer-nav a {
  color: #c7c7cc;
  font-size: 13px;
}

body.hah-shell .site-footer .container {
  max-width: none !important;
  padding-left: 0;
  padding-right: 0;
}

body.hah-shell .site-footer .footer-nav {
  justify-content: flex-start;
  margin-bottom: 0.75rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
  .hah-content-shell {
    grid-template-columns: 1fr;
  }
  .hah-sidebar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
  }
  .hah-side {
    margin: 0;
  }
  .hah-quick-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .hah-hero-in {
    padding-top: 24px;
    padding-bottom: 24px;
  }
  .hah-hero-search {
    flex-direction: column;
  }
  .hah-hero-search .hah-btn {
    height: 44px;
  }
  .hah-content-shell {
    padding-top: 18px;
  }
  .hah-song {
    grid-template-columns: 1fr;
    padding: 15px;
  }
  .hah-tags {
    justify-content: flex-start;
  }
  .hah-sidebar {
    grid-template-columns: 1fr;
  }
  .hah-quick-strip {
    grid-template-columns: 1fr;
  }
  .hah-footer-in {
    flex-direction: column;
  }
}
