/*
Theme Name: RONROV Blog RTL
Theme URI: https://ronrov.com/
Author: RonRov
Description: עיצוב בלוג RTL בסגנון Tech/SaaS בהיר, מינימלי וחזק.
Version: 8.0.0
License: GNU General Public License v2 or later
Text Domain: ronrov-blog-rtl
*/

:root {
  /* Light, modern "Tech" palette (white + grays only) */
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-hover: #f3f4f6;

  --text: #111827;        /* almost-black */
  --heading: #0b1220;
  --muted: #6b7280;
  --border: #e5e7eb;
  --border-highlight: #d1d5db;

  --primary: #111827;     /* keep it monochrome */
  --primary-glow: rgba(17, 24, 39, 0.08);

  --radius: 16px;
  --radius-sm: 12px;

  --shadow: 0 20px 40px -24px rgba(15, 23, 42, 0.22);
  --shadow-hover: 0 26px 60px -32px rgba(15, 23, 42, 0.26);

  --font: "Heebo", sans-serif;

  --gap: 32px;
  --pad: 24px;
  --content: 72ch;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: var(--font) !important;
  background:
    radial-gradient(900px 420px at 18% -10%, rgba(15,23,42,0.055), transparent 62%),
    radial-gradient(760px 340px at 86% 0%, rgba(15,23,42,0.045), transparent 58%),
    var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

/* Ensure unified font across all elements */
body, h1, h2, h3, h4, h5, h6, p, a, span, div, input, button, textarea, select, li, label, th, td, strong, em, article, section, header, footer, nav, aside, main {
  font-family: var(--font) !important;
}

code, pre, kbd, samp, code *, pre * {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !important;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

*, *::before, *::after {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  display: block;
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

a:hover {
  color: #000;
}

.container {
  max-width: 1200px;
  width: 100%;
  padding-inline: 20px;
  margin-inline: auto;
}

/* Header */
.site-header {
  position: relative;
  top: auto;
  z-index: 100;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-link{
  display:flex;
  align-items:center;
  gap:12px;
  color: var(--heading);
}

.brand-mark{
  width:38px;
  height:38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(17,24,39,0.06), rgba(17,24,39,0.02));
}

.brand .custom-logo,
.brand .custom-logo-link img{
  border-radius: 4px;
  display:block;
  width:auto;
  height:auto;
  max-height: 46px;
  max-width: 180px;
}

.site-title{
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.site-title:hover{ color:#000; }

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}

.primary-nav a {
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.92rem;
  transition: all 0.2s ease;
}

.primary-nav a:hover {
  background: var(--surface-hover);
  color: var(--heading);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--heading);
  padding: 10px 20px;
  font-size: 0.9rem;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-highlight);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--heading);
  border-color: var(--heading);
  color: #fff;
}

.btn.primary:hover {
  background: #000;
  border-color: #000;
}

.search-toggle, .menu-toggle {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
}

.icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  line-height:0;
}

.search-toggle:hover, .menu-toggle:hover {
  color: var(--heading);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
}

/* Cards */
.card {
  background: linear-gradient(180deg, var(--surface) 0%, rgba(255,255,255,0.92) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.card-inner {
  padding: var(--pad);
}

.card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

/* Hero */
.hero {
  padding: 64px 0 34px;
  margin-bottom: 34px;
  border-bottom: 1px solid rgba(229,231,235,0.7);
  background:
    radial-gradient(900px 260px at 70% 10%, rgba(15,23,42,0.06), transparent 60%),
    radial-gradient(800px 220px at 10% 0%, rgba(15,23,42,0.04), transparent 55%);
}

.hero h1 {
  font-size: clamp(2rem, 3.6vw, 3rem);
  font-weight: 700;
  margin: 0 0 16px;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.hero-kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.hero-sub{
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 70ch;
  margin: 0 0 22px;
}

/* Home toolbar */
.home-toolbar{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding: 18px 18px;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
}

.home-toolbar--footer{
  margin: 24px 0 18px;
}

.home-toolbar-title{
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -0.01em;
  padding-top: 2px;
}

.home-toolbar-chips{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-start;
  gap:8px;
}

.hero p {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 60ch;
  margin-bottom: 24px;
}

.chip {
  display: inline-block;
  padding: 4px 12px;
  margin: 4px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--muted);
  transition: 0.2s;
}

.chip:hover {
  border-color: var(--border-highlight);
  color: var(--heading);
}

/* Main Layout */
.main {
  padding: 40px 0 80px;
  background: linear-gradient(180deg, rgba(255,255,255,1) 0%, var(--bg-soft) 140px, var(--bg-soft) 100%);
}

/* Search modal */
.search-modal{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(17,24,39,0.35);
  backdrop-filter: blur(6px);
  z-index: 999;
}

.search-modal[aria-hidden="false"]{
  display:flex;
}

.search-panel{
  max-width: 720px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow-hover);
  padding: 18px;
}

.search-panel .row{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

.search-panel input[type="search"]{
  flex: 1 1 320px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  background: var(--surface-2);
  color: var(--heading);
  outline: none;
}

.search-panel input[type="search"]:focus{
  border-color: var(--border-highlight);
  box-shadow: 0 0 0 6px var(--primary-glow);
}

.search-panel button{
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--heading);
  font-weight: 700;
  cursor:pointer;
}

.search-panel button:hover{
  background: var(--surface-hover);
}

.grid-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: var(--gap);
}

