/* =========================
   Base / Layout
   ========================= */
:root{
  --container: 1280px;
  --text:#222;
  --muted:#686060;
  --bg:#fff;
  --shadow:0 4px 12px rgba(0,0,0,.1);
  --shadow-sm:0 2px 5px rgba(0,0,0,.1);
  --border:#00000022;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.rh-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 15px;
}

/* =========================
   Header
   ========================= */
.main-header{
  position: sticky;
  top: 0;
  z-index: 9999;
  background:#fff;
  box-shadow: var(--shadow-sm);
  padding: 15px 20px;
  display:flex;
  justify-content:center;
  align-items:center;
  will-change: transform;
  height: 60px;
}

.header-container{
  width:100%;
  max-width: var(--container);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 16px;
}

.logo-container{
  display:flex;
  align-items:center;
  text-decoration:none;
}

.site-logo{ height:50px; }

/* Search (desktop + reused inside drawer) */
.search-container{
  display:flex;
  align-items:center;
  gap: 8px;
  width:350px;
  padding:6px 10px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:30px;
  height: 40px;
}

#searchInput,
#mobileSearchInput{
  flex:1;
  border:0;
  outline:0;
  padding:10px 6px;
  font-size:14px;
  background:transparent;
}

#searchInput::placeholder,
#mobileSearchInput::placeholder{
  color:#aaa;
}

#searchButton,
#mobileSearchButton{
  display:grid;
  place-items:center;
  border:0;
  background:#333;
  color:#fff;
  padding:4px;
  border-radius:50%;
  cursor:pointer;
}

/* =========================
   Mobile hamburger + drawer
   ========================= */
.hamburger-btn{
  display:none;             /* shown only on mobile */
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border-radius:50%;
  border:1px solid var(--border);
  background:#fff;
  cursor:pointer;
  padding:0;
}

.hamburger-btn span{
  display:block;
  width:18px;
  height:2px;
  background:#333;
  border-radius:99px;
  position:relative;
}

.hamburger-btn span::before,
.hamburger-btn span::after{
  content:"";
  position:absolute;
  left:0;
  width:18px;
  height:2px;
  background:#333;
  border-radius:99px;
}

.hamburger-btn span::before{ top:-5px; }
.hamburger-btn span::after{ top:5px; }

/* overlay behind drawer */
.mobile-menu-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  opacity:0;
  pointer-events:none;
  transition:opacity .25s ease;
  z-index:9998;
}

.mobile-menu-overlay.open{
  opacity:1;
  pointer-events:auto;
}

/* drawer itself */
.mobile-menu{
  position:fixed;
  top:0;
  right:0;
  width:80%;
  max-width:320px;
  height:100%;
  background:#fff;
  box-shadow:-4px 0 14px rgba(0,0,0,.25);
  transform:translateX(100%);
  transition:transform .25s ease;
  z-index:9999;
  display:flex;
  flex-direction:column;
  padding:18px 18px 24px;
}

.mobile-menu.open{
  transform:translateX(0);
}

.mobile-menu__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:16px;
}

.mobile-menu__title{
  font-size:16px;
  font-weight:600;
}

.mobile-menu__close{
  border:0;
  background:#f4f4f4;
  border-radius:50%;
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
  cursor:pointer;
}

.mobile-menu__search{
  margin-bottom:18px;
}

.mobile-menu__search .search-container{
  width:100%;
}

.mobile-menu__cats{
  flex:1;
  overflow-y:auto;
}

.mobile-menu__cats-title{
  font-size:14px;
  font-weight:600;
  margin:0 0 10px;
}

.mobile-menu__cats .modern-categories-grid{
  grid-template-columns:1fr;
  gap:12px;
}

/* =========================
   Categories (modern bar)
   ========================= */
.categories-section-modern{
  margin-top:20px;
  text-align:center;
}

.modern-categories-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap:20px;
  margin-top:20px;
}

.modern-category-card{
  display:flex;
  flex-direction:column;
  justify-content:center;
  padding:8px 20px;
  background:#fff;
  color:#333;
  text-decoration:none;
  border-radius:16px;
  border:1px solid var(--border);
  box-shadow:0 6px 18px rgba(0,0,0,.05);
  transition: transform .2s ease, box-shadow .2s ease;
}

.modern-category-card:hover{
  transform: translateY(-4px);
  box-shadow:0 10px 24px rgba(0,0,0,.12);
}

.modern-category-title{
  font-size:14px;
  font-weight:600;
  letter-spacing:.5px;
  text-transform:uppercase;
}

/* =========================
   Featured Section
   ========================= */
.featured-section{
  display:grid;
  grid-template-columns: 2fr 3fr; /* left 4 cards | main */
  gap:20px;
  max-width: var(--container);
  margin:40px auto;
  align-items:stretch;
}

.featured-left{
  display:grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap:20px;
  height:400px;
}

.featured-right{ height:400px; }

