/* ================================================
   JisanVerse — Main Stylesheet
   ================================================ */

:root {
  --primary: #7c3aed;
  --secondary: #06b6d4;
  --bg: #0b0b14;
  --bg-soft: #12121f;
  --text: #f1f1f6;
  --text-muted: #a3a3b8;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --transition: all .25s ease;
  --nav-h: 68px;
}

[data-theme="light"] {
  --bg: #f5f6fb;
  --bg-soft: #ffffff;
  --text: #14141f;
  --text-muted: #5b5b6e;
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: rgba(0, 0, 0, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(700px circle at 90% -10%, rgba(124,58,237,.16), transparent 60%),
    radial-gradient(600px circle at -10% 20%, rgba(6,182,212,.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  transition: background-color .25s ease, color .25s ease;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
button, input, select, textarea { font-family: inherit; }

::selection { background: var(--primary); color: #fff; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

.gradient-text {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 50px; border: none;
  font-weight: 600; cursor: pointer; transition: var(--transition);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  background-size: 160% 160%;
  color: #fff; font-size: 15px; min-height: 46px;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(124,58,237,0.4); background-position: 100% 0; }
.btn:active { transform: translateY(0) scale(.98); }
.btn.outline { background: transparent; border: 1px solid var(--card-border); color: var(--text); }
.btn.outline:hover { border-color: var(--primary); box-shadow: none; }

/* ---------- Glass card ---------- */
.glass {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
  position: fixed; left: 20px; right: 20px; bottom: -120px; max-width: 560px; margin: 0 auto;
  background: var(--bg-soft); border: 1px solid var(--card-border); border-radius: 16px; box-shadow: var(--shadow);
  padding: 18px 22px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; z-index: 9970;
  transition: bottom .35s ease;
}
.cookie-banner.open { bottom: 20px; }
.cookie-banner p { font-size: 13.5px; color: var(--text-muted); flex: 1; min-width: 200px; }
.cookie-banner a { color: var(--secondary); text-decoration: underline; }
.cookie-banner .btn { padding: 8px 20px; font-size: 13px; flex-shrink: 0; }
@media (max-width: 480px) { .cookie-banner { left: 12px; right: 12px; padding: 14px 16px; } }

/* ---------- Emergency contacts ---------- */
.emergency-box { padding: 26px; margin-top: 24px; border: 1px solid rgba(239,68,68,.3); }
.emergency-list { display: flex; flex-direction: column; gap: 12px; }
.emergency-item {
  display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px;
  background: var(--card-bg); border: 1px solid var(--card-border); flex-wrap: wrap;
}
.emergency-photo { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.emergency-photo-fallback {
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.emergency-info { flex: 1; min-width: 140px; display: flex; flex-direction: column; }
.emergency-info span { color: var(--text-muted); font-size: 13.5px; }
.emergency-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 480px) { .emergency-box { padding: 18px; } .emergency-item { padding: 10px; } }

/* ---------- Site-wide alert popup ---------- */
.site-alert-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 9980; display: none;
  align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px);
}
.site-alert-backdrop.open { display: flex; }
.site-alert { position: relative; width: 100%; max-width: 440px; animation: fadeInUp .3s ease both; }
.site-alert-inner {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 30px 26px 26px;
  border-top: 4px solid var(--secondary); text-align: left;
}
.site-alert-body { font-size: 15px; line-height: 1.6; }
.site-alert-title { display: block; font-size: 17px; margin-bottom: 6px; }
.site-alert-btn { padding: 9px 20px; font-size: 13.5px; }
.site-alert-close {
  position: absolute; top: -14px; right: -14px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-soft); border: 1px solid var(--card-border); color: var(--text-muted); font-size: 18px;
  line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 1;
}
.site-alert-close:hover { color: var(--text); }
.site-alert-success .site-alert-inner { border-top-color: #10b981; }
.site-alert-warning .site-alert-inner { border-top-color: #f59e0b; }
@media (max-width: 480px) { .site-alert-inner { padding: 24px 20px 20px; } .site-alert-body { font-size: 14px; } }

/* ---------- Mood & Status widget ---------- */
.mood-status-bar { padding: 16px 22px; display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.mood-status-item { font-size: 14px; color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mood-status-label {
  font-size: 11.5px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 3px 10px; border-radius: 50px; white-space: nowrap;
}
.mood-status-sep { width: 1px; height: 20px; background: var(--card-border); }
@media (max-width: 480px) {
  .mood-status-bar { padding: 12px 16px; gap: 10px; }
  .mood-status-item { font-size: 12.5px; }
  .mood-status-sep { display: none; }
}

.quick-links-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Ad slot ---------- */
.ad-slot { text-align: center; }
.ad-slot-label { display: block; font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.ad-slot img { max-width: 100%; border-radius: 12px; margin: 0 auto; }
.quick-link-pill { padding: 9px 18px; font-size: 13.5px; font-weight: 600; border-radius: 50px; transition: var(--transition); }
.quick-link-pill:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
@media (max-width: 480px) { .quick-link-pill { padding: 7px 14px; font-size: 12.5px; } }

/* ---------- Live streaming banner ---------- */
.live-banner { padding: 22px; }
.live-banner-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.live-banner-head h2 { font-size: 18px; }
.live-viewer-count {
  margin-left: auto; font-size: 12px; color: var(--text-muted); background: var(--card-bg);
  border: 1px solid var(--card-border); padding: 4px 12px; border-radius: 50px; white-space: nowrap;
}
@media (max-width: 480px) { .live-viewer-count { font-size: 11px; padding: 3px 10px; } }
.live-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #ef4444; flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(239,68,68,.6); animation: live-pulse 1.6s infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,.6); }
  70% { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.live-embed-wrap { position: relative; width: 100%; padding-top: 56.25%; border-radius: 12px; overflow: hidden; background: #000; }
.live-embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---------- Marquee / Announcement bar ---------- */
.marquee-bar {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #fff; overflow: hidden; white-space: nowrap; position: relative;
  padding: 9px 0; font-size: 13px; font-weight: 600; letter-spacing: .2px;
}
.marquee-track {
  display: inline-flex; white-space: nowrap;
  animation: marquee-scroll 22s linear infinite;
  will-change: transform;
}
.marquee-item { padding: 0 40px; display: inline-block; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}
@media (max-width: 600px) {
  .marquee-bar { font-size: 12px; padding: 8px 0; }
  .marquee-item { padding: 0 24px; }
  .marquee-track { animation-duration: 16s; }
}

/* ---------- Navbar ---------- */
.navbar {
  position: sticky; top: 0; z-index: 200;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h);
  padding: 0 24px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--card-border);
}
.navbar .logo { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; white-space: nowrap; min-width: 0; overflow: hidden; }
.navbar .logo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbar .logo img { height: 34px; width: 34px; border-radius: 8px; object-fit: cover; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { font-weight: 500; color: var(--text-muted); transition: var(--transition); font-size: 15px; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }
.nav-search { display: flex; gap: 6px; }
.nav-search input { padding: 8px 14px; font-size: 14px; width: 150px; }
.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-avatar {
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-weight: 700;
  overflow: hidden; flex-shrink: 0; font-size: 15px; border: none; cursor: pointer; font-family: inherit;
}
.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.search-icon { text-decoration: none; font-size: 16px; }
.nav-links-auth { display: none; }

.profile-dropdown { position: relative; }
.profile-dropdown-menu {
  position: absolute; top: calc(100% + 12px); right: 0; min-width: 220px;
  background: var(--bg-soft); border: 1px solid var(--card-border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 8px; opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: var(--transition); z-index: 300;
}
.profile-dropdown-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.profile-dropdown-name {
  padding: 10px 12px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--card-border); margin-bottom: 6px;
}
.profile-dropdown-name span { display: block; font-weight: 500; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.profile-dropdown-menu a {
  display: block; padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--text);
}
.profile-dropdown-menu a:hover { background: var(--card-bg); color: var(--primary); }
.theme-toggle {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--card-border);
  background: var(--card-bg); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 18px; flex-shrink: 0;
}
.lang-toggle { font-size: 12px; font-weight: 700; text-decoration: none; color: var(--text); }
@media (max-width: 480px) { .lang-toggle { display: none; } }
.menu-toggle {
  display: none; background: none; border: none; color: var(--text); cursor: pointer;
  width: 42px; height: 42px; flex-shrink: 0; position: relative; z-index: 9997; touch-action: manipulation;
}
.menu-toggle span {
  display: block; position: absolute; left: 10px; right: 10px; height: 2px; background: var(--text);
  border-radius: 2px; transition: var(--transition);
}
.menu-toggle span:nth-child(1) { top: 15px; }
.menu-toggle span:nth-child(2) { top: 21px; }
.menu-toggle span:nth-child(3) { top: 27px; }
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

#nav-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 195; display: none; }
#nav-backdrop.open { display: block; }

@media (max-width: 860px) {
  .navbar { padding: 0 16px; }
  .navbar .logo { max-width: 45vw; }
  .nav-links {
    position: fixed; top: 0; right: 0; height: 100vh; width: min(300px, 80vw);
    background: var(--bg-soft); z-index: 9995;
    flex-direction: column; align-items: stretch; padding: 90px 26px 26px; gap: 6px;
    transform: translateX(100%); transition: transform .3s ease;
    border-left: 1px solid var(--card-border); overflow-y: auto; -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  .nav-links.open { transform: translateX(0); box-shadow: -10px 0 40px rgba(0,0,0,.3); }
  .nav-links a { padding: 14px 6px; font-size: 17px; border-bottom: 1px solid var(--card-border); touch-action: manipulation; }
  .nav-search { order: -1; margin-bottom: 10px; }
  .nav-search input { width: 100%; }
  .menu-toggle { display: block; }
  .search-icon { display: none; }
  .nav-links-auth { display: flex; flex-direction: column; margin-top: 8px; }
  .nav-links-auth a { border-bottom: 1px solid var(--card-border); }
}

/* ---------- Reading progress bar ---------- */
#reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--secondary)); z-index: 999;
}

/* ---------- Entrance animation ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: no-preference) {
  .hero-photo, .hero-text { animation: fadeInUp .6s ease both; }
  .hero-text { animation-delay: .1s; }
  .card { animation: fadeInUp .5s ease both; }
}

/* ---------- Hero ---------- */
.hero { padding: 70px 0 50px; }
.hero-inner { display: flex; align-items: center; gap: 50px; flex-wrap: wrap; }
.hero-photo {
  width: 260px; height: 260px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  border: 4px solid transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box,
  linear-gradient(135deg, var(--primary), var(--secondary)) border-box;
  box-shadow: var(--shadow);
}
.hero-text { flex: 1; min-width: 280px; }
.hero-text h1 { font-size: clamp(28px, 5vw, 42px); margin-bottom: 10px; line-height: 1.2; }
.typing { font-size: clamp(16px, 3vw, 22px); color: var(--secondary); min-height: 30px; font-weight: 600; }
.hero-text p.bio { color: var(--text-muted); margin: 18px 0 26px; max-width: 620px; line-height: 1.7; font-size: 15px; }
.social-row { display: flex; gap: 12px; margin-bottom: 26px; flex-wrap: wrap; }
.social-row a {
  width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--card-bg); border: 1px solid var(--card-border); transition: var(--transition); font-size: 13px; font-weight: 700;
}
.social-row a:hover { background: linear-gradient(135deg, var(--primary), var(--secondary)); transform: translateY(-3px); color: #fff; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

@media (max-width: 720px) {
  .hero { padding: 40px 0 30px; text-align: center; }
  .hero-inner { justify-content: center; gap: 26px; }
  .hero-photo { width: 150px; height: 150px; margin: 0 auto; border-width: 3px; }
  .social-row, .hero-cta { justify-content: center; }
  .hero-text p.bio { margin-left: auto; margin-right: auto; }
}
@media (max-width: 480px) {
  .hero-photo { width: 120px; height: 120px; }
}

/* ---------- Section ---------- */
.section { padding: 50px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 10px; }
.section-title h2 { font-size: clamp(22px, 4vw, 28px); }
.section-title a { color: var(--secondary); font-weight: 600; font-size: 14px; }
@media (max-width: 480px) { .section { padding: 34px 0; } .container { padding: 0 18px; } }

/* ---------- Grid / Cards ---------- */
.grid { display: grid; gap: 22px; align-items: stretch; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.card { padding: 20px; transition: var(--transition); height: 100%; display: flex; flex-direction: column; }
.card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.card img.cover { width: 100%; height: 180px; object-fit: cover; border-radius: 12px; margin-bottom: 14px; }
.card h3 {
  font-size: 18px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card p {
  color: var(--text-muted); font-size: 14px; line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card .meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); margin-top: 12px; flex-wrap: wrap; }
.badge {
  display: inline-block; padding: 4px 12px; font-size: 12px; border-radius: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; margin-bottom: 10px; align-self: flex-start;
}
.post-card { display: flex; flex-direction: column; }
.pin-badge { background: linear-gradient(135deg, #f59e0b, #ef4444) !important; margin-right: 6px; }
@media (max-width: 768px) { .grid-desktop-only { display: none !important; } }
@media (min-width: 769px) { .grid-mobile-only { display: none !important; } }
.post-card .read-more { margin-top: auto; padding-top: 12px; color: var(--secondary); font-weight: 700; font-size: 14px; }
@media (max-width: 600px) { .card:hover { transform: none; } }
@media (max-width: 600px) {
  .card { padding: 12px; border-radius: 12px; }
  .card img.cover { height: 90px; border-radius: 8px; margin-bottom: 10px; }
  .card h3 { font-size: 13.5px; margin-bottom: 4px; line-height: 1.3; }
  .card p {
    font-size: 11.5px; line-height: 1.4; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .card .meta { font-size: 10px; gap: 6px; margin-top: 8px; }
  .card .badge { font-size: 10px; padding: 3px 9px; margin-bottom: 6px; }
  .post-card .read-more { font-size: 11.5px; padding-top: 8px; }
}

/* ---------- Stats ---------- */
.stats-row { display: flex; gap: 20px; flex-wrap: wrap; }
.stats-glass { padding: 30px; }
.stat-box { flex: 1; min-width: 130px; text-align: center; padding: 22px 10px; }
.stat-box .num { font-size: clamp(24px, 5vw, 32px); font-weight: 800; }
.stat-box .label { color: var(--text-muted); font-size: 13px; margin-top: 6px; }
@media (max-width: 640px) {
  .stats-glass { padding: 14px 8px; }
  .stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .stat-box { min-width: 0; padding: 10px 2px; }
  .stat-box .num { font-size: 16px; }
  .stat-box .label { font-size: 8.5px; margin-top: 3px; line-height: 1.2; }
}
@media (max-width: 360px) {
  .stat-box .num { font-size: 14px; }
  .stat-box .label { font-size: 7.5px; }
}

/* ---------- Skills ---------- */
.skills-row { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-pill { padding: 9px 16px; border-radius: 50px; font-size: 14px; }
.skill-pill-bar {
  display: flex; flex-direction: column; gap: 6px; border-radius: 12px; padding: 10px 14px;
  min-width: 140px; align-items: stretch;
}
.skill-pill-top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; gap: 10px; }
.skill-pill-track { width: 100%; height: 6px; border-radius: 4px; background: var(--card-border); overflow: hidden; }
.skill-pill-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--secondary)); border-radius: 4px; }
@media (max-width: 640px) {
  .skills-section { padding: 20px 0; }
  .skills-section .section-title { margin-bottom: 12px; }
  .skills-row { justify-content: center; gap: 6px; }
  .skill-pill { padding: 5px 11px; font-size: 11.5px; border-radius: 20px; }
  .skill-pill-bar { min-width: 120px; padding: 8px 12px; }
}

/* ---------- Blog single ---------- */
.post-content { line-height: 1.9; font-size: 17px; word-wrap: break-word; }
.post-content img { border-radius: 12px; margin: 20px 0; max-width: 100%; height: auto; }
.post-content h2, .post-content h3 { margin: 24px 0 12px; }
.post-content p { margin-bottom: 16px; }
@media (max-width: 600px) { .post-content { font-size: 16px; } }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { margin: 16px 0; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; gap: 6px; font-size: 13px; }
.breadcrumbs li { display: flex; align-items: center; gap: 6px; color: var(--text-muted); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); }
.crumb-sep { color: var(--card-border); }

/* ---------- Table of contents ---------- */
.toc-box { padding: 18px 22px; margin-bottom: 24px; font-size: 14px; }
.toc-box strong { display: block; margin-bottom: 10px; }
.toc-box ol { margin: 0; padding-left: 20px; }
.toc-box li { margin-bottom: 6px; }
.toc-box .toc-level-3 { margin-left: 16px; font-size: 13px; }
.toc-box a { color: var(--text-muted); }
.toc-box a:hover { color: var(--primary); }

/* ---------- Inspire page ---------- */
.insp-header { text-align: center; max-width: 640px; margin: 0 auto 30px; }
.insp-header h1 { font-size: clamp(30px, 6vw, 42px); margin-bottom: 10px; }
.insp-tagline { color: var(--text-muted); margin-bottom: 26px; }
.insp-search-wrap { margin-bottom: 16px; }
#insp-search { max-width: 460px; margin: 0 auto; text-align: center; border-radius: 50px; }
.insp-cat-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.insp-cat-pill {
  padding: 8px 18px; border-radius: 50px; border: 1px solid var(--card-border); background: var(--card-bg);
  color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.insp-cat-pill:hover { transform: translateY(-2px); color: var(--text); }
.insp-cat-pill.active { background: linear-gradient(120deg, var(--primary), var(--secondary)); color: #fff; border-color: transparent; }

.insp-feed { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 720px) { .insp-feed { grid-template-columns: 1fr; } }
.insp-card { padding: 26px; display: flex; flex-direction: column; gap: 14px; animation: fadeInUp .5s ease both; height: 100%; }
.insp-cat-tag {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase;
  padding: 4px 12px; border-radius: 50px; color: #fff; background: linear-gradient(120deg, var(--primary), var(--secondary));
}
.insp-quote-text {
  font-size: 16.5px; line-height: 1.7; font-weight: 500; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.insp-card-actions { display: flex; gap: 10px; margin-top: auto; }
.insp-card-btn {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 50px; border: 1px solid var(--card-border);
  background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.insp-card-btn:hover { color: var(--text); border-color: var(--primary); transform: translateY(-2px); }
.insp-card-btn.favorited { background: linear-gradient(120deg, var(--primary), var(--secondary)); color: #fff; border-color: transparent; }
.insp-status { text-align: center; color: var(--text-muted); padding: 30px 0; font-size: 14px; }

/* ---------- Social feed (Threads-style) ---------- */
.thread-feed { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 900px; margin: 0 auto; align-items: stretch; }
@media (max-width: 768px) { .thread-feed { grid-template-columns: 1fr; max-width: 480px; } }
.thread-card { padding: 18px 20px; height: 100%; display: flex; flex-direction: column; }
.thread-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.thread-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.thread-avatar-fallback {
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}
.thread-head strong { display: block; font-size: 14px; }
.thread-time { color: var(--text-muted); font-size: 12.5px; }
.thread-caption { font-size: 14.5px; line-height: 1.6; margin-bottom: 4px; }
.thread-caption.clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.thread-caption.clamped.expanded { -webkit-line-clamp: unset; overflow: visible; }
.see-more-btn {
  background: none; border: none; color: var(--secondary); font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 0 0 12px; text-align: left;
}
.see-more-btn:hover { text-decoration: underline; }
.hashtag { color: var(--secondary); font-weight: 600; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 20px; }
.tag-pill {
  padding: 6px 14px; border-radius: 50px; background: var(--card-bg); border: 1px solid var(--card-border);
  color: var(--secondary); font-size: 13px; font-weight: 600; transition: var(--transition);
}
.tag-pill:hover { background: var(--primary); color: #fff; border-color: transparent; }
.notif-bell-btn { position: relative; background: var(--card-bg); font-size: 16px; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.notif-menu { min-width: 260px; max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; font-size: 13px; color: var(--text);
}
.notif-item:hover { background: var(--card-bg); }
.notif-item.unread { background: rgba(124,58,237,.08); }
.notif-time { font-size: 11px; color: var(--text-muted); }

.verified-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px;
  border-radius: 50%; background: #3b82f6; color: #fff; font-size: 10px; margin-left: 4px; vertical-align: middle;
}
.thread-media { border-radius: 14px; overflow: hidden; background: #000; position: relative; }
.thread-media > img, .thread-media > video { width: 100%; max-height: 520px; object-fit: cover; display: block; cursor: pointer; }

.thread-carousel { position: relative; }
.thread-carousel-track {
  display: flex; gap: 4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.thread-carousel-track::-webkit-scrollbar { display: none; }
.thread-carousel-item { flex: 0 0 47%; scroll-snap-align: start; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; }
.thread-carousel-item img, .thread-carousel-item video { width: 100%; height: 100%; object-fit: cover; display: block; cursor: pointer; }
.thread-carousel-counter {
  position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px;
  font-weight: 700; padding: 3px 10px; border-radius: 50px; z-index: 3; pointer-events: none;
}
.thread-actions { display: flex; align-items: center; gap: 22px; margin-top: auto; padding-top: 14px; }
.thread-action {
  background: none; border: none; color: var(--text-muted); font-size: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; padding: 0; transition: var(--transition);
}
.thread-like-btn:hover, .thread-like-btn.liked { color: #ef4444; }
@media (max-width: 480px) { .thread-card { padding: 14px 16px; } .thread-actions { gap: 16px; } }

/* ---------- Testimonials ---------- */
.testimonial-card { display: flex; flex-direction: column; }
.testimonial-stars { margin-bottom: 10px; font-size: 14px; }
.testimonial-quote { flex: 1; font-style: italic; color: var(--text); line-height: 1.6; margin-bottom: 16px; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-author img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.testimonial-author span { display: block; font-size: 12.5px; color: var(--text-muted); }

/* ---------- Client logos ---------- */
.client-logos-row { display: flex; flex-wrap: wrap; align-items: center; gap: 36px; justify-content: center; }
.client-logos-row img { height: 42px; max-width: 140px; object-fit: contain; opacity: .75; filter: grayscale(1); transition: var(--transition); }
.client-logos-row img:hover { opacity: 1; filter: grayscale(0); }
@media (max-width: 600px) { .client-logos-row { gap: 22px; } .client-logos-row img { height: 32px; } }

/* ---------- Project case study ---------- */
.case-study { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }
.case-study-block { padding: 20px; }
.case-study-label { display: block; font-weight: 700; margin-bottom: 10px; font-size: 14px; }
@media (max-width: 768px) { .case-study { grid-template-columns: 1fr; } }

/* ---------- Comments ---------- */
.comment { padding: 16px; margin-bottom: 12px; }
.comment .name { font-weight: 700; }
.comment .date { color: var(--text-muted); font-size: 12px; }
.comment .reply {
  margin: 14px 0 0 24px; padding: 12px 14px; border-left: 2px solid var(--card-border);
  background: rgba(255,255,255,.03); border-radius: 0 10px 10px 0;
}
.comment .reply.admin-reply { border-left-color: var(--primary); background: rgba(124,58,237,.08); }
.admin-tag {
  display: inline-block; padding: 2px 8px; font-size: 10px; font-weight: 700; border-radius: 50px;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; margin-left: 6px; vertical-align: middle;
}
.reply-toggle {
  margin-top: 10px; background: none; border: 1px solid var(--card-border); color: var(--text-muted);
  padding: 5px 14px; border-radius: 50px; font-size: 12px; cursor: pointer; transition: var(--transition);
}
.reply-toggle:hover { border-color: var(--primary); color: var(--primary); }
.reply-form { margin-top: 12px; padding: 14px; background: rgba(255,255,255,.03); border-radius: 10px; }
@media (max-width: 480px) { .comment .reply { margin-left: 12px; } }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.form-control {
  width: 100%; padding: 13px 16px; border-radius: 10px; border: 1px solid var(--card-border);
  background: var(--bg-soft); color: var(--text); font-size: 15px; transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(124,58,237,.15); }
textarea.form-control { min-height: 140px; resize: vertical; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 200px; }
@media (max-width: 480px) { .form-row > * { min-width: 100%; } }

/* ---------- Gallery / Lightbox ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 860px) { .gallery-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.gallery-grid img { border-radius: 12px; height: 180px; width: 100%; object-fit: cover; cursor: pointer; transition: var(--transition); }
@media (max-width: 560px) { .gallery-grid img { height: 120px; } }
.gallery-grid img:hover { opacity: .85; transform: scale(1.02); }
#lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,.92); display: none;
  align-items: center; justify-content: center; z-index: 999; flex-direction: column; gap: 16px; padding: 20px;
}
#lightbox img { max-width: 92%; max-height: 80vh; border-radius: 10px; }
.lightbox-caption { color: #fff; max-width: 600px; text-align: center; font-size: 14px; line-height: 1.6; padding: 0 16px; }
#lightbox .close-lb {
  position: absolute; top: 18px; right: 18px; font-size: 26px; color: #fff; cursor: pointer;
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1); border-radius: 50%;
}

/* ---------- Notice ---------- */
.notice-item { padding: 18px; margin-bottom: 14px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.notice-item.pinned { border-left: 4px solid var(--primary); }
@media (max-width: 480px) { .notice-item { flex-direction: column; gap: 6px; } }

/* ---------- Footer ---------- */
footer { border-top: 1px solid var(--card-border); padding: 40px 0 24px; margin-top: 50px; }
footer .foot-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 30px; }
footer .copy { text-align: center; color: var(--text-muted); font-size: 13px; margin-top: 30px; padding: 0 10px; }
@media (max-width: 600px) { footer .foot-grid { text-align: center; justify-content: center; } footer .foot-grid > div { width: 100%; } .social-row { justify-content: center; } }

/* ---------- Back to top ---------- */
#back-to-top {
  position: fixed; bottom: calc(24px + env(safe-area-inset-bottom)); right: calc(20px + env(safe-area-inset-right)); width: 46px; height: 46px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; display: none;
  align-items: center; justify-content: center; cursor: pointer; z-index: 90; box-shadow: var(--shadow); border: none;
  font-size: 18px;
}
@media (max-width: 480px) { #back-to-top { bottom: calc(16px + env(safe-area-inset-bottom)); right: calc(16px + env(safe-area-inset-right)); width: 42px; height: 42px; } }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--card-border);
  color: var(--text-muted); font-size: 14px;
}
.pagination a.active, .pagination span.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Toast / Popup ---------- */
#toast {
  position: fixed; bottom: 24px; left: 20px; right: 20px; padding: 14px 22px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--card-border); box-shadow: var(--shadow);
  display: none; z-index: 999; max-width: 320px; font-size: 14px;
}
@media (max-width: 480px) { #toast { left: 16px; right: 16px; max-width: none; bottom: 70px; } }

/* ---------- Admin ---------- */
.admin-wrap { display: flex; min-height: 100vh; position: relative; }
.admin-sidebar {
  width: 260px; background: var(--bg-soft); border-right: 1px solid var(--card-border); padding: 20px;
  flex-shrink: 0; transition: transform .25s ease;
}
.admin-sidebar h2 { font-size: 20px; margin-bottom: 24px; }
.admin-nav-group-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text-muted); margin: 18px 0 6px; padding: 0 14px;
}
.admin-sidebar a {
  display: block; padding: 11px 14px; border-radius: 8px; margin-bottom: 4px; color: var(--text-muted); font-size: 14px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--card-bg); color: var(--text); }
.admin-main { flex: 1; padding: 30px; overflow-x: auto; min-width: 0; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 480px; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--card-border); font-size: 14px; }
.admin-table th { color: var(--text-muted); font-weight: 600; }
.admin-actions a, .admin-actions button { margin-right: 8px; font-size: 13px; }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-box { width: 100%; max-width: 380px; padding: 40px; }
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.alert.success { background: rgba(16,185,129,.15); border: 1px solid rgba(16,185,129,.4); }
.alert.error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.4); }
.dashboard-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; margin-bottom: 30px; }
.views-chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.views-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.views-bar { width: 100%; max-width: 28px; background: linear-gradient(180deg, var(--secondary), var(--primary)); border-radius: 6px 6px 0 0; min-height: 4px; transition: var(--transition); }
.views-bar-col:hover .views-bar { opacity: .8; }
.views-bar-label { font-size: 10px; color: var(--text-muted); white-space: nowrap; }

#admin-menu-toggle { display: none; }

@media (max-width: 960px) {
  .dashboard-cards { grid-template-columns: repeat(2,1fr); }
  .admin-sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 250;
    transform: translateX(-100%); overflow-y: auto; box-shadow: 20px 0 40px rgba(0,0,0,.3);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { padding: 20px 16px 80px; width: 100%; }
  #admin-menu-toggle {
    display: flex; align-items: center; justify-content: center; position: fixed; bottom: 20px; left: 20px;
    width: 52px; height: 52px; border-radius: 50%; z-index: 240; border: none; cursor: pointer;
    background: linear-gradient(135deg, var(--primary), var(--secondary)); color: #fff; font-size: 22px;
    box-shadow: var(--shadow);
  }
  #admin-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 245; display: none; }
  #admin-backdrop.open { display: block; }
  .login-box { padding: 28px; }
}
@media (max-width: 480px) {
  .dashboard-cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .admin-main h1 { font-size: 22px; }
}

/* ---------- Print-friendly view (blog posts) ---------- */
@media print {
  .navbar, .marquee-bar, .site-alert-backdrop, .cookie-banner, #back-to-top, #toast, #lightbox,
  #reading-progress, .quick-links-row, .live-banner, .mood-status-bar, footer, .comments-thread,
  .comment-form, #comment-form, .toc-box a::after, .thread-actions, .card .meta a, .search-icon {
    display: none !important;
  }
  body { background: #fff !important; color: #000 !important; }
  .printable-article { max-width: 100% !important; padding: 0 !important; }
  .printable-article .badge { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; }
  .printable-article .post-content { color: #000 !important; font-size: 12pt; }
  .printable-article a { color: #000 !important; text-decoration: underline; }
  .printable-article img { max-width: 100% !important; page-break-inside: avoid; }
  .like-btn, .copy-link, [onclick*="window.print"], .thread-like-btn, .thread-share-btn, .bookmark-btn { display: none !important; }
}
