/* ChainWise 10 – DNN skin
   Design tokens and look are taken from the 2sxc app CSS (ChainWiseV10/assets/css/chainwise-2sxc.css),
   so header, footer and regular DNN modules match the .cw10 2sxc views. */

:root {
  --cw-navy: #0a255e;
  --cw-blue: #009fda;
  --cw-blue-text: #006bd4;
  --cw-burgundy: #b5003c;
  --cw-burgundy-dark: #8f0030;
  --cw-ink: #243657;
  --cw-muted: #596c83;
  --cw-pale: #eef7fd;
  --cw-pale-alt: #f3f9fe;
  --cw-line: #dce8f2;
  --cw-white: #fff;
  --cw-radius: 16px;
  --cw-shadow: 0 8px 22px #102d5010;
  --cw-header-h: 84px;
  --cw-font: Arial, Helvetica, sans-serif;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--cw-white);
  color: var(--cw-ink);
  font-family: var(--cw-font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.cw-skin *, .cw-skin *::before, .cw-skin *::after { box-sizing: border-box; }
.cw-skin img { max-width: 100%; height: auto; }
.cw-skin a { color: var(--cw-burgundy); }
.cw-skin a:hover { color: var(--cw-burgundy-dark); }
.cw-skin :focus-visible { outline: 3px solid var(--cw-blue); outline-offset: 2px; }

.cw-wrap { width: min(1160px, calc(100% - 36px)); margin-inline: auto; }

.cw-skip {
  position: absolute; left: 12px; top: -60px; z-index: 1000;
  padding: 10px 16px; border-radius: 8px;
  background: var(--cw-navy); color: #fff !important; font-weight: 700; text-decoration: none;
}
.cw-skip:focus { top: 12px; }

/* Typography for regular DNN/HTML modules (2sxc views use their own .cw10 rules) */
.cw-text h1, .cw-text h2, .cw-text h3, .cw-text h4 { color: var(--cw-navy); line-height: 1.12; margin: 0 0 18px; }
.cw-text h1 { font-size: clamp(2rem, 4.3vw, 3.9rem); letter-spacing: -.035em; }
.cw-text h2 { font-size: clamp(1.6rem, 2.6vw, 2.5rem); }
.cw-text h3 { font-size: 1.3rem; }
.cw-text p, .cw-text ul, .cw-text ol { margin: 0 0 20px; }
.cw-text ul, .cw-text ol { padding-left: 1.25em; }

/* Buttons (same as .cw10 .btn) */
.cw-btn {
  display: inline-block; padding: 12px 24px; border-radius: 50px; border: 1px solid var(--cw-burgundy);
  background: var(--cw-burgundy); color: #fff !important; font-weight: 700; text-decoration: none; line-height: 1.2;
  transition: background .15s ease, border-color .15s ease;
}
.cw-btn:hover { background: var(--cw-burgundy-dark); border-color: var(--cw-burgundy-dark); }
.cw-btn.alt { background: #fff; color: var(--cw-burgundy) !important; }
.cw-btn.alt:hover { background: var(--cw-pale); }

/* ---------- Header ---------- */
.cw-header {
  position: sticky; top: 0; z-index: 900;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--cw-line);
  transition: box-shadow .2s ease;
}
.cw-header.is-scrolled { box-shadow: 0 6px 24px #0a255e14; }
.cw-header-inner { display: flex; align-items: center; gap: 28px; min-height: var(--cw-header-h); }
.cw-brand { display: inline-flex; flex: 0 0 auto; }
.cw-brand img { display: block; width: 190px; height: auto; }

.cw-nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.cw-menu, .cw-submenu { list-style: none; margin: 0; padding: 0; }
.cw-menu { display: flex; align-items: center; gap: 4px; }
.cw-menu-item { position: relative; display: flex; align-items: center; }
.cw-menu-link {
  display: block; padding: 10px 12px; border-radius: 8px;
  color: var(--cw-navy) !important; font-weight: 700; font-size: .95rem; text-decoration: none; white-space: nowrap;
}
.cw-menu-link:hover, .cw-menu-item.active > .cw-menu-link { color: var(--cw-burgundy) !important; background: var(--cw-pale); }
.cw-menu-link.disabled { cursor: default; }

.cw-sub-toggle {
  width: 26px; height: 26px; margin-left: -8px; padding: 0; border: 0; background: transparent; cursor: pointer;
}
.cw-sub-toggle::before {
  content: ""; display: block; width: 7px; height: 7px; margin: 0 auto;
  border-right: 2px solid var(--cw-navy); border-bottom: 2px solid var(--cw-navy);
  transform: translateY(-2px) rotate(45deg); transition: transform .15s ease;
}
.cw-menu-item.sub-open > .cw-sub-toggle::before { transform: translateY(2px) rotate(-135deg); }

.cw-submenu {
  position: absolute; top: 100%; left: 0; min-width: 240px; padding: 10px;
  background: #fff; border: 1px solid var(--cw-line); border-radius: 12px; box-shadow: 0 16px 45px #0a255e20;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.cw-menu-item.has-children:hover > .cw-submenu,
.cw-menu-item.has-children:focus-within > .cw-submenu,
.cw-menu-item.sub-open > .cw-submenu { opacity: 1; visibility: visible; transform: none; }
.cw-submenu a, .cw-submenu span {
  display: block; padding: 9px 12px; border-radius: 8px; color: var(--cw-ink); text-decoration: none; font-size: .95rem;
}
.cw-submenu a:hover, .cw-submenu-item.active > a { background: var(--cw-pale); color: var(--cw-burgundy); }

.cw-nav-toggle { display: none; }

/* ---------- Breadcrumb ---------- */
.cw-crumbs { background: var(--cw-pale-alt); border-bottom: 1px solid var(--cw-line); font-size: .85rem; padding: 10px 0; color: var(--cw-muted); }
.cw-crumbs a { color: var(--cw-muted); text-decoration: none; }
.cw-crumbs a:hover { color: var(--cw-burgundy); }
.cw-crumbs .sep { margin: 0 8px; opacity: .6; }

/* ---------- Panes ---------- */
.cw-pane-full { width: 100%; }
.cw-columns { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 44px; }
.cw-columns:has(.cw-side.DNNEmptyPane) { grid-template-columns: minmax(0, 1fr); }
.cw-columns:has(.cw-text.DNNEmptyPane):has(.cw-side.DNNEmptyPane) { display: none; }
.cw-text:not(.DNNEmptyPane) { padding: 56px 0; }
.cw-side:not(.DNNEmptyPane) { padding: 56px 0; }
.cw-side .DnnModule {
  padding: 26px; margin-bottom: 20px; background: #fff;
  border: 1px solid var(--cw-line); border-radius: var(--cw-radius); box-shadow: var(--cw-shadow);
}
.cw-home .cw-text.DNNEmptyPane, .cw-side.DNNEmptyPane { padding: 0; }

/* Edit mode: keep empty panes visible and droppable */
.dnnEditState .cw-columns { display: grid !important; grid-template-columns: minmax(0, 1fr) 320px !important; }
.dnnEditState .DNNEmptyPane { min-height: 80px; padding: 20px 0 !important; }

/* ---------- Footer ---------- */
.cw-footer { background: var(--cw-navy); color: #c9d6ea; margin-top: 0; }
.cw-footer a { color: #fff; text-decoration: none; }
.cw-footer a:hover { color: var(--cw-blue); text-decoration: underline; }
.cw-footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 40px; padding: 60px 0 44px; }
.cw-footer-brand img {
  display: block; width: 160px; padding: 10px 14px; margin-bottom: 18px; background: #fff; border-radius: 10px; box-sizing: content-box;
}
.cw-footer-menu { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.cw-footer-menu li { margin: 0 0 10px; break-inside: avoid; }
.cw-footer-pane h2, .cw-footer-pane h3 { color: #fff; font-size: 1.05rem; margin: 0 0 12px; }
.cw-footer-bottom { border-top: 1px solid #ffffff1f; font-size: .85rem; }
.cw-footer-bottom-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 18px 0; }
.cw-footer-links, .cw-footer-credits { display: inline-flex; flex-wrap: wrap; gap: 16px; }
.cw-footer-credits { margin-left: auto; }

/* ---------- Containers (Containers/Chainwise10) ---------- */
.cw-container-title { padding: 0 0 8px; }
.cw-container-title h2 { color: var(--cw-navy); font-size: clamp(1.6rem, 2.6vw, 2.5rem); line-height: 1.12; margin: 0 0 18px; }
.cw-container-box {
  padding: 26px; border: 1px solid var(--cw-line); background: #fff; border-radius: var(--cw-radius); box-shadow: var(--cw-shadow);
}
.cw-container-box .cw-container-title h2 { font-size: 1.3rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .cw-header-inner { gap: 16px; }
  .cw-brand img { width: 160px; }

  .cw-nav-toggle {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; margin-left: auto; padding: 0 10px;
    background: transparent; border: 1px solid var(--cw-line); border-radius: 10px; cursor: pointer;
  }
  .cw-nav-toggle span { display: block; height: 2px; background: var(--cw-navy); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
  .nav-open .cw-nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-open .cw-nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .cw-nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .cw-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 16px; margin: 0; padding: 12px 18px 22px;
    background: #fff; border-bottom: 1px solid var(--cw-line); box-shadow: 0 16px 30px #0a255e1a;
    max-height: calc(100vh - var(--cw-header-h)); overflow-y: auto;
  }
  .nav-open .cw-nav { display: flex; }
  .cw-menu { flex-direction: column; align-items: stretch; gap: 0; }
  .cw-menu-item { flex-wrap: wrap; border-bottom: 1px solid var(--cw-line); }
  .cw-menu-link { flex: 1; padding: 14px 4px; border-radius: 0; }
  .cw-menu-link:hover, .cw-menu-item.active > .cw-menu-link { background: transparent; }
  .cw-sub-toggle { width: 44px; height: 44px; margin: 0; }
  .cw-submenu {
    position: static; display: none; width: 100%; min-width: 0; padding: 0 0 10px 12px;
    border: 0; box-shadow: none; opacity: 1; visibility: visible; transform: none;
  }
  .cw-menu-item.has-children:hover > .cw-submenu,
  .cw-menu-item.has-children:focus-within > .cw-submenu { display: none; }
  .cw-menu-item.sub-open > .cw-submenu { display: block; }
  .cw-nav-cta { text-align: center; }

  .cw-header { position: sticky; }
}

@media (max-width: 800px) {
  .cw-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .cw-text:not(.DNNEmptyPane), .cw-side:not(.DNNEmptyPane) { padding: 40px 0; }
  .cw-footer-grid { grid-template-columns: 1fr; gap: 28px; padding: 44px 0 32px; }
  .cw-footer-credits { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cw-skin * { transition: none !important; }
}
