/*
Theme Name: FMB Live Webcams
Theme URI: https://fortmyersbeach.org
Author: Fort Myers Beach
Author URI: https://fortmyersbeach.org
Description: Fort Myers Beach and Southwest Florida live webcam wall with Google Ads sidebar and footer support.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fmb-webcams
Tags: one-column, two-columns, right-sidebar, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, full-width-template, sticky-post, theme-options, translation-ready, blog
*/

/* ─── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ocean: #0a3d5c;
  --gulf:  #1278a0;
  --sky:   #7ec9e4;
  --foam:  #e8f6fb;
  --gold:  #f0a000;
  --dusk:  #d65d30;
  --dark:  #071926;
  --card:  rgba(10,61,92,0.22);
  --bdr:   rgba(126,201,228,0.22);
  --sidebar-w: 300px;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;  /* mobile browsers scroll at html level, not body */
  width: 100%;
}

body {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  background: var(--dark);
  color: var(--foam);
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 90% 55% at 15% 105%, rgba(18,120,160,.32) 0%, transparent 60%),
    radial-gradient(ellipse 60% 45% at 85% -5%,  rgba(126,201,228,.12) 0%, transparent 55%),
    linear-gradient(170deg, #071926 0%, #0b2d42 45%, #093550 75%, #071926 100%);
}

img, iframe, video, embed, object {
  max-width: 100%;
  /* iframes with hardcoded width= attributes can overflow on mobile */
}
img { height: auto; display: block; }
a { color: var(--sky); text-decoration: none; }
a:hover { opacity: .8; }

/* ─── Site wrapper ──────────────────────────────────────────────────────────── */
#page { display: flex; flex-direction: column; min-height: 100vh; width: 100%; overflow-x: hidden; }

/* ─── Site header ───────────────────────────────────────────────────────────── */
#masthead {
  text-align: center;
  padding: 3.5rem 1rem 2rem;
  position: relative;
}

.site-eyebrow {
  font-size: .7rem; letter-spacing: .4em; text-transform: uppercase;
  color: var(--sky); opacity: .75; margin-bottom: .6rem;
}

.site-title {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-size: clamp(3rem, 9vw, 6.5rem);
  line-height: .92; letter-spacing: .07em;
  background: linear-gradient(130deg, var(--foam) 10%, var(--sky) 55%, var(--gold) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: .6rem;
}

.site-title a {
  background: inherit; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; text-decoration: none;
}

.site-description {
  font-size: .82rem; font-weight: 300; letter-spacing: .08em;
  color: rgba(232,246,251,.45); margin-bottom: 1.2rem;
}

.header-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }

.pill {
  display: inline-flex; align-items: center; gap: .35rem;
  border-radius: 999px; padding: .28rem .85rem;
  font-size: .68rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
}
.pill-live  { background: rgba(240,160,0,.12); border: 1px solid rgba(240,160,0,.35); color: var(--gold); }
.pill-count { background: rgba(126,201,228,.08); border: 1px solid rgba(126,201,228,.35); color: var(--sky); }

.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.3} }

.header-rule {
  height: 1px; margin: 1.8rem 0 0;
  background: linear-gradient(90deg,transparent,var(--sky),var(--gold),var(--dusk),var(--sky),transparent);
  opacity: .35;
}

/* ─── Navigation ────────────────────────────────────────────────────────────── */
#site-navigation {
  background: rgba(7,25,38,.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bdr);
  /* Outside-facing corners of the nav bar = bottom-left + bottom-right */
  border-radius: 0 0 12px 12px;
  padding: 0 1.5rem;
  position: relative;   /* stacking context so z-index works */
  z-index: 100;
}

/* ── Top-level menu ─────────────────────────────────────────────────────────── */
.nav-menu {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: 0; margin: 0; padding: 0;
}
.nav-menu > li {
  position: relative;   /* anchor point for submenu absolute positioning */
}
.nav-menu > li > a {
  display: block; padding: .7rem 1rem;
  font-size: .72rem; font-weight: 500; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(232,246,251,.7); transition: color .2s;
}
.nav-menu > li > a:hover,
.nav-menu > li.current-menu-item > a,
.nav-menu > li.current-menu-ancestor > a { color: var(--sky); }

