
/* ==== Black Market Dark Theme Overrides v3 (syntax fixed, safe overrides) ==== */

/* Base surfaces */
html.dark, body.dark, body.dark #wrapper, body.dark #main {
  background: #001920 !important;
  color: #cccccc !important;
}

/* Typography */
body.dark h1, 
body.dark h2, 
body.dark h3, 
body.dark h4, 
body.dark h5, 
body.dark h6 {
  color: #f2f2f2 !important;
}
body.dark p, 
body.dark li, 
body.dark small {
  color: #cccccc !important;
}

/* Links */
body.dark a {
  color: #a8d48b !important;
  border-bottom: 1px dotted rgba(168,212,139,0.45) !important;
  text-decoration: none !important;
}
body.dark a:hover {
  color: #b7e6c3 !important;
  border-bottom-color: transparent !important;
}

/* Header / Nav */
body.dark #nav {
  background: #001214 !important;
  border-bottom: 1px solid #2d484e !important;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15) inset;
}
body.dark #nav .links a,
body.dark #nav .icons a {
  color: #e6e6e6 !important;
  border-bottom: none !important;
}
body.dark #nav .links a:hover,
body.dark #nav .icons a:hover {
  color: #b7e6c3 !important;
}

/* Intro / Featured */
body.dark #intro {
  background: #001920 !important;
  color: #cccccc !important;
}
body.dark .post.featured .major h2 a,
body.dark .post.featured .major h2 {
  color: #f2f2f2 !important;
}
body.dark .post.featured .major p {
  color: #cccccc !important;
}

