:root{
  --bg:#f7f9fc;
  --fg:#0f172a;
  --muted:#5b6b82;

  --card:#ffffff;
  --border:#e5edf7;

  --blue:#1f5fa9;
  --blue-2:#2b74c7;
  --orange:#f97316;

  --shadow:0 20px 40px rgba(15,23,42,.08);
  --radius:18px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--fg);
  line-height:1.6;
}

a{ color:var(--blue-2); text-decoration:none; }
a:hover{ text-decoration:underline; }

.wrap{
  max-width:1100px;
  margin:0 auto;
  padding:10px 20px 80px;
}

/* ───────── Topbar ───────── */

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin-bottom:10px;
}

/* NEW: right side container so we can hold search + nav */
.topbar-right{
  display:flex;
  align-items:center;
  gap:14px;
}

/* Logo container */
.logo{
  display:flex;
  align-items:center;
  gap:12px;
  font-weight:800;
  font-size:20px;
  color:var(--fg);
  text-decoration:none;
}

.logo-img{
  height:88px;
  width:auto;
  display:block;
  transition:transform .15s ease, opacity .15s ease;
}

.logo:hover .logo-img{
  transform:translateY(-1px);
  opacity:.96;
}

@media (max-width:520px){
  .logo-img{ height:64px; }
}

/* Optional fallback badge (unused now) */
.logo-badge{
  width:44px;
  height:44px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--blue),var(--blue-2));
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight:900;
}

/* Top nav (About) */
.topnav a{
  font-weight:800;
  color:var(--fg);
  padding:8px 10px;
  border-radius:10px;
  display:inline-block;
}

.topnav a:hover{
  background:rgba(43,116,199,.08);
  color:var(--blue);
  text-decoration:none;
}

/* Top search */
.topsearch{
  display:flex;
  align-items:center;
  gap:8px;
}

.topsearch input{
  width:200px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  font-size:14px;
  outline:none;
}

.topsearch input:focus{
  border-color:rgba(43,116,199,.6);
  box-shadow:0 0 0 4px rgba(43,116,199,.12);
}

.topsearch button{
  width:38px;
  height:38px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--blue);
  font-weight:900;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background .15s ease,border-color .15s ease,transform .05s ease;
}

.topsearch button:hover{
  background:rgba(43,116,199,.08);
  border-color:rgba(43,116,199,.35);
}

.topsearch button:active{
  transform:translateY(1px);
}

@media (max-width:820px){
  .topsearch{ display:none; }
}

/* ───────── Hero (start page) ───────── */

.hero{
  background:
    radial-gradient(1200px 500px at 15% 0%, rgba(43,116,199,.18), transparent 55%),
    radial-gradient(900px 400px at 90% 10%, rgba(249,115,22,.18), transparent 55%),
    #fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:34px;
}

.hero-inner{
  display:grid;
  grid-template-columns:1.1fr .9fr;
  gap:30px;
  align-items:center;
}

@media (max-width:900px){
  .hero-inner{ grid-template-columns:1fr; }
}

.kicker{
  display:inline-block;
  padding:6px 12px;
  border-radius:999px;
  background:rgba(37,99,235,.1);
  color:var(--blue);
  font-weight:700;
  font-size:13px;
  border:1px solid rgba(37,99,235,.18);
  margin-bottom:12px;
}

h1{
  font-size:42px;
  line-height:1.1;
  margin:0 0 14px;
}

.sub{
  color:var(--muted);
  font-size:18px;
  margin-bottom:22px;
}

/* Search (hero) */

.search{
  display:flex;
  gap:12px;
  margin-bottom:14px;
}

.search input{
  flex:1;
  padding:16px 18px;
  font-size:16px;
  border-radius:14px;
  border:1px solid var(--border);
  outline:none;
  background:#fff;
}

.search input:focus{
  border-color:rgba(43,116,199,.6);
  box-shadow:0 0 0 4px rgba(43,116,199,.12);
}

.search button{
  padding:16px 22px;
  font-size:15px;
  border-radius:14px;
  border:0;
  background:linear-gradient(135deg,var(--blue),var(--blue-2));
  color:#fff;
  font-weight:800;
  cursor:pointer;
}

/* Chips */

.example-row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.chip{
  padding:7px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--fg);
  font-size:13px;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}

.chip:hover{
  border-color:rgba(43,116,199,.35);
  text-decoration:none;
}

/* Image */

.brand-img{
  width:100%;
  max-width:520px;
  display:block;
  margin-left:auto;
  border-radius:16px;
  box-shadow:0 18px 45px rgba(15,23,42,.18);
}

