/* Joy Services – Carbon Policy Pages (Improved)
   - Rounded buttons
   - Slightly smaller font scale
   - Better mobile layout (topbar/actions/menu)
   Theme: Auto/Light/Dark via html[data-theme]
*/

:root{
  /* Rounded corners (Carbon-ish but modern) */
  --cx-radius: 10px;
  --cx-radius-sm: 8px;

  --cx-accent: #0F62FE;

  --cx-bg: #f4f4f4;
  --cx-surface: #ffffff;
  --cx-surface2: #fafafa;
  --cx-text: #161616;
  --cx-muted: #525252;
  --cx-border: #e0e0e0;
  --cx-border2: #c6c6c6;
  --cx-shadow: 0 12px 36px rgba(0,0,0,.10);
  --cx-grid: rgba(82,82,82,.18);

  --cx-max: 1240px;
  --cx-pad: 24px;

  /* Typography scale (smaller + consistent) */
  --cx-font: 14px;
  --cx-font-sm: 13px;
  --cx-font-xs: 12px;
  --cx-topbar-h: 56px; /* adjust if your topbar height changes */
}

@media (max-width: 980px){
  :root{ --cx-pad: 16px; --cx-font: 13.5px; }
}
@media (max-width: 560px){
  :root{ --cx-font: 13px; }
}

@media (prefers-color-scheme: dark){
  html[data-theme="auto"]{
    --cx-bg:#0f0f10;
    --cx-surface:#121214;
    --cx-surface2:#16161a;
    --cx-text:#f4f4f4;
    --cx-muted:#c6c6c6;
    --cx-border: rgba(255,255,255,.10);
    --cx-border2: rgba(255,255,255,.18);
    --cx-shadow: 0 18px 48px rgba(0,0,0,.55);
    --cx-grid: rgba(244,244,244,.09);
  }
}

html[data-theme="dark"]{
  --cx-bg:#0f0f10;
  --cx-surface:#121214;
  --cx-surface2:#16161a;
  --cx-text:#f4f4f4;
  --cx-muted:#c6c6c6;
  --cx-border: rgba(255,255,255,.10);
  --cx-border2: rgba(255,255,255,.18);
  --cx-shadow: 0 18px 48px rgba(0,0,0,.55);
  --cx-grid: rgba(244,244,244,.09);
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }
body{
  padding-top: var(--cx-topbar-h);
  margin: 0;
  background: var(--cx-bg);
  color: var(--cx-text);
  font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;
  font-size: var(--cx-font);
  line-height: 1.6;
}

