/* ── Reset & Base ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 1rem; line-height: 1.7; color: #1a1a2e;
  background: #f8f9fc;
}
img { max-width: 100%; height: auto; display: block; }
a { color: #1565c0; text-decoration: none; }
a:hover { text-decoration: underline; color: #0d47a1; }

/* ── Layout ───────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }
.content-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; margin-top: 2rem; }

/* ── Header ───────────────────────────────────────────── */
.site-header {
  background: #0a1628;
  border-bottom: 3px solid #1565c0;
  position: sticky; top: 0; z-index: 100;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 2rem;
}
.site-logo {
  display: flex; align-items: center; gap: .5rem;
  text-decoration: none; flex-shrink: 0;
}
.logo-mark {
  width: 36px; height: 36px; background: #1565c0;
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 1.1rem; color: #fff;
}
.logo-text { font-size: 1.15rem; font-weight: 500; color: #e8edf5; letter-spacing: -.01em; }
.logo-text strong { color: #fff; font-weight: 700; }

.primary-nav .nav-list { display: flex; gap: 0; list-style: none; }
.primary-nav .nav-list a {
  display: block; padding: .5rem .85rem; color: #b0bec5;
  font-size: .88rem; font-weight: 500; transition: color .15s;
}
.primary-nav .nav-list a:hover, .primary-nav .nav-list .current-menu-item a { color: #fff; text-decoration: none; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; background: none;
  border: none; cursor: pointer; padding: .5rem;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: #fff; border-radius: 2px; }

/* ── Hero Post ────────────────────────────────────────── */
.hero-post {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center;
  background: #fff; border-radius: 12px; overflow: hidden;
  border: 1px solid #e0e7f0; margin-top: 2rem;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.hero-thumb img { width: 100%; height: 320px; object-fit: cover; }
.hero-content { padding: 2rem 2rem 2rem 0; }
.hero-title { font-family: 'Merriweather', Georgia, serif; font-size: 1.65rem; line-height: 1.3; margin: .5rem 0 1rem; }
.hero-title a { color: #0a1628; }
.hero-title a:hover { color: #1565c0; text-decoration: none; }
.hero-excerpt { color: #4a5568; margin-bottom: 1.25rem; }
.btn-read {
  display: inline-block; background: #1565c0; color: #fff;
  padding: .55rem 1.25rem; border-radius: 6px; font-weight: 600;
  font-size: .9rem; transition: background .15s;
}
.btn-read:hover { background: #0d47a1; text-decoration: none; color: #fff; }

/* ── Post Cards Grid ──────────────────────────────────── */
.posts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.post-card {
  background: #fff; border-radius: 10px; border: 1px solid #e0e7f0;
  overflow: hidden; transition: box-shadow .2s, transform .2s;
  display: flex; flex-direction: column;
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.1); transform: translateY(-2px); }
.card-thumb img { width: 100%; height: 180px; object-fit: cover; }
.card-body { padding: 1.1rem 1.25rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card-title { font-family: 'Merriweather', Georgia, serif; font-size: 1.05rem; line-height: 1.4; margin: .35rem 0 .6rem; }
.card-title a { color: #0a1628; }
.card-title a:hover { color: #1565c0; text-decoration: none; }
.card-excerpt { color: #5a6a7a; font-size: .9rem; flex: 1; }
.reading-time { font-size: .78rem; color: #8a9ab0; margin-top: .75rem; display: block; }

/* ── Post Meta ────────────────────────────────────────── */
.post-meta { font-size: .78rem; color: #6b7a90; text-transform: uppercase; letter-spacing: .04em; }
.post-meta a { color: #1565c0; }

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar { min-width: 0; }
.widget {
  background: #fff; border: 1px solid #e0e7f0; border-radius: 10px;
  padding: 1.25rem; margin-bottom: 1.5rem;
}
.widget-title { font-size: .95rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #0a1628; margin-bottom: .85rem;
  padding-bottom: .5rem; border-bottom: 2px solid #1565c0; }
.cat-list, .recent-list, .standards-list, .footer-nav { list-style: none; }
.cat-list li, .recent-list li { padding: .3rem 0; border-bottom: 1px solid #f0f2f7; font-size: .9rem; }
.cat-list li:last-child, .recent-list li:last-child { border-bottom: none; }
.standards-list li { padding: .3rem 0; font-size: .88rem; border-bottom: 1px solid #f0f2f7; }
.standards-list li:last-child { border-bottom: none; }
.standards-list strong { color: #1565c0; }

/* ── Single Article ───────────────────────────────────── */
.article-header { margin-bottom: 2rem; }
.article-title { font-family: 'Merriweather', Georgia, serif; font-size: 2rem; line-height: 1.3; margin: .5rem 0 1.25rem; color: #0a1628; }
.article-thumb { border-radius: 10px; overflow: hidden; margin-bottom: 1.5rem; }
.article-content {
  font-size: 1.05rem; line-height: 1.8; color: #2d3748;
  max-width: 720px;
}
.article-content h2 { font-family: 'Merriweather', Georgia, serif; font-size: 1.4rem; margin: 2rem 0 .75rem; color: #0a1628; padding-bottom: .4rem; border-bottom: 2px solid #e0e7f0; }
.article-content h3 { font-size: 1.15rem; margin: 1.5rem 0 .5rem; color: #1a2a3a; }
.article-content p { margin-bottom: 1.1rem; }
.article-content ul, .article-content ol { margin: .75rem 0 1rem 1.5rem; }
.article-content li { margin-bottom: .4rem; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.25rem 0; font-size: .92rem; }
.article-content th { background: #0a1628; color: #fff; padding: .65rem .85rem; text-align: left; font-weight: 600; }
.article-content td { padding: .6rem .85rem; border-bottom: 1px solid #e0e7f0; }
.article-content tr:nth-child(even) td { background: #f5f7fc; }
.article-content code { background: #f0f4ff; color: #1565c0; padding: .15em .4em; border-radius: 3px; font-size: .88em; font-family: 'Fira Code', monospace; }
.article-content pre { background: #0a1628; color: #e2e8f0; padding: 1.25rem; border-radius: 8px; overflow-x: auto; font-size: .88rem; margin: 1.25rem 0; }
.article-content pre code { background: none; color: inherit; padding: 0; }
.article-content strong { color: #0a1628; }
.article-content blockquote { border-left: 4px solid #1565c0; padding: .75rem 1.25rem; background: #f0f4ff; border-radius: 0 6px 6px 0; margin: 1.25rem 0; color: #4a5568; font-style: italic; }

.article-footer { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #e0e7f0; }
.article-tags { font-size: .88rem; color: #5a6a7a; margin-bottom: .75rem; }
.article-tags a { background: #f0f4ff; color: #1565c0; padding: .2em .6em; border-radius: 4px; margin-right: .35rem; }
.share-bar { display: flex; align-items: center; gap: .75rem; font-size: .88rem; color: #6b7a90; }
.share-btn { padding: .35rem .85rem; border-radius: 6px; font-weight: 600; font-size: .82rem; }
.share-twitter { background: #000; color: #fff; }
.share-linkedin { background: #0a66c2; color: #fff; }
.share-btn:hover { opacity: .85; text-decoration: none; }

/* ── Breadcrumb ───────────────────────────────────────── */
.breadcrumb { font-size: .82rem; color: #8a9ab0; margin: 1.25rem 0; }
.breadcrumb a { color: #1565c0; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Pagination ───────────────────────────────────────── */
.pagination { margin: 2.5rem 0; text-align: center; }
.pagination .nav-links { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.pagination .page-numbers {
  display: inline-block; padding: .45rem .9rem; border-radius: 6px;
  border: 1px solid #dce4f0; color: #1a2a3a; font-size: .9rem;
}
.pagination .page-numbers.current { background: #1565c0; color: #fff; border-color: #1565c0; }
.pagination .page-numbers:hover:not(.current) { background: #f0f4ff; text-decoration: none; }

/* ── Footer ───────────────────────────────────────────── */
.site-footer { background: #080f1e; color: #8a9ab0; margin-top: 4rem; padding: 3rem 0 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; padding-bottom: 2.5rem; border-bottom: 1px solid #111d30; }
.footer-brand .site-logo { margin-bottom: .85rem; }
.footer-logo .logo-text { color: #c8d5e8; }
.footer-brand p { font-size: .85rem; line-height: 1.65; color: #4a5e72; max-width: 280px; }
.footer-links h4, .footer-cats h4 { color: #c8d5e8; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 1rem; }
.footer-nav, .footer-cats ul { list-style: none; }
.footer-nav li, .footer-cats ul li { padding: .22rem 0; }
.footer-nav a, .footer-cats a { color: #4a5e72; font-size: .85rem; transition: color .15s; }
.footer-nav a:hover, .footer-cats a:hover { color: #c8d5e8; text-decoration: none; }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 0; gap: 1rem;
}
.footer-bottom-left { font-size: .8rem; color: #2e3f52; }
.footer-bottom-links { display: flex; gap: 1.5rem; }
.footer-bottom-links a { font-size: .8rem; color: #2e3f52; transition: color .15s; }
.footer-bottom-links a:hover { color: #607a9a; text-decoration: none; }
.footer-tm { font-size: .7rem; color: #1e2d3d; padding: .65rem 0 1rem; border-top: 1px solid #0d1828; margin-top: 0; line-height: 1.5; }

@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } .footer-bottom { flex-direction: column; align-items: flex-start; gap: .5rem; } }

/* ── Page Template ────────────────────────────────────── */
.page-content { background: #fff; border-radius: 10px; padding: 2rem; border: 1px solid #e0e7f0; }
.page-title { font-family: 'Merriweather', Georgia, serif; font-size: 1.75rem; margin-bottom: 1.5rem; color: #0a1628; }

/* ── Category Archive ─────────────────────────────────── */
.archive-header { margin: 1.5rem 0 2rem; }
.archive-title { font-family: 'Merriweather', Georgia, serif; font-size: 1.6rem; color: #0a1628; }
.archive-title span { color: #1565c0; }
.archive-description { color: #5a6a7a; margin-top: .5rem; }

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 900px) {
  .content-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero-post { grid-template-columns: 1fr; }
  .hero-thumb img { height: 220px; }
  .hero-content { padding: 1.25rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .posts-grid { grid-template-columns: 1fr; }
  .article-title { font-size: 1.5rem; }
  .header-inner { gap: 1rem; }
  .primary-nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: #0a1628; padding: 1rem; }
  .primary-nav.open { display: block; }
  .primary-nav .nav-list { flex-direction: column; }
  .nav-toggle { display: flex; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ── Utility ──────────────────────────────────────────── */
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.trademark-notice { font-size: .75rem; color: #304050; margin-top: .4rem; }

/* Contact Form 7 */
.wpcf7-form p { margin-bottom: 1rem; }
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
  width: 100%; padding: .75rem 1rem;
  border: 1px solid #d0dae8; border-radius: 6px;
  font-family: inherit; font-size: .95rem; color: #1a1a2e;
  background: #f8f9fc; transition: border-color .15s;
}
.wpcf7-form input:focus, .wpcf7-form textarea:focus {
  outline: none; border-color: #1565c0; background: #fff;
}
.wpcf7-form textarea { min-height: 140px; resize: vertical; }
.wpcf7-form input[type="submit"] {
  background: #1565c0; color: #fff; border: none;
  padding: .65rem 1.75rem; border-radius: 6px;
  font-size: .95rem; font-weight: 600; cursor: pointer; transition: background .15s;
}
.wpcf7-form input[type="submit"]:hover { background: #0d47a1; }
.wpcf7-response-output { margin-top: 1rem; padding: .75rem 1rem; border-radius: 6px; }

/* ── Subscription bar ─────────────────────────────────── */
.sub-bar {
  background: #0d1f3c;
  border-bottom: 1px solid #1a3050;
  padding: .55rem 0;
}
.sub-bar .ml-form--bar {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}
.sub-bar__label {
  font-size: .8rem; color: #7a9ab8; white-space: nowrap; flex-shrink: 0;
}
.sub-bar .ml-form__input {
  flex: 1; min-width: 180px; max-width: 260px;
  height: 34px; padding: 0 .75rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px;
  color: #fff; font-size: .82rem; font-family: "Inter", sans-serif;
  outline: none; transition: border-color .15s;
}
.sub-bar .ml-form__input:focus { border-color: rgba(77,171,247,.5); }
.sub-bar .ml-form__input::placeholder { color: rgba(255,255,255,.25); }
.sub-bar .ml-form__btn {
  height: 34px; padding: 0 1rem;
  background: #1565c0; color: #fff;
  border: none; border-radius: 6px;
  font-size: .8rem; font-weight: 600; font-family: "Inter", sans-serif;
  cursor: pointer; white-space: nowrap;
  transition: background .15s; flex-shrink: 0;
}
.sub-bar .ml-form__btn:hover { background: #1976d2; }
.sub-bar .ml-form__btn:disabled { opacity: .55; cursor: default; }
.sub-bar .ml-form__status {
  font-size: .78rem;
}
.sub-bar .ml-form__status--ok  { color: #69db7c; }
.sub-bar .ml-form__status--err { color: #ff8a80; }

/* Sidebar widget newsletter */
.widget-newsletter {
  background: #0b1e3d !important;
  border-color: #1e3a5f !important;
}
.widget-newsletter .widget-title { color: #e8edf5 !important; border-bottom-color: #4dabf7 !important; }
.widget-newsletter-sub { font-size: .82rem; color: #4a6580; margin: -.3rem 0 .85rem; }
.ml-form--widget .ml-form__input {
  display: block; width: 100%;
  height: 40px; padding: 0 .85rem; margin-bottom: .6rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 7px; color: #fff;
  font-size: .88rem; font-family: "Inter", sans-serif;
  outline: none;
}
.ml-form--widget .ml-form__input::placeholder { color: rgba(255,255,255,.28); }
.ml-form--widget .ml-form__btn {
  display: block; width: 100%; height: 40px;
  background: #1565c0; color: #fff;
  border: none; border-radius: 7px;
  font-size: .88rem; font-weight: 700; font-family: "Inter", sans-serif;
  cursor: pointer; transition: background .15s;
}
.ml-form--widget .ml-form__btn:hover { background: #1976d2; }
.ml-form--widget .ml-form__status { font-size: .78rem; margin-top: .5rem; display: block; }
.ml-form--widget .ml-form__status--ok  { color: #69db7c; }
.ml-form--widget .ml-form__status--err { color: #ff8a80; }
.ml-form--widget .ml-form__note { font-size: .72rem; color: #3d5570; margin-top: .4rem; }

@media (max-width: 600px) {
  .sub-bar__label { display: none; }
  .sub-bar .ml-form__input { max-width: none; }
}

/* ── Chat widget ──────────────────────────────────────── */
#ml-chat { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; font-family: "Inter", sans-serif; }

/* Floating teaser card */
#ml-teaser {
  position: absolute; bottom: 68px; right: 0;
  width: 240px; background: #fff;
  border-radius: 14px; padding: 1rem 1rem .85rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  opacity: 0; transform: translateY(10px) scale(.97);
  pointer-events: none; transition: opacity .25s, transform .25s;
}
#ml-teaser.ml-teaser--show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
#ml-teaser::after {
  content: ""; position: absolute; bottom: -7px; right: 18px;
  width: 14px; height: 14px; background: #fff;
  transform: rotate(45deg); box-shadow: 3px 3px 6px rgba(0,0,0,.07);
  clip-path: polygon(0 0, 100% 100%, 0 100%);
}
.ml-teaser-close {
  position: absolute; top: .5rem; right: .6rem;
  background: none; border: none; cursor: pointer;
  color: #aab; font-size: .85rem; line-height: 1; padding: .15rem .25rem;
}
.ml-teaser-close:hover { color: #445; }
.ml-teaser-msg { font-size: .82rem; color: #334; line-height: 1.45; margin: 0 0 .75rem; padding-right: .5rem; }
.ml-teaser-cta {
  width: 100%; padding: .5rem; background: #1565c0; color: #fff;
  border: none; border-radius: 8px; font-size: .8rem; font-weight: 600;
  font-family: "Inter", sans-serif; cursor: pointer; transition: background .15s;
}
.ml-teaser-cta:hover { background: #1976d2; }

/* Trigger button */
#ml-chat-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: #1565c0; color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(21,101,192,.5);
  transition: transform .15s, background .15s; position: relative;
}
#ml-chat-btn:hover { background: #1976d2; transform: scale(1.06); }
#ml-chat-btn.ml-open { background: #0d47a1; }
.ml-chat-dot {
  position: absolute; top: 2px; right: 2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #37b24d; border: 2px solid #fff;
}
/* Icon swap on open */
.ml-icon-close { display: none; }
#ml-chat-btn.ml-open .ml-icon-chat  { display: none; }
#ml-chat-btn.ml-open .ml-icon-close { display: block; }

/* Chat window */
#ml-chat-box {
  position: absolute; bottom: 66px; right: 0; width: 300px;
  background: #fff; border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,.18); overflow: hidden;
  display: flex; flex-direction: column;
}
.ml-chat-head {
  display: flex; align-items: center; gap: .7rem;
  background: #0a1628; padding: .85rem 1rem;
}
.ml-chat-avatar {
  width: 34px; height: 34px; border-radius: 50%; background: #1565c0;
  color: #fff; font-size: .72rem; font-weight: 700; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.ml-chat-head-text strong { display: block; font-size: .85rem; color: #fff; font-weight: 600; }
.ml-chat-head-text span   { font-size: .7rem; color: #37b24d; }

.ml-chat-msgs {
  flex: 1; overflow-y: auto; padding: .85rem .75rem;
  display: flex; flex-direction: column; gap: .4rem;
  min-height: 160px; max-height: 260px; background: #f4f6fa;
}
.ml-msg { max-width: 86%; padding: .5rem .75rem; font-size: .82rem; line-height: 1.45; word-wrap: break-word; border-radius: 12px; }
.ml-msg--bot  { background: #fff; color: #1a1a2e; border: 1px solid #e4e8f0; align-self: flex-start; border-radius: 3px 12px 12px 12px; }
.ml-msg--user { background: #1565c0; color: #fff; align-self: flex-end; border-radius: 12px 3px 12px 12px; }
.ml-typing { display: flex; gap: 4px; align-items: center; padding: .55rem .75rem; }
.ml-typing span { width: 6px; height: 6px; border-radius: 50%; background: #b0bec5; animation: mlbounce .8s infinite; }
.ml-typing span:nth-child(2) { animation-delay: .13s; }
.ml-typing span:nth-child(3) { animation-delay: .26s; }
@keyframes mlbounce { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-4px)} }

.ml-chat-foot { padding: .65rem .75rem; background: #fff; border-top: 1px solid #eef0f5; }
.ml-choices { display: flex; flex-direction: column; gap: .3rem; }
.ml-choice {
  text-align: left; background: #fff; border: 1px solid #dce8ff;
  border-radius: 8px; color: #1565c0; font-size: .78rem; font-weight: 500;
  padding: .42rem .7rem; cursor: pointer; font-family: "Inter", sans-serif;
  transition: background .1s, border-color .1s;
}
.ml-choice:hover { background: #edf3ff; border-color: #1565c0; }
.ml-input-group { display: flex; flex-direction: column; gap: .4rem; }
.ml-inp {
  width: 100%; height: 36px; padding: 0 .7rem;
  border: 1px solid #dce4f0; border-radius: 7px;
  font-size: .82rem; font-family: "Inter", sans-serif; color: #1a1a2e;
  outline: none; transition: border-color .15s;
}
.ml-inp:focus { border-color: #1565c0; }
.ml-inp-send {
  width: 100%; height: 36px; background: #1565c0; color: #fff;
  border: none; border-radius: 7px; font-size: .82rem; font-weight: 600;
  font-family: "Inter", sans-serif; cursor: pointer; transition: background .15s;
}
.ml-inp-send:hover { background: #1976d2; }

@media (max-width: 380px) { #ml-chat-box, #ml-teaser { width: calc(100vw - 3rem); right: -1.5rem; } }