/* Cards */
.article-card.overlay-style{
  position:relative;
  display:block;
  width:100%;
  height:100%;
  border-radius:12px;
  overflow:hidden;
  text-decoration:none;
  color:#fff;
  box-shadow: var(--shadow);
}

.article-card.overlay-style img{
  width:100%;
  height:100%;
  object-fit:cover;
  aspect-ratio: 16 / 9;
  transition: transform .25s ease;
  will-change: transform;
}

.article-card.overlay-style:hover img{ transform: scale(1.03); }

.overlay-content{
  position:absolute;
  inset:auto 0 0 0;
  padding:15px 20px;
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
}

.overlay-content h2,
.overlay-content h3{
  margin:0;
  color:#fff;
  width:92%;
  font-weight:700;
  font-size: 16px;
}

/* =========================
   Articles Section + Sidebar
   ========================= */
.articles-section{ margin-top:40px; }

.main-grid{
  display:grid;
  grid-template-columns: 1fr 3fr 1fr;
  gap:20px;
}

.sidebar{
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  padding:20px;
  box-shadow:0 4px 10px rgba(0,0,0,.05);
  height:fit-content;
}

.sidebar h2{
  margin:0 0 15px;
  font-size:20px;
  color:#333;
}

.sidebar ul{
  list-style:none;
  padding:0;
  margin:0;
}

.sidebar li{ margin-bottom:12px; }

.sidebar a{
  color:#333;
  text-decoration:none;
  font-size:14px;
}

.sidebar a:hover{ color: var(--muted); }

.latest-posts{
  display:flex;
  flex-direction:column;
  gap:15px;
}

.latest-post-item{
  display:flex;
  gap:12px;
  align-items:flex-start;
  border-radius:10px;
  text-decoration:none;
  transition: transform .15s ease;
}

.latest-post-item:hover{ transform: translateY(-2px); }

.latest-post-item img{
  width:60px; height:60px;
  flex-shrink:0;
  border-radius:10px;
  object-fit:cover;
  box-shadow:0 2px 6px rgba(0,0,0,.1);
}

.latest-post-item .post-info{ flex:1; }
.latest-post-item .post-info p{
  margin:0;
  font-size:14px;
  color:#333;
  line-height:1.4;
  font-weight:500;
}

/* Articles grid */
.articles-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:20px;
  content-visibility: auto;
  contain-intrinsic-size: 600px;
}

.articles-grid .article-card{ height:220px; }
.articles-grid .article-card img{
  height:100%;
  object-fit:cover;
}
.articles-grid .overlay-content h3{ font-size:13px; }

/* =========================
   Category / Article pages
   ========================= */
.category-title{
  max-width: var(--container);
  margin: 0 auto;
  padding: 30px 0 10px;
  font-size: 140%;
  font-weight: 700;
  color:#333;
  text-align:left;
}

.category-article-card{
  position:relative;
  display:flex;
  gap:16px;
  padding:20px;
  margin-bottom:20px;
  background:#fff;
  border:1px solid #e3e3e3;
  border-radius:12px;
  box-shadow:0 5px 15px rgba(0,0,0,.1);
  transition: transform .2s ease, box-shadow .2s ease;
}

.category-article-card:hover{
  transform: translateY(-4px);
  box-shadow:0 8px 22px rgba(0,0,0,.12);
}

.category-article-card .card-thumb{
  flex:0 0 220px;
  height:160px;
  overflow:hidden;
  border-radius:12px 0 0 12px;
}

.category-article-card .card-thumb img{
  width:100%; height:100%;
  object-fit:cover;
}

.card-details{ flex:1; display:flex; flex-direction:column; justify-content:center; }
.card-details a{ text-decoration:none; }
.card-details h2{
  margin:0 0 10px;
  font-size:20px;
  font-weight:700;
  color:#333;
  transition: color .2s ease;
}

.card-snippet{
  margin-bottom:10px;
  font-size:15px;
  color:#666;
  line-height:1.5;
  display:-webkit-box;
  -webkit-line-clamp:4;
  -webkit-box-orient:vertical;
  overflow:hidden;
  text-overflow:ellipsis;
}