/* ───────── Cards ───────── */

.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px;
  margin:22px 0;
}

.card h2{
  margin:0 0 10px;
  font-size:18px;
}

.card h3{
  margin:0 0 6px;
  font-size:16px;
}

.quote{
  font-style:italic;
  color:#334155;
}

/* ───────── Details / Deep dive ───────── */

.details{
  border-top:1px solid var(--border);
  margin-top:12px;
  padding-top:12px;
}

.details summary{
  cursor:pointer;
  font-weight:800;
  color:var(--blue);
  list-style:none;
}

.details summary::-webkit-details-marker{ display:none; }

.details summary::after{
  content:" +";
  color:var(--muted);
  font-weight:900;
}

.details[open] summary::after{
  content:" −";
}

.details-body{
  margin-top:10px;
  color:var(--fg);
}

/* ───────── Small text ───────── */

.hint{
  color:var(--muted);
  font-size:14px;
}
.home-grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
  margin-top:22px;
}

@media (max-width:900px){
  .home-grid{ grid-template-columns:1fr; }
}

.home-list{
  margin:0;
  padding-left:18px;
}

.home-list li{
  margin:8px 0;
}

.footer{
  margin-top:34px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  color:var(--muted);
}
.tag-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.tag{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--fg);
  font-size:12px;
  font-weight:800;
  text-decoration:none;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}

.tag:hover{
  border-color:rgba(43,116,199,.35);
  text-decoration:none;
}
/* --- Mobile fixes (home page / topbar / hero) --- */

@media (max-width: 820px){

  /* Make topbar wrap instead of forcing one line */
  .topbar{
    display:flex;
    flex-direction:column;   /* 👈 gör headern 2-radig */
    gap:14px;
  }

  /* Let logo take full width if needed */
  .logo{
    flex: 1 1 180px;
  }

  /* Topbar-right should wrap (search + About) */
  .topbar-right{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
  }

  /* Search should shrink properly */
  .topsearch{
    flex: 1 1 220px;
  }

  .topsearch input{
    width: 100%;
    min-width: 0;
  }

  /* About link shouldn't hog space */
  .topnav a{
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(255,255,255,.7);
    border: 1px solid var(--border);
  }

  /* Hero layout: stack columns */
  .hero-inner{
    grid-template-columns: 1fr;
  }

  /* Headline smaller */
  h1{
    font-size: 34px;
  }

  /* Make hero image responsive and not too huge */
  .brand-img{
    max-width: 100%;
    height: auto;
    margin-top: 14px;
  }

  /* Search button shouldn't overflow */
  .search{
    flex-wrap: wrap;
  }
  .search input{
    min-width: 0;
  }
  .search button{
    width: 100%;
  }

  /* Chips wrap neatly */
  .example-row{
    gap: 8px;
  }
}
/* --- Term header polish --- */

.term-header{
  position: relative;
}

.term-title{
  margin: 0;
  font-size: 28px;      /* gör svaret tydligare */
  line-height: 1.2;
}

.term-acronym{
  font-weight: 900;
}

.term-formal{
  font-weight: 600;
  font-size: 0.9em;
  color: var(--muted);
}

.term-updated{
  position: static;     /* <-- VIKTIGT: ingen absolute */
  font-size: 12px;
  color: var(--muted);
  opacity: .75;
  white-space: nowrap;
  margin-left: auto;    /* <-- puttar den åt höger i flex-row */
}

/* Tags a bit smaller so they don't compete */
.term-header .tag-row{
  margin-top: 12px;
}

.term-header .tag{
  font-size: 12px;
  padding: 5px 10px;
  font-weight: 700;
}
@media (max-width: 520px){
  .term-updated{
    position: static;
    display: block;
    margin-top: 8px;
    margin-bottom: 8px;
  }
  .term-title{
    font-size: 24px;
  }
}
/* --- Rate row (compact, right-aligned) --- */
.rate-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:18px 0 8px;
  padding:0 4px;
}

.rate-left strong{
  font-size:16px;
}

.rate-right{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  justify-content:flex-end;
  text-align:right;
}

.rate-form{
  display:flex;
  gap:10px;
  align-items:center;
}

.rate-btn{
  padding:7px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  font-weight:800;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}

.rate-btn:hover{
  border-color:rgba(43,116,199,.35);
}

.rate-count{
  white-space:nowrap;
}

