/* ==========================================================================
   Cialella & Carney Digital — Design System
   ========================================================================== */

:root {
  --color-primary: #1b2559;
  --color-primary-dark: #12173a;
  --color-primary-light: #2d3a75;
  --color-accent: #0ea5a0;
  --color-accent-dark: #0b8580;
  --color-warn: #b8560f;
  --color-warn-bg: #fdf1e6;
  --color-safe-bg: #e9f8f6;
  --color-bg: #ffffff;
  --color-bg-alt: #f6f8fb;
  --color-bg-dark: #101431;
  --color-text: #1a1f36;
  --color-text-muted: #5b6472;
  --color-text-inverse: #eef1fb;
  --color-border: #e4e8f0;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(16, 20, 49, 0.06), 0 1px 3px rgba(16, 20, 49, 0.08);
  --shadow-md: 0 4px 12px rgba(16, 20, 49, 0.08), 0 2px 4px rgba(16, 20, 49, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 20, 49, 0.14);

  --container-width: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-accent-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-sans); line-height: 1.25; color: var(--color-primary); margin: 0 0 0.6em; }
h1 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 750; margin-top: 2.2em; }
h3 { font-size: 1.25rem; font-weight: 700; margin-top: 1.6em; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }
li { margin-bottom: 0.45em; }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ---------- Top utility bar ---------- */
.topbar {
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
  font-size: 0.82rem;
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; padding-bottom: 8px; gap: 12px; flex-wrap: wrap; }
.topbar a { color: var(--color-text-inverse); opacity: 0.85; }
.topbar a:hover { opacity: 1; }
.topbar .topbar-badges { display: flex; gap: 16px; opacity: 0.9; }

/* ---------- Header / Nav ---------- */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 14px; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--color-primary); }
.brand img { width: 40px; height: 40px; }
.brand .brand-sub { display: block; font-size: 0.68rem; font-weight: 600; color: var(--color-text-muted); letter-spacing: 0.04em; text-transform: uppercase; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  color: var(--color-text); font-weight: 600; font-size: 0.94rem;
  padding: 8px 12px; border-radius: var(--radius-sm);
}
.main-nav a:hover { background: var(--color-bg-alt); text-decoration: none; }
.main-nav a.current { color: var(--color-accent-dark); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  padding: 8px 10px; font-size: 1.1rem; cursor: pointer;
}

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-bg);
    border-bottom: 1px solid var(--color-border); flex-direction: column; align-items: stretch; padding: 8px 20px 16px;
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 8px; border-bottom: 1px solid var(--color-bg-alt); }
}

/* ---------- Hero / Banner ---------- */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  overflow: hidden;
}
.hero .container { display: grid; grid-template-columns: 1.1fr 0.9fr; align-items: center; gap: 40px; padding-top: 56px; padding-bottom: 56px; }
.hero h1 { color: #fff; }
.hero p.lead { color: #cdd4ee; font-size: 1.08rem; max-width: 46ch; }
.hero .hero-art { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 24px; }
.hero-badge {
  background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.18);
  padding: 6px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: #dfe4f7;
}
@media (max-width: 880px) {
  .hero .container { grid-template-columns: 1fr; padding-top: 36px; padding-bottom: 36px; }
}

.page-banner { width: 100%; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); margin: 22px 0 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; font-weight: 700; padding: 12px 22px; border-radius: var(--radius-sm);
  font-size: 0.95rem; cursor: pointer; border: 2px solid transparent;
}
.btn:hover { text-decoration: none; }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: var(--color-accent-dark); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,0.5); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,0.1); }
.btn-primary-outline { border-color: var(--color-primary); color: var(--color-primary); }
.btn-primary-outline:hover { background: var(--color-primary); color: #fff; }

/* ---------- Sections / cards ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--color-bg-alt); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section-head .kicker { color: var(--color-accent-dark); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 0.78rem; }

.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 880px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md);
  padding: 24px; box-shadow: var(--shadow-sm); height: 100%;
}
.card h3 { margin-top: 0; font-size: 1.08rem; }
.card .card-icon { width: 42px; height: 42px; margin-bottom: 12px; }
.card p { color: var(--color-text-muted); margin-bottom: 0; font-size: 0.95rem; }

.pillar-card { display: block; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow .15s, transform .15s; }
.pillar-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); text-decoration: none; }
.pillar-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.pillar-card .pillar-card-body { padding: 20px; }
.pillar-card .pillar-tag { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-accent-dark); }
.pillar-card h3 { color: var(--color-primary); margin: 6px 0 8px; }
.pillar-card p { color: var(--color-text-muted); font-size: 0.92rem; margin: 0; }

/* ---------- Breadcrumb ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--color-text-muted); padding: 16px 0 0; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li::after { content: "/"; margin-left: 6px; color: var(--color-border); }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb a { color: var(--color-text-muted); }
.breadcrumb li:last-child { color: var(--color-text); font-weight: 600; }

/* ---------- Article layout ---------- */
.article-header { padding: 26px 0 8px; }
.article-meta { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--color-text-muted); margin: 14px 0 0; flex-wrap: wrap; }
.article-meta .author-chip { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--color-text); }
.article-meta .author-chip img { width: 30px; height: 30px; border-radius: 50%; }
.article-meta .dot { opacity: 0.5; }