.card-meta{ display:flex; justify-content:space-between; align-items:center; }
.card-date{ font-size:13px; color:#aaa; font-style:italic; }

.read-more{
  padding:6px 14px;
  font-size:13px;
  font-weight:700;
  background:#333;
  color:#fff;
  border-radius:20px;
  text-decoration:none;
  transition: background .2s ease;
}
.read-more:hover{ background:#494446; }

.article-content h1{ font-size:32px; color:#333; margin-bottom:10px;
    margin-block-start: 10px;
    margin-block-end:10px;
}
.article-content em{ color:#888; font-size:14px; display:block; margin-bottom:15px; }
.article-content img{
  border-radius: 10px;
  margin: 15px 0;
  width: 100%;
  height: 120px;
  object-fit: cover;
}
.article-content p,
.article-content li{     font-size: 16px;
    line-height: 1.4;
    margin-bottom: 0px;
    color: #333;}
.article-content ul{ padding-left:20px; margin-bottom:20px; }

/* Pagination */
.pagination{ text-align:center; padding:30px 0; }
.page-link{
  display:inline-block;
  padding:8px 14px;
  margin:0 5px;
  border-radius:20px;
  text-decoration:none;
  color:#333;
  border:1px solid #333;
  font-weight:500;
}
.page-link.active,
.page-link:hover{ background:#333; color:#fff; }

/* =========================
   Footer
   ========================= */
.footer{
  background:#222;
  color:#fff;
  text-align:center;
  padding:20px;
  margin-top:40px;
}
.footer-links{ margin-bottom:10px; }
.footer-links a{
  color:#eee;
  margin:0 10px;
  font-size:14px;
  text-decoration:none;
}
.footer-links a:hover{ text-decoration:underline; }

/* =========================
   MGID slot wrapper
   ========================= */
.mgid-article-thumbnails-container{
  max-width: var(--container);
  margin: 15px auto 0;
  padding: 0 15px;
}
.category-with-sidebar,
.article-with-sidebar {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 30px;
  text-align: left;
  margin-top: 20px;
}
/* =========================
   Responsive
   ========================= */
@media (max-width: 1400px){
  .category-title{ padding:30px 15px 10px; }
}

@media (max-width: 1024px){
  .header-container{ flex-direction:column; align-items:center; }
  .search-container{ width:100%; max-width:100%; }

  .main-grid{ grid-template-columns:1fr; }

  .featured-section{ grid-template-columns: 1fr; }
  .featured-left{
    grid-template-columns:1fr 1fr;
    grid-template-rows:auto;
    height:auto;
  }
  .featured-right{ height:auto; }
  #article-main-card{ min-height:300px; }

  .category-title{ text-align:center; }

  .category-with-sidebar,
  .article-with-sidebar{ display:flex !important; flex-direction:column;  margin-top: 0px }

  .category-articles,
  .article-content{ width:95%; padding-left:10px; }

  .sidebar{ width:88%; margin-left:6px; }

  .category-article-card{
    flex-direction:row;
    gap:16px;
    padding:15px;
  }

  .category-article-card .card-thumb{
    flex:0 0 100px;
    height:100px;
    border-radius:10px;
  }

  .card-details h2{ font-size:16px; margin:0 0 6px; line-height:1.3; }
  .card-snippet{ font-size:14px; color:#555; line-height:1.4; }

  .card-meta{ flex-wrap:wrap; gap:6px; font-size:13px; color:#aaa; }
  .read-more{ font-size:12px; padding:6px 12px; }
  .article-content h1{ font-size:25px; }
  .categories-section-modern{
        margin-top: 0px;
  }
   .category-with-sidebar,
  .article-with-sidebar {
    display:flex !important;
    flex-direction:column;
  }
 
     /* Show burger */
  .hamburger-btn{
    display:flex;
  }
  .header-container{
    flex-direction:row;
    align-items:center;
  }

  /* Hide inline search + only the categories grid on mobile
     (keep the article-with-sidebar visible) */
  .header-container > .search-container{
    display:none;
  }
  .categories-section-modern .modern-categories-grid{
    display:none;
  }

}

@media (max-width: 768px){


  .featured-left{ grid-template-columns:1fr; }
  .featured-left .article-card,
  .featured-right .article-card{ height:200px; }

  .overlay-content{ padding:10px; }
  .overlay-content h2{ font-size:18px; }
  .overlay-content h3{ font-size:14px; }

  .sidebar{ padding:15px; 
  
  }
}

@media (max-width: 600px){
  .latest-post-item img{ width:56px; height:56px; }
}
p{
      margin-block-start: 5px;
    margin-block-end: 5px;
}

 h2{font-size:24px;    margin-block-start: 15px;
    margin-block-end: 15px;}
 h3{font-size:22px ;  margin-block-start: 15px;
    margin-block-end: 15px;}
 h4{font-size:20px;    margin-block-start: 15px;
    margin-block-end: 15px;}

.wrapper-below-article-container {
  margin-left: 20.5%;
  margin-right: 20.5%;
  margin-top: 15px;
  min-height: 1px; /* just to avoid 0-height edge cases */
}
@media (max-width: 1024px) {
  .wrapper-below-article-container {
    margin-left: auto;
    margin-right: auto;
    margin-top: 15px;
  }
}


    /* default: desktop */
#wrapper-articlepage__hero-desktop {
  display: block;
}

#wrapper-articlepage__hero-mobile {
  display: none;
}

/* mobile: swap which hero is visible */
@media (max-width: 768px) {
  #wrapper-articlepage__hero-desktop {
    display: none;
  }

  #wrapper-articlepage__hero-mobile {
    display: block;
    margin-top: 12px; /* tweak if you want spacing above hero */
  }
}
.wrapper-top-article-container .mgid-top-widget {
    min-height: 300px;
}