.grid-layout--single {
  grid-template-columns: 1fr;
}

/* Single stack */
.single-stack{
  max-width: 980px;
  width: 100%;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Single post layout */
.post-single{
  overflow: hidden;
}

.post-single:hover,
.post-box:hover{
  transform: none;
  box-shadow: var(--shadow);
}

.post-hero-media{
  position: relative;
  background: var(--surface-2);
}

.post-hero-media img{
  display:block;
  width:100%;
  height: clamp(220px, 36vw, 520px);
  object-fit: cover;
}

.post-divider{
  height: 1px;
  background: var(--border);
}

.post-header{
  padding: var(--pad);
}

.post-single-title{
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.post-single-meta{
  display:flex;
  flex-wrap:wrap;
  gap: 8px;
}

.post-body{
  padding-top: 0;
}

.post-footer{
  padding: var(--pad);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}

/* Author Card */
.author-card{
  display:flex;
  align-items:center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.author-avatar img{
  border-radius: 14px;
  border: 1px solid rgba(229,231,235,0.9);
  width: 72px;
  height: 72px;
  background: #fff;
}
.author-meta{
  display:flex;
  flex-direction: column;
  gap: 4px;
}
.author-label{
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
}
.author-name{
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--heading);
  line-height: 1.2;
}
.author-bio{
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 2px;
}

/* Comments */
.comments-area h3,
.comments-area .comment-reply-title{
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
}

.comment-list > li{
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 16px;
  padding: 14px;
}

.comment-list{
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.comment-meta{
  margin-bottom: 8px;
}

.comment-author .fn{
  font-weight: 700;
  color: var(--heading);
}

.comment-metadata{
  color: var(--muted);
  font-size: 0.85rem;
}

.comments-area input[type="text"],
.comments-area input[type="email"],
.comments-area input[type="url"],
.comments-area textarea{
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--surface-2);
  color: var(--text);
}

.comments-area textarea{
  min-height: 140px;
  resize: vertical;
}

.comments-area label{
  display:block;
  margin: 14px 0 6px;
  font-weight: 700;
  color: var(--heading);
}

/* =============================================
   CATEGORY TABS
   ============================================= */

.category-tabs-wrap {
  margin-bottom: 22px;
  overflow: hidden;
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  direction: rtl;
  align-items: center;
}
.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  flex-shrink: 0;
}
.category-tab:hover {
  background: var(--surface-hover);
  color: var(--heading);
  border-color: var(--border-highlight);
}
.category-tab.active,
.category-tab.all-tab {
  background: var(--heading);
  border-color: var(--heading);
  color: #fff;
}

/* =============================================
   POST GRID
   ============================================= */

.post-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.post-list > :not(article) {
  grid-column: 1 / -1;
}

/* =============================================
   FEATURED POST — Full-width hero card
   ============================================= */

.post-list > article:first-child {
  grid-column: 1 / -1;
  min-height: 480px;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: 0 24px 56px -20px rgba(15,23,42,0.28);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: block;
  border: 1px solid var(--border);
}

.post-list > article:first-child:hover {
  transform: translateY(-4px);
  box-shadow: 0 36px 72px -28px rgba(15,23,42,0.34);
}

/* "מובחר" frosted-glass pill badge */
.post-list > article:first-child::before {
  content: '✦  מובחר';
  position: absolute;
  top: 20px;
  inset-inline-start: 20px;
  z-index: 4;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.73rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.26);
  letter-spacing: 0.05em;
}

/* Dark gradient overlay from bottom */
.post-list > article:first-child::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(6,10,20,0.93) 0%,
    rgba(6,10,20,0.58) 36%,
    rgba(6,10,20,0.12) 64%,
    transparent 100%
  );
  border-radius: var(--radius);
  z-index: 1;
  pointer-events: none;
}

/* Image fills the whole card */
.post-list > article:first-child .post-thumb {
  display: block;
  position: absolute;
  inset: 0;
}
.post-list > article:first-child .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  min-height: auto;
  transition: transform 0.6s ease;
}
.post-list > article:first-child:hover .post-thumb img {
  transform: scale(1.04);
}