/* Mobile: stack nicely */
@media (max-width: 520px){
  .rate-row{
    align-items:flex-start;
    flex-direction:column;
    gap:10px;
  }
  .rate-right{
    width:100%;
    justify-content:space-between;
    text-align:left;
  }
}
/* ───────── Admin UI helpers ───────── */

.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  font-weight:800;
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}
.btn:hover{
  border-color:rgba(43,116,199,.35);
  text-decoration:none;
}

.admin-grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
@media (max-width: 900px){
  .admin-grid-2{ grid-template-columns:1fr; }
}

.admin-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.admin-table{
  width:100%;
  border-collapse:collapse;
}
.admin-table th{
  text-align:left;
  padding:8px 6px;
  font-size:13px;
  color:var(--muted);
}
.admin-table td{
  padding:8px 6px;
  vertical-align:top;
}
.admin-table tbody tr{
  border-top:1px solid var(--border);
}

.admin-kpi-row{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:12px;
}
@media (max-width: 900px){
  .admin-kpi-row{ grid-template-columns:repeat(2, 1fr); }
}
@media (max-width: 520px){
  .admin-kpi-row{ grid-template-columns:1fr; }
}

.admin-kpi{
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:#fff;
  box-shadow:0 10px 26px rgba(15,23,42,.06);
}
.admin-kpi-label{
  color:var(--muted);
  font-size:13px;
  font-weight:700;
}
.admin-kpi-value{
  font-size:28px;
  font-weight:900;
  line-height:1.1;
  margin-top:6px;
}
.admin-kpi-muted .admin-kpi-value{ font-size:14px; font-weight:700; }
.admin-kpi-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

/* Adbox ska INTE följa vanliga länkregler i .rt */
.rt a.adbox{
  font-weight:400 !important;
  text-decoration:none !important;
}

/* Stoppa underline som ibland “läcker” till child text */
.rt a.adbox *{
  text-decoration:none !important;
}

.rt a.adbox .adbox-inner,
.rt a.adbox .adbox-hook,
.rt a.adbox .adbox-subtitle,
.rt a.adbox .adbox-disclosure{
  font-weight:400 !important;
}
/* Affiliate “resource box” – polished */
.adbox{
  display:block;
  text-decoration:none;
  background:#fff;

  border:1px solid var(--border);
  border-radius:16px;
  padding:14px 16px;

  /* minimal accent line */
  border-left:4px solid rgba(59, 130, 246, 0.18);

  transition: transform .08s ease, border-color .12s ease, box-shadow .12s ease, border-left-color .12s ease;
}

.adbox:hover{
  border-color:#cbd5e1;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
  border-left-color: rgba(59, 130, 246, 0.45);
}

.adbox-inner{ display:block; }

/* Hook: default normal, bold only when explicitly wrapped */
.adbox-hook{
  display:block;
  font-weight:400;          /* NORMAL som default */
  color: var(--fg);
  margin:0 0 10px;
  line-height:1.25;
}

/* Explicit bold control */
.adbox-hook b,
.adbox-hook strong{
  font-weight:900;          /* Fet när DU väljer */
}

/* Title: accent blå */
.adbox-title{
  display:inline-block;
  font-weight:950;
  color: var(--blue);
  line-height:1.15;
  font-size:1.1rem;
}

.adbox:hover .adbox-title{
  text-decoration: underline;
}

/* Subtitle: starkare än muted men fortfarande lugn */
.adbox-subtitle{
  display:block;
  color: rgba(15,23,42,0.72);
  margin-top:8px;
  line-height:1.45;
}

/* Disclosure: quiet pill */
.adbox-disclosure{
  display:inline-block;
  margin-top:12px;
  font-size:12px;
  color: rgba(15,23,42,0.55);
  padding:3px 8px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#f8fafc;
}

.term-meta-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:12px;
  flex-wrap:wrap;
}
/* --- Term header layout fix --- */
.term-header{
  position: relative;
}

.term-title{
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
}

.term-meta{
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.term-updated{
  position: static;      /* IMPORTANT: no absolute */
  margin: 0;
  font-size: 12px;
  opacity: 0.7;
  white-space: nowrap;
}

/* Tags should not add extra top margin now */
.term-header .tag-row{
  margin-top: 0;
}

/* --- Inline meaning images --- */
figure.wm-img { margin: 12px 0; }
figure.wm-img img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
}

figure.wm-img .wm-img-link { display: inline-block; cursor: zoom-in; }
figure.wm-img figcaption { margin-top: 6px; }

