/* ============================================================
   GLOBAL + TYPOGRAPHY
============================================================ */
body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
}

/* Prevent global conflict with Tailwind’s layout */
*, *::before, *::after {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Header logo text */
.header-logo {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* For rich text images inside blog posts */
.prose img,
img.responsive,
.widget-img {
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}


/* ============================================================
   16:10 UNIVERSAL ASPECT RATIO (GLOBAL)
============================================================ */
.ratio-16-10 {
  aspect-ratio: 16 / 10 !important;
  position: relative;
  width: 100% !important;
  overflow: hidden;
  border-radius: 0.5rem;
}

.ratio-16-10 img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

/* Safety (old rules can interfere) */
.article-img {
  width: 100%;
  display: block;
  aspect-ratio: 16/10;
  object-fit: cover;
}

/* Mobile limit */
@media (max-width: 640px) {
  .article-img {
    max-height: 200px;
    aspect-ratio: auto;
  }
}

/* Tablet limit */
@media (min-width: 641px) and (max-width: 1024px) {
  .article-img {
    max-height: 300px;
  }
}

/* Desktop free */
@media (min-width: 1025px) {
  .article-img {
    max-height: none;
  }
}

/* Placeholder */
.article-img[alt=""] {
  background: #f3f4f6;
  min-height: 140px;
}


/* ============================================================
   ADS
============================================================ */
.ad-block {
  display: block;
  margin: 1.25rem 0;
}
.ad-block img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}


/* ============================================================
   HEADER + NAVIGATION
============================================================ */
.site-header {
  background: #fff;
  position: relative;
  z-index: 50;
}

.site-header .container,
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* Brand logo block */
.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.site-brand img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

/* Desktop nav */
.nav-desktop {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Hover styles */
.mobile-nav a:hover,
.nav-desktop a:hover {
  opacity: 0.95;
}

/* Mobile behavior */
@media (max-width: 860px) {
  .nav-desktop { display: none; }
  .hamburger { display: flex; }

  .mobile-nav {
    position: static !important;
    display: none;
    width: 100%;
    border-bottom: 1px solid #e6e6e6;
    padding: 12px;
  }

  .mobile-nav.open,
  .mobile-nav[aria-hidden="false"] {
    display: block;
  }

  .mobile-nav a {
    display: block;
    padding: 10px 6px;
    border-radius: 6px;
    color: #111827;
    text-decoration: none;
  }

  .mobile-nav .sub {
    padding-left: 14px;
    color: #4b5563;
    font-size: 0.95rem;
  }

  .site-header .container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (min-width: 861px) {
  .mobile-nav { display: none !important; }
}

.dropdown-menu {
  min-width: 220px;
  max-height: 320px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}


/* ============================================================
   HERO BANNER / SPECIAL ASPECT BOX
============================================================ */
.aspect-hero {
  position: relative;
  width: 100%;
  padding-top: 40%;
  overflow: hidden;
}
.aspect-hero img {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
}


/* ============================================================
   IMAGE SLIDER COMPONENT
============================================================ */
.image-slider .slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-slider .prev,
.image-slider .next {
  cursor: pointer;
}

.image-slider .dots button {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
}


/* ============================================================
   CHART AREA FIXES
============================================================ */
.chart-wrapper {
  height: 260px;
  max-height: 380px;
  position: relative;
}

.chart-wrapper canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}


/* ============================================================
   MISC
============================================================ */
@media (max-width: 640px) {
  .header-logo { font-size: 1.25rem; }
}

/* Fix header push-down issues */
main, .page-content, .content, .container > .page {
  margin-top: 0;
}

/* ===== ADMIN POSTS TABLE – MOBILE FIX ===== */

.post-cell {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 100%;
}

/* Thumbnail */
.post-thumb {
  width: 80px;
  height: 50px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
}

/* Text wrapper */
.post-text {
  min-width: 0; /* IMPORTANT for text wrapping */
}

/* Title */
.post-title {
  display: block;
  font-weight: 600;
  line-height: 1.35;
  color: #111827;
  word-break: break-word;
}

.post-title:hover {
  color: #4f46e5;
}

/* Slug */
.post-slug {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  word-break: break-all;
}

/* ---------- MOBILE VIEW ---------- */
@media (max-width: 568px) {
  .post-cell {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-thumb {
    width: 100%;
    height: auto;
    max-width: 240px;
  }

  .post-title {
    font-size: 15px;
  }
}


/* ===== LOGO HANDLING (BANNER → LOGO SAFE) ===== */

.logo-box {
  width: 260px;       /* desktop width */
  height: 80px;          /* logo height */
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;   /* 🔥 NO CROP */
  display: block;
  border-radius: 6px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .logo-box {
    width: 200px;
    height: 60px;
  }
}