/* Content pinned to bottom */
.post-list > article:first-child .card-inner {
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  z-index: 2;
  padding: 30px 28px 24px;
  background: transparent;
  min-width: 0;
  display: block;
}

.post-list > article:first-child .post-meta-line {
  color: rgba(255,255,255,0.68);
  direction: rtl;
  justify-content: flex-start;
}
.post-list > article:first-child .meta-sep { color: rgba(255,255,255,0.36); }

.post-list > article:first-child .post-divider {
  background: rgba(255,255,255,0.13);
}

.post-list > article:first-child .post-title {
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  margin-top: 10px;
  margin-bottom: 8px;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.2);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.post-list > article:first-child .post-title a { color: #fff; }
.post-list > article:first-child .post-title a:hover {
  color: rgba(255,255,255,0.88);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.post-list > article:first-child .post-byline {
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
}

.post-list > article:first-child .post-excerpt {
  color: rgba(255,255,255,0.78);
  font-size: 0.97rem;
  max-width: 70ch;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.post-list > article:first-child .post-readmore {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255,255,255,0.13);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 99px;
  padding: 9px 22px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  margin-top: 14px;
  text-decoration: none;
  transition: background 0.2s;
}
.post-list > article:first-child .post-readmore:hover {
  background: rgba(255,255,255,0.23);
  color: #fff;
}

/* Hide clutter on featured */
.post-list > article:first-child .post-tags-row,
.post-list > article:first-child .post-divider--after-readmore,
.post-list > article:first-child .post-divider--after-tags,
.post-list > article:first-child .post-cat-badge {
  display: none;
}

/* =============================================
   REGULAR POST CARDS
   ============================================= */

.post-card {
  grid-column: span 1;
}

.post-card .post-thumb {
  display: block;
  overflow: hidden;
  background: var(--bg-soft);
  position: relative;
}
.post-card .post-thumb img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 0;
  transition: transform 0.45s ease;
}
.post-card:hover .post-thumb img {
  transform: scale(1.05);
}

/* Category badge on thumbnail */
.post-cat-badge {
  position: absolute;
  bottom: 10px;
  inset-inline-start: 12px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--heading);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}
