/*
Theme Name: Astra Child Hranic
Template: astra
Text Domain: astra-child-hranic
Version: 1.0.5
*/

:root {
  --cbh-bg: #12141a;
  --cbh-surface: #1b1e27;
  --cbh-border: #2e3342;
  --cbh-text: #e8e6e0;
  --cbh-muted: #a8a69e;
  --cbh-accent: #d4a94e;
  --cbh-accent-dark: #9a772f;
  --cbh-radius: 10px;
  --cbh-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

body, body.cbh-body {
  background-color: var(--cbh-bg);
  color: var(--cbh-text);
  font-size: 17px;
  line-height: 1.65;
}

/* Anti-flex Astra rule */
#content .ast-container, .ast-container { display: block !important; width: 100% !important; max-width: 100% !important; }
#primary, .site-main, #main { width: 100% !important; max-width: 100% !important; flex: 1 1 100% !important; margin-inline: auto !important; }

/* One centered content measure */
.cbh-wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: 24px;
}

body.cbh-body .entry-content > *,
body.cbh-body .ast-container > * {
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

body.cbh-body .entry-content {
  max-width: 1180px !important;
  margin-inline: auto !important;
  padding-inline: 24px !important;
}

/* Parent theme shells hidden */
#masthead, #masthead .main-header-bar-wrap, .ast-below-header { display: none; }
#colophon, .site-info { display: none; }

/* Headings recolored above Astra specificity */
body.cbh-body h1,
body.cbh-body h2,
body.cbh-body h3,
body.cbh-body h4,
body.cbh-body h5,
body.cbh-body h6 {
  color: var(--cbh-text);
}

body.cbh-body a {
  color: var(--cbh-accent);
  text-decoration: none;
}

body.cbh-body a:hover {
  color: var(--cbh-accent-dark);
  text-decoration: none;
}

/* Shared bordered card style */
.cbh-header, .cbh-nav, .cbh-footer, .cbh-card, .cbh-hero, .cbh-toc,
.cbh-warning, .cbh-aside, .cbh-calc, .cbh-faq, .cbh-table-wrap,
.cbh-board, .cbh-figure, .cbh-breadcrumb, .cbh-colophon {
  background: var(--cbh-surface);
  border: 1px solid var(--cbh-border);
  border-radius: var(--cbh-radius);
  box-shadow: var(--cbh-shadow);
  padding: 20px;
  margin-block: 20px;
}

/* Header */
.cbh-header {
  margin-block: 0;
  border-radius: 0;
  border-inline: none;
  border-top: none;
}

/* Header: hard fix against Astra-inherited height/stretch */
.cbh-header {
  width: 100%;
  line-height: 1.4;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 12px 0 !important;
  box-sizing: border-box;
}

.cbh-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cbh-header__brand {
  font-size: 20px;
  font-weight: 700;
  color: #f2efe8;
  text-decoration: none;
  white-space: nowrap;
}

.cbh-header__brand:hover {
  color: var(--cbh-accent);
  text-decoration: none;
}

/* Nav: wrap instead of clipping */
.cbh-nav {
  max-width: 100%;
  min-width: 0;
  flex: 1 1 320px;
}

.cbh-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.cbh-nav a {
  color: var(--cbh-accent);
  white-space: normal;
  overflow-wrap: anywhere;
  display: inline-block;
  padding: 4px 2px;
}

.cbh-nav a:hover {
  color: var(--cbh-text);
  text-decoration: none;
}

.cbh-nav li {
  position: relative;
}

.cbh-nav ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--cbh-surface);
  border: 1px solid var(--cbh-border);
  border-radius: var(--cbh-radius);
  box-shadow: var(--cbh-shadow);
  padding: 8px;
  min-width: 220px;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
}

.cbh-nav li:hover > ul,
.cbh-nav li:focus-within > ul {
  display: flex;
}

.cbh-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: none;
  overflow: visible;
}

.cbh-nav__item,
.cbh-nav__link {
  white-space: normal;
  overflow-wrap: anywhere;
}

.cbh-nav__link {
  display: inline-block;
  padding: 4px 2px;
  color: #d4a94e;
  text-decoration: none;
  font-size: 14px;
  line-height: 1.4;
}

