:root {
  --sidebar-width: 320px;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #e5e7eb;
  border-bottom: 1px solid rgba(15, 23, 42, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 0.5rem 0.85rem;
}

.logo-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.site-logo-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 10%, #facc15, #f97316);
  color: #020617;
  font-weight: 700;
  font-size: 1.1rem;
}

.site-title-group {
  display: flex;
  flex-direction: column;
}

.site-title {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.site-subtitle {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.social-links {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}

.social-links a {
  font-size: 0.78rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #111827;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.social-links a:hover {
  border-color: #374151;
  color: #374151;
  background: rgba(17, 24, 39, 0.06);
  transform: translateY(-1px);
}

/* WhatsApp highlight in header */
.social-links a.is-whatsapp {
  border-color: rgba(22, 163, 74, 0.5);
  color: #166534;
}

.social-links a.is-whatsapp:hover {
  border-color: #16a34a;
  background: rgba(22, 163, 74, 0.12);
  color: #16a34a;
}

.main-nav {
  border-top: 1px solid rgba(15, 23, 42, 0.15);
  border-bottom: 1px solid rgba(15, 23, 42, 0.15);
  background: transparent;
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.7rem 0.5rem;
}

.nav-inner a {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #111827;
  position: relative;
}

.nav-inner a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 100%;
  height: 1px;
  background: #374151;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.nav-inner a:hover {
  color: #374151;
}

.nav-inner a:hover::after {
  transform: scaleX(1);
}

.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(17, 24, 39, 0.04);
  color: #111827;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

/* Shrink on scroll */
.site-header.shrink {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
}

.site-header.shrink .header-top {
  padding: 0.55rem 0.5rem 0.5rem;
}

.site-header.shrink .site-logo-circle {
  width: 30px;
  height: 30px;
  font-size: 1rem;
}

.site-header.shrink .site-title {
  font-size: 0.86rem;
}

.site-header.shrink .site-subtitle {
  font-size: 0.74rem;
}

.site-header.shrink .nav-inner {
  padding: 0.5rem 0.5rem;
}

/* Hamburger hover */
.hamburger:hover {
  background: rgba(17, 24, 39, 0.08);
  border-color: #374151;
  color: #374151;
  transform: translateY(-1px);
}

/* Sidebar/backdrop */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: transparent; /* keep the rest of the page clear */
  opacity: 1;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.sidebar-backdrop.show {
  opacity: 1; /* visible click layer only */
  pointer-events: auto;
  left: var(--sidebar-width);
  width: calc(100vw - var(--sidebar-width));
}

#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  max-width: 92vw;
  background: #f3f4f6;
  border-right: 1px solid rgba(15, 23, 42, 0.15);
  box-shadow: 10px 0 28px rgba(0, 0, 0, 0.08);
  transform: translateX(-100%);
  transition: transform 280ms ease;
  z-index: 100;
}

#sidebar.open { transform: translateX(0); }

#sidebar {
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Make sure all sidebar text elements inherit Montserrat */
#sidebar h1, #sidebar h2, #sidebar h3, #sidebar h4, #sidebar h5, #sidebar h6,
#sidebar p, #sidebar a, #sidebar li, #sidebar button, #sidebar .actions .button,
#sidebar input, #sidebar .logo { font-family: inherit; }

/* Ensure readable colors inside sidebar */
#sidebar h2, #sidebar h3, #sidebar h6 { color: #1f2937; }
#sidebar p { color: #374151; }
#sidebar a { color: #1f2937; }
#sidebar a:hover { color: #334155; }

/* Global sidebar rhythm */
#sidebar { line-height: 1.55; }

#sidebar .inner {
  position: relative;
  height: 100%;
  padding: 2.6rem 1.2rem 1.8rem; /* a bit more breathing room at bottom */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(107,114,128,0.45) transparent;
}
#sidebar .inner::-webkit-scrollbar { width: 10px; }
#sidebar .inner::-webkit-scrollbar-track { background: transparent; }
#sidebar .inner::-webkit-scrollbar-thumb {
  background-color: rgba(107, 114, 128, 0.45);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