.post-cat-badge--no-thumb {
  position: static;
  display: inline-block;
  margin: 14px 14px 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

/* Single Box Tags */
.post-box-title{ font-weight: 700; color: var(--heading); margin: 0 0 10px; font-size: 1rem; }
.post-box-tags{ display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-box-tag-link{ font-weight: 700; font-size: 0.9rem; color: var(--muted); text-decoration: none; }
.post-box-tag-link:hover{ color: var(--heading); }
.post-box-tag-sep{ opacity: 0.35; font-weight: 700; }

/* Entry Content (Post Body) */
.entry h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.5em; color: var(--heading); }
.entry-content, .entry-content *{ font-family: inherit; letter-spacing: normal; }
.entry-content{ font-size: 1.06rem;
  line-height: 1.95; text-align: right; color: var(--text); }
.entry-content p{ margin: 0 0 1.05em; }
.entry-content a{ text-decoration: underline; text-underline-offset: 3px; color: var(--primary); }
.entry-content ul, .entry-content ol{ margin: 0 0 1.2em; padding-inline-start: 1.2em; }
.entry-content li{ margin: 0.35em 0; }
.entry-content h2{ color: var(--heading); font-size: 1.8rem; margin-top: 1.5em; letter-spacing: -0.01em; }
.entry-content h3, .entry-content h4{ letter-spacing: -0.01em; color: var(--heading); }
.entry-content code, .entry-content pre, .entry-content kbd, .entry-content samp{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

/* Sidebar */
.widget-title {
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
  color: var(--heading);
}
.widget ul li { margin-bottom: 8px; }
.widget ul li a { color: var(--muted); display: block; padding: 4px 0; }
.widget ul li a:hover { color: var(--primary); padding-right: 4px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  padding: 40px 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-inner ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }

/* Home tags at bottom */
.home-tags-wrap{ margin-top: 18px; }
.home-tags-inline{
  border: 1px solid var(--border);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-radius: 18px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.home-tags-title{ font-weight: 700; color: var(--heading); font-size: 0.95rem; line-height: 1.1; flex: 0 0 auto; }
.home-tags-links{ display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.home-tag-link{ font-weight: 700; font-size: 0.9rem; color: var(--muted); text-decoration: none; white-space: nowrap; }
.home-tag-link:hover{ color: var(--heading); }
.home-tag-sep{ opacity: 0.35; font-weight: 700; }

/* =============================================
   MOBILE APP BAR — hidden on desktop
   ============================================= */

.mobile-appbar { display: none; }

/* =============================================
   RESPONSIVE — TABLET (≤ 1024px)
   ============================================= */

@media (max-width: 1024px) {
  .post-list > article:first-child { min-height: 420px; }
}

/* =============================================
   RESPONSIVE — MEDIUM (≤ 900px)
   ============================================= */

@media (max-width: 900px) {
  .post-list { grid-template-columns: repeat(2, 1fr); }
  .grid-layout { grid-template-columns: 1fr; }
  .menu-toggle { display: block; }
  .primary-nav { display: none; }

  body.menu-open { overflow: hidden; }

  body.menu-open .primary-nav {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ffffff;
    padding: calc(var(--ronrov-mobile-header-h, 70px) + env(safe-area-inset-top, 0px)) 18px 18px;
    z-index: 9999;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.menu-open .primary-nav ul { flex-direction: column; gap: 10px; }
  body.menu-open .primary-nav a {
    display: block;
    padding: 14px 14px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--heading);
    background: var(--surface-2);
    border: 1px solid var(--border);
  }
  body.menu-open .primary-nav a:hover { background: var(--surface-hover); }
  body.menu-open .primary-nav li ul {
    margin-top: 8px;
    padding-right: 12px;
    border-right: 1px solid var(--border);
  }
  body.menu-open .primary-nav li ul a {
    font-size: 0.95rem;
    padding: 12px 12px;
    background: transparent;
    border: 0;
    color: var(--muted);
    font-weight: 600;
  }
  body.menu-open .primary-nav li ul a:hover { background: var(--surface-hover); color: var(--heading); }

  .nav-wrap:focus-within .primary-nav {
    display: block;
    position: fixed;
    top: 70px; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 18px;
    z-index: 1050;
    overflow: auto;
    border: 0;
  }
  .nav-wrap:focus-within .primary-nav ul { flex-direction: column; gap: 10px; }
  .nav-wrap:focus-within .primary-nav a {
    display: block; padding: 14px 14px; border-radius: 14px;
    font-size: 1rem; font-weight: 700; color: var(--heading);
    background: var(--surface-2); border: 1px solid var(--border);
  }
  .nav-wrap:focus-within .primary-nav a:hover { background: var(--surface-hover); }
  .nav-wrap:focus-within .primary-nav li ul {
    margin-top: 8px; padding-right: 12px; border-right: 1px solid var(--border);
  }
  .nav-wrap:focus-within .primary-nav li ul a {
    font-size: 0.95rem; padding: 12px; background: transparent;
    border: 0; color: var(--muted); font-weight: 600;
  }
  .nav-wrap:focus-within .primary-nav li ul a:hover { background: var(--surface-hover); color: var(--heading); }

  .menu-toggle { position: relative; z-index: 1100; }
}

/* =============================================
   RESPONSIVE — SMALL (≤ 720px)
   ============================================= */

@media (max-width: 720px) {
  .author-card { padding: 14px 14px; }
  .author-avatar img { width: 56px; height: 56px; }
  .home-tags-inline { padding: 14px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .home-tags-links { gap: 10px; }
}

/* =============================================
   RESPONSIVE — MOBILE (≤ 768px)  — App-like
   ============================================= */

@media (max-width: 768px) {
  .container { padding-inline: 14px; }

  .site-header { position: sticky; top: 0; z-index: 1100; }
  .header-inner { height: 60px; }
  .brand .custom-logo,
  .brand .custom-logo-link img { max-height: 34px; }

  /* Account for bottom app bar */
  .main { padding: 24px 0 calc(72px + env(safe-area-inset-bottom, 0px)); }

  /* Single-column post grid */
  .post-list { grid-template-columns: 1fr; gap: 16px; }
  .post-list > article:first-child { min-height: 360px; }

  /* Lighter cards on mobile */
  .card, .post-card, .post-single {
    border-radius: 16px;
    box-shadow: 0 8px 22px -18px rgba(15,23,42,0.20);
  }

  .post-title { font-size: 1.18rem; line-height: 1.35; }
  .post-excerpt { font-size: 0.93rem; }

  /* ── Mobile Bottom App Bar ── */
  .mobile-appbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    z-index: 900;
    align-items: flex-start;
    justify-content: space-around;
  }

  .appbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 10px;
    color: var(--muted);
    cursor: pointer;
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 600;
    transition: color 0.18s;
    text-decoration: none;
    flex: 1;
    min-width: 0;
  }
  .appbar-item.active { color: var(--heading); }
  .appbar-item:hover  { color: var(--heading); }

  .appbar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }
  .appbar-label {
    font-size: 0.64rem;
    font-weight: 600;
    white-space: nowrap;
  }

  /* Menu overlay fits smaller header */
  body.menu-open .primary-nav {
    display: block;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ffffff;
    padding: calc(var(--ronrov-mobile-header-h, 70px) + env(safe-area-inset-top, 0px)) 18px 18px;
    z-index: 9999;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
}