/* Default token [img:ID] => show smaller */
figure.wm-img-block img {
  width: 25%;
  min-width: 180px;
  max-width: 520px;
}

/* Float helpers */
figure.wm-img-left {
  float: left;
  width: 35%;
  min-width: 180px;
  max-width: 420px;
  margin: 6px 16px 10px 0;
}

figure.wm-img-right {
  float: right;
  width: 35%;
  min-width: 180px;
  max-width: 420px;
  margin: 6px 0 10px 16px;
}

/* Clear floats inside cards */
.card:after { content: ""; display: block; clear: both; }

@media (max-width: 720px) {
  figure.wm-img-block img { width: 100%; min-width: 0; max-width: none; }
  figure.wm-img-left, figure.wm-img-right {
    float: none;
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 10px 0;
  }
}

.wm-lightbox{
  position: fixed;
  inset: 0;
  z-index: 2147483647; /* max-ish */
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.82);
}

.wm-lightbox.is-open{ display:flex; }
.wm-lightbox-inner{max-width:min(1100px,96vw);max-height:90vh;}
.wm-lightbox-inner img{
  max-width:100%;
  max-height:90vh;
  width:auto;height:auto;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.15);
  background:#111;
}
.wm-lightbox-caption{color:#fff;opacity:.9;margin-top:10px;font-size:14px;line-height:1.35;}
.wm-lightbox-close{
  position:fixed; top:14px; right:14px;
  width:40px;height:40px;border-radius:999px;
  border:1px solid rgba(255,255,255,.25);
  color:#fff;background:rgba(0,0,0,.25);
  cursor:pointer;font-size:18px;line-height:38px;text-align:center;
}
body { position: relative; }
.wm-lightbox.is-open { outline: 3px solid red; }

/* === Section header (Articles / Guides / Templates) === */

.page-hero {
  background: linear-gradient(135deg, #eef3f9, #f8fafc);
  padding: 28px 32px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.page-hero h1 {
  margin: 0 0 6px;
  font-size: 32px;
}

.page-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

/* === Content list cards === */

.content-list {
  display: grid;
  gap: 18px;
}

.content-card {
  background: #fff;
  border-radius: 14px;
  padding: 22px;
  border: 1px solid var(--border);
  transition: 0.15s ease;
}

.content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.content-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.content-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* === Template grid === */

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.template-card {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border);
  transition: 0.2s ease;
}

.template-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.06);
}

.template-card .badge {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: #e6f0ff;
  color: var(--blue);
  margin-bottom: 10px;
  font-weight: 600;
}

.template-card h3 {
  margin: 0 0 8px;
}

.template-card p {
  font-size: 14px;
  color: var(--muted);
}
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}
/* === Table of contents (auto-generated) === */
.toc { }
.toc-title{
  font-weight: 700;
  margin: 0 0 10px;
}
.toc-list{
  margin: 0;
  padding-left: 18px;
  line-height: 1.5;
}
.toc-list li{ margin: 6px 0; }
.toc-list a{ text-decoration: none; }
.toc-list a:hover{ text-decoration: underline; }

.toc-l3 { margin-left: 14px; font-size: 14px; }
.toc-l4 { margin-left: 28px; font-size: 13px; opacity: 0.95; }

/* Template cards: image thumbnail */
.template-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  display: block;
  margin-bottom: 12px;
}

/* Slightly tighter card spacing */
.template-card h3 { margin: 0 0 6px; }
.template-card p { margin: 0 0 10px; }
/* Templates list grid */
.template-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

@media (max-width: 980px){
  .template-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px){
  .template-grid{ grid-template-columns: 1fr; }
}

.template-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  padding:16px;
  transition: .2s ease;
}
.template-card:hover{
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0,0,0,.06);
}

.template-thumb{
  width:100%;
  height:160px;
  object-fit:cover;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  display:block;
  margin-bottom:12px;
}

.template-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:12px;
}

.template-price{
  font-weight:700;
  color: var(--fg);
  font-size:14px;
}

