/*
Theme Name: JBS Productions - Dark
Theme URI: https://jbs.productions/
Author: JBS Productions
Author URI: https://jbs.productions/
Description: Custom dark theme for JBS Productions. Black base, green accent, built to sit underneath the JBSP plugin suite. Own templates - no parent theme.
Version: 1.0.3
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jbsp-dark
Tags: dark, one-column, two-columns, right-sidebar, custom-logo, custom-menu, featured-images, translation-ready
*/

/* =========================================================================
   1. DESIGN TOKENS
   Palette lifted from the previous theme: black base, white text, green accent.
   ========================================================================= */
:root{
  /* Surfaces */
  --jb-bg:            #000000;
  --jb-surface:       #0e0e0e;
  --jb-surface-2:     #141414;
  --jb-surface-3:     #1c1c1c;

  /* Text */
  --jb-text:          #ffffff;
  --jb-text-muted:    #9a9a9a;
  --jb-text-dim:      #6f6f6f;

  /* Lines */
  --jb-border:        #262626;
  --jb-border-strong: #333333;

  /* Brand */
  --jb-accent:        #0abf53;
  --jb-accent-dark:   #089a42;
  --jb-accent-soft:   rgba(10,191,83,.14);
  --jb-amber:         #fbb034;
  --jb-red:           #c0392b;

  /* Layout */
  --jb-wrap:          1200px;
  --jb-gap:           24px;
  --jb-radius:        10px;
  --jb-radius-sm:     6px;

  /* The "View as" bar height, published by the JBSP Live connector while an admin
     is viewing the site as a model. 0px when it is not showing, so the header
     offset below is a no-op in normal use. */
  --jbsp-banner-h:    0px;
  --jb-adminbar:      0px;

  --jb-transition:    160ms ease;
}

/* WordPress toolbar height, so sticky things can sit below it. */
body.admin-bar{ --jb-adminbar: 32px; }
@media screen and (max-width:782px){ body.admin-bar{ --jb-adminbar: 46px; } }

/* =========================================================================
   2. RESET / BASE
   ========================================================================= */
*,*::before,*::after{ box-sizing:border-box; }

html{ -webkit-text-size-adjust:100%; scroll-behavior:smooth; }
@media (prefers-reduced-motion:reduce){ html{ scroll-behavior:auto; } }