/* Down-arrow caret on items that have children */
.nav-menu > li.menu-item-has-children > a::after {
  content: ' ▾';
  font-size: .55rem;
  opacity: .55;
  margin-left: 3px;
  vertical-align: middle;
}

/* ── Submenus ───────────────────────────────────────────────────────────────── */

.nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 9999;
  min-width: 210px;
  margin: 0;
  padding: 5px 0;
  list-style: none;

  /* Theme-matched background */
  background: rgba(7,25,38,.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bdr);
  box-shadow: 0 16px 42px rgba(0,0,0,.55), 0 2px 8px rgba(0,0,0,.3);

  /*
   * Corner logic:
   *   top-left  → sits directly below/adjacent to parent nav item  → square (0)
   *   top-right → free edge, faces outward                         → rounded
   *   bot-right → free edge, faces outward                         → rounded
   *   bot-left  → free edge, faces outward                         → rounded
   */
  border-radius: 0 10px 10px 10px;

  /* Smooth reveal */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
  pointer-events: none;
}

/*
 * Invisible "bridge" strip above the submenu.
 * Keeps :hover alive while the cursor moves from the nav item down
 * into the dropdown — prevents flicker on the gap between them.
 */
.nav-menu .sub-menu::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

/* Show on hover; :focus-within keeps it open for keyboard navigation */
.nav-menu li:hover > .sub-menu,
.nav-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

/* Submenu links */
.nav-menu .sub-menu a {
  display: block;
  padding: .55rem 1.15rem;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(232,246,251,.72);
  white-space: nowrap;
  transition: color .15s, background .15s;
  opacity: 1;           /* override the global a:hover opacity rule */
}
.nav-menu .sub-menu a:hover {
  color: var(--sky);
  background: rgba(126,201,228,.08);
  opacity: 1;
}
.nav-menu .sub-menu li.current-menu-item > a,
.nav-menu .sub-menu li.current-menu-ancestor > a { color: var(--sky); }

/*
 * Per-item corner rounding inside the submenu.
 * Only the link background shows when hovered, so we round the link itself
 * to match the container's outside corners — not the nav-bar-adjacent ones.
 *
 * First item: top-right corner is outside-facing (top-left is at 0 per container)
 * Last item:  both bottom corners are outside-facing
 * Only item:  three corners are outside-facing
 */
.nav-menu .sub-menu > li:first-child > a        { border-radius: 0 8px 0 0; }
.nav-menu .sub-menu > li:last-child > a         { border-radius: 0 0 8px 8px; }
.nav-menu .sub-menu > li:only-child > a         { border-radius: 0 8px 8px 8px; }

/* Right-arrow caret on nested items */
.nav-menu .sub-menu li.menu-item-has-children > a::after {
  content: ' ▸';
  font-size: .55rem;
  opacity: .55;
  float: right;
  margin-top: 1px;
}

/* ── Nested sub-submenus (fly out to the right) ─────────────────────────────── */
.nav-menu .sub-menu .sub-menu {
  top: -6px;            /* align top of submenu with the triggering row */
  left: 100%;
  margin-left: 3px;
  /*
   * top-left  → adjacent to parent row (inside)        → square (0)
   * all others → free / outside-facing                 → rounded
   */
  border-radius: 0 10px 10px 10px;
}

/* ─── Content + Sidebar layout ──────────────────────────────────────────────── */
#content {
  flex: 1;
  width: 100%; max-width: 1600px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
  box-sizing: border-box;
}

/* CSS grid is far more predictable than flexbox for a 2-col layout */
#primary-and-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 1.4rem;
  align-items: start;
}

#primary { min-width: 0; }

/* ─── Sidebar ───────────────────────────────────────────────────────────────── */
#secondary {
  position: sticky;
  top: 1.5rem;
}