.template-badges{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.badge-free{
  display:inline-block;
  font-size:12px;
  padding:4px 10px;
  border-radius:999px;
  background:#e6f0ff;
  color: var(--blue);
  font-weight:600;
}
.badge-premium{
  display:inline-block;
  font-size:12px;
  padding:4px 10px;
  border-radius:999px;
  background: #fff4e6;
  color: #9a3412;
  font-weight:700;
}
.container{
  max-width: 1100px;
  margin: 0 auto;
  padding: 30px 20px 60px;
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.menu-panel-inner{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  padding:10px 14px; /* flyttad från .menu-panel om du vill */
}

.menu-panel{
  padding:0; /* så inte både panel och inner paddar */
}

/* Header: full width background, centered content */
.site-header { width: 100%; }

.topbar {
  width: 100%;
  background: transparent;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Mobile menu button + dropdown */
.menu-btn{
  display:none;
  margin-left:10px;
  border:1px solid var(--border);
  background:var(--card);
  border-radius:10px;
  padding:8px 10px;
  font-size:16px;
  line-height:1;
  cursor:pointer;
}

.menu-panel{
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  padding: 10px 0;
}

.menu-panel-inner{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  padding-left: 14px;
  padding-right: 14px;
}

.menu-panel a{
  text-decoration:none;
  color:var(--fg);
  font-weight:600;
}

@media (max-width: 760px){
  .topnav{ display:none; }
  .menu-btn{ display:inline-flex; align-items:center; justify-content:center; }
}
.menu-btn { display:none; }
.menu-panel { display:none; }

@media (max-width: 760px){
  .topnav { display:none; }
  .menu-btn { display:inline-flex; align-items:center; justify-content:center; }

  body.menu-open .menu-panel{
    display:flex;
    gap:14px;
    flex-wrap:wrap;
    padding:10px 14px;
    border:1px solid var(--border);
    border-radius:12px;
    background:var(--card);
    margin-top:10px;
  }

  .topsearch{ width:100%; }
  .topsearch input{ width:100%; }
}
.topnav{
  display:flex;
  gap:24px;
  font-weight:600;
}

/* ===== Header layout: logo row + (search + nav) row ===== */

/* outer bar */
.topbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding: 18px 20px;
}

/* logo always gets its own row */
.topbar .logo{
  flex: 0 0 100%;
  display:flex;
  justify-content:center;
  align-items:center;
}

/* right side becomes second row (centered) */
.topbar .topbar-right{
  flex: 0 0 100%;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:12px;
}

/* keep search + nav on same line when possible */
.topbar .topsearch{
  display:flex;
  align-items:center;
  gap:8px;
}

/* nav row */
.topbar .topnav{
  display:flex;
  gap:18px;
  align-items:center;
  flex-wrap:wrap;
  justify-content:center;
}

/* Mobile tightening */
@media (max-width: 760px){
  /* if you want NO hamburger: just let nav wrap */
  .menu-btn{ display:none !important; }
  .menu-panel{ display:none !important; }

  .topbar .topsearch{
    flex: 1 1 100%;
    justify-content:center;
  }
  .topbar .topsearch input{
    width:min(520px, 90vw);
  }
}
.float-right {
  float: right;
  margin: 0 0 15px 20px;
  max-width: 40%;
}

.float-left {
  float: left;
  margin: 0 20px 15px 0;
  max-width: 40%;
}
.article::after {
  content: "";
  display: block;
  clear: both;
}
@media (max-width: 768px) {
  .float-right,
  .float-left {
    float: none;
    display: block;
    margin: 15px auto;
    max-width: 100%;
  }
}


/* === Article/Guide/Template content: image behavior (mobile-safe, no forced upscaling) === */
/* Default: never overflow container, never stretch small images */
.article-body-content img,
.guide-body-content img,
.template-body-content img{
  max-width: 100%;
  height: auto;
}

/* Center non-floated images nicely without breaking float helpers */
.article-body-content img:not(.float-left):not(.float-right),
.guide-body-content img:not(.float-left):not(.float-right),
.template-body-content img:not(.float-left):not(.float-right){
  display: block;
  margin: 12px auto;
}

/* If TinyMCE injected inline float styles, disable floats on mobile */
@media (max-width: 768px){
  .article-body-content img[style*="float"],
  .guide-body-content img[style*="float"],
  .template-body-content img[style*="float"]{
    float: none !important;
    display: block !important;
    margin: 12px auto !important;
    max-width: 100% !important;
    height: auto !important;
  }
}


/* === Template page (template.php) mobile overflow fix === */
/* Prevent long titles (e.g., with underscores) from forcing horizontal overflow in grid/cards */
.tpl-hero{ min-width: 0; }
.tpl-hero > div{ min-width: 0; }
.tpl-hero h1{
  overflow-wrap: anywhere;
  word-break: break-word;
}
<style>
  @media (max-width: 760px) {
    .article-row {
      grid-template-columns: 1fr !important;
      gap: 0 !important;
    }

    .article-row > div:last-child {
      padding: 0 18px 18px 18px !important;
    }
  }
</style>