/* Cards / Articles */
body.dark .posts article,
body.dark .post,
body.dark .box,
body.dark .promo,
body.dark .tile {
  background: #0b2a31 !important;
  border: 1px solid #2d484e !important;
  border-radius: 16px !important;
  color: #cccccc !important;
}
body.dark .posts article h2,
body.dark .post h2 { color: #f2f2f2 !important; }

/* Images */
body.dark .image img { 
  display: block; 
  border-radius: 12px; 
}

/* Buttons */
body.dark .button,
body.dark input[type="submit"],
body.dark button,
body.dark .button.primary {
  background: #a8d48b !important;
  color: #001920 !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
}
body.dark .button:hover,
body.dark input[type="submit"]:hover,
body.dark button:hover {
  background: #b7e6c3 !important;
  color: #001920 !important;
}
/* Outline variant */
body.dark .button.alt,
body.dark .button.secondary {
  background: transparent !important;
  color: #f2f2f2 !important;
  box-shadow: inset 0 0 0 2px #2d484e !important;
}
body.dark .button.alt:hover,
body.dark .button.secondary:hover {
  box-shadow: inset 0 0 0 2px #a8d48b !important;
  color: #b7e6c3 !important;
}

/* Forms */
body.dark input, 
body.dark select, 
body.dark textarea {
  background: #0a1f26 !important;
  color: #f0f0f0 !important;
  border: 1px solid #2d484e !important;
  border-radius: 10px !important;
}
body.dark input::placeholder, 
body.dark textarea::placeholder { color: #8da3a7 !important; }
body.dark label { color: #e9e9e9 !important; }

/* Tables */
body.dark table { color: #e6e6e6 !important; }
body.dark th { background: #0d232a !important; color: #f2f2f2 !important; }
body.dark td { border-top: 1px solid #2d484e !important; }

/* Misc elements */
body.dark hr { background: #2d484e !important; height: 1px !important; border: 0 !important; }
body.dark blockquote { border-left: 4px solid #2d484e !important; color: #d6d6d6 !important; }

/* Footer */
body.dark #footer, 
body.dark footer {
  background: #001214 !important;
  color: #9ab0b4 !important;
  border-top: 1px solid #2d484e !important;
}
body.dark #footer h3 { color: #f2f2f2 !important; }
body.dark #footer a { color: #9ab0b4 !important; border-bottom-color: rgba(154,176,180,0.4) !important; }
body.dark #footer a:hover { color: #b7e6c3 !important; border-bottom-color: transparent !important; }

/* Map quick dark filter (iframe embed) */
body.dark iframe[src*="google.com/maps"] {
  filter: invert(90%) hue-rotate(180deg) brightness(85%) contrast(90%) !important;
  border: 1px solid #2d484e !important;
  border-radius: 16px !important;
}

/* Copyright bar */
body.dark #copyright {
  background: #001214 !important;
  color: #9ab0b4 !important;
  border-top: 1px solid #2d484e !important;
}
body.dark #copyright a { color: #9ab0b4 !important; }

/* === Mobile stacking fix (Cipher) === */
@media (max-width: 768px){
  .grid{ grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .grid > * { grid-column: 1 / -1 !important; }
  .grid > [style*="grid-column"]{ grid-column: 1 / -1 !important; }

  /* Prevent horizontal scroll from media inside cards */
  .card img,
  .card video,
  .card picture,
  .card canvas { max-width: 100%; height: auto; display: block; }

  /* Tame giant H1s on phones */
  .head h1 { font-size: clamp(28px, 7vw, 42px); }
}


/* === Mobile nav burger (Cipher) === */
.hamburger{
  width:44px; height:44px; border-radius:10px;
  background:transparent; border:1px solid var(--line, #2d484e);
  position:relative; cursor:pointer; vertical-align:middle;
  color: var(--text-hi, #f2f2f2);
  display:none; /* hidden on desktop; shown on mobile below */
  background:
    linear-gradient(currentColor,currentColor) center calc(50% - 6px)/22px 2px no-repeat,
    linear-gradient(currentColor,currentColor) center/22px 2px no-repeat,
    linear-gradient(currentColor,currentColor) center calc(50% + 6px)/22px 2px no-repeat;
}
.hamburger .bar{ display:none !important; }
@media (max-width: 900px){
  #nav .links, .nav .links{ display:none !important; }
  .hamburger{ display:inline-flex !important; }
}
#drawer{ z-index:190; } 
#drawer-overlay{ z-index:180; }


/* === Mobile stacking fix v2 (Cipher) === */
@media (max-width: 780px){
  /* Single-column for typical content grids */
  .section .grid,
  .container .grid,
  .posts, .tiles, .features, .cards, .columns{
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-flow: row !important;
    gap: 1.25rem;
  }
  .section .grid > *,
  .container .grid > *,
  .posts > *, .tiles > *, .features > *, .cards > *, .columns > *{
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: none !important;
  }
  /* Flex rows collapse to block */
  .row, .row.flex, .flex-row{ display: block !important; }
  .row > *, .row.flex > *, .flex-row > *{ width: 100% !important; max-width: none !important; }
  /* Media no side-scroll */
  .card img, .card video, .card picture, .card canvas,
  .posts img, .posts video, .posts picture, .posts canvas{
    max-width: 100% !important; height: auto !important; display: block !important;
  }
  /* Tame huge H1s on phones */
  .head h1 { font-size: clamp(28px, 7vw, 42px); }
}
/* === Burger crisp v3 (pixel-snapped) === */
.hamburger{
  width:44px; height:44px; border-radius:10px;
  position:relative; cursor:pointer; vertical-align:middle;
  color: var(--text-hi, #f2f2f2);
  border:1px solid var(--line, #2d484e);
  background: none !important;            /* kill gradient/dashed backgrounds */
}

/* draw the three bars from one 2px line using box-shadows */
.hamburger::before, .hamburger::after { content:none; }  /* disable older rules */
.hamburger span, .hamburger .bar { display:none !important; } /* hide legacy child */

.hamburger::after{
  content:"";
  position:absolute; left:50%; top:50%;
  width:22px; height:2px; background: currentColor; border-radius:1px;
  transform: translate(-50%, -50%); /* center line */
  box-shadow:
    0 -6px 0 currentColor,          /* top line */
    0  6px 0 currentColor;          /* bottom line */
}

/* keep mobile behavior */
@media (max-width: 900px){
  #nav .links, .nav .links{ display:none !important; }
  .hamburger{ display:inline-flex !important; }
}

/* ==== Stackable Cards — Global System ==== */
:root{
  --bg-card: #0a1518;
  --bg-card-alt:#0e1c20;
  --fg: #e7ecef;
  --accent: #a8d48b;
  --border: rgba(255,255,255,.08);
  --shadow: 0 6px 20px rgba(0,0,0,.25);
  --radius: 16px;
}

.section-cards{
  display:grid;
  gap: clamp(14px, 2.5vmin, 24px);
  margin: clamp(18px, 3vmin, 36px) auto;
  padding: 0 clamp(12px, 3vmin, 28px);
  max-width: 1100px;
}
.section-cards.stackable{ grid-template-columns: 1fr; }
@media (min-width: 680px){
  .section-cards.stackable{ grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px){
  .section-cards.stackable{ grid-template-columns: repeat(3, 1fr); }
}

.card{
  background: linear-gradient(180deg, var(--bg-card), var(--bg-card-alt));
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(16px, 2.5vmin, 28px);
  position: relative;
  overflow: clip;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover{
  transform: translateY(-3px);
  border-color: rgba(168,212,139,.35);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.card h2,.card h3{ margin: 0 0 .5rem 0; line-height: 1.2; }
.card p{ opacity:.95; }
.card a{ color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.card .eyebrow{
  font-size:.8rem; letter-spacing:.12em; text-transform:uppercase;
  opacity:.7; margin-bottom:.4rem;
}

.card .media{ border-radius:10px; overflow:hidden; margin:.6rem 0 0 0; }
.card .media img{ display:block; width:100%; height:auto; }

.card.span-all{ grid-column: 1 / -1; }

.card ul, .card ol{ margin:.5rem 0 0 1.1rem; }
.card li + li{ margin-top:.35rem; }

/* === Responsive spacing tune for stackable cards === */

/* Mobile-first (default) */
.section-cards {
  max-width: 1150px;                 /* keeps rows from stretching too wide */
  gap: 22px;                          /* space between cards */
  margin: 28px auto 56px;             /* space around the whole section */
  padding: 0 18px;                    /* gutter from viewport edges */
}
.card {
  padding: 24px;                      /* inner space inside each card */
}
.card .media { margin-top: 10px; }    /* breathing room above images */

/* Slightly wider phones / small tablets */
@media (min-width: 480px) {
  .section-cards {
    gap: 26px;
    margin: 32px auto 64px;
    padding: 0 20px;
  }
  .card { padding: 26px; }
}

/* Tablets / small laptops (this breakpoint also becomes 2 columns per your grid rules) */
@media (min-width: 680px) {
  .section-cards {
    gap: 28px;
    margin: 36px auto 72px;
    padding: 0 24px;
  }
  .card { padding: 28px; }
}

/* Desktops (3 columns per your grid rules) */
@media (min-width: 1024px) {
  .section-cards {
    gap: 32px;            /* more separation between columns */
    margin: 40px auto 84px;
    padding: 0 32px;      /* a little wider gutter so edges don't feel cramped */
  }
  .card { padding: 32px; }
}

/* XL desktops */
@media (min-width: 1280px) {
  .section-cards {
    gap: 36px;
    margin: 48px auto 96px;
    padding: 0 40px;
  }
  .card { padding: 36px; }
}

/* UX niceties: reduce hover “lift” on touch devices & motion-sensitive users */
@media (hover: none) {
  .card:hover { transform: none; box-shadow: var(--shadow); }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: border-color .18s ease; }
  .card:hover { transform: none; }
}


/* === Promo Banner Global Fix === */
.card.promo > img,
.promo-img {
  height: auto !important;
  width: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
  display: block !important;
}