.widget-area-label {
  font-size: .6rem; letter-spacing: .2em; text-transform: uppercase;
  color: rgba(126,201,228,.35); text-align: center; margin-bottom: .5rem;
}

.widget {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: 1.2rem;
  overflow: hidden;
}

.widget-title {
  font-size: .72rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sky); margin-bottom: .8rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--bdr);
}

/* Ad slot containers */
.ad-slot {
  display: flex; align-items: center; justify-content: center;
  min-height: 250px;
  background: rgba(126,201,228,.03);
  border: 1px dashed rgba(126,201,228,.15);
  border-radius: 8px;
  color: rgba(126,201,228,.3);
  font-size: .62rem; letter-spacing: .15em; text-transform: uppercase;
  text-align: center;
}

.ad-slot-leaderboard { min-height: 90px; }
.ad-slot-rectangle   { min-height: 250px; }
.ad-slot-skyscraper  { min-height: 600px; }

/* ─── Section labels ─────────────────────────────────────────────────────────── */
.section-label {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-size: 1.3rem; letter-spacing: .18em; color: var(--sky);
  padding: 2.2rem 0 .8rem;
  display: flex; align-items: center; gap: .7rem;
}
.section-label::before {
  content: ''; width: 4px; height: 1.3rem; border-radius: 2px;
  background: linear-gradient(180deg,var(--gold),var(--dusk)); flex-shrink: 0;
}
.section-line { height: 1px; background: var(--bdr); margin: 0 0 1.4rem; }

/* ─── Cam grid — always 2+ columns, never 1 ─────────────────────────────────── */
.cam-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
  margin-bottom: 1rem;
}
.cam-grid-sm {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .6rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .cam-grid    { gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); }
  .cam-grid-sm { gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
@media (min-width: 1100px) {
  .cam-grid    { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
  .cam-grid-sm { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ─── Click-to-play thumbnail overlay ───────────────────────────────────────── */
.cam-placeholder {
  position: absolute; inset: 0; cursor: pointer; overflow: hidden;
}
.cam-placeholder img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; filter: brightness(.78); transition: filter .25s;
}
.cam-placeholder:hover img { filter: brightness(1); }
.play-over {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .4rem;
  background: rgba(7,25,38,.38); transition: background .25s;
}
.cam-placeholder:hover .play-over { background: rgba(7,25,38,.12); }
.play-btn {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(240,160,0,.92); display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; color: #071926;
  box-shadow: 0 4px 22px rgba(0,0,0,.55);
  transition: transform .2s, background .2s;
}
.cam-placeholder:hover .play-btn { transform: scale(1.12); background: var(--gold); }
.play-label {
  font-size: .6rem; letter-spacing: .14em; text-transform: uppercase;
  color: rgba(232,246,251,.85); text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
@media (max-width: 479px) {
  .play-btn { width: 34px; height: 34px; font-size: .9rem; }
  .play-label { display: none; }
}

/* ─── Embed cards ───────────────────────────────────────────────────────────── */
.cam-card {
  background: var(--card); border: 1px solid var(--bdr); border-radius: 14px; overflow: hidden;
  backdrop-filter: blur(10px); display: flex; flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  animation: card-up .55s ease both;
}
.cam-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(126,201,228,.45);
  border-color: rgba(126,201,228,.5);
}

@keyframes card-up { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }
.cam-card:nth-child(1){animation-delay:.04s} .cam-card:nth-child(2){animation-delay:.09s}
.cam-card:nth-child(3){animation-delay:.13s} .cam-card:nth-child(4){animation-delay:.17s}
.cam-card:nth-child(5){animation-delay:.21s} .cam-card:nth-child(6){animation-delay:.25s}
.cam-card:nth-child(7){animation-delay:.29s} .cam-card:nth-child(8){animation-delay:.33s}

.embed-wrap { position: relative; width: 100%; padding-top: 56.25%; background: #040e17; }
.embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; display: block; }

.cam-info { padding: .65rem .9rem .8rem; display: flex; flex-direction: column; gap: .25rem; }
.cam-name { font-size: .84rem; font-weight: 500; color: var(--foam); }
.cam-loc  { font-size: .68rem; font-weight: 300; color: var(--sky); opacity: .75; letter-spacing: .03em; }
.cam-badge {
  display: inline-flex; align-items: center; gap: .3rem; margin-top: .4rem; align-self: flex-start;
  background: rgba(18,120,160,.28); border: 1px solid rgba(126,201,228,.25); border-radius: 999px;
  padding: .22rem .7rem; font-size: .62rem; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--sky);
}

/* ─── Hero camera ───────────────────────────────────────────────────────────── */
.hero-cam-section {
  margin-bottom: 2rem;
  animation: card-up .6s ease both;
}

.hero-cam-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #040e17;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--bdr);
  box-shadow: 0 8px 40px rgba(0,0,0,.45);
}

.hero-cam-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.hero-cam-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .7rem .5rem .2rem;
}

