/* LawClarity UI final readability fix
   Goal: calm legal publication UI, smaller headings, better spacing,
   desktop sidebar TOC, no duplicate H1 in article body.
*/

:root{
  --bg:#f5f6f7;
  --paper:#ffffff;
  --paper-soft:#fafafa;
  --ink:#202624;
  --text:#303a37;
  --muted:#69736f;
  --line:rgba(32,38,36,.12);
  --line-strong:rgba(32,38,36,.20);
  --accent:#2f5752;
  --accent-dark:#1f3d39;
  --accent-soft:#edf3f2;
  --gold:#a8762a;
  --gold-soft:#fff8eb;
  --shadow:0 18px 44px rgba(32,38,36,.07);
  --shadow-soft:0 10px 24px rgba(32,38,36,.055);
  --max:1180px;
  --content:760px;
  --sidebar:300px;
}

*{box-sizing:border-box}
html{
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body{
  margin:0;
  color:var(--ink);
  background:
    radial-gradient(circle at 12% 0%,rgba(47,87,82,.08),transparent 30rem),
    radial-gradient(circle at 90% 5%,rgba(168,118,42,.08),transparent 30rem),
    var(--bg);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  font-size:16px;
  line-height:1.72;
  overflow-x:hidden;
  text-rendering:optimizeLegibility;
}

a{color:inherit;text-decoration:none}
img{display:block;max-width:100%;height:auto}

.skip-link{
  position:absolute;
  left:16px;
  top:-100px;
  z-index:999;
  padding:10px 14px;
  border-radius:10px;
  color:#fff;
  background:var(--ink);
}
.skip-link:focus{top:16px}

/* Header */
.site-header{
  position:sticky;
  top:0;
  z-index:80;
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(14px);
  border-bottom:1px solid var(--line);
}
.nav{
  width:min(var(--max),100%);
  min-height:72px;
  margin:0 auto;
  padding:12px 22px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
}
.brand{display:inline-flex;align-items:center;min-width:0}
.brand img{
  width:min(202px,48vw);
  max-height:52px;
  object-fit:contain;
}
.nav-links{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex-wrap:wrap;
}
.nav-links a{
  min-height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  color:var(--muted);
  border-radius:999px;
  font-size:15px;
  font-weight:650;
}
.nav-links a:hover{background:var(--accent-soft);color:var(--accent-dark)}
.nav-links .nav-cta{
  color:#fff;
  background:var(--accent-dark);
  box-shadow:0 10px 22px rgba(31,61,57,.18);
}

/* Core typography */
h1,h2,h3{
  margin:0;
  color:var(--ink);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  text-wrap:balance;
}
h1{
  font-size:clamp(32px,4vw,48px);
  line-height:1.18;
  letter-spacing:-.025em;
  font-weight:650;
}
h2{
  font-size:clamp(24px,3vw,34px);
  line-height:1.24;
  letter-spacing:-.018em;
  font-weight:650;
}
h3{
  font-size:clamp(19px,2vw,23px);
  line-height:1.34;
  letter-spacing:-.01em;
  font-weight:650;
}
p{margin:0 0 16px}

/* Common sections */
.container{
  width:min(var(--max),100%);
  margin:0 auto;
  padding:0 22px;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:9px;
  margin-bottom:16px;
  padding:7px 12px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  color:var(--accent-dark);
  font-size:13px;
  font-weight:750;
}
.badge:before{
  content:"";
  width:8px;
  height:8px;
  border-radius:999px;
  background:var(--accent);
  box-shadow:0 0 0 6px rgba(47,87,82,.10);
}
.lead{
  max-width:720px;
  margin-top:18px;
  color:var(--muted);
  font-size:clamp(17px,1.8vw,20px);
  line-height:1.65;
}
.hero-actions{display:flex;flex-wrap:wrap;gap:12px;margin-top:26px}
.btn{
  min-height:48px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:11px 16px;
  border:1px solid transparent;
  border-radius:13px;
  font-weight:750;
  text-align:center;
}
.btn-primary{
  color:#fff;
  background:var(--accent-dark);
  box-shadow:0 12px 24px rgba(31,61,57,.18);
}
.btn-secondary{
  color:var(--accent-dark);
  background:#fff;
  border-color:var(--line-strong);
}

/* Blog landing page */
.hero{
  padding:clamp(34px,6vw,66px) 0 clamp(30px,5vw,54px);
}
.hero-card{
  border:1px solid var(--line);
  border-radius:24px;
  background:rgba(255,255,255,.94);
  box-shadow:var(--shadow);
  padding:clamp(26px,4.2vw,46px);
}
.hero-card h1{
  max-width:820px;
  font-size:clamp(34px,4.2vw,50px);
  line-height:1.18;
  letter-spacing:-.026em;
  font-weight:650;
}
.hero-card h1 span{color:var(--accent)}

.section{
  padding:clamp(40px,7vw,72px) 0;
  border-top:1px solid var(--line);
}
.section-head{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(250px,.62fr);
  gap:24px;
  align-items:end;
  margin-bottom:26px;
}
.kicker{
  margin-bottom:8px;
  color:var(--accent);
  font-size:12px;
  font-weight:780;
  letter-spacing:.11em;
  text-transform:uppercase;
}
.section-head p{
  margin:0;
  color:var(--muted);
  font-size:16.5px;
  line-height:1.65;
}
.grid{display:grid;gap:18px}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.card{
  padding:22px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-soft);
}
.card h2,.card h3{margin-bottom:8px}
.card p{margin:0;color:var(--muted);line-height:1.65}

