/*
 * CHINA LEGAL PORTAL: MERIDIAN LEDGER L4 ARTICLE SYSTEM
 * Namespace: cll-l4-*
 * Dependency: Native CSS Grid/Flexbox only. No UI framework or external runtime.
 */

.cll-l4-page {
    --cll-navy: #0b2341;
    --cll-navy-light: #174b78;
    --cll-gold: #d2a84f;
    --cll-gold-dark: #8a6420;
    --cll-bg-muted: #f3faf8;
    --cll-border: #d5dce6;
    --cll-text-main: #4a5568;
    --cll-text-heading: #172b3d;
    --cll-white: #ffffff;
    --cll-page-bg: #f8f9fa;
    --cll-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --cll-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    background: var(--cll-page-bg);
    color: var(--cll-text-main);
    font-family: var(--cll-sans);
}

.cll-l4-page *,
.cll-l4-page *::before,
.cll-l4-page *::after {
    box-sizing: border-box;
}

.cll-l4-page img {
    max-width: 100%;
}

.cll-l4-hero {
    background: var(--cll-navy) !important;
    color: #f4f7fb !important;
    padding: 64px 20px 54px;
}

.cll-l4-hero-inner {
    max-width: 980px;
    margin: 0 auto;
}

.cll-l4-hero a,
.cll-l4-hero p,
.cll-l4-hero h1,
.cll-l4-hero span,
.cll-l4-hero dt,
.cll-l4-hero dd,
.cll-l4-hero time,
.cll-l4-hero nav,
.cll-l4-hero li {
    color: #f4f7fb !important;
}

.cll-l4-eyebrow,
.cll-l4-byline-label {
    margin: 0 0 12px;
    color: var(--cll-gold);
    font-family: var(--cll-sans);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.cll-l4-hero .cll-l4-eyebrow,
.cll-l4-hero .cll-l4-byline-label {
    color: #e4c06a !important;
}

.cll-l4-hero-title {
    max-width: 920px;
    margin: 0;
    color: #ffffff !important;
    font-family: var(--cll-serif);
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

.cll-l4-hero-deck {
    max-width: 760px;
    margin: 22px 0 0;
    color: #e8eef4 !important;
    font-size: 1.1rem;
    line-height: 1.65;
}

.cll-l4-byline {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.18);
}

/* Legacy custom.css paints .cll-l4-byline as a pale card. Reset it on the navy hero. */
.cll-l4-hero .cll-l4-byline {
    background: transparent !important;
    background-image: none !important;
    border: 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #f4f7fb !important;
    margin: 34px 0 0 !important;
    padding: 24px 0 0 !important;
}

.cll-l4-author-avatar {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid rgba(210,168,79,0.7);
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: var(--cll-gold);
    font-family: var(--cll-sans);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

img.cll-l4-author-avatar {
    object-fit: cover;
    padding: 0;
}

.cll-l4-bc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    max-width: 980px;
    margin: 0 auto 22px;
    color: #9fb0c2;
    font-size: 0.78rem;
}

.cll-l4-bc a {
    color: #dce5ee;
    text-decoration: none;
}

.cll-l4-bc a:hover { color: var(--cll-gold); }
.cll-l4-current-mobile { display: none; }

.cll-l4-hero .cll-l4-bc,
.cll-l4-hero .cll-l4-bc [aria-current="page"] {
    color: #d5deea !important;
}

.cll-l4-hero .cll-l4-bc a {
    color: #f4f7fb !important;
}

.cll-l4-hero .cll-l4-bc a:hover {
    color: #e4c06a !important;
}

.cll-l4-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    height: 3px;
    pointer-events: none;
}

.cll-l4-progress > span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--cll-gold);
}

.cll-l4-byline-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.cll-l4-byline .cll-l4-byline-label {
    margin: 0;
}

.cll-l4-author-name {
    width: fit-content;
    color: var(--cll-white);
    font-family: var(--cll-serif);
    font-size: 1.12rem;
    font-weight: 700;
    text-decoration: none;
}

.cll-l4-hero .cll-l4-author-name,
.cll-l4-hero a.cll-l4-author-name {
    color: #ffffff !important;
}

.cll-l4-hero a.cll-l4-author-name:hover {
    color: #e4c06a !important;
}

.cll-l4-author-role {
    color: #cbd5e1;
    font-size: 0.9rem;
}

.cll-l4-hero .cll-l4-author-role {
    color: #d7e2ee !important;
}

.cll-l4-publication-meta {
    display: flex;
    gap: 22px;
    margin: 0;
}

.cll-l4-publication-meta div {
    min-width: 88px;
}

.cll-l4-hero .cll-l4-publication-meta dt {
    color: #c5d3e2 !important;
}