.hero-cam-name {
  font-size: 1rem;
  font-weight: 500;
  color: var(--foam);
}

.hero-cam-loc {
  font-size: .75rem;
  font-weight: 300;
  color: var(--sky);
  opacity: .75;
  letter-spacing: .03em;
}

/* ─── Link-out cards ─────────────────────────────────────────────────────────── */
a.link-card {
  background: var(--card); border: 1px solid var(--bdr); border-radius: 14px; overflow: hidden;
  backdrop-filter: blur(10px); display: flex; flex-direction: column;
  text-decoration: none; color: inherit; cursor: pointer;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  animation: card-up .55s ease both;
}
a.link-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(126,201,228,.45);
  border-color: rgba(126,201,228,.5);
}
a.link-card:hover .thumb img { transform: scale(1.04); filter: brightness(1) saturate(1.15); }
a.link-card:hover .thumb-overlay { opacity: 1; }
a.link-card:hover .open-btn { background: var(--sky); color: var(--dark); }

.thumb { position: relative; width: 100%; padding-top: 56.25%; background: #040e17; overflow: hidden; }
.thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease, filter .3s ease; filter: brightness(.88) saturate(1.05);
}
.thumb-overlay {
  position: absolute; inset: 0; background: rgba(7,25,38,.55);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .22s ease;
}
.play-icon {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(240,160,0,.92);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; box-shadow: 0 4px 20px rgba(0,0,0,.5);
}
.thumb-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .5rem;
  background: radial-gradient(ellipse at center,rgba(18,120,160,.18) 0%,transparent 70%);
}
.thumb-empty .cam-icon { font-size: 2.4rem; opacity: .4; }
.thumb-empty span { font-size: .62rem; letter-spacing: .15em; text-transform: uppercase; color: var(--sky); opacity: .5; }
.link-info { padding: .65rem .9rem .8rem; display: flex; flex-direction: column; gap: .25rem; }
.open-btn {
  display: inline-flex; align-items: center; gap: .35rem; margin-top: .4rem; align-self: flex-start;
  background: rgba(18,120,160,.35); border: 1px solid rgba(126,201,228,.3); border-radius: 999px;
  padding: .32rem .9rem; font-size: .68rem; font-weight: 500; letter-spacing: .08em;
  text-transform: uppercase; color: var(--foam);
  transition: background .2s, color .2s;
}

/* ─── Footer ─────────────────────────────────────────────────────────────────── */
#colophon {
  border-top: 1px solid var(--bdr);
  margin-top: 2rem;
}

/* Footer ad bar */
.footer-ad-bar {
  background: rgba(7,25,38,.6);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer widget area */
.footer-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  max-width: 1600px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1rem;
}

.footer-widget { }
.footer-widget .widget-title { color: var(--gold); }

