/* Blog-specific styles */
:root{
  --bg:#ffffff;
  --card:#f8f9fa;
  --muted:#6c757d;
  --text:#212529;
  --brand:#0d6efd;
  --accent:#198754;
  --danger:#dc3545;
  --shadow: 0 6px 18px rgba(0,0,0,.08);
  --radius: 16px;
  --maxw: 920px;
  --border: rgba(0,0,0,.1);
  --logo: 68px; /* match index.html */
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial}
a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

/* Header / Navigation (match index.html) */
header{position:sticky;top:0;z-index:50;backdrop-filter:saturate(1.2) blur(8px);
  background:rgba(255,255,255,.8);border-bottom:1px solid var(--border)}
.nav{max-width:1200px;margin:0 auto;display:flex;justify-content:space-between;align-items:center;gap:14px;padding:12px 18px}
.nav-left{display:flex;align-items:center;gap:20px}
.logo{display:flex;align-items:center;gap:10px;font-weight:800;letter-spacing:.2px}
.menu{display:flex;gap:12px;align-items:center}
.menu a{padding:8px 10px;border-radius:8px;color:var(--muted)}
.menu a:hover{color:var(--text);background:rgba(0,0,0,.04)}

/* Desktop Social Icons in Navigation (matching homepage) */
.nav-social-desktop{
  display:flex;
  align-items:center;
  gap:12px;
}
.nav-social-desktop .icon{
  width:22px;
  height:22px;
  opacity:0.85;
  transition:opacity 0.2s ease, transform 0.2s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.nav-social-desktop .icon:hover{
  opacity:1;
  transform:translateY(-2px);
}

/* Mobile Social Icons in Navigation (matching homepage) - Hidden on desktop */
.nav-social-mobile{
  display:none !important;
  align-items:center;
  gap:10px;
}
@media (max-width:720px){
  .nav{
    position:relative;
  }
  .nav-left{
    flex:0 0 auto;
  }
  /* Hide desktop social icons on mobile */
  .nav-social-desktop{
    display:none !important;
  }
  /* Show mobile social icons on mobile */
  .nav-social-mobile{
    display:flex !important;
    position:absolute;
    left:50%;
    transform:translateX(-50%);
    align-items:center;
    gap:10px;
  }
}
.nav-social-mobile .icon{
  width:20px;
  height:20px;
  opacity:0.85;
  transition:opacity 0.2s ease, transform 0.2s ease;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.nav-social-mobile .icon:hover{
  opacity:1;
  transform:translateY(-2px);
}

/* Hamburger Menu Toggle Button - Hidden on desktop */
.menu-toggle{
  display:none !important;
  background:none;
  border:none;
  cursor:pointer;
  padding:8px;
  z-index:60;
  position:relative;
  align-items:center;
  justify-content:center;
}
.menu-toggle img{
  display:block;
  width:24px;
  height:24px;
  transition:opacity 0.2s ease;
}
.menu-toggle:hover img{
  opacity:0.7;
}
@media (max-width:720px){
  /* Show hamburger menu on mobile only */
  .menu-toggle{
    display:flex !important;
    flex:0 0 auto;
  }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.5);
  z-index:55;
  display:none;
}
.mobile-menu-overlay.show{
  display:block;
}
.mobile-menu{
  position:fixed;
  top:0;
  right:0;
  width:280px;
  max-width:85vw;
  height:100vh;
  max-height:100vh;
  background:#fff;
  box-shadow:-2px 0 12px rgba(0,0,0,0.15);
  transform:translateX(100%);
  transition:transform 0.3s ease;
  display:flex;
  flex-direction:column;
  padding:60px 24px 24px;
  overflow-y:auto;
  z-index:56;
}
.mobile-menu-overlay.show .mobile-menu{
  transform:translateX(0);
}
.mobile-menu-close{
  position:absolute;
  top:16px;
  right:16px;
  background:none;
  border:none;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  color:var(--text);
  padding:8px;
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  border-radius:8px;
  transition:background 0.2s ease;
}
.mobile-menu-close:hover{
  background:rgba(0,0,0,0.05);
}
.mobile-menu-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.mobile-menu-link{
  padding:12px 16px;
  border-radius:10px;
  color:var(--text);
  font-weight:500;
  transition:background 0.2s ease, color 0.2s ease;
}
.mobile-menu-link:hover{
  background:rgba(0,0,0,0.05);
  color:var(--brand);
}

:root { --logo: 68px; } /* change to 40–48px if you want a slightly taller header */

/* keep the header compact regardless of the SVG's intrinsic size */
.logo-img{
  height: var(--logo);
  width: auto;
  display: block;   /* avoids baseline gaps */
}

/* (optional) slightly reduce header padding if needed */
.nav{ padding-block: 12px; } /* was 14px */

/* Logo image */
.logo-img{
  height: var(--logo);
  width: auto;
  display: block;
}

/* Banner */
.banner{
  width:100%;
  background:linear-gradient(180deg,#fdfdfd 0%,#f4f6f9 100%);
  border-bottom:1px solid var(--border);
}
.banner-inner{
  max-width:1200px;          /* match index's --maxw without changing blog main width */
  margin:0 auto;
  padding:52px 18px 56px;
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
  text-align:center;
}
.banner h1{
  font-size:clamp(28px,4vw,44px);  /* match index */
  margin:0 0 6px 0;
  letter-spacing:.2px;
}
.banner p{
  margin:0 auto;
  color:var(--muted);
  max-width:700px;                 /* match index */
  font-size:clamp(14px,2vw,16px);
}

/* Full-bleed hero background with soft overlay (same as index) */
#new{
  --hero: url('../assets/images/hero/hero.png'); /* default image; can be overridden inline */
  --overlay: linear-gradient(180deg, rgba(255,255,255,.88), rgba(244,246,249,.88));
  background: var(--overlay), var(--hero) center/cover no-repeat;
}

main{max-width:var(--maxw);margin:0 auto;padding:26px 18px 70px}
.actions{display:flex;gap:10px;justify-content:space-between;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.search{flex:1;min-width:220px}
.search input{width:100%;padding:12px 14px;border:1px solid var(--border);border-radius:12px;background:#fff}
.tags{display:flex;gap:8px;flex-wrap:wrap}
.tag{padding:6px 10px;font-size:12.5px;border:1px solid var(--border);border-radius:999px;background:#fff;color:#3b5bdb;cursor:pointer}
.tag.active{background:#e7f0ff;border-color:#9ec5fe}

.list{display:grid;gap:16px}
.post-card{display:grid;grid-template-columns:180px 1fr;gap:14px;border:1px solid var(--border);border-radius:16px;background:var(--card);box-shadow:var(--shadow);overflow:hidden}
.post-card .cover{width:100%;height:100%;max-height:140px;object-fit:cover;background:#e9ecef}
.post-card .meta{display:flex;gap:10px;align-items:center;color:var(--muted);font-size:13px}
.post-card .title{margin:2px 0 6px 0;font-weight:800;font-size:18px}
.post-card .excerpt{color:var(--muted);margin:0}
@media (max-width:720px){
  .menu{display:none}
}
@media (max-width:700px){
  .post-card{grid-template-columns:1fr}
  .post-card .cover{max-height:220px}
}

.pagination{display:flex;gap:8px;justify-content:center;margin-top:24px;flex-wrap:wrap}
.page-btn{min-width:40px;height:40px;display:inline-grid;place-items:center;padding:0 12px;border-radius:10px;border:1px solid var(--border);background:#fff;color:var(--text);cursor:pointer;user-select:none}
.page-btn.active{background:var(--brand);border-color:transparent;color:#fff;font-weight:800}
.page-btn.disabled{opacity:.45;pointer-events:none}

.detail{display:none}
.detail.show{display:block}
.detail .hero{border:1px solid var(--border);border-radius:16px;overflow:hidden;background:var(--card);box-shadow:var(--shadow)}
.detail .hero img{width:100%;height:auto;display:block}
.detail h1{margin:16px 0 6px}
.detail .post-meta{color:var(--muted);font-size:14px;display:flex;gap:8px;flex-wrap:wrap}
.detail .content{line-height:1.75;font-size:16px;margin-top:12px}
.detail .content img{border-radius:12px;margin:14px 0}
.detail .tags{margin-top:14px}
.backlink{display:inline-flex;gap:8px;align-items:center;padding:8px 12px;border:1px solid var(--border);border-radius:10px;background:#fff}
/* List view: add breathing room above date line */
.post-card .body{
  padding: 12px 14px;           /* top + sides padding inside the card body */
}

.post-card .meta{
  margin-top: 2px;               /* tiny space from the top edge of body */
  line-height: 1.4;              /* nicer vertical rhythm */
}

/* Optional: give the title a bit more air from the meta line */
.post-card .title{
  margin: 8px 0 6px;             /* was 2px 0 6px */
}

/* Detail view: ensure space between title and date */
.detail h1{ margin: 16px 0 12px; }
.detail .post-meta{ margin-top: 6px; }

/* Square list cards only */
#listView .post-card{ border-radius:0 !important; }
#listView .post-card .cover{ border-radius:0 !important; }