#sidebar .inner::-webkit-scrollbar-thumb:hover { background-color: rgba(55,65,81,0.6); }

.sidebar-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(17, 24, 39, 0.04);
  color: #111827;
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}
.sidebar-close:hover { background: rgba(17,24,39,0.08); border-color:#374151; color:#374151; }

/* Search */
#sidebar #search input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #fff;
  color: #111827;
}

/* Menu */
#sidebar #menu .major { margin-top: 1rem; }
#sidebar #menu h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0.5rem 0 0.6rem;
}
#sidebar #menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}
#sidebar #menu ul a {
  display: block;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  color: #111827;
  font-weight: 600;
  letter-spacing: 0.06em;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}
#sidebar #menu ul a:hover { color:#374151; background:rgba(17,24,39,0.06); transform: translateX(3px); }

/* Mini posts */
#sidebar .mini-posts { display:grid; gap:1.2rem; margin-top:0.8rem; }
#sidebar .mini-posts .image img { display:block; width:100%; height:auto; border-radius:12px; box-shadow:0 6px 18px rgba(0,0,0,0.06); }
#sidebar .mini-posts .image {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4/3; /* slightly taller visuals */
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.45);
  background: #e5e7eb url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='2' ry='2'/%3E%3Ccircle cx='8.5' cy='8.5' r='1.5'/%3E%3Cpath d='M21 15l-5-5L5 21'/%3E%3C/svg%3E") center/48px no-repeat;
}
#sidebar .mini-posts .image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#sidebar .mini-posts .image img[src=""],
#sidebar .mini-posts .image img:not([src]) {
  display: none; /* show placeholder background when no src */
}
#sidebar .mini-posts h3 { margin:0.6rem 0 0.5rem; font-size:1.06rem; font-weight:600; color:#1f2937; padding-left:0.6rem; border-left:4px solid #16a34a; }
#sidebar .mini-posts h6 { margin:0.22rem 0; font-size:0.86rem; color:#1f2937; line-height:1.55; }

#sidebar .mini-posts h6:not(:last-child) { padding-bottom: 0.35rem; margin-bottom: 0.4rem; }
#sidebar .mini-posts h6:not(:last-child)::after {
  content: '';
  display: block;
  height: 2px;
  margin-top: 0.3rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #166534, #16a34a, #22c55e);
  opacity: 0.4;
}

#sidebar .mini-posts article { padding-bottom:1rem; border-bottom:1px solid rgba(148,163,184,0.35); }
#sidebar .mini-posts article:last-child { border-bottom:none; padding-bottom:0; }

#sidebar .actions { list-style:none; padding:0; margin:1rem 0 0; }
#sidebar .actions .button {
  display:inline-flex; align-items:center; justify-content:center; gap:0.4rem;
  padding:0.5rem 0.9rem; border-radius:999px; border:1px solid #16a34a;
  color:#fff; background:#16a34a; font-weight:600; font-size:0.85rem;
  box-shadow:0 6px 18px rgba(22, 163, 74, 0.2);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
#sidebar .actions .button i { font-size:1rem; line-height:1; }
#sidebar .actions .button:hover { background:#166534; border-color:#166534; transform:translateY(-1px); box-shadow:0 10px 22px rgba(22, 163, 74, 0.28); }
#sidebar .actions .button:active { transform:translateY(0); box-shadow:0 6px 18px rgba(22, 163, 74, 0.2); }

#sidebar .contact { list-style:none; padding:0; margin:0.6rem 0 0; display:grid; gap:0.25rem; }
#sidebar .contact a { color:#111827; }
#sidebar .contact a:hover { color:#374151; }