a{ color: var(--cx-accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

.cx-mono{
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: var(--cx-font-xs);
  letter-spacing: .2px;
}

.cx-topbar{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: var(--cx-surface);
  border-bottom: 1px solid var(--cx-border);
}
.cx-topbar__inner{
  max-width: var(--cx-max);
  margin: 0 auto;
  padding: 10px var(--cx-pad);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: nowrap; /* IMPORTANT: prevent ugly wrapping */
}

.cx-brand{
  display:flex;
  align-items:center;
  gap: 10px;
  color: var(--cx-text);
  min-width: 0;
  flex: 1 1 auto;
}
.cx-brand__icon{
  width: 22px;
  height: 22px;
  display:block;
  flex: 0 0 auto;
}
.cx-brand__name{
  font-weight: 600;
  font-size: var(--cx-font-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Desktop nav */
.cx-nav{ display:flex; align-items:center; gap: 6px; }
.cx-nav--desktop{ flex: 0 0 auto; }
.cx-nav__link{
  color: var(--cx-muted);
  font-size: var(--cx-font-sm);
  padding: 7px 10px;
  border-radius: var(--cx-radius-sm);
}
.cx-nav__link:hover{
  background: var(--cx-surface2);
  color: var(--cx-text);
  text-decoration: none;
}

/* Actions */
.cx-actions{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 0 0 auto;
}

/* Buttons (rounded + better tap targets) */
.cx-btn{
  border: 1px solid var(--cx-border);
  background: var(--cx-surface2);
  color: var(--cx-text);
  padding: 9px 12px;
  font-size: var(--cx-font-xs);
  cursor: pointer;
  display: inline-flex;
  align-items:center;
  justify-content:center;
  gap: 8px;
  white-space: nowrap;
  min-height: 38px;
}
.cx-btn:hover{ border-color: var(--cx-border2); }
.cx-btn--primary{
  background: var(--cx-accent);
  border-color: var(--cx-accent);
  color: #fff;
}
.cx-btn--ghost{ background: transparent; }

/* Burger: hidden by default (desktop) */
.cx-actions .cx-burger{
  display: none !important;
}

/* Show burger only on mobile */
@media (max-width: 980px){
  .cx-actions .cx-burger{
    display: inline-flex !important;
  }
}

/* Burger button styling */
.cx-actions .cx-burger{
  width: 44px;
  height: 40px;
  padding: 0;
  border-radius: var(--cx-radius);
  border: 1px solid var(--cx-border);
  background: var(--cx-surface2);
  cursor: pointer;
  position: relative;

  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cx-actions .cx-burger:hover{
  border-color: var(--cx-border2);
  background: var(--cx-surface);
}

.cx-actions .cx-burger:active{
  transform: translateY(1px);
}

.cx-actions .cx-burger:focus-visible{
  outline: 2px solid var(--cx-accent);
  outline-offset: 2px;
}

.cx-actions .cx-burger__bar{
  display: block;
  width: 18px;
  height: 2px;
  background: var(--cx-text);
  border-radius: 999px;
  opacity: .95;
}


/* Mobile breakpoint: show burger, hide desktop nav */
@media (max-width: 980px){
  .cx-burger{ display: inline-flex; }
}


/* Mobile menu container (hidden by default in your JS) */
.cx-mobile{
  position: fixed;
  top: var(--cx-topbar-h);
  left: 0;
  right: 0;
  z-index: 9998;
}
.cx-nav--mobile{
  padding: 12px var(--cx-pad) 16px;
  display:flex;
  flex-direction: column;
  gap: 6px;
}
.cx-mobile__row{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* MOBILE BEHAVIOR */
@media (max-width: 980px){
  .cx-nav--desktop{ display:none; }
  .cx-burger{ display:inline-flex; }
}

@media (max-width: 560px){
  /* Keep only the burger + essential buttons if you want */
  .cx-actions .cx-btn:not(.cx-burger){ display:none; }

  /* Make brand not push actions off screen */
  .cx-brand__name{ max-width: 180px; }
}

/* Layout */
.cx-hero{
  max-width: var(--cx-max);
  margin: 0 auto;
  padding: 34px var(--cx-pad) 10px;
}
.cx-kicker{
  color: var(--cx-muted);
  font-size: var(--cx-font-sm);
  margin: 0 0 8px;
}
.cx-title{
  font-size: clamp(20px, 4vw, 30px);
  line-height: 1.2;
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.2px;
}
.cx-subtitle{
  margin: 10px 0 0;
  color: var(--cx-muted);
  max-width: 86ch;
  font-size: var(--cx-font-sm);
}

.cx-wrap{
  max-width: var(--cx-max);
  margin: 0 auto;
  padding: 0 var(--cx-pad) 44px;
}

.cx-panel{
  background: var(--cx-surface);
  border: 1px solid var(--cx-border);
  box-shadow: var(--cx-shadow);
  border-radius: var(--cx-radius);
  overflow: hidden;
}

.cx-panel__head{
  padding: 14px 16px;
  border-bottom: 1px solid var(--cx-border);
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.cx-panel__head h2{
  margin: 0;
  font-size: 15px;
  letter-spacing: .2px;
}
.cx-panel__head .cx-badges{ display:flex; gap:8px; flex-wrap:wrap; }
.cx-badge{
  border: 1px solid var(--cx-border);
  padding: 5px 10px;
  border-radius: var(--cx-radius);
  font-size: var(--cx-font-xs);
  color: var(--cx-muted);
  background: var(--cx-surface2);
}

.cx-panel__body{
  padding: 14px 28px 18px;
}

/* Grid background */
.cx-gridbg{
  position: relative;
  overflow: hidden;
}
.cx-gridbg::before{
  content:"";
  position:absolute;
  inset:0;
  background:
    linear-gradient(to right, var(--cx-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--cx-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .30;
  pointer-events:none;
  mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
}
.cx-gridbg > *{ position: relative; }

/* Content typography */
.cx-content h3{
  margin: 18px 0 10px;
  font-size: 13.5px;
  letter-spacing: .2px;
}
.cx-content p{
  margin: 10px 0;
  color: var(--cx-text);
  font-size: var(--cx-font-sm);
}
.cx-content ul, .cx-content ol{
  margin: 10px 0 10px 20px;
  color: var(--cx-text);
  font-size: var(--cx-font-sm);
}
.cx-content li{ margin: 8px 0; }

.cx-note{
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--cx-accent);
  background: var(--cx-surface2);
  color: var(--cx-muted);
  border-radius: var(--cx-radius);
  font-size: var(--cx-font-sm);
}

.cx-ctaRow{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.cx-divider{
  height: 1px;
  background: var(--cx-border);
  margin: 16px 0;
}

/* Footer */
.cx-footer{
  border-top: 1px solid var(--cx-border);
  background: var(--cx-surface);
}
.cx-footer__inner{
  max-width: var(--cx-max);
  margin: 0 auto;
  padding: 22px var(--cx-pad);
}
.cx-footer__brand{
  font-weight: 650;
  letter-spacing: .2px;
  font-size: var(--cx-font-sm);
}
.cx-footer__links{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.cx-footer__links a{
  color: var(--cx-muted);
  border: 1px solid var(--cx-border);
  background: var(--cx-surface2);
  padding: 7px 10px;
  border-radius: var(--cx-radius);
  font-size: var(--cx-font-xs);
}
.cx-footer__links a:hover{
  color: var(--cx-text);
  text-decoration: none;
  border-color: var(--cx-border2);
}
.cx-footer__copy{
  margin-top: 12px;
  color: var(--cx-muted);
  font-size: var(--cx-font-xs);
}

/* Print */
@media print{
  .cx-topbar, .cx-footer, .cx-actions, .cx-mobile{ display:none !important; }
  body{ background: #fff; color:#000; }
  .cx-panel{ box-shadow:none; border: 1px solid #ddd; }
  a{ color:#000; text-decoration: underline; }
}