/* Site info */
.site-info {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  color: rgba(232,246,251,.28);
  font-size: .68rem; letter-spacing: .06em; font-weight: 300;
  line-height: 2;
}
.site-info a { color: var(--sky); opacity: .65; transition: opacity .2s; }
.site-info a:hover { opacity: 1; }

/* ─── WordPress standard classes ────────────────────────────────────────────── */
.alignleft  { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { margin: 0 auto 1em; display: block; }
.wp-caption { max-width: 100%; }
.screen-reader-text {
  clip: rect(1px,1px,1px,1px); height: 1px; overflow: hidden;
  position: absolute; width: 1px; word-wrap: normal;
}

/* ─── Contain all page content — nothing may exceed its parent width ─────────── */
.entry-content        { overflow-x: hidden; max-width: 100%; }
.wp-block-embed       { overflow: hidden; max-width: 100%; }
.wp-block-embed__wrapper { overflow: hidden; }
/* Hero embed in 484 Media plugin — force iframe to fill container width */
.cmp-hero-embed       { overflow: hidden; }
.cmp-hero-embed iframe { width: 100% !important; height: 100% !important; }

/* ─── Full-width elements — always stretch edge to edge ─────────────────────── */
#masthead,
#site-navigation,
.footer-ad-bar,
.weather-banner {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Weather banner — drop-in slot above the cam grid for a weather widget/iframe */
.weather-banner {
  margin: 0 0 1rem;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--bdr);
  background: var(--card);
}

/* ─── Tablet: shrink sidebar ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 260px; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PHONE LAYOUT  (≤ 639 px)
   Never show fewer than 2 camera columns. Override the plugin's 1-col rule
   with !important. Leave .entry-content as normal block flow so weather
   widgets, headings, and text always stack full-width naturally.
   ═══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 639px) {

  /* ── 484 Media Cam Page plugin: force 2 columns (overrides plugin's 1-col) ── */
  .cmp-grid-cols-2,
  .cmp-grid-cols-3,
  .cmp-grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* ── WordPress Columns block: stack vertically on phone ─────────────────── */
  .wp-block-columns {
    flex-wrap: wrap !important;
  }
  .wp-block-column {
    flex-basis: 100% !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* ── Our custom cam-grid class (standalone HTML or shortcode) ────────────── */
  .cam-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: .5rem;
    width: 100%;
  }
  .cam-grid > *:first-child { grid-column: 1 / -1; }
}

/* ─── Phone: stack sidebar below content ────────────────────────────────────── */
@media (max-width: 768px) {
  #primary-and-sidebar {
    grid-template-columns: 1fr;
  }
  #secondary { position: static; width: 100%; }
  .site-title { font-size: 2.8rem; }
  .section-label { padding: 1.8rem 0 .6rem; font-size: 1.1rem; }

  /* Hard-constrain every major container to the visible viewport.
     calc(100vw - 1.5rem) = viewport minus 12px each side.
     !important overrides any WP block-editor or plugin stylesheet padding:0 rules. */
  #content {
    width: 100vw !important;
    max-width: 100vw !important;
    padding-left: .75rem !important;
    padding-right: .75rem !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  #primary-and-sidebar,
  #primary,
  .entry-content,
  .cmp-wrap,
  .cmp-hero,
  .cmp-grid {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }
  /* Secondary (sidebar stacked below) must not exceed viewport either */
  #secondary {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   BLOG HIERARCHY — categories listing · category archive · single post
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Shared: breadcrumb ────────────────────────────────────────────────────── */
.fmb-breadcrumb {
  font-size: .7rem;
  letter-spacing: .08em;
  color: rgba(232,246,251,.38);
  margin-bottom: 1rem;
}
.fmb-breadcrumb a { color: var(--sky); opacity: .65; }
.fmb-breadcrumb a:hover { opacity: 1; }
.fmb-breadcrumb span { margin: 0 .4em; opacity: .4; }

/* ─── Categories listing (template-categories.php) ──────────────────────────── */
.fmb-cats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.2rem;
  margin-bottom: 2rem;
}