/* focus-visible */
.hamburger:focus-visible,
.sidebar-close:focus-visible,
#sidebar #menu ul a:focus-visible,
#sidebar .actions .button:focus-visible,
#sidebar #search input[type="text"]:focus-visible { outline:2px solid #374151; outline-offset:2px; }

/* Polished hamburger */
.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.55);
  background: #ffffff;
  color: #111827;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease, color 180ms ease;
}
.hamburger svg { transition: transform 220ms ease, color 180ms ease; }
.hamburger:hover { background:#f9fafb; border-color:#94a3b8; transform: translateY(-1px); box-shadow:0 10px 24px rgba(0,0,0,0.08); }
.hamburger:active { transform: translateY(0); box-shadow:0 6px 18px rgba(0,0,0,0.06); }
.hamburger.is-active { background:#f3f4f6; border-color:#64748b; color:#111827; }
.hamburger.is-active svg { transform: rotate(90deg); }

/* When sidebar is open, reflect active state on hamburger */
body.sidebar-open .hamburger { background:#f3f4f6; border-color:#64748b; }
body.sidebar-open .hamburger svg { transform: rotate(90deg); }

/* Sidebar search */
#sidebar-search { margin: 0.6rem 0 0.8rem; }
#sidebar-search .search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(148,163,184,0.6);
  border-radius: 10px;
  background: #fff;
}
#sidebar-search .search-input-wrap i { color:#6b7280; font-size: 1.1rem; }
#sidebar-search input[type="text"] {
  flex: 1;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.95rem;
  border: none;
  outline: none;
  color: #111827;
}

#sidebarResults {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  display: grid;
  gap: 0.35rem;
}
#sidebarResults li a {
  display: block;
  padding: 0.5rem 0.6rem;
  border-radius: 8px;
  color: #111827;
}
#sidebarResults li a:hover { background: rgba(17,24,39,0.06); color:#374151; }