/* Post cards */
.post-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}
.post-card{
  min-height:100%;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-soft);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
.post-card:hover{
  transform:translateY(-2px);
  border-color:var(--line-strong);
  box-shadow:0 18px 42px rgba(32,38,36,.09);
}
.post-card img{
  width:100%;
  aspect-ratio:16/9;
  object-fit:cover;
  background:var(--paper-soft);
}
.post-card-body{padding:18px}
.post-meta{
  display:flex;
  flex-wrap:wrap;
  gap:8px 12px;
  margin-bottom:8px;
  color:var(--accent);
  font-size:12px;
  font-weight:750;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.post-card h2{
  margin:0 0 9px;
  font-size:21px;
  line-height:1.28;
  letter-spacing:-.016em;
  font-weight:650;
}
.post-card p{
  margin:0;
  color:var(--muted);
  font-size:15px;
  line-height:1.62;
}

/* Article shell */
.article-shell{
  width:min(var(--max),100%);
  margin:0 auto;
  padding:30px 22px 72px;
}
.breadcrumb{
  max-width:var(--content);
  margin:0 0 18px;
  color:var(--muted);
  font-size:14px;
  line-height:1.45;
}
.breadcrumb a{
  color:var(--accent-dark);
  font-weight:750;
}

/* Article hero */
.article-hero{
  max-width:var(--content);
  margin:0 0 26px;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.article-hero .badge{margin-bottom:16px}
.article-hero h1{
  max-width:740px;
  font-size:clamp(30px,3.4vw,42px);
  line-height:1.22;
  letter-spacing:-.022em;
  font-weight:650;
}
.article-meta{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px 12px;
  margin-top:15px;
  color:var(--muted);
  font-size:14.5px;
}
.article-meta span{display:inline-flex;align-items:center;gap:5px}
.article-meta span:not(:last-child)::after{
  content:"";
  width:4px;
  height:4px;
  margin-left:7px;
  border-radius:999px;
  background:rgba(105,115,111,.55);
}
.article-meta strong{
  color:var(--ink);
  font-weight:750;
}
.article-cover{
  margin-top:24px;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--paper-soft);
  box-shadow:var(--shadow-soft);
}
.article-cover img{
  width:100%;
  aspect-ratio:16/9;
  object-fit:cover;
}
.article-cover img[alt]{color:transparent}

/* Article grid */
.article-page-grid{
  display:grid;
  grid-template-columns:minmax(0,var(--content)) var(--sidebar);
  gap:42px;
  align-items:start;
}
.article-content{
  min-width:0;
  padding:32px;
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-soft);
}

/* Critical: do not show the Markdown H1 again inside the article body */
.article-content h1,
.article-content > h1{
  display:none !important;
}

.article-content h2{
  margin:36px 0 12px;
  padding-top:2px;
  font-size:clamp(23px,2.4vw,29px);
  line-height:1.30;
  letter-spacing:-.014em;
  font-weight:650;
}
.article-content h3{
  margin:24px 0 9px;
  font-size:clamp(18.5px,1.8vw,21.5px);
  line-height:1.38;
  letter-spacing:-.006em;
  font-weight:650;
}
.article-content p{
  margin:0 0 17px;
  color:var(--text);
  font-size:17px;
  line-height:1.86;
}
.article-content ul,.article-content ol{
  margin:0 0 22px;
  padding-left:1.28rem;
}
.article-content li{
  margin:8px 0;
  color:var(--text);
  font-size:16.5px;
  line-height:1.78;
}
.article-content a{
  color:var(--accent-dark);
  font-weight:700;
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
}
.disclaimer{
  margin:0 0 22px;
  padding:14px 16px;
  border:1px solid rgba(168,118,42,.28);
  border-radius:14px;
  background:var(--gold-soft);
  color:#60430d;
  font-size:15px;
  line-height:1.65;
}