.cll-l4-hero .cll-l4-publication-meta dd,
.cll-l4-hero .cll-l4-publication-meta time {
    color: #ffffff !important;
}

.cll-l4-hero .cll-keywords,
.cll-l4-hero .cll-keyword-btn {
    color: #0b2341 !important;
    background: #f4f7fb !important;
    border-color: transparent !important;
}

.cll-l4-publication-meta dt {
    color: #9fb0c2;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cll-l4-publication-meta dd {
    margin: 3px 0 0;
    color: var(--cll-white);
    font-size: 0.83rem;
}

/* Base Article Typography */
.cll-l4-article-body {
    max-width: 75ch;
    margin: 0 auto;
    padding: 48px 20px 56px;
    background: var(--cll-white);
    color: var(--cll-text-main);
    box-shadow: 0 0 20px rgba(0,0,0,0.02);
    font-family: var(--cll-sans);
    font-size: 1.125rem;
    line-height: 1.8;
}

.cll-l4-article-body h2,
.cll-l4-article-body h3,
.cll-l4-article-body h4 {
    color: var(--cll-text-heading);
    font-family: var(--cll-serif);
    line-height: 1.3;
}

.cll-l4-article-body > h2 {
    margin: 2.5em 0 1em;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--cll-border);
    font-size: 2.2rem;
}

.cll-l4-article-body p {
    margin: 0 0 1.8em;
}

.cll-l4-article-body a,
.cll-l4-text-link {
    color: var(--cll-gold-dark);
    text-decoration: underline;
    text-decoration-color: rgba(138,100,32,0.35);
    text-underline-offset: 3px;
}

.cll-l4-article-body a:hover,
.cll-l4-text-link:hover {
    color: var(--cll-navy);
    text-decoration-color: var(--cll-navy);
}

/* 1. Executive Summary */
.cll-l4-executive-summary {
    margin: 0 0 3em;
    padding: 32px 36px;
    border-left: 4px solid var(--cll-gold);
    border-radius: 0 8px 8px 0;
    background: var(--cll-bg-muted);
}

.cll-l4-executive-summary p {
    margin: 0;
    color: var(--cll-navy);
    font-size: 1.2rem;
    font-weight: 500;
    line-height: 1.65;
}

/* 2. Impact Matrix */
.cll-l4-impact-matrix {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin: 3em 0;
}

.cll-l4-matrix-col {
    padding: 28px;
    border: 1px solid var(--cll-border);
    border-radius: 8px;
    background: var(--cll-white);
    box-shadow: 0 4px 6px rgba(11,35,65,0.02);
}