.fmb-cat-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(10px);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  animation: card-up .5s ease both;
}
.fmb-cat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 50px rgba(0,0,0,.5), 0 0 0 1px rgba(126,201,228,.45);
  border-color: rgba(126,201,228,.5);
  opacity: 1;
}

.fmb-cat-thumb {
  position: relative;
  width: 100%;
  padding-top: 52%;
  background: #040e17;
  overflow: hidden;
}
.fmb-cat-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.75);
  transition: transform .35s ease, filter .25s ease;
}
.fmb-cat-card:hover .fmb-cat-thumb img {
  transform: scale(1.05);
  filter: brightness(.9);
}
.fmb-cat-thumb-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(18,120,160,.18) 0%, transparent 70%);
  color: rgba(126,201,228,.25);
  font-size: 2rem;
}

.fmb-cat-body {
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex: 1;
}
.fmb-cat-name {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-size: 1.25rem;
  letter-spacing: .1em;
  color: var(--sky);
  line-height: 1.1;
}
.fmb-cat-desc {
  font-size: .78rem;
  line-height: 1.55;
  color: rgba(232,246,251,.58);
  flex: 1;
}
.fmb-cat-count {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  background: rgba(18,120,160,.28);
  border: 1px solid rgba(126,201,228,.22);
  border-radius: 999px;
  padding: .2rem .65rem;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sky);
  margin-top: .3rem;
}

/* ─── Category archive (category.php) ──────────────────────────────────────── */
.fmb-archive-desc {
  font-size: .84rem;
  color: rgba(232,246,251,.55);
  line-height: 1.65;
  margin-top: -.4rem;
  margin-bottom: 1.4rem;
}

.fmb-post-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.8rem;
}

.fmb-post-card {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  backdrop-filter: blur(10px);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
  animation: card-up .5s ease both;
  text-decoration: none;
  color: inherit;
}
.fmb-post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(0,0,0,.5), 0 0 0 1px rgba(126,201,228,.4);
  border-color: rgba(126,201,228,.45);
  opacity: 1;
}
.fmb-post-card:nth-child(1){animation-delay:.04s} .fmb-post-card:nth-child(2){animation-delay:.08s}
.fmb-post-card:nth-child(3){animation-delay:.12s} .fmb-post-card:nth-child(4){animation-delay:.16s}
.fmb-post-card:nth-child(5){animation-delay:.20s} .fmb-post-card:nth-child(6){animation-delay:.24s}

.fmb-post-thumb {
  flex-shrink: 0;
  width: 260px;
  position: relative;
  background: #040e17;
  overflow: hidden;
}
.fmb-post-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.85);
  transition: transform .35s ease, filter .25s ease;
}
.fmb-post-card:hover .fmb-post-thumb img {
  transform: scale(1.04);
  filter: brightness(1);
}
.fmb-post-thumb-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(18,120,160,.15) 0%, transparent 70%);
  color: rgba(126,201,228,.25);
  font-size: 2.5rem;
}

.fmb-post-body {
  flex: 1;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-width: 0;
}
.fmb-post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .6rem;
}
.fmb-post-date {
  font-size: .65rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(232,246,251,.38);
}
.fmb-post-cat-tag {
  display: inline-flex;
  align-items: center;
  background: rgba(18,120,160,.28);
  border: 1px solid rgba(126,201,228,.22);
  border-radius: 999px;
  padding: .18rem .6rem;
  font-size: .6rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sky);
  text-decoration: none;
}
.fmb-post-cat-tag:hover { opacity: 1; background: rgba(18,120,160,.45); }

.fmb-post-title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--foam);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fmb-post-excerpt {
  font-size: .8rem;
  line-height: 1.65;
  color: rgba(232,246,251,.58);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fmb-read-more {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  align-self: flex-start;
  margin-top: .3rem;
  background: rgba(18,120,160,.35);
  border: 1px solid rgba(126,201,228,.28);
  border-radius: 999px;
  padding: .28rem .8rem;
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--foam);
  text-decoration: none;
  transition: background .18s, color .18s;
}
.fmb-read-more:hover { background: var(--sky); color: var(--dark); opacity: 1; }

