/* Search uses the same full-width listing geometry as the homepage. */
html body main.container > .search-results {
  width: 100% !important;
  max-width: none !important;
  min-width: 0;
  margin: 0 !important;
  padding: 28px 0 56px !important;
}
html body main.container > .search-results > .section-title {
  margin: 0 0 16px !important;
}
html body main.container > .search-results h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
html body main.container > .search-results > .catalog-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 16px !important;
}
html body main.container > .search-results > .catalog-grid > .card {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}
@media (max-width: 1050px) {
  html body main.container > .search-results > .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 720px) {
  html body main.container > .search-results h1 { font-size: 17px; }
  html body main.container > .search-results > .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}
/* Hide the Recent Post widget without changing stored posts or widget settings. */
html body:not(.dashboard):not(.admin-body) .sidebar-widget.widget-latest {
  display: none !important;
}
/* Public palette based on the supplied reference screenshot; admin is unchanged. */
html body:not(.dashboard):not(.admin-body) {
  --accent: #e94049;
  --text: #eeeeee;
  --muted: #999999;
  background: #000 !important;
  color: #eee;
}
html body:not(.dashboard):not(.admin-body) > main.container,
html body:not(.dashboard):not(.admin-body) main.container > .catalog-header > .header-main,
html body:not(.dashboard):not(.admin-body) main.container > .catalog-header > nav.nav,
html body:not(.dashboard):not(.admin-body) > footer:not(.site-footer) {
  background: #212121 !important;
  color: #eee !important;
  border-color: #333 !important;
}
html body:not(.dashboard):not(.admin-body) main.container .catalog-header .header-search,
html body:not(.dashboard):not(.admin-body) main.container .catalog-header .header-search input,
html body:not(.dashboard):not(.admin-body) main.container .catalog-header .header-search button {
  background: #000 !important;
  border-color: #363636 !important;
}
html body:not(.dashboard):not(.admin-body) main.container .catalog-header .header-search input {
  color: #eee !important;
}
html body:not(.dashboard):not(.admin-body) main.container .catalog-header .header-search input::placeholder {
  color: #888 !important;
}
html body:not(.dashboard):not(.admin-body) main.container .card {
  background: #212121 !important;
  border-color: #333 !important;
}
html body:not(.dashboard):not(.admin-body) main.container .card h3,
html body:not(.dashboard):not(.admin-body) main.container .section-title :is(h1, h2) {
  color: #eee !important;
}
html body:not(.dashboard):not(.admin-body) main.container .card-copy p,
html body:not(.dashboard):not(.admin-body) main.container .views {
  color: #999 !important;
}
html body:not(.dashboard):not(.admin-body) main.container .archive-pagination a {
  background: #303030 !important;
  border-color: #444 !important;
  color: #eee !important;
}
html body:not(.dashboard):not(.admin-body) main.container .archive-pagination a.active,
html body:not(.dashboard):not(.admin-body) main.container .archive-pagination a:hover {
  background: #e94049 !important;
  border-color: #e94049 !important;
  color: #fff !important;
}
/* Footer keeps a readable intrinsic height and wraps within the centered shell. */
html body:not(.dashboard):not(.admin-body) > footer:not(.site-footer) {
  box-sizing: border-box !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px 24px !important;
  height: auto !important;
  min-height: 100px !important;
  padding: 24px !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  overflow-wrap: anywhere;
}
html body:not(.dashboard):not(.admin-body) > footer > span {
  min-width: 0;
  white-space: normal !important;
}
@media (max-width: 600px) {
  html body:not(.dashboard):not(.admin-body) > footer:not(.site-footer) {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 20px 16px !important;
  }
}
/* Shared navigation sizing. */
.catalog-header .sidebar-genre-group { width:100%; border-top:1px solid #333; margin-top:12px; padding-top:12px; }
.catalog-header .sidebar-genre-group h2 { margin:0; padding:8px 12px; font:700 11px/1.5 Arial,sans-serif; color:#999; }
.catalog-header .sidebar-genre-group h2 > svg { display:none; }
.catalog-header .sidebar-genre-group h2 span { display:flex; align-items:center; gap:10px; }
.catalog-header .sidebar-genre-group .drawer-genre-list { display:flex; flex-direction:column; gap:2px; }
.catalog-header svg { width:18px; height:18px; flex-shrink:0; vertical-align:middle; }
@media (min-width:1024px) {
 html body .catalog-header .sidebar-genre-group { display:block!important; }
 html body .catalog-header .nav svg { fill:none; stroke:currentColor; stroke-width:1.7; }
 html body .catalog-header .header-main > * { min-width:0!important; }
 html body .catalog-header .header-actions { flex-wrap:wrap; gap:6px!important; }
 html body .catalog-header .header-search { min-width:160px!important; }
 html body .catalog-header .header-search button { position:relative!important; color:transparent!important; font-size:0!important; }
 html body .catalog-header .header-search button::after { content:""!important; position:absolute; top:50%; left:50%; width:20px; height:20px; transform:translate(-50%,-50%); background:var(--accent,#ff7800); mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5' fill='none' stroke='black' stroke-width='2'/%3E%3Cpath d='m16 16 5 5' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat; }
 html body .catalog-header .nav .drawer-genre-link { font-weight:400!important; }
}
@media (max-width:1023px) {
 html body:not(.dashboard):not(.admin-body) > main.container { width:100%!important; margin:0!important; padding:0 12px 32px!important; }
 html body:not(.dashboard):not(.admin-body) main.container > header.catalog-header { position:sticky!important; top:0!important; left:auto!important; bottom:auto!important; width:100%!important; height:auto!important; margin:0!important; overflow:visible!important; display:block!important; }
 html body:not(.dashboard):not(.admin-body) .catalog-header > .header-main { flex-direction:row!important; flex-wrap:wrap!important; height:auto!important; padding:10px!important; gap:10px!important; }
 html body:not(.dashboard):not(.admin-body) .catalog-header .brand { width:auto!important; min-width:0!important; }
 html body:not(.dashboard):not(.admin-body) .catalog-header .header-search { flex:1 1 180px!important; width:auto!important; min-width:0!important; }
 html body:not(.dashboard):not(.admin-body) > footer { width:100%!important; margin-left:0!important; }
 .catalog-header .sidebar-genre-group { display:none; }
 .catalog-header .nav.open .sidebar-genre-group { display:block; }
}
/* Desktop layout: full-width top bar plus navigation sidebar below it. */
@media (min-width: 1024px) {
  :root {
    --public-topbar-height: 62px;
    --public-sidebar-width: 232px;
  }

  html body:not(.dashboard):not(.admin-body) > main.container {
    box-sizing: border-box !important;
    width: calc(100% - var(--public-sidebar-width)) !important;
    max-width: none !important;
    min-height: 100vh !important;
    margin: 0 0 0 var(--public-sidebar-width) !important;
    padding: calc(var(--public-topbar-height) + 22px) 22px 48px !important;
  }

  html body:not(.dashboard):not(.admin-body) main.container > .catalog-header {
    position: static !important;
    display: block !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header > .header-main {
    position: fixed !important;
    z-index: 120 !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    height: var(--public-topbar-height) !important;
    min-height: var(--public-topbar-height) !important;
    margin: 0 !important;
    padding: 0 20px !important;
    gap: 22px !important;
    background: #171717 !important;
    border-bottom: 1px solid #303030 !important;
    box-shadow: 0 8px 22px #0005 !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .brand {
    display: flex !important;
    flex: 0 0 calc(var(--public-sidebar-width) - 20px) !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: calc(var(--public-sidebar-width) - 20px) !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
    font-size: 22px !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .brand img {
    width: auto !important;
    max-width: 174px !important;
    max-height: 46px !important;
    object-fit: contain !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .header-search {
    display: flex !important;
    flex: 1 1 560px !important;
    width: auto !important;
    max-width: 620px !important;
    height: 40px !important;
    margin: 0 !important;
    border: 1px solid #3a3a3a !important;
    border-radius: 22px !important;
    background: #080808 !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .header-search input {
    min-width: 0 !important;
    font-size: 13px !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .header-search button {
    width: 52px !important;
    border-left: 1px solid #333 !important;
    color: transparent !important;
    font-size: 0 !important;
    background: #0c0c0c !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .header-search button::after {
    content: "\2315";
    color: var(--accent) !important;
    font-size: 22px !important;
    line-height: 1 !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .header-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    width: auto !important;
    margin: 0 0 0 auto !important;
    gap: 8px !important;
    font-size: 12px !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .header-actions a {
    padding: 9px 13px !important;
    border: 1px solid #363636 !important;
    border-radius: 18px !important;
    color: #eee !important;
    background: #222 !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .header-actions a:hover {
    border-color: var(--accent) !important;
    color: #fff !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .catalog-menu-toggle {
    display: none !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav,
  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav.open {
    position: fixed !important;
    z-index: 105 !important;
    top: var(--public-topbar-height) !important;
    right: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    display: block !important;
    box-sizing: border-box !important;
    width: var(--public-sidebar-width) !important;
    height: calc(100vh - var(--public-topbar-height)) !important;
    margin: 0 !important;
    padding: 18px 10px 28px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    background: #181818 !important;
    border: 0 !important;
    border-right: 1px solid #303030 !important;
    box-shadow: 8px 0 20px #0003 !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav::before {
    content: "JELAJAHI";
    display: block;
    padding: 0 12px 12px;
    color: #777;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.5px;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav > div {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 3px !important;
    overflow: visible !important;
    white-space: normal !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav a,
  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav a:first-child {
    display: flex !important;
    flex: 0 0 auto !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 40px !important;
    height: auto !important;
    margin: 0 !important;
    padding: 9px 11px !important;
    gap: 10px !important;
    color: #e4e4e4 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 5px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    white-space: normal !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav a:hover,
  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav a.active {
    color: #fff !important;
    background: #292929 !important;
    opacity: 1 !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav a:hover {
    box-shadow: inset 3px 0 0 var(--accent) !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header > nav.nav svg {
    flex: 0 0 17px !important;
    width: 17px !important;
    height: 17px !important;
  }

  html body:not(.dashboard):not(.admin-body) .grid,
  html body:not(.dashboard):not(.admin-body) .featured {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  html body:not(.dashboard):not(.admin-body) .home-all-videos {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  html body:not(.dashboard):not(.admin-body) > footer:not(.site-footer) {
    box-sizing: border-box !important;
    width: calc(100% - var(--public-sidebar-width)) !important;
    margin-left: var(--public-sidebar-width) !important;
  }
}

@media (min-width: 1024px) and (max-width: 1240px) {
  html body:not(.dashboard):not(.admin-body) .grid,
  html body:not(.dashboard):not(.admin-body) .featured {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  html body:not(.dashboard):not(.admin-body) .catalog-header .header-actions a:nth-child(2),
  html body:not(.dashboard):not(.admin-body) .catalog-header .header-actions a:nth-child(3) {
    display: none !important;
  }
}

/* Center the complete desktop shell; navigation scrolls with the document. */
@media (min-width: 1024px) {
  html body:not(.dashboard):not(.admin-body) > main.container {
    display: grid !important;
    grid-template-columns: 212px minmax(0, 1fr) !important;
    align-content: start !important;
    /* Keep zoomed-out pages content-sized, not viewport-sized. */
    height: auto !important;
    min-height: 0 !important;
    grid-auto-rows: auto !important;
    row-gap: 0 !important;
    column-gap: 20px !important;
    width: calc(100% - 32px) !important;
    max-width: 1520px !important;
    margin: 0 auto !important;
    padding: 0 20px 40px !important;
    background: #1c1c1c;
  }
  html body:not(.dashboard):not(.admin-body) main.container > .catalog-header {
    display: contents !important;
  }
  html body:not(.dashboard):not(.admin-body) main.container > .catalog-header > .header-main {
    position: static !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 66px !important;
    padding: 10px 0 !important;
    margin: 0 0 20px !important;
    flex-wrap: wrap !important;
    box-shadow: none !important;
  }
  html body:not(.dashboard):not(.admin-body) main.container > .catalog-header > nav.nav {
    position: static !important;
    inset: auto !important;
    grid-column: 1 !important;
    grid-row: 2 / span 1000 !important;
    align-self: start !important;
    width: 212px !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 0 10px 24px 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  html body:not(.dashboard):not(.admin-body) main.container > :not(.catalog-header) {
    grid-column: 2;
    min-width: 0;
  }
  html body:not(.dashboard):not(.admin-body) main.container > .home-all-videos {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    padding-top: 0 !important;
  }
  html body:not(.dashboard):not(.admin-body) > footer:not(.site-footer) {
    width: calc(100% - 32px) !important;
    max-width: 1520px !important;
    margin: 0 auto !important;
  }
}