.cll-l4-matrix-col.rule { border-top: 4px solid var(--cll-navy); }
.cll-l4-matrix-col.impact { border-top: 4px solid var(--cll-gold); background: #fffdf8; }

.cll-l4-matrix-title {
    margin: 0 0 18px;
    font-family: var(--cll-sans) !important;
    font-size: 0.82rem !important;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.cll-l4-matrix-col.rule .cll-l4-matrix-title { color: var(--cll-navy); }
.cll-l4-matrix-col.impact .cll-l4-matrix-title { color: var(--cll-gold-dark); }
.cll-l4-matrix-col p { margin: 0; font-size: 1.02rem; }

/* 3. Callout / Warning */
.cll-l4-callout {
    position: relative;
    overflow: hidden;
    margin: 3em 0;
    padding: 34px 38px;
    border-radius: 8px;
    background: var(--cll-navy);
    color: var(--cll-white);
    box-shadow: 0 10px 25px rgba(11,35,65,0.15);
}

.cll-l4-callout::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    background: var(--cll-gold);
    content: "";
}

.cll-l4-callout h3 {
    margin: 0 0 14px;
    color: var(--cll-gold);
    font-family: var(--cll-sans);
    font-size: 1rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cll-l4-callout p { margin: 0; color: #e2e8f0; font-size: 1.05rem; }

/* 4. Legal Review */
.cll-l4-legal-review {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    margin: 3em 0;
    padding: 28px;
    border: 1px solid var(--cll-border);
    border-radius: 8px;
    background: var(--cll-white);
}

.cll-l4-review-icon {
    display: flex;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--cll-bg-muted);
    color: var(--cll-navy);
}

.cll-l4-review-content h3 { margin: 0 0 10px; font-size: 1.3rem; }
.cll-l4-review-content p { margin: 0; color: var(--cll-text-main); font-size: 1rem; }

/* 5. Spotlight Resource */
.cll-l4-spotlight {
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    margin: 3em 0;
    border: 1px solid var(--cll-border);
    border-radius: 8px;
    background: var(--cll-white);
    box-shadow: 0 4px 12px rgba(11,35,65,0.04);
}

.cll-l4-spotlight-img {
    width: 100%;
    height: 100%;
    min-height: 230px;
    object-fit: cover;
}

.cll-l4-spotlight-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 36px;
}

.cll-l4-spotlight-badge {
    display: inline-block;
    align-self: flex-start;
    margin-bottom: 14px;
    padding: 5px 11px;
    border-radius: 4px;
    background: var(--cll-navy);
    color: var(--cll-white);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cll-l4-spotlight h3 { margin: 0 0 14px; font-size: 1.55rem; }
.cll-l4-spotlight p { margin: 0 0 18px; font-size: 1rem; }

.cll-l4-spotlight-link {
    width: fit-content;
    color: var(--cll-gold-dark) !important;
    font-family: var(--cll-sans);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-decoration: none !important;
    text-transform: uppercase;
}

/* 6. Regulatory Comparison Table */
.cll-l4-table-scroll {
    width: 100%;
    margin: 3em 0;
    overflow-x: auto;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

.cll-l4-table-scroll:focus-visible {
    outline: 3px solid var(--cll-gold);
    outline-offset: 4px;
}

.cll-l4-comparison {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
    background: var(--cll-white);
    box-shadow: 0 2px 8px rgba(11,35,65,0.03);
}

.cll-l4-comparison th {
    padding: 15px 20px;
    background: var(--cll-navy);
    color: var(--cll-white);
    font-family: var(--cll-sans);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-align: left;
    text-transform: uppercase;
}

.cll-l4-comparison tbody th,
.cll-l4-comparison td {
    padding: 20px;
    border-right: 1px solid var(--cll-border);
    border-bottom: 1px solid var(--cll-border);
    background: var(--cll-white);
    color: var(--cll-text-main);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0;
    text-align: left;
    text-transform: none;
    vertical-align: top;
}

.cll-l4-comparison tbody th { color: var(--cll-navy); font-weight: 700; }
.cll-l4-comparison tr > *:last-child { border-right: 0; }
.cll-l4-comparison tbody tr:last-child > * { border-bottom: 0; }

/* 7. Author trust layer */
.cll-l4-author-panel {
    padding: 0 20px;
}

.cll-l4-author-panel-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 24px;
    max-width: 760px;
    margin: 0 auto;
    padding: 30px;
    border: 1px solid var(--cll-border);
    border-radius: 8px;
    background: var(--cll-white);
}

.cll-l4-author-avatar-large {
    width: 68px;
    height: 68px;
    border-color: var(--cll-gold);
    background: var(--cll-navy);
}

.cll-l4-author-panel h2 {
    margin: 0;
    color: var(--cll-navy);
    font-family: var(--cll-serif);
    font-size: 1.65rem;
}

.cll-l4-author-panel-role { margin: 4px 0 12px; color: var(--cll-gold-dark); font-weight: 600; }
.cll-l4-author-panel p:not(.cll-l4-byline-label):not(.cll-l4-author-panel-role) { margin: 0 0 12px; line-height: 1.65; }

/* 8. Counsel CTA */
.cll-l4-counsel-cta {
    margin: 4em 0;
    padding: 56px 24px;
    border-top: 1px solid var(--cll-border);
    border-bottom: 1px solid var(--cll-border);
    background: var(--cll-bg-muted);
    text-align: center;
}

.cll-l4-counsel-cta h2 {
    margin: 0;
    color: var(--cll-navy);
    font-family: var(--cll-serif);
    font-size: 2.2rem;
}

.cll-l4-counsel-cta p {
    max-width: 650px;
    margin: 14px auto 28px;
    font-size: 1.08rem;
    line-height: 1.65;
}

.cll-l4-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.cll-l4-btn-primary,
.cll-l4-btn-secondary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 12px 26px;
    border: 2px solid var(--cll-navy);
    border-radius: 4px;
    font-family: var(--cll-sans);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
}

.cll-l4-btn-primary { background: var(--cll-gold); color: var(--cll-navy); }
.cll-l4-btn-primary:hover { background: #e0bb67; }
.cll-l4-btn-secondary { background: var(--cll-navy); color: var(--cll-white); }
.cll-l4-btn-secondary:hover { background: var(--cll-navy-light); }

/* 9. Related Insights */
.cll-l4-related-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 64px;
}

.cll-l4-related-section > h2 {
    margin: 0 0 20px;
    color: var(--cll-navy);
    font-family: var(--cll-serif);
    font-size: 2rem;
}

.cll-l4-related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.cll-l4-related-card {
    position: relative;
    padding: 25px;
    border: 1px solid var(--cll-border);
    border-radius: 8px;
    background: var(--cll-white);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.cll-l4-related-card:hover { box-shadow: 0 10px 20px rgba(11,35,65,0.06); transform: translateY(-2px); }

.cll-l4-related-meta {
    display: block;
    margin-bottom: 10px;
    color: var(--cll-gold-dark);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cll-l4-related-title { margin: 0; font-family: var(--cll-serif); font-size: 1.2rem; line-height: 1.4; }
.cll-l4-related-title a { color: var(--cll-navy); text-decoration: none; }
.cll-l4-related-title a::after { position: absolute; inset: 0; content: ""; }
.cll-l4-related-title a:hover { color: var(--cll-gold-dark); }

/* Keyboard focus */
.cll-l4-page a:focus-visible,
.cll-l4-page button:focus-visible {
    outline: 3px solid var(--cll-gold);
    outline-offset: 3px;
}

.cll-l4-btn-primary:focus-visible {
    outline-color: var(--cll-navy) !important;
    outline-offset: 4px !important;
}

/* Responsive layout */
@media (min-width: 768px) {
    .cll-l4-impact-matrix { grid-template-columns: 1fr 1fr; }
    .cll-l4-spotlight { grid-template-columns: 2fr 3fr; }
    .cll-l4-related-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .cll-l4-byline { grid-template-columns: auto 1fr; }
    .cll-l4-publication-meta { grid-column: 1 / -1; padding-left: 66px; }
}

@media (max-width: 640px) {
    .cll-l4-hero { padding: 44px 18px 38px; }
    .cll-l4-hero-title { font-size: clamp(2rem, 10vw, 2.55rem); }
    .cll-l4-hero-deck { font-size: 1rem; }
    .cll-l4-byline { grid-template-columns: auto 1fr; gap: 14px; }
    .cll-l4-publication-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-left: 0; }
    .cll-l4-publication-meta div:last-child { grid-column: 1 / -1; }
    .cll-l4-article-body { padding: 36px 18px 44px; font-size: 1rem; line-height: 1.75; }
    .cll-l4-article-body > h2 { font-size: 1.7rem; }
    .cll-l4-executive-summary,
    .cll-l4-callout,
    .cll-l4-legal-review,
    .cll-l4-spotlight-body,
    .cll-l4-matrix-col { padding: 22px; }
    .cll-l4-legal-review { flex-direction: column; }
    .cll-l4-executive-summary p { font-size: 1.05rem; }
    .cll-l4-spotlight-img { min-height: 210px; }
    .cll-l4-author-panel { padding: 0 18px; }
    .cll-l4-author-panel-inner { grid-template-columns: 1fr; padding: 24px; }
    .cll-l4-counsel-cta { margin: 3em 0; padding: 44px 18px; }
    .cll-l4-counsel-cta h2 { font-size: 1.8rem; }
    .cll-l4-btn-group { align-items: stretch; flex-direction: column; }
    .cll-l4-btn-primary,
    .cll-l4-btn-secondary { width: 100%; }
    .cll-l4-related-section { padding: 0 18px 48px; }
    .cll-l4-related-section > h2 { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
    .cll-l4-page *,
    .cll-l4-page *::before,
    .cll-l4-page *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.cll-l4-article-body table:not(.cll-l4-comparison) {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.cll-l4-share,
.cll-l4-keywords,
.cll-l4-discussion {
    max-width: 75ch;
    margin: 0 auto;
    padding: 0 20px 36px;
}

.cll-l4-share {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.cll-l4-share-label {
    color: var(--cll-gold-dark);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.cll-l4-share-btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    padding: 0 14px;
    border: 1px solid var(--cll-border);
    border-radius: 4px;
    background: var(--cll-white);
    color: var(--cll-navy);
    font-family: var(--cll-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.cll-l4-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cll-l4-keywords a {
    display: inline-flex;
    min-height: 36px;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--cll-border);
    border-radius: 999px;
    color: var(--cll-navy);
    font-size: 0.82rem;
    text-decoration: none;
}

.cll-l4-discussion h2 {
    margin: 0 0 10px;
    color: var(--cll-navy);
    font-family: var(--cll-serif);
}

.cll-l4-disclaimer {
    max-width: 75ch;
    margin: 0 auto;
    padding: 0 20px 48px;
    color: #6b7785;
    font-size: 0.85rem;
    line-height: 1.6;
}

.cll-l4-review-content ul {
    margin: 0;
    padding-left: 1.1em;
}

.cll-l4-review-content a { color: var(--cll-gold-dark); }

.cll-l4-sticky {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 30;
    display: flex;
    gap: 8px;
}

@media (max-width: 767px) {
    .cll-l4-current-desktop { display: none; }
    .cll-l4-current-mobile { display: inline; }
    .cll-l4-sticky {
        left: 16px;
        right: 16px;
        bottom: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .cll-l4-sticky a { flex: 1; }
    .cll-l4-sticky-secondary { display: none !important; }
}