/* Pagination */
.fmb-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  margin: .5rem 0 2rem;
}
.fmb-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 .45rem;
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 8px;
  font-size: .76rem;
  color: rgba(232,246,251,.55);
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
}
.fmb-pagination .page-numbers:hover,
.fmb-pagination .page-numbers.current {
  background: rgba(18,120,160,.4);
  border-color: rgba(126,201,228,.5);
  color: var(--sky);
}
.fmb-pagination .page-numbers.dots { background: none; border-color: transparent; }

/* ─── Single post (single.php) ──────────────────────────────────────────────── */
.fmb-single-hero {
  display: inline-block;   /* shrink-wraps to the image */
  max-width: 300px;
  max-height: 300px;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 1.4rem;
  border: 1px solid var(--bdr);
  background: #040e17;
}
.fmb-single-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 300px;
  max-height: 300px;
  object-fit: cover;
}

.fmb-single-title {
  font-family: 'Bebas Neue', 'Arial Black', sans-serif;
  font-size: clamp(1.9rem, 4.5vw, 3.2rem);
  letter-spacing: .06em;
  line-height: 1.08;
  color: var(--foam);
  margin-bottom: .8rem;
}

.fmb-single-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .7rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--bdr);
}
.fmb-single-date {
  font-size: .67rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(232,246,251,.38);
}

.fmb-single-content {
  font-size: .95rem;
  line-height: 1.82;
  color: rgba(232,246,251,.82);
}
.fmb-single-content p { margin-bottom: 1.2em; }
.fmb-single-content h2,
.fmb-single-content h3,
.fmb-single-content h4 { color: var(--foam); margin: 1.6em 0 .55em; line-height: 1.25; }
.fmb-single-content ul,
.fmb-single-content ol  { margin: 0 0 1.2em 1.4em; }
.fmb-single-content li  { margin-bottom: .35em; }
.fmb-single-content img { border-radius: 8px; margin: 1em 0; }
.fmb-single-content a   { color: var(--sky); }
.fmb-single-content blockquote {
  border-left: 3px solid var(--sky);
  padding: .5rem 1rem;
  margin: 1.2em 0;
  color: rgba(232,246,251,.6);
  font-style: italic;
}

.fmb-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--bdr);
}
.fmb-post-tag {
  background: rgba(7,25,38,.7);
  border: 1px solid var(--bdr);
  border-radius: 999px;
  padding: .22rem .75rem;
  font-size: .64rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(232,246,251,.5);
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.fmb-post-tag:hover { color: var(--sky); border-color: rgba(126,201,228,.4); opacity: 1; }

.fmb-post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--bdr);
}
.fmb-nav-item {
  background: var(--card);
  border: 1px solid var(--bdr);
  border-radius: 12px;
  padding: .85rem 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .2s, background .2s;
}
.fmb-nav-item:hover { border-color: rgba(126,201,228,.45); background: rgba(10,61,92,.35); opacity: 1; }
.fmb-nav-item.fmb-nav-next { text-align: right; }
.fmb-nav-dir {
  font-size: .6rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(232,246,251,.3);
  display: block;
  margin-bottom: .3rem;
}
.fmb-nav-title {
  font-size: .8rem;
  font-weight: 500;
  color: var(--sky);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Responsive: stack post cards on mobile ────────────────────────────────── */
@media (max-width: 640px) {
  .fmb-post-card  { flex-direction: column; }
  .fmb-post-thumb { width: 100%; height: 190px; position: relative; }
  .fmb-cats-grid  { grid-template-columns: repeat(2, 1fr); }
  .fmb-post-nav   { grid-template-columns: 1fr; }
  .fmb-nav-item.fmb-nav-next { text-align: left; }
}
@media (max-width: 380px) {
  .fmb-cats-grid { grid-template-columns: 1fr; }
}