body{
  margin:0;
  background:var(--jb-bg);
  color:var(--jb-text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:16px;
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}

img,svg,video,iframe,embed,object{ max-width:100%; height:auto; display:block; }
figure{ margin:0 0 1.25rem; }

a{ color:var(--jb-accent); text-decoration:none; transition:color var(--jb-transition); }
a:hover,a:focus{ color:#fff; }
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:2px solid var(--jb-accent); outline-offset:2px;
}

/* =========================================================================
   3. TYPOGRAPHY
   ========================================================================= */
h1,h2,h3,h4,h5,h6{
  margin:0 0 .6em;
  line-height:1.2;
  font-weight:700;
  color:var(--jb-text);
  letter-spacing:-.01em;
}
h1{ font-size:2.25rem; }
h2{ font-size:1.75rem; }
h3{ font-size:1.35rem; }
h4{ font-size:1.15rem; }
h5,h6{ font-size:1rem; }

p{ margin:0 0 1.25rem; }
ul,ol{ margin:0 0 1.25rem; padding-left:1.4rem; }
li{ margin-bottom:.35rem; }

blockquote{
  margin:1.5rem 0; padding:.75rem 1.25rem;
  border-left:3px solid var(--jb-accent);
  background:var(--jb-surface-2);
  color:var(--jb-text-muted); font-style:italic;
}
code,kbd,pre{ font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:.9em; }
code{ background:var(--jb-surface-3); padding:.15em .4em; border-radius:4px; }
pre{ background:var(--jb-surface-2); padding:1rem; border-radius:var(--jb-radius-sm); overflow:auto; border:1px solid var(--jb-border); }
pre code{ background:none; padding:0; }
hr{ border:0; border-top:1px solid var(--jb-border); margin:2rem 0; }

table{ width:100%; border-collapse:collapse; margin-bottom:1.5rem; }
th,td{ padding:.6rem .75rem; border:1px solid var(--jb-border); text-align:left; }
th{ background:var(--jb-surface-2); }

.screen-reader-text{
  border:0; clip:rect(1px,1px,1px,1px); clip-path:inset(50%);
  height:1px; width:1px; margin:-1px; overflow:hidden; padding:0; position:absolute; word-wrap:normal;
}
.skip-link{ position:absolute; left:-9999px; top:0; z-index:100000; }
.skip-link:focus{
  left:8px; top:8px; background:var(--jb-accent); color:#000;
  padding:.6rem 1rem; border-radius:var(--jb-radius-sm); font-weight:600;
}

/* =========================================================================
   4. FORMS & BUTTONS
   ========================================================================= */
input[type=text],input[type=email],input[type=url],input[type=password],
input[type=search],input[type=number],input[type=tel],input[type=date],
select,textarea{
  width:100%; max-width:100%;
  background:var(--jb-surface-2);
  color:var(--jb-text);
  border:1px solid var(--jb-border-strong);
  border-radius:var(--jb-radius-sm);
  padding:.7rem .85rem;
  font:inherit;
  transition:border-color var(--jb-transition),background var(--jb-transition);
}
input::placeholder,textarea::placeholder{ color:var(--jb-text-dim); }
input:focus,select:focus,textarea:focus{ border-color:var(--jb-accent); background:var(--jb-surface-3); }
select{ appearance:none; background-image:none; }

button,input[type=submit],input[type=button],.button,.wp-block-button__link{
  display:inline-block;
  background:var(--jb-accent); color:#04170c;
  border:0; border-radius:var(--jb-radius-sm);
  padding:.7rem 1.25rem;
  font:inherit; font-weight:700; line-height:1.2;
  cursor:pointer; text-decoration:none;
  transition:background var(--jb-transition),color var(--jb-transition),transform var(--jb-transition);
}
button:hover,input[type=submit]:hover,input[type=button]:hover,.button:hover,.wp-block-button__link:hover{
  background:var(--jb-accent-dark); color:#fff; transform:translateY(-1px);
}
button:disabled{ opacity:.5; cursor:not-allowed; transform:none; }

.button--ghost,.wp-block-button.is-style-outline .wp-block-button__link{
  background:transparent; color:var(--jb-text); border:1px solid var(--jb-border-strong);
}
.button--ghost:hover{ background:var(--jb-surface-3); color:#fff; }

/* =========================================================================
   5. LAYOUT
   ========================================================================= */
.jb-wrap{ width:100%; max-width:var(--jb-wrap); margin:0 auto; padding:0 var(--jb-gap); }

.site{ display:flex; flex-direction:column; min-height:100vh; }
.site-content{ flex:1 0 auto; }

.content-area{ padding:40px 0 64px; }

/* Two-column: content + sidebar. Collapses on small screens. */
.jb-layout{ display:grid; grid-template-columns:minmax(0,1fr) 320px; gap:40px; align-items:start; }
.jb-layout--left{ grid-template-columns:320px minmax(0,1fr); }
.jb-layout--full{ grid-template-columns:minmax(0,1fr); }
@media (max-width:960px){
  .jb-layout,.jb-layout--left{ grid-template-columns:minmax(0,1fr); gap:32px; }
  .jb-layout--left .widget-area{ order:2; }
}

/* Wider shell + hero spacing for full-width (app) pages. */
.jb-wrap--full{ max-width:1400px; }
.home-content{ margin-bottom:36px; }
.home-content .widget{ padding:0; background:transparent; border:0; }

/* =========================================================================
   6. HEADER
   Sticky, but deliberately NOT fixed: it sits in normal flow and offsets itself by
   the "View as" bar and the WP toolbar, so nothing can ever cover the nav.
   ========================================================================= */
.site-header{
  position:sticky;
  top:calc(var(--jbsp-banner-h) + var(--jb-adminbar));
  z-index:900;
  background:var(--jb-surface);
  border-bottom:1px solid var(--jb-border);
}
.site-header__inner{
  display:flex; align-items:center; gap:24px;
  min-height:68px;
  max-width:var(--jb-wrap); margin:0 auto; padding:0 var(--jb-gap);
}

.site-branding{ display:flex; align-items:center; gap:14px; flex-shrink:0; }
.site-branding img{ max-height:44px; width:auto; }
.site-title{ margin:0; font-size:1.25rem; line-height:1.1; }
.site-title a{ color:var(--jb-text); }
.site-title a:hover{ color:var(--jb-accent); }
.site-description{ margin:0; font-size:.8rem; color:var(--jb-text-muted); line-height:1.2; }

/* Primary nav */
.primary-navigation{ margin-left:auto; }
.primary-navigation ul{ list-style:none; margin:0; padding:0; display:flex; align-items:center; gap:4px; }
.primary-navigation li{ position:relative; margin:0; }
.primary-navigation a{
  display:block; padding:.6rem .9rem;
  color:var(--jb-text); font-size:.95rem; font-weight:500;
  border-radius:var(--jb-radius-sm);
}
.primary-navigation a:hover{ background:var(--jb-surface-3); color:var(--jb-accent); }
.primary-navigation .current-menu-item > a,
.primary-navigation .current_page_item > a{ color:var(--jb-accent); }

/* Dropdowns */
.primary-navigation ul ul{
  position:absolute; left:0; top:100%; min-width:210px;
  display:block; flex-direction:column; align-items:stretch;
  background:var(--jb-surface-2); border:1px solid var(--jb-border);
  border-radius:var(--jb-radius-sm); padding:6px;
  box-shadow:0 12px 30px rgba(0,0,0,.6);
  opacity:0; visibility:hidden; transform:translateY(6px);
  transition:opacity var(--jb-transition),transform var(--jb-transition),visibility var(--jb-transition);
}
.primary-navigation li:hover > ul,
.primary-navigation li:focus-within > ul{ opacity:1; visibility:visible; transform:translateY(0); }
.primary-navigation ul ul a{ padding:.5rem .7rem; font-size:.9rem; }

/* Top bar menu (location: top) */
.top-menu{ background:var(--jb-surface-2); border-bottom:1px solid var(--jb-border); font-size:.85rem; }
.top-menu ul{ list-style:none; margin:0 auto; padding:6px var(--jb-gap); max-width:var(--jb-wrap); display:flex; gap:18px; flex-wrap:wrap; }
.top-menu a{ color:var(--jb-text-muted); }
.top-menu a:hover{ color:var(--jb-accent); }

/* Mobile toggle + modal */
.jb-nav-toggle{
  display:none; margin-left:auto;
  background:transparent; border:1px solid var(--jb-border-strong); color:var(--jb-text);
  padding:.5rem .8rem; border-radius:var(--jb-radius-sm);
}
.jb-nav-toggle:hover{ background:var(--jb-surface-3); color:#fff; transform:none; }
.jb-mobile-menu{
  display:none; background:var(--jb-surface-2); border-bottom:1px solid var(--jb-border);
}
.jb-mobile-menu.is-open{ display:block; }
.jb-mobile-menu ul{ list-style:none; margin:0; padding:10px var(--jb-gap); }
.jb-mobile-menu ul ul{ padding:0 0 0 14px; }
.jb-mobile-menu a{ display:block; padding:.7rem 0; color:var(--jb-text); border-bottom:1px solid var(--jb-border); }

@media (max-width:960px){
  .primary-navigation{ display:none; }
  .jb-nav-toggle{ display:inline-block; }
}

/* =========================================================================
   7. POSTS / CARDS
   ========================================================================= */
.entry-list{ display:grid; gap:28px; }

.hentry{
  background:var(--jb-surface);
  border:1px solid var(--jb-border);
  border-radius:var(--jb-radius);
  overflow:hidden;
  transition:border-color var(--jb-transition),transform var(--jb-transition);
}
.hentry:hover{ border-color:var(--jb-border-strong); transform:translateY(-2px); }
.hentry__inner{ padding:22px; }
.hentry__thumb{ display:block; aspect-ratio:16/9; overflow:hidden; background:var(--jb-surface-3); }
.hentry__thumb img{ width:100%; height:100%; object-fit:cover; }

.entry-title{ margin:0 0 .5rem; font-size:1.3rem; }
.entry-title a{ color:var(--jb-text); }
.entry-title a:hover{ color:var(--jb-accent); }

.entry-meta{ font-size:.82rem; color:var(--jb-text-muted); margin:0 0 .75rem; display:flex; flex-wrap:wrap; gap:6px 14px; }
.entry-meta a{ color:var(--jb-text-muted); }
.entry-meta a:hover{ color:var(--jb-accent); }
.entry-summary{ color:var(--jb-text-muted); margin:0 0 1rem; }
.entry-summary p:last-child{ margin-bottom:0; }
.more-link{ font-weight:600; }

/* Home / archive cards on wider screens */
@media (min-width:700px){
  .entry-list--grid{ grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (min-width:1080px){
  .entry-list--grid{ grid-template-columns:repeat(3,minmax(0,1fr)); }
}

/* =========================================================================
   8. SINGLE POST / PAGE
   ========================================================================= */
.single-post .entry-header,.page .entry-header{ margin-bottom:1.5rem; }
.single-post .entry-title,.page .entry-title{ font-size:2rem; }
.entry-content{ color:#e6e6e6; }
.entry-content > *:first-child{ margin-top:0; }
.entry-content a{ text-decoration:underline; text-underline-offset:2px; }
.entry-content img,.entry-content iframe{ border-radius:var(--jb-radius-sm); }

.entry-footer{ margin-top:2rem; padding-top:1.25rem; border-top:1px solid var(--jb-border); font-size:.85rem; color:var(--jb-text-muted); }

/* Tag / category pills */
.jb-pills{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:8px; }
.jb-pills li{ margin:0; }
.jb-pills a{
  display:inline-block; padding:.25rem .7rem; font-size:.78rem;
  background:var(--jb-accent-soft); color:var(--jb-accent);
  border-radius:999px;
}
.jb-pills a:hover{ background:var(--jb-accent); color:#04170c; }

/* =========================================================================
   9. COMMENTS
   ========================================================================= */
.comments-area{ margin-top:48px; padding-top:28px; border-top:1px solid var(--jb-border); }
.comment-list{ list-style:none; margin:0; padding:0; }
.comment-list ol.children{ list-style:none; padding-left:24px; }
.comment-body{
  background:var(--jb-surface); border:1px solid var(--jb-border);
  border-radius:var(--jb-radius); padding:16px; margin-bottom:16px;
}
.comment-author{ font-weight:600; }
.comment-author img{ border-radius:50%; display:inline-block; vertical-align:middle; margin-right:8px; }
.comment-metadata{ font-size:.78rem; color:var(--jb-text-dim); margin-bottom:.6rem; }
.comment-metadata a{ color:var(--jb-text-dim); }
.reply a{ font-size:.82rem; font-weight:600; }
.comment-form label{ display:block; font-size:.85rem; color:var(--jb-text-muted); margin-bottom:.3rem; }
.comment-form p{ margin-bottom:1rem; }
.comment-form-cookies-consent label{ display:inline; }

/* =========================================================================
   10. SIDEBAR / WIDGETS
   ========================================================================= */
.widget-area{ display:grid; gap:28px; align-content:start; }
.widget{
  background:var(--jb-surface); border:1px solid var(--jb-border);
  border-radius:var(--jb-radius); padding:20px;
}
.widget-title{ margin:0 0 1rem; font-size:1.05rem; padding-bottom:.6rem; border-bottom:1px solid var(--jb-border); }
.widget ul{ list-style:none; margin:0; padding:0; }
.widget ul li{ padding:.5rem 0; border-bottom:1px solid var(--jb-border); margin:0; font-size:.92rem; }
.widget ul li:last-child{ border-bottom:0; padding-bottom:0; }
.widget a{ color:var(--jb-text); }
.widget a:hover{ color:var(--jb-accent); }
.widget img{ border-radius:var(--jb-radius-sm); }

/* =========================================================================
   11. PAGINATION
   ========================================================================= */
.pagination,.navigation.pagination{ margin-top:36px; }
.pagination .nav-links{ display:flex; flex-wrap:wrap; gap:8px; justify-content:center; align-items:center; }
.pagination .page-numbers{
  display:inline-block; min-width:40px; text-align:center;
  padding:.5rem .7rem;
  background:var(--jb-surface); border:1px solid var(--jb-border);
  border-radius:var(--jb-radius-sm); color:var(--jb-text); font-size:.9rem;
}
.pagination .page-numbers:hover{ border-color:var(--jb-accent); color:var(--jb-accent); }
.pagination .page-numbers.current{ background:var(--jb-accent); border-color:var(--jb-accent); color:#04170c; font-weight:700; }
.posts-navigation a{ display:inline-block; padding:.6rem 1rem; border:1px solid var(--jb-border); border-radius:var(--jb-radius-sm); }

/* =========================================================================
   12. 404 / SEARCH / ARCHIVE
   ========================================================================= */
.page-header{ margin-bottom:2rem; }
.page-title{ margin:0; font-size:1.9rem; }
.page-subtitle,.archive-description{ color:var(--jb-text-muted); margin-top:.4rem; }
.error-404{ text-align:center; padding:64px 0; }
.error-404 .error-code{ font-size:5rem; font-weight:800; color:var(--jb-accent); line-height:1; margin-bottom:.5rem; }

/* =========================================================================
   13. FOOTER
   ========================================================================= */
.site-footer{
  background:var(--jb-surface); border-top:1px solid var(--jb-border);
  padding:40px 0 24px; margin-top:0; font-size:.9rem; color:var(--jb-text-muted);
}
.site-footer__inner{ max-width:var(--jb-wrap); margin:0 auto; padding:0 var(--jb-gap); }
.site-footer a{ color:var(--jb-text-muted); }
.site-footer a:hover{ color:var(--jb-accent); }
.site-footer .widget-area{ grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); }
.site-footer .widget{ background:transparent; border:0; padding:0; }
.footer-legal{
  max-width:var(--jb-wrap); margin:24px auto 0; padding:16px var(--jb-gap) 0;
  border-top:1px solid var(--jb-border); font-size:.8rem; text-align:center;
}
.footer-legal ul{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:16px; justify-content:center; }
.footer-legal li{ margin:0; }

/* Back to top */
#back-top{ position:fixed; right:18px; bottom:18px; z-index:800; }
#back-top a{
  display:flex; align-items:center; justify-content:center;
  width:42px; height:42px; border-radius:50%;
  background:var(--jb-surface-2); border:1px solid var(--jb-border-strong);
  color:var(--jb-text);
}
#back-top a:hover{ background:var(--jb-accent); border-color:var(--jb-accent); color:#04170c; }

/* =========================================================================
   14. BLOCK EDITOR / GUTENBERG
   ========================================================================= */
.alignwide{ margin-left:-24px; margin-right:-24px; max-width:calc(100% + 48px); }
.alignfull{ margin-left:calc(50% - 50vw); margin-right:calc(50% - 50vw); max-width:100vw; width:100vw; }
.aligncenter{ margin-left:auto; margin-right:auto; }
.wp-block-image figcaption,.wp-block-gallery figcaption{ color:var(--jb-text-dim); font-size:.82rem; text-align:center; }
.wp-block-quote{ border-left:3px solid var(--jb-accent); padding-left:1.25rem; }
.wp-block-table td,.wp-block-table th{ border-color:var(--jb-border); }
.wp-block-separator{ border-color:var(--jb-border); }

/* =========================================================================
   15. UTILITIES
   ========================================================================= */
.jb-center{ text-align:center; }
.jb-mt-0{ margin-top:0; }
.jb-hidden{ display:none !important; }
.jb-muted{ color:var(--jb-text-muted); }
.jb-flex-between{ display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }

/* Keep the view-as bar clear of the sticky header when it wraps on small screens. */
@media screen and (max-width:600px){
  .site-header__inner{ min-height:60px; }
}
