/*
Theme Name: SanchitGurukul V3.1
Description: Sanchit Gurukul Theme v2.0 — responsive, performance-conscious WordPress theme.
Author: Sanchit Gurukul
Version: 3.1.0
*/

/* Reset / base */
*,*::before,*::after{box-sizing:border-box}
html,body{height:100%;margin:0;padding:0}

/* ========== VARIABLES ========== */
:root{
  --primary:#0f4c5c;
  --accent:#f2994a;
  --bg:#ffffff;
  --text:#111827;
  --muted:#64748b;
  --panel-bg:#fafafa;
  --border:#f1f5f9;
  --card-bg:#ffffff;
  --radius:10px;
  --shadow-lg:0 10px 30px rgba(15,23,42,0.08);
  --shadow-sm:0 2px 8px rgba(15,23,42,0.03);
  --gutter:1.5rem;
  --max-width-content:1200px;
  --sidebar-w-large:300px;
  --sidebar-inner-w:200px;

  --bp-xl:1300px;
  --bp-lg:1100px;
  --bp-md:900px;
  --bp-sm:800px;

  --focus-outline:rgba(21,156,228,0.22);
}

/* Base typography */
body{
  font-family:Inter,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.65;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* Header */
.site-header,.sticky-header{
  width:100%;
  background:var(--primary);
  color:#fff;
  box-shadow:0 2px 6px rgba(12,20,30,0.03);
  border-bottom:1px solid rgba(255,255,255,0.06);
  position:relative;
  z-index:100;
}
.header-inner{
  max-width:var(--max-width-content);
  margin:0 auto;
  padding:12px 1rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
}
.brand-link img,.custom-logo{max-height:56px;width:auto;display:block}
.site-title{font-weight:700;font-size:1.05rem;color:#fff}

/* Layout */
.content-wrap{
  max-width:var(--max-width-content);
  margin:0 auto;
  padding:1.5rem;
}
.layout{
  display:grid;
  grid-template-columns:minmax(140px,var(--sidebar-w-large)) minmax(0,1fr) minmax(140px,var(--sidebar-w-large));
  gap:var(--gutter);
  align-items:start;
}
.left,.right{
  background:var(--panel-bg);
  padding:1rem;
  border-radius:var(--radius);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  max-width:var(--sidebar-inner-w);
  margin-inline:auto;
}
@media (min-width:1300px){
  .left,.right{
    position:sticky;
    top:90px;
    max-height:calc(100vh - 110px);
    overflow:auto;
  }
}
.main{
  background:var(--card-bg);
  padding:1.25rem;
  border-radius:var(--radius);
  box-shadow:var(--shadow-lg);
  min-width:0;
}

/* Typography */
.article-title{
  font-size:clamp(1.6rem,2.2vw,2.4rem);
  margin:0 0 .6rem;
  line-height:1.12;
}
.meta{font-size:.95rem;color:var(--muted);margin-bottom:1rem}
.content{
  font-size:clamp(1rem,1.05vw,1.125rem);
  color:#0f172a;
  line-height:1.65;
}

/* 🔧 FIX 1: REMOVE forced aspect-ratio on content images */
.content img{
  max-width:100%;
  height:auto;
  display:block;
  margin:1rem 0;
}

/* Thumbnails only */
.post-list img{
  width:64px;
  height:64px;
  object-fit:cover;
  border-radius:6px;
  aspect-ratio:1/1;
}

/* Widgets & lists */
.widget-item{
  background:var(--panel-bg);
  padding:.85rem;
  border-radius:8px;
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  margin-bottom:1rem;
}
.post-list{list-style:none;padding:0;margin:0}
.post-list li{display:flex;gap:.75rem;margin-bottom:.75rem}

/* ===========================
   ARTICLE CONTENT (FIXED)
   =========================== */

.sg-article-content{
  width:100%;
  max-width:none; /* 🔧 FIX 2 */
  overflow-wrap:break-word;
}

/* Images & blocks */
.sg-article-content img,
.sg-article-content figure,
.sg-article-content .wp-block-image{
  max-width:100%;
  height:auto;
}

/* 🔧 FIX 3: Restore Gutenberg alignment */
.sg-article-content .alignleft{
  float:left;
  margin:.5rem 1rem .5rem 0;
  max-width:45%;
}
.sg-article-content .alignright{
  float:right;
  margin:.5rem 0 .5rem 1rem;
  max-width:45%;
}
.sg-article-content .alignwide,
.sg-article-content .alignfull{
  max-width:none;
}

/* Captions */
.sg-article-content figcaption{
  font-size:.9rem;
  color:#6b7280;
  margin-top:.35rem;
}

/* Embeds */
.sg-article-content iframe,
.sg-article-content .wp-block-embed{
  width:100%;
  aspect-ratio:16/9;
  border:0;
}

/* Footer */
.site-footer{
  background:#0b1220;
  color:#e6eef8;
  padding:36px 0 22px;
}
.footer-grid{
  max-width:var(--max-width-content);
  margin:0 auto;
  padding:0 20px;
  display:grid;
  grid-template-columns:0.8fr 2fr 0.9fr;
}
@media(max-width:900px){
  .layout{grid-template-columns:1fr}
  .left,.right{order:2;max-width:100%}
  .main{order:1}
  .footer-grid{grid-template-columns:1fr}
}

/* Accessibility */
:focus-visible{
  outline:3px solid var(--focus-outline);
  outline-offset:2px;
}
.hidden-visually{
  position:absolute!important;
  width:1px;height:1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
}

/* SEO/accessibility rebuild */
.screen-reader-text{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.screen-reader-text:focus,.skip-link:focus{clip:auto!important;width:auto;height:auto;top:8px;left:8px;padding:10px 14px;background:#fff;color:#111;z-index:100000}
.sg-site-header{height:auto;background:#fff;color:var(--text)}
.sg-site-header .header-inner{min-height:88px}
.sg-site-header .brand-link{display:flex;align-items:center;gap:10px;text-decoration:none}
.sg-site-header .site-logo-img,.sg-site-header .custom-logo{width:auto;height:64px;max-height:64px;object-fit:contain}
.sg-site-header .site-title{color:var(--text)}
.sg-nav-toggle{display:none;border:1px solid var(--border);background:#fff;border-radius:8px;padding:.55rem .75rem;font-size:1.3rem}
.sg-breadcrumbs ol{display:flex;flex-wrap:wrap;gap:.45rem;list-style:none;margin:0 0 1rem;padding:0;font-size:.9rem;color:var(--muted)}
.sg-breadcrumbs li+li:before{content:"/";margin-right:.45rem;color:var(--muted)}
.sg-breadcrumbs a{color:inherit}
img{max-width:100%;height:auto}
@media(max-width:900px){
 .sg-site-header .header-inner{flex-wrap:wrap;min-height:72px}
 .sg-nav-toggle{display:block;margin-left:auto}
 .sg-site-header .boxed-nav{display:none;flex-basis:100%;order:4}
 .sg-site-header .boxed-nav.is-open{display:block}
 .sg-site-header .boxed-menu{display:flex;flex-direction:column;align-items:stretch}
 .sg-site-header .search-form{order:3;width:100%}
 .sg-site-header .search-input{flex:1;min-width:0}
}

/* ==========================================================
   v3.0.1 — Restore vertical primary navigation
   This final block intentionally overrides earlier menu rules.
   ========================================================== */
.sg-site-header .header-inner{
  align-items:flex-start;
}
.sg-site-header .boxed-nav{
  display:block;
  flex:0 0 260px;
  width:260px;
  max-width:100%;
}
.sg-site-header .boxed-menu,
.sg-site-header .boxed-nav > ul,
.sg-site-header .boxed-nav .menu{
  display:flex !important;
  flex-direction:column !important;
  flex-wrap:nowrap !important;
  align-items:stretch !important;
  justify-content:flex-start !important;
  gap:8px !important;
  width:100% !important;
  margin:0 !important;
  padding:0 !important;
  list-style:none !important;
  overflow:visible !important;
  max-height:none !important;
}
.sg-site-header .boxed-menu > li,
.sg-site-header .boxed-nav .menu > li{
  display:block !important;
  width:100% !important;
  margin:0 !important;
  flex:0 0 auto !important;
}
.sg-site-header .boxed-menu > li > a,
.sg-site-header .boxed-nav .menu > li > a{
  display:block !important;
  width:100% !important;
  white-space:normal !important;
  text-align:left !important;
}

@media (max-width:900px){
  .sg-site-header .header-inner{
    align-items:center;
  }
  .sg-site-header .boxed-nav{
    flex-basis:100%;
    width:100%;
  }
  .sg-site-header .boxed-menu,
  .sg-site-header .boxed-nav > ul,
  .sg-site-header .boxed-nav .menu{
    flex-direction:column !important;
    overflow:visible !important;
  }
}

/* LOGO: single authoritative rule (250x240) */
:root{
  --sg-logo-w: 250px;
  --sg-logo-h: 240px;
}

/* brand column reserve so nav stays centered */
.brand-group { display:flex; flex-direction:row; align-items:center; gap:18px; width: calc(var(--sg-logo-w) + 18px); }

/* logo container */
.logo-circle {
  width: var(--sg-logo-w);
  height: var(--sg-logo-h);
  border-radius: 12px;
  overflow: hidden;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:#f7f7f7;
  box-shadow:0 8px 26px rgba(0,0,0,0.08);
  flex-shrink:0;
}

/* logo image */
.site-logo-img,
.brand-group img.site-logo-img,
.logo-circle img {
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  width: var(--sg-logo-w) !important;
  height: var(--sg-logo-h) !important;
  max-width: var(--sg-logo-w) !important;
  max-height: var(--sg-logo-h) !important;
  object-fit: cover !important;
}

/* responsive shrink on small screens */
@media (max-width: 900px) {
  :root { --sg-logo-w: 160px; --sg-logo-h: 140px; }
  .brand-group { width: auto !important; flex-direction: column; align-items:center; }
}
/* ensure logo image fills the logo container */
.logo-circle,
.logo-circle img,
.site-logo-img,
.brand-group img.site-logo-img {
  display: block !important;
  width: 100% !important;        /* fill container width */
  height: 100% !important;       /* fill container height */
  max-width: none !important;    /* ignore other max rules */
  max-height: none !important;
  object-fit: cover !important;  /* crop to fill while preserving aspect */
  object-position: center center !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
}
/* === Primary menu two-line layout with full text visible === */

:root {
  --sg-header-h: 380px;   /* enough height for logo row + 2 rows of menu */
}

/* Navigation wrapper */
.boxed-nav {
  order: 2;               /* push menu below logo row */
  width: 100%;
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

/* Menu list: allow wrapping */
.boxed-menu {
  display: flex;
  flex-wrap: wrap;        /* wrap into multiple rows */
  gap: 12px 18px;         /* vertical gap / horizontal gap */
  justify-content: center;
  align-items: flex-start;
  padding: 6px 8px;
  margin: 0;
  list-style: none;
  width: 100%;
  box-sizing: border-box;
}

/* Menu items: let them size to content */
.boxed-menu li {
  flex: 0 0 auto;         /* do not stretch or shrink */
  min-width: auto;        /* no forced minimum width */
}

/* === FORCE: primary menu show full text and wrap into two lines ===
   Paste this as the final menu CSS (end of file) to override prior rules. */

:root {
  --sg-menu-row-h: 58px;
  --sg-header-h: 380px !important; /* ensure header tall enough */
}

/* make sure boxed-nav sits below top row if using wrap layout */
.container.header-inner .boxed-nav {
  order: 2 !important;
  width: 100% !important;
  margin-top: 10px !important;
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
}

/* THE MENU LIST - allow wrapping and keep items natural width */
.container.header-inner .boxed-menu {
  display: flex !important;
  flex-wrap: wrap !important;          /* allow two or more rows */
  gap: 12px 18px !important;            /* row-gap / column-gap */
  justify-content: center !important;
  align-content: flex-start !important;
  padding: 6px 8px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 !important;
  list-style: none !important;
  max-height: calc(var(--sg-menu-row-h) * 2 + 20px) !important; /* mainly cosmetic */
  overflow: visible !important;
}

/* each li should size to content (no forced equal widths) */
.container.header-inner .boxed-menu > li {
  flex: 0 0 auto !important;   /* do not expand or shrink */
  min-width: 0 !important;
}

/* links: show full text, wrap naturally, no ellipsis */
.container.header-inner .boxed-menu > li > a,
.boxed-menu a {
  display: inline-block !important;
  padding: 10px 16px !important;
  border-radius: 10px !important;
  background: #fff !important;
  border: 1px solid rgba(13,31,66,0.06) !important;
  box-shadow: 0 6px 16px rgba(13,31,66,0.04) !important;
  color: #0d1f42 !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  text-align: center !important;

  /* KEY: allow full text */
  white-space: normal !important;     /* allow line-breaks within label */
  overflow: visible !important;       /* no cropping */
  text-overflow: unset !important;    /* remove ellipsis */
  max-width: none !important;
}

/* Keep hover/focus look */
.container.header-inner .boxed-menu > li > a:hover,
.container.header-inner .boxed-menu > li > a:focus,
.boxed-menu a:hover, .boxed-menu a:focus {
  background: var(--sg-accent) !important;
  color: #fff !important;
  transform: translateY(-4px) !important;
  box-shadow: 0 16px 36px rgba(21,124,230,0.14) !important;
}

/* MOBILE: fallback to horizontal scroll if space too tight */
@media (max-width: 900px) {
  :root { --sg-header-h: 300px !important; }
  .container.header-inner .boxed-menu {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 10px !important;
    padding: 8px 4px !important;
  }
  .container.header-inner .boxed-menu > li { flex: 0 0 auto !important; }
  .container.header-inner .boxed-menu > li > a { white-space: nowrap !important; }
}

/* Responsive helpers added automatically */

/* Mobile-first base */
html { box-sizing: border-box; font-size: 16px; }
*, *:before, *:after { box-sizing: inherit; }

body {
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  word-wrap: break-word;
}

/* Images and media */
img, video, iframe, embed, .responsive-media {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Containers */
.site, .container, .wrap {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Header / nav adjustments */
.site-header, header {
  width: 100%;
}
.site-navigation, nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Make menus accessible on small screens */
.menu-toggle, .nav-toggle {
  display: inline-block;
  cursor: pointer;
}

/* Utility classes */
.hide-on-mobile { display: none; }
.show-on-mobile { display: block; }

/* Typography */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Layout columns fallback */
.columns, .row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.column, .col {
  flex: 1 1 100%;
}

/* Tablet and up */
@media (min-width: 600px) {
  .column.sm-1-2 { flex: 1 1 48%; }
  .hide-on-mobile { display: block; }
  .show-on-mobile { display: none; }
}

/* Desktop */
@media (min-width: 992px) {
  .column.md-1-3 { flex: 1 1 30%; }
  .column.md-1-2 { flex: 1 1 48%; }
}

/* Small fixes for common theme pitfalls */
.site-main { padding-top: 1rem; padding-bottom: 1rem; }
.widget, .sidebar { box-sizing: border-box; }

/* Reduce layout shift for fonts */
img { font-display: optional; }
/* Sanchit Gurukul v3.0.3: horizontal desktop navigation.
   Loaded after all other theme styles to prevent legacy header rules overriding it. */
.sg-site-header,
.sg-site-header .header-inner,
.sg-site-header .boxed-nav,
.sg-site-header .boxed-nav * {
  box-sizing: border-box;
}

.sg-site-header {
  position: relative !important;
  z-index: 100 !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
  background: #fff !important;
  color: var(--text, #111827) !important;
  border-bottom: 1px solid var(--border, #f1f5f9) !important;
}

.sg-site-header .header-inner {
  display: grid !important;
  grid-template-columns: minmax(180px, 300px) minmax(280px, 1fr) !important;
  grid-template-areas:
    "brand search"
    "navigation navigation" !important;
  align-items: center !important;
  justify-content: stretch !important;
  gap: 14px 28px !important;
  width: 100% !important;
  max-width: var(--max-width-content, 1200px) !important;
  min-height: 0 !important;
  height: auto !important;
  margin: 0 auto !important;
  padding: 14px 16px 12px !important;
  overflow: visible !important;
}

.sg-site-header .brand-group {
  grid-area: brand !important;
  display: block !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.sg-site-header .brand-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: auto !important;
  max-width: 100% !important;
  text-decoration: none !important;
}

.sg-site-header .brand-link .custom-logo-link {
  display: block !important;
  line-height: 0 !important;
}

.sg-site-header .site-logo-img,
.sg-site-header .custom-logo,
.sg-site-header .brand-group img {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 105px !important;
  object-fit: contain !important;
  object-position: left center !important;
}

.sg-site-header .site-title {
  color: var(--text, #111827) !important;
}

.sg-site-header .sg-header-actions {
  grid-area: search !important;
  display: flex !important;
  align-items: center !important;
  justify-self: end !important;
  gap: 10px !important;
  width: min(100%, 720px) !important;
  min-width: 0 !important;
}

.sg-site-header .search-form {
  position: static !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

.sg-site-header .search-input {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 42px !important;
  padding: 9px 12px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
}

.sg-site-header .search-btn {
  min-height: 42px !important;
  padding: 9px 16px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: var(--primary, #0f4c5c) !important;
  color: #fff !important;
  cursor: pointer !important;
}

.sg-site-header .sg-translate-control { flex: 0 0 auto !important; }
.sg-site-header .sg-translate-select {
  min-height: 42px !important;
  max-width: 150px !important;
  padding: 9px 34px 9px 12px !important;
  color: #0d1f42 !important;
  background-color: #fff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 8px !important;
  cursor: pointer !important;
}

.sg-site-header .boxed-nav {
  grid-area: navigation !important;
  position: static !important;
  inset: auto !important;
  display: block !important;
  float: none !important;
  clear: both !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  transform: none !important;
}

.sg-site-header .boxed-nav > div,
.sg-site-header .boxed-nav > ul,
.sg-site-header .boxed-nav .menu,
.sg-site-header .boxed-nav .boxed-menu,
.sg-site-header .boxed-nav div > ul {
  position: static !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 10px 0 0 !important;
  overflow: visible !important;
  list-style: none !important;
  border-top: 1px solid var(--border, #f1f5f9) !important;
}

.sg-site-header .boxed-nav li,
.sg-site-header .boxed-nav .menu-item,
.sg-site-header .boxed-nav .page_item {
  position: relative !important;
  display: block !important;
  float: none !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  transform: none !important;
}

.sg-site-header .boxed-nav li::before,
.sg-site-header .boxed-nav li::after,
.sg-site-header .boxed-nav li::marker {
  content: none !important;
  display: none !important;
}

.sg-site-header .boxed-nav li > a {
  display: block !important;
  width: auto !important;
  max-width: none !important;
  min-height: 40px !important;
  margin: 0 !important;
  padding: 9px 15px !important;
  color: #0d1f42 !important;
  background: #fff !important;
  border: 1px solid rgba(13,31,66,.09) !important;
  border-radius: 9px !important;
  box-shadow: 0 2px 8px rgba(13,31,66,.035) !important;
  text-align: center !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transform: none !important;
}

.sg-site-header .boxed-nav li.current-menu-item > a,
.sg-site-header .boxed-nav li.current_page_item > a,
.sg-site-header .boxed-nav li > a:hover,
.sg-site-header .boxed-nav li > a:focus-visible {
  color: #fff !important;
  background: var(--primary, #0f4c5c) !important;
  border-color: var(--primary, #0f4c5c) !important;
}

.sg-site-header .boxed-nav .sub-menu,
.sg-site-header .boxed-nav .children {
  position: absolute !important;
  z-index: 110 !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  display: none !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: max-content !important;
  min-width: 210px !important;
  margin: 0 !important;
  padding: 8px !important;
  background: #fff !important;
  border: 1px solid var(--border, #f1f5f9) !important;
  border-radius: 10px !important;
  box-shadow: 0 12px 30px rgba(15,23,42,.12) !important;
  list-style: none !important;
}

.sg-site-header .boxed-nav li:hover > .sub-menu,
.sg-site-header .boxed-nav li:focus-within > .sub-menu,
.sg-site-header .boxed-nav li:hover > .children,
.sg-site-header .boxed-nav li:focus-within > .children {
  display: flex !important;
}

.sg-site-header .boxed-nav .sub-menu li,
.sg-site-header .boxed-nav .children li,
.sg-site-header .boxed-nav .sub-menu a,
.sg-site-header .boxed-nav .children a {
  width: 100% !important;
  text-align: left !important;
  white-space: normal !important;
}

.sg-site-header .sg-nav-toggle {
  display: none !important;
}

@media (max-width: 900px) {
  .sg-site-header .header-inner {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "brand toggle"
      "search search"
      "navigation navigation" !important;
    gap: 12px !important;
    padding: 12px 16px !important;
  }

  .sg-site-header .sg-nav-toggle {
    grid-area: toggle !important;
    display: block !important;
    margin: 0 !important;
  }

  .sg-site-header .sg-header-actions {
    justify-self: stretch !important;
    width: 100% !important;
    flex-wrap: wrap !important;
  }
  .sg-site-header .search-form { flex: 1 1 320px !important; width: auto !important; }
  .sg-site-header .sg-translate-control { flex: 0 0 auto !important; }

  .sg-site-header .boxed-nav {
    display: none !important;
  }

  .sg-site-header .boxed-nav.is-open {
    display: block !important;
  }

  .sg-site-header .boxed-nav > div,
  .sg-site-header .boxed-nav > ul,
  .sg-site-header .boxed-nav .menu,
  .sg-site-header .boxed-nav .boxed-menu,
  .sg-site-header .boxed-nav div > ul {
    flex-direction: column !important;
    align-items: stretch !important;
    padding-top: 10px !important;
  }

  .sg-site-header .boxed-nav li,
  .sg-site-header .boxed-nav li > a {
    width: 100% !important;
    text-align: left !important;
    white-space: normal !important;
  }

  .sg-site-header .boxed-nav .sub-menu,
  .sg-site-header .boxed-nav .children {
    position: static !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 6px !important;
    padding: 0 0 0 14px !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .sg-site-header .site-logo-img,
  .sg-site-header .custom-logo,
  .sg-site-header .brand-group img {
    max-height: 82px !important;
  }
}

@media (max-width: 520px) {
  .sg-site-header .sg-header-actions,
  .sg-site-header .search-form { flex-wrap: wrap !important; }
  .sg-site-header .sg-translate-control,
  .sg-site-header .sg-translate-select { width: 100% !important; max-width: none !important; }

  .sg-site-header .search-input,
  .sg-site-header .search-btn {
    width: 100% !important;
  }
}

/* v3.0.4 image payload controls */
.sg-list-thumb { width:48px!important; height:48px!important; flex:0 0 48px!important; object-fit:cover!important; border-radius:7px!important; }

/* v3.0.5 content refinements */
.sg-view-all-categories{text-align:center;margin:1rem 0 0}
.sg-col-left .sg-cat-root>li:nth-child(n+11){display:none}
.sg-small-meta [itemprop="author"] a{color:inherit;font-weight:600}
@media(max-width:900px){.sg-col-left{display:none}.sg-col-right{margin-top:1rem}}

/* v4.1.2 — definitive primary-menu visibility correction. */
.sg-site-header .boxed-nav li > a,
.sg-site-header .boxed-nav .menu li > a,
.sg-site-header .boxed-nav .boxed-menu li > a {
  opacity: 1 !important;
  visibility: visible !important;
  color: #0d1f42 !important;
  text-indent: 0 !important;
}

.sg-site-header .boxed-nav li.current-menu-item > a,
.sg-site-header .boxed-nav li.current_page_item > a,
.sg-site-header .boxed-nav li.current-menu-ancestor > a,
.sg-site-header .boxed-nav li.current_page_ancestor > a {
  color: #ffffff !important;
  background: var(--primary, #0f4c5c) !important;
  border-color: var(--primary, #0f4c5c) !important;
}

.sg-site-header .boxed-nav li > a:hover,
.sg-site-header .boxed-nav li > a:focus,
.sg-site-header .boxed-nav li > a:focus-visible {
  color: #0d1f42 !important;
  background: #e8f4f6 !important;
  border-color: var(--primary, #0f4c5c) !important;
  transform: none !important;
}

/* Never display an accidental empty navigation button. */
.sg-site-header .boxed-nav li > a:empty,
.sg-site-header .boxed-nav li:empty {
  display: none !important;
}
/* v4.1.3 — stable content flow and ad-provider compatibility */
.sg-container,
.sg-grid,
.sg-col-main,
.sg-article-content { min-width: 0; }
.sg-article-content { display: flow-root; }
.sg-container::after,
.sg-grid::after,
.sg-article-content::after { content: ""; display: table; clear: both; }
.site-footer { clear: both; position: relative; z-index: auto; border-top: 0; }
.sg-ad-slot { width: 100%; max-width: 100%; margin: 1.25rem 0; text-align: center; overflow: visible; }
.sg-ad-slot .adsbygoogle { display: block; width: 100%; }
.sg-ad-label { display: block; margin-bottom: .35rem; color: #64748b; font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; }
/* Do not resize, reposition, hide, or move Google/WordAds iframes. Providers manage their own dimensions. */