.cbh-nav__link:hover {
  color: #e8e6e0;
}

/* Hero — centered (fix #2) */
.cbh-hero {
  text-align: center;
}

.cbh-hero h1 {
  margin-block-start: 0;
  margin-inline: auto;
  max-width: 900px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.2;
  text-align: center;
}

.cbh-hero p {
  color: var(--cbh-muted);
  font-size: 1.1rem;
  margin-inline: auto;
  text-align: center;
}

/* Breadcrumb — removed from view (fix #1) */
.cbh-breadcrumb {
  display: none !important;
}

/* TOC — compact one-line chips with borders (fix #3) */
.cbh-toc {
  padding: 10px 14px;
}

.cbh-toc .cbh-toc__head {
  margin: 0 0 8px 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cbh-muted);
  text-align: center;
}

.cbh-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 7px;
}

.cbh-toc li {
  display: inline-block;
  margin: 0;
  padding: 0;
}

.cbh-toc a {
  display: inline-block;
  font-size: 0.78rem;
  line-height: 1.3;
  padding: 3px 10px;
  border: 1px solid var(--cbh-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  white-space: nowrap;
}

.cbh-toc a:hover {
  color: var(--cbh-accent);
  border-color: var(--cbh-accent);
}

/* Statutory warning */
.cbh-warning {
  border-left: 5px solid var(--cbh-accent);
  background: var(--cbh-surface);
  color: var(--cbh-text);
  font-weight: 600;
}

/* Aside */
.cbh-aside {
  color: var(--cbh-muted);
  font-size: 0.95rem;
}

/* Tables */
.cbh-table-wrap {
  padding: 0;
  overflow-x: auto;
}

.cbh-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  background: var(--cbh-surface);
  color: var(--cbh-text);
  min-width: 480px;
}

.cbh-table-wrap th,
.cbh-table-wrap td {
  border: 1px solid var(--cbh-border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}

.cbh-table-wrap thead th {
  background: var(--cbh-accent-dark);
  color: var(--cbh-bg);
  font-weight: 700;
}

.cbh-table-wrap tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.03);
}

body.cbh-body table {
  border-collapse: collapse;
  width: 100%;
  background: var(--cbh-surface);
}

body.cbh-body table th,
body.cbh-body table td {
  border: 1px solid var(--cbh-border);
  padding: 10px 14px;
  color: var(--cbh-text);
}

/* Calculator */
.cbh-calc label {
  display: block;
  margin-block: 10px 4px;
  color: var(--cbh-text);
}

.cbh-calc input[type="number"] {
  background: var(--cbh-bg);
  border: 1px solid var(--cbh-border);
  border-radius: 6px;
  color: var(--cbh-text);
  padding: 8px 10px;
  width: 100%;
  max-width: 320px;
}

.cbh-calc output,
.cbh-calc .cbh-calc-result {
  display: block;
  margin-block-start: 12px;
  color: var(--cbh-accent);
  font-weight: 700;
}

.cbh-calc small, .cbh-calc .cbh-calc-note {
  color: var(--cbh-muted);
}

/* FAQ */
.cbh-faq__item {
  border-bottom: 1px solid var(--cbh-border);
}

.cbh-faq__item:last-child {
  border-bottom: none;
}

.cbh-faq__q {
  color: var(--cbh-text);
  cursor: pointer;
  padding: 12px 0;
  font-weight: 600;
}

.cbh-faq__a {
  color: var(--cbh-muted);
  padding: 0 0 12px 0;
}