/* Header polish and animations */
/* Brand typography enhancement */
.site-header .logo-title { display:flex; align-items:center; gap:0.8rem; }
.site-header .site-title-group { display:flex; flex-direction:column; line-height:1; align-items:center; }
.site-header .logo-title .site-title {
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1;
  font-size: clamp(1.6rem, 2.2vw + 1rem, 2.4rem);
  display: inline-block;
  background: linear-gradient(90deg, #0b0b0b 0%, #1f2937 45%, #374151 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  text-shadow: 0 1px 0 rgba(0,0,0,0.04);
  transition: background-position 420ms ease;
}
.site-header .logo-title .site-title::after {
  content: "";
  display: block;
  height: 3px;
  width: 0;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b0b0b, #111827, #0b0b0b);
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: width 260ms ease;
}
.site-header .logo-title:hover .site-title { background-position: 100% 0; }
.site-header .logo-title:hover .site-title::after { width: 76%; }
.site-header .site-subtitle {
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-top: 0.25rem;
  font-size: clamp(0.8rem, 0.25vw + 0.75rem, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.3px;
  color: #475569;
  text-align: center;
}

@media (max-width: 520px) {
  .site-header .logo-title { gap:0.6rem; }
}

/* Smooth shrink driven by --shrink (0..1) */
.site-header { --shrink: 0; }
/* Header bar height shrinks smoothly with logo */
.site-header .header-top {
  padding-block: calc(1.2rem - 0.6rem * var(--shrink));
  transition: padding-block 380ms cubic-bezier(0.22, 0.61, 0.36, 1);
  will-change: padding;
}
/* Use transform scaling instead of font-size/padding changes */
.site-header .logo-title { will-change: transform; transform-origin: left center; transform: scale(calc(1 - 0.10 * var(--shrink))); transition: transform 380ms cubic-bezier(0.22, 0.61, 0.36, 1); }
/* Keep font sizes constant (use clamp rules above) */
.site-header .logo-title .site-title { font-size: clamp(1.6rem, 2.2vw + 1rem, 2.4rem); }
.site-header .site-subtitle { font-size: clamp(0.8rem, 0.25vw + 0.75rem, 0.95rem); }
/* Keep logo circle constant size to prevent reflow */
.site-header .site-logo-circle { width: 44px; height: 44px; display:flex; align-items:center; justify-content:center; font-weight:800; color:#111827; background:#f3f4f6; border:1px solid #e5e7eb; border-radius:999px; }

/* Smooth background/shadow when shrink toggles */
.site-header { transition: box-shadow 320ms ease, background-color 320ms ease, border-color 320ms ease, backdrop-filter 320ms ease; }

/* Sidebar special section */
.sidebar-special { margin-top: 1.2rem; }
.sidebar-special .major { margin: 0.25rem 0 0.6rem; }
.sidebar-special .logo {
  display: inline-block;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #111827;
}

/* Aesthetic accented headings */
#sidebar .major h2,
.sidebar-special .logo {
  padding-left: 0.6rem;
  border-left: 4px solid #16a34a;
}

/* Sidebar contact */
.sidebar-contact { margin-top: 2rem; }
.sidebar-contact .major { margin: 0.25rem 0 0.6rem; }
.sidebar-contact .major h2 { font-size: 0.95rem; font-weight: 700; color:#1f2937; }
.sidebar-contact .major .accent { color:#16a34a; }
.sidebar-contact .major .sep { color:#64748b; }
.sidebar-contact .major h2 { position: relative; padding-bottom: 0; }
.sidebar-contact .major h2::after { content: none; }
.sidebar-contact .contact-list { display:grid; gap:0.6rem; }
.sidebar-contact .contact-item { display:flex; align-items:center; gap:0.6rem; color:#374151; }
.sidebar-contact .contact-item i { color:#ef4444; font-size:1.1rem; }
.sidebar-contact .contact-item .dotted {
  color:#374151;
  text-decoration: none;
  padding-bottom: 2px;
  background-image: linear-gradient(90deg, #16a34a, #22c55e);
  background-size: 0% 2px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 220ms ease, color 180ms ease;
}
.sidebar-contact .contact-item .dotted:hover { color:#111827; background-size: 100% 2px; }
.sidebar-contact .contact-item .dotted:focus-visible { outline: 2px solid #16a34a; outline-offset: 2px; }
.sidebar-contact .contact-item .muted { color:#4b5563; }
.sidebar-contact .divider { height:1px; background: rgba(148,163,184,0.45); margin: 0.4rem 0; }

/* Page shift when sidebar opens (layout-based, no overlap) */
#page-wrap {
  position: relative;
  transition: margin-left 280ms ease;
}

body.sidebar-open #page-wrap {
  margin-left: var(--sidebar-width); /* push layout to the right */
}

@media (max-width: 768px) {
  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    position: relative; /* allow absolute positioning inside */
    padding-top: 0.35rem; /* nudge logo area further up */
  }

  /* Center brand (logo/title) on mobile */
  .logo-title { margin-left: auto; margin-right: auto; margin-top: 0; }
  .site-title-group { align-items: center; text-align: center; }

  /* Place social links at top-right */
  .social-links { position: absolute; right: 10px; top: 4px; justify-content: flex-end; }

  .nav-inner {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.9rem;
  }

  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(17, 24, 39, 0.04);
    margin-top: 8px; /* push a bit downward */
  }
  .hamburger svg { width: 22px; height: 22px; }

  /* compact header height on mobile */
  .site-header .header-top { padding: 0.45rem 0.5rem 0.4rem; }
  .site-header .site-logo-circle { width: 38px; height: 38px; }
  .site-header .logo-title { transform: scale(0.96); }
  .site-header .logo-title .site-title { font-size: clamp(1.4rem, 1.6vw + 0.9rem, 2rem); }
  .site-header .site-subtitle { font-size: 0.78rem; margin-top: 0.08rem; }
  .logo-title { margin-top: -12px; }
}