/* Desktop sidebar */
.article-sidebar{
  position:sticky;
  top:94px;
  display:grid;
  gap:16px;
}
.sidebar-card{
  border:1px solid var(--line);
  border-radius:18px;
  background:#fff;
  box-shadow:var(--shadow-soft);
}
.sidebar-card-inner{padding:18px}
.sidebar-label{
  margin:0 0 8px;
  color:var(--accent);
  font-size:11.5px;
  font-weight:780;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.sidebar-title{
  margin:0 0 12px;
  font-size:16px;
  line-height:1.35;
  letter-spacing:0;
  font-weight:700;
}
.sidebar-toc{
  display:grid;
  gap:5px;
  margin:0;
  padding:0;
  list-style:none;
}
.sidebar-toc a{
  display:block;
  padding:8px 9px;
  border-radius:10px;
  color:var(--muted);
  font-size:14px;
  line-height:1.45;
  font-weight:600;
}
.sidebar-toc a:hover{
  background:var(--accent-soft);
  color:var(--accent-dark);
}

/* Author */
.author-mini{
  display:grid;
  grid-template-columns:46px minmax(0,1fr);
  gap:12px;
  align-items:center;
}
.author-avatar{
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:999px;
  background:var(--accent-soft);
  color:var(--accent-dark);
  font-weight:750;
}
.author-mini h2{
  margin:0 0 3px;
  font-size:15.5px;
  line-height:1.25;
  letter-spacing:0;
  font-weight:700;
}
.author-mini p{
  margin:0;
  color:var(--muted);
  font-size:13.5px;
  line-height:1.45;
}

/* Mobile in-body TOC, hidden on desktop because sidebar is used */
.toc-card{
  display:none;
  margin:20px 0 28px;
  padding:16px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--paper-soft);
}
.toc-card h2{
  margin:0 0 12px;
  font-size:20px;
  line-height:1.3;
  font-weight:650;
}
.toc-list{
  display:grid;
  gap:7px;
  margin:0;
  padding:0;
  list-style:none;
}
.toc-list a{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:9px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:var(--text);
  font-size:14.5px;
  line-height:1.5;
  font-weight:600;
  text-decoration:none;
}
.toc-number{
  color:var(--accent);
  font-weight:750;
}

/* Tables */
.table-wrap{
  width:100%;
  overflow-x:auto;
  margin:24px 0;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
  -webkit-overflow-scrolling:touch;
}
table{
  width:100%;
  min-width:640px;
  border-collapse:collapse;
  background:#fff;
}
th,td{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
  color:var(--text);
  font-size:15.5px;
  line-height:1.6;
}
th{
  background:var(--paper-soft);
  color:var(--ink);
  font-weight:700;
}

/* FAQ */
details{
  margin:12px 0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:14px;
  background:#fff;
}
summary{
  cursor:pointer;
  list-style:none;
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:15px 16px;
  color:var(--ink);
  font-size:15.5px;
  line-height:1.5;
  font-weight:700;
}
summary::-webkit-details-marker{display:none}
summary:after{
  content:"+";
  flex:0 0 auto;
  color:var(--accent);
  font-size:22px;
  font-weight:750;
}
details[open] summary:after{content:"−"}
details p{
  margin:0;
  padding:0 16px 15px;
  color:var(--muted);
  font-size:15.5px;
  line-height:1.75;
}

/* Footer */
.site-footer{
  width:min(var(--max),100%);
  margin:0 auto;
  padding:30px 22px 46px;
  border-top:1px solid var(--line);
  display:flex;
  gap:18px;
  justify-content:space-between;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:14px;
}
.footer-links{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
}
.footer-links a{
  color:var(--accent-dark);
  font-weight:700;
}

/* Responsive */
@media(max-width:1060px){
  .article-page-grid{
    grid-template-columns:minmax(0,var(--content));
    gap:24px;
  }
  .article-sidebar{
    display:none;
  }
  .toc-card{
    display:block;
  }
}
@media(max-width:920px){
  .section-head,.grid-3,.post-grid{
    grid-template-columns:1fr;
  }
}
@media(max-width:720px){
  .nav{
    padding:12px 16px;
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }
  .brand img{
    width:min(176px,62vw);
    max-height:46px;
  }
  .nav-links{
    width:100%;
    justify-content:flex-start;
    gap:6px;
  }
  .nav-links a{
    min-height:36px;
    padding:7px 10px;
    font-size:14px;
  }
  .nav-links .nav-cta{
    width:100%;
  }
  .container{
    padding:0 16px;
  }
  .hero{
    padding:28px 0 36px;
  }
  .hero-card{
    padding:22px;
    border-radius:20px;
  }
  .hero-card h1{
    font-size:clamp(30px,8vw,40px);
    line-height:1.20;
  }
  .hero-actions .btn{
    width:100%;
  }
  .article-shell{
    padding:22px 14px 54px;
  }
  .article-hero h1{
    font-size:clamp(28px,7.6vw,36px);
    line-height:1.24;
  }
  .article-meta{
    display:grid;
    gap:7px;
    font-size:14px;
  }
  .article-meta span:not(:last-child)::after{
    display:none;
  }
  .article-content{
    padding:22px;
    border-radius:16px;
  }
  .article-content p{
    font-size:16.25px;
    line-height:1.82;
  }
  .article-content li{
    font-size:16.1px;
    line-height:1.76;
  }
  .article-content h2{
    margin-top:32px;
    font-size:clamp(22px,5.8vw,28px);
    line-height:1.33;
  }
  .article-content h3{
    font-size:clamp(18px,4.8vw,21px);
  }
  table{
    min-width:560px;
  }
}
@media(max-width:420px){
  .article-shell{
    padding-left:10px;
    padding-right:10px;
  }
  .article-content{
    padding:18px;
  }
  .article-hero h1{
    font-size:clamp(27px,8.5vw,34px);
  }
}