/* Buttons */
.cbh-btn, body.cbh-body button, .cbh-calc button {
  display: inline-block;
  background: var(--cbh-accent);
  color: var(--cbh-bg);
  border: 1px solid var(--cbh-accent-dark);
  border-radius: 6px;
  padding: 10px 22px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.cbh-btn:hover, body.cbh-body button:hover, .cbh-calc button:hover {
  background: var(--cbh-accent-dark);
  color: var(--cbh-bg);
  text-decoration: none;
}

/* Figure */
.cbh-figure {
  padding: 14px;
  text-align: center;
}

.cbh-figure figcaption {
  color: var(--cbh-muted);
  font-size: 0.9rem;
  margin-block-start: 8px;
}

.cbh-figure svg {
  max-width: 100%;
  height: auto;
}

/* Board */
.cbh-board {
  border-color: var(--cbh-accent-dark);
}

/* Footer */
.cbh-footer {
  margin-block: 40px 0;
  border-radius: 0;
  border-inline: none;
  border-bottom: none;
  color: var(--cbh-muted);
}

.cbh-footer a {
  color: var(--cbh-muted);
}

.cbh-footer a:hover {
  color: var(--cbh-accent);
}

.cbh-colophon {
  border: none;
  box-shadow: none;
  background: transparent;
  color: var(--cbh-muted);
  font-size: 0.85rem;
  padding: 12px 0 24px 0;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .cbh-nav ul {
    flex-wrap: wrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cbh-nav ul ul {
    position: static;
    display: flex;
    border: none;
    box-shadow: none;
    padding: 0 0 0 16px;
  }

  .cbh-toc a {
    white-space: normal;
  }
}

/* Footer centered */
.cbh-footer__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Content area on dark background */
body.cbh-body { background: #14161b; color: #e8e6e0; }
body.cbh-body .cbh-h1 {
  color: #f2efe8;
  margin: 24px 0 12px;
  font-size: 32px;
  line-height: 1.2;
  text-align: center;
}
body.cbh-body p, body.cbh-body li { color: #d9d7d0; line-height: 1.65; }
body.cbh-body h2, body.cbh-body h3 { color: #f2efe8; }
body.cbh-body a { color: #d4a94e; }

.cbh-table-wrap {
  max-width: 1200px;
  margin: 0 auto;
  overflow-x: auto;
}

.cbh-table, .cbh-board__table {
  width: 100%;
  border-collapse: collapse;
  background: #1b1e25;
  color: #e8e6e0;
}

.cbh-table th, .cbh-table td,
.cbh-board__table th, .cbh-board__table td {
  border: 1px solid #33363f;
  padding: 8px 10px;
  text-align: left;
}

/* Header nav: hard horizontal fix (highest specificity, wins over everything) */
.cbh-header .cbh-header__inner {
	display: flex !important;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 24px;
}
.cbh-header .cbh-nav,
.cbh-header nav.cbh-nav {
	flex: 1 1 auto;
	min-width: 0;
}
.cbh-header .cbh-nav > ul.cbh-nav__list {
	display: flex !important;
	flex-wrap: wrap;
	flex-direction: row !important;
	align-items: center;
	gap: 2px 18px;
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}
.cbh-header .cbh-nav > ul.cbh-nav__list > li {
	display: list-item;
	position: relative;
	white-space: nowrap;
}
.cbh-header .cbh-nav > ul.cbh-nav__list > li > a {
	display: inline-block;
	color: #d4a94e;
	text-decoration: none;
	font-size: 14px;
	line-height: 1.5;
	padding: 6px 2px;
	white-space: nowrap;
}
.cbh-header .cbh-nav > ul.cbh-nav__list > li > a:hover {
	color: #e8e6e0;
}
.cbh-header .cbh-nav ul.cbh-nav__sub {
	display: none !important;
	position: absolute;
	top: 100%;
	left: 0;
	flex-direction: column;
	background: #1b1e27;
	border: 1px solid #2e3342;
	border-radius: 8px;
	box-shadow: 0 6px 24px rgba(0,0,0,.35);
	padding: 8px;
	min-width: 240px;
	list-style: none;
	margin: 0;
	z-index: 30;
}
.cbh-header .cbh-nav li:hover > ul.cbh-nav__sub,
.cbh-header .cbh-nav li:focus-within > ul.cbh-nav__sub {
	display: flex !important;
}
.cbh-header .cbh-brand { white-space: nowrap; }

/* ==== v1.0.5: hard-centered content column on wide screens ==== */
body.cbh-body #primary,
body.cbh-body .site-main,
body.cbh-body #main {
  width: 100% !important;
  max-width: 1280px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  float: none !important;
}

body.cbh-body .entry-content > *,
body.cbh-body .ast-container > * {
  max-width: 1180px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}