.article-layout { display: grid; grid-template-columns: 2.1fr 1fr; gap: 48px; align-items: start; padding: 8px 0 60px; }
@media (max-width: 940px) { .article-layout { grid-template-columns: 1fr; } }

.article-body { max-width: 74ch; font-size: 1.03rem; }
.article-body h2 { border-top: 1px solid var(--color-border); padding-top: 0.9em; }
.article-body h2:first-of-type { border-top: none; padding-top: 0; }
.article-body blockquote {
  margin: 1.6em 0; padding: 14px 20px; background: var(--color-bg-alt); border-left: 4px solid var(--color-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--color-text-muted); font-style: italic;
}
.callout { padding: 18px 20px; border-radius: var(--radius-md); margin: 1.6em 0; }
.callout-warn { background: var(--color-warn-bg); border: 1px solid #f0d3b3; }
.callout-warn strong { color: var(--color-warn); }
.callout-safe { background: var(--color-safe-bg); border: 1px solid #bfe8e2; }
.callout-safe strong { color: var(--color-accent-dark); }
.callout p:last-child { margin-bottom: 0; }

.toc { background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 18px 20px; margin: 1.6em 0; }
.toc p { font-weight: 700; margin: 0 0 8px; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em; color: var(--color-text-muted); }
.toc ol { margin: 0; padding-left: 1.2em; font-size: 0.93rem; }

.sidebar { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 20px; }
.sidebar-box { background: var(--color-bg-alt); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 20px; }
.sidebar-box h4 { font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 12px; }
.sidebar-box ul { list-style: none; padding: 0; margin: 0; }
.sidebar-box li { margin-bottom: 10px; font-size: 0.9rem; }
.sidebar-box li a { font-weight: 600; }
.sidebar-author { text-align: center; }
.sidebar-author img { width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 10px; }
.sidebar-author .role { color: var(--color-text-muted); font-size: 0.82rem; }

.related-grid { margin-top: 8px; }

/* ---------- Author ---------- */
.author-hero { display: flex; gap: 26px; align-items: center; padding: 40px 0; flex-wrap: wrap; }
.author-hero img { width: 128px; height: 128px; border-radius: 50%; box-shadow: var(--shadow-md); }
.author-hero .role { color: var(--color-accent-dark); font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.04em; }
.author-card-sm { display: block; background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 22px; text-align: center; box-shadow: var(--shadow-sm); }
.author-card-sm img { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 14px; }
.author-card-sm .role { color: var(--color-text-muted); font-size: 0.85rem; margin-bottom: 6px; }

.expertise-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.expertise-tags span { background: var(--color-bg-alt); border: 1px solid var(--color-border); padding: 5px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: var(--color-primary); }

/* ---------- Trust strip ---------- */
.trust-strip { border-top: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); background: var(--color-bg-alt); }
.trust-strip .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding: 20px; }
.trust-item { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; font-weight: 600; color: var(--color-text-muted); }
.trust-item img { width: 24px; height: 24px; }

/* ---------- CTA band ---------- */
.cta-band { background: var(--color-primary); color: #fff; text-align: center; padding: 56px 0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #cdd4ee; max-width: 56ch; margin: 0 auto 22px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-bg-dark); color: #aeb6d6; padding: 52px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: #fff; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; font-size: 0.9rem; }
.site-footer a { color: #aeb6d6; }
.site-footer a:hover { color: #fff; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.footer-brand img { width: 34px; height: 34px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 0.82rem; }
.footer-bottom a { color: #aeb6d6; }

/* ---------- 404 ---------- */
.error-page { text-align: center; padding: 90px 0; }
.error-page h1 { font-size: 5rem; margin-bottom: 0; }

/* ---------- Utility ---------- */
.text-muted { color: var(--color-text-muted); }
.mt-0 { margin-top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
