/* =====================================================================
   k-legal.pl – design layer on top of Cassiopeia (child template "cassiopeia_klegal")
   Palette kept from the previous site: navy #003069, deep navy #00224b, gold #b38b4d
   ===================================================================== */
:root {
  --kl-navy: #003069;
  --kl-navy-900: #00224b;
  --kl-navy-700: #0a3f80;
  --kl-gold: #b38b4d;
  --kl-gold-600: #9a7438;
  --kl-gold-100: #f6efe3;
  --kl-ink: #1d2533;
  --kl-text: #374151;
  --kl-muted: #5f6670;
  --kl-line: #e3e7ee;
  --kl-soft: #f4f6fa;
  --kl-white: #fff;
  --kl-radius: 10px;
  --kl-shadow: 0 10px 30px rgba(0, 34, 75, .10);
  --kl-shadow-sm: 0 2px 10px rgba(0, 34, 75, .08);
  --kl-max: 1240px;
  --kl-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --kl-head: var(--kl-font);
  --cassiopeia-color-primary: var(--kl-navy);
  --cassiopeia-color-link: var(--kl-navy);
  --cassiopeia-color-hover: var(--kl-gold-600);
  --link-color: var(--kl-navy);
  --body-font-family: var(--kl-font);
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body.kl-site {
  margin: 0;
  font-family: var(--kl-font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--kl-text);
  background: var(--kl-white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.kl-site h1, .kl-site h2, .kl-site h3, .kl-site h4 {
  font-family: var(--kl-head);
  color: var(--kl-navy);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-transform: none;
}
.kl-site h1 { font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.75rem); margin: 0 0 .6em; }
.kl-site h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem); margin: 1.4em 0 .6em; }
.kl-site h3 { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); margin: 1.2em 0 .5em; }
.kl-site p { margin: 0 0 1em; }
.kl-site a { color: var(--kl-navy); text-decoration-color: rgba(0, 48, 105, .3); text-underline-offset: 3px; transition: color .15s; }
.kl-site a:hover { color: var(--kl-gold-600); }
.kl-site img { max-width: 100%; height: auto; }
.kl-site :focus-visible { outline: 3px solid var(--kl-gold); outline-offset: 2px; }
.kl-container { width: 100%; max-width: var(--kl-max); margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.kl-skip { position: absolute; left: -9999px; top: 8px; z-index: 1000; background: var(--kl-navy); color: #fff !important; padding: 10px 16px; border-radius: 6px; }
.kl-skip:focus { left: 8px; }

/* ---------- Icons (inline SVG masks – no icon font needed) ---------- */
.kl-ico { display: inline-block; width: 1em; height: 1em; background: currentColor; vertical-align: -.125em; margin-right: .45em; flex-shrink: 0;
  -webkit-mask: var(--i) no-repeat center / contain; mask: var(--i) no-repeat center / contain; }
.kl-ico-phone { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E"); }
.kl-ico-mail { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zm0 4-8 5-8-5V6l8 5 8-5z'/%3E%3C/svg%3E"); }
.kl-ico-pin { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.25 7 13 7 13s7-7.75 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E"); }
.kl-ico-clock { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm1 10.4 3.5 2.1-.75 1.25L11.5 13V7h1.5z'/%3E%3C/svg%3E"); }

/* ---------- Top bar ---------- */
.kl-topbar { background: var(--kl-navy-900); color: rgba(255,255,255,.82); font-size: 14px; line-height: 1.4; }
.kl-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 40px; }
.kl-topbar ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.kl-topbar a { color: #fff !important; text-decoration: none; }
.kl-topbar a:hover { color: var(--kl-gold) !important; }
.kl-topbar .kl-ico { color: var(--kl-gold); }
.kl-topbar .kl-lang .mod-languages { margin: 0; }
.kl-topbar .kl-lang ul { gap: 8px; }
.kl-topbar .kl-lang img { display: block; width: 20px; height: auto; border-radius: 2px; opacity: .75; transition: opacity .15s; }
.kl-topbar .kl-lang li.lang-active img, .kl-topbar .kl-lang a:hover img { opacity: 1; }
.kl-topbar .kl-lang .visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header + navigation ---------- */
.kl-header { position: sticky; top: 0; z-index: 900; background: rgba(255,255,255,.97); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--kl-line); transition: box-shadow .2s; }
.kl-header.is-scrolled { box-shadow: var(--kl-shadow-sm); }
.kl-header-inner { display: flex; align-items: center; gap: 28px; min-height: 84px; position: relative; }
.kl-brand { display: block; flex-shrink: 0; }
.kl-brand img { display: block; width: 260px; height: auto; }
.kl-nav { display: flex; align-items: center; justify-content: flex-end; gap: 20px; flex: 1; }
.kl-menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.kl-menu-item { position: relative; }
.kl-menu-link, .kl-menu-item > .kl-nav-label { display: block; padding: 30px 12px; font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--kl-navy-900) !important; text-decoration: none; text-transform: uppercase; cursor: pointer; white-space: nowrap; position: relative; }
.kl-menu-link::after, .kl-menu-item > .kl-nav-label::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 22px; height: 2px; background: var(--kl-gold); transform: scaleX(0); transform-origin: left; transition: transform .2s; }
.kl-menu-item:hover > .kl-menu-link::after, .kl-menu-item:hover > .kl-nav-label::after,
.kl-menu-item.is-active > .kl-menu-link::after, .kl-menu-item.is-active > .kl-nav-label::after { transform: scaleX(1); }
.kl-menu-item.has-children > .kl-menu-link, .kl-menu-item.has-children > .kl-nav-label { padding-right: 26px; }
.kl-menu-item.has-children > .kl-menu-link::before, .kl-menu-item.has-children > .kl-nav-label::before { content: ""; position: absolute; right: 10px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--kl-gold); border-bottom: 2px solid var(--kl-gold); transform: translateY(-70%) rotate(45deg); }
.kl-sub-toggle { display: none; }
.kl-sub { position: absolute; top: 100%; left: 0; min-width: 280px; padding: 14px; background: #fff; border: 1px solid var(--kl-line); border-top: 3px solid var(--kl-gold); border-radius: 0 0 var(--kl-radius) var(--kl-radius); box-shadow: var(--kl-shadow); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .18s, transform .18s, visibility .18s; z-index: 50; }
.kl-menu-item:hover > .kl-sub, .kl-menu-item:focus-within > .kl-sub, .kl-menu-item.is-open > .kl-sub { opacity: 1; visibility: visible; transform: none; }
.kl-sub ul { list-style: none; margin: 0; padding: 0; }
.kl-sub a, .kl-sub .kl-nav-label { display: block; padding: 8px 12px; border-radius: 6px; font-size: 15px; line-height: 1.35; color: var(--kl-ink) !important; text-decoration: none; }
.kl-sub a:hover, .kl-sub a.is-active { background: var(--kl-soft); color: var(--kl-navy) !important; }
.kl-menu-item.is-mega { position: static; }
.kl-menu-item.is-mega > .kl-sub { left: 50%; transform: translate(-50%, 8px); width: min(920px, calc(100vw - 48px)); padding: 24px 22px; }
.kl-menu-item.is-mega:hover > .kl-sub, .kl-menu-item.is-mega:focus-within > .kl-sub, .kl-menu-item.is-mega.is-open > .kl-sub { transform: translate(-50%, 0); }
.kl-mega { display: grid; grid-template-columns: 2fr 1fr; gap: 10px 28px; }
.kl-mega-col:first-child ul { columns: 2; column-gap: 12px; }
.kl-mega-col li { break-inside: avoid; }
.kl-mega-title { margin: 0 0 8px; padding: 0 12px 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--kl-gold-600); border-bottom: 1px solid var(--kl-line); }
.kl-nav-cta { display: flex; gap: 10px; flex-shrink: 0; }
.kl-burger { display: none; }

/* Buttons */
.kl-btn { display: inline-flex; align-items: center; justify-content: center; gap: 2px; padding: 11px 18px; border-radius: 8px; font-size: 15px; font-weight: 700; line-height: 1.2; text-decoration: none !important; border: 2px solid transparent; transition: background .15s, color .15s, border-color .15s, transform .15s; white-space: nowrap; }
.kl-btn:hover { transform: translateY(-1px); }
.kl-btn-gold { background: var(--kl-gold); color: #fff !important; }
.kl-btn-gold:hover { background: var(--kl-gold-600); color: #fff !important; }
.kl-btn-ghost { border-color: var(--kl-line); color: var(--kl-navy) !important; background: #fff; }
.kl-btn-ghost:hover { border-color: var(--kl-navy); }
.kl-btn-navy { background: var(--kl-navy); color: #fff !important; }
.kl-btn-navy:hover { background: var(--kl-navy-900); color: #fff !important; }

/* ---------- Banner + breadcrumbs ---------- */
.kl-banner { background: var(--kl-navy); }
.kl-banner > * { margin: 0; }
.kl-banner img { display: block; width: 100%; height: auto; max-height: 420px; object-fit: cover; }
.kl-breadcrumbs { background: var(--kl-soft); border-bottom: 1px solid var(--kl-line); font-size: 14px; }
.kl-breadcrumbs .breadcrumb { margin: 0; padding: 12px 0 !important; background: none; display: flex; flex-wrap: wrap; gap: 4px; list-style: none; }
.kl-breadcrumbs .mod-breadcrumbs__here { display: none; }
.kl-breadcrumbs .breadcrumb-item + .breadcrumb-item::before { content: "›"; color: var(--kl-gold); padding: 0 6px 0 2px; }
.kl-breadcrumbs a { color: var(--kl-muted) !important; text-decoration: none; }
.kl-breadcrumbs .active span { color: var(--kl-navy); font-weight: 600; }

/* ---------- Module rows (kept positions of the previous template) ---------- */
.kl-row { padding: 48px 0; }
.kl-row:nth-of-type(even) { background: var(--kl-soft); }
.kl-grid { display: grid; gap: 28px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); }
.kl-cols-2 { --cols: 2; } .kl-cols-3 { --cols: 3; } .kl-cols-4 { --cols: 4; } .kl-cols-5 { --cols: 5; } .kl-cols-6 { --cols: 6; }
.kl-inner-row { padding: 0; background: none !important; margin: 0 0 28px; }
.kl-inner-row .kl-container { padding: 0; }
.kl-inner-row .kl-grid { gap: 18px; }
.kl-row .moduletable > h3, .kl-sidebar .moduletable > h3 { font-size: 1.15rem; margin: 0 0 .8em; color: var(--kl-navy); }
.kl-top-row2 .kl-cell, .kl-top-row3 .kl-cell, .kl-middle-top .kl-cell { background: #fff; border: 1px solid var(--kl-line); border-radius: var(--kl-radius); padding: 24px; box-shadow: var(--kl-shadow-sm); transition: transform .2s, box-shadow .2s; }
.kl-top-row2 .kl-cell:hover, .kl-top-row3 .kl-cell:hover { transform: translateY(-3px); box-shadow: var(--kl-shadow); }
.kl-above-body .kl-cell, .kl-below-body .kl-cell { border-radius: var(--kl-radius); overflow: hidden; }

/* ---------- Columns: sidebars + main content ---------- */
.kl-columns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-top: 48px; padding-bottom: 56px; }
.kl-has-left .kl-columns { grid-template-columns: 300px minmax(0, 1fr); }
.kl-has-right .kl-columns { grid-template-columns: minmax(0, 1fr) 300px; }
.kl-has-left.kl-has-right .kl-columns { grid-template-columns: 260px minmax(0, 1fr) 260px; }
.kl-main { min-width: 0; }
.kl-sidebar .moduletable { background: #fff; border: 1px solid var(--kl-line); border-radius: var(--kl-radius); padding: 22px; margin-bottom: 24px; box-shadow: var(--kl-shadow-sm); }
.kl-sidebar .moduletable:empty { display: none; }
.kl-sidebar ul { list-style: none; margin: 0; padding: 0; }
.kl-sidebar ul li a { display: block; padding: 8px 0; border-bottom: 1px solid var(--kl-line); text-decoration: none; color: var(--kl-ink); }
.kl-sidebar ul li:last-child a { border-bottom: 0; }
.kl-sidebar ul li a:hover, .kl-sidebar ul li.current > a { color: var(--kl-gold-600); }
@media (min-width: 1100px) { .kl-sidebar { position: sticky; top: 110px; align-self: start; } }

/* Article content typography */
.kl-main .page-header h1, .kl-main .page-header h2 { margin-top: 0; }
.kl-main ul:not([class]), .kl-main ol:not([class]) { padding-left: 1.3em; }
.kl-main ul:not([class]) li::marker { color: var(--kl-gold); }
.kl-main blockquote { margin: 1.5em 0; padding: 18px 22px; border-left: 4px solid var(--kl-gold); background: var(--kl-gold-100); border-radius: 0 var(--kl-radius) var(--kl-radius) 0; }
.kl-main table:not([class]) { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
.kl-main table:not([class]) th, .kl-main table:not([class]) td { padding: 10px 14px; border-bottom: 1px solid var(--kl-line); text-align: left; }
.kl-main table:not([class]) th { background: var(--kl-navy); color: #fff; }

/* Legacy content helpers from the previous template */
.readon, a.readon, .button { display: inline-flex; align-items: center; gap: 6px; padding: 11px 20px; border-radius: 8px; background: var(--kl-navy); color: #fff !important; font-weight: 700; text-decoration: none !important; border: 0; transition: background .15s; }
.readon:hover, a.readon:hover, .button:hover { background: var(--kl-gold-600); }
.readon_highlight2 { background: var(--kl-gold) !important; }
.hide_all { display: none !important; }
@media (max-width: 900px) { .hide_900 { display: none !important; } .show_mobile { display: block !important; } }
.kl-site .btn-primary { --bs-btn-bg: var(--kl-navy); --bs-btn-border-color: var(--kl-navy); --bs-btn-hover-bg: var(--kl-navy-900); --bs-btn-hover-border-color: var(--kl-navy-900); }

/* ---------- Footer ---------- */
.kl-footer { background: var(--kl-navy-900); color: rgba(255,255,255,.78); font-size: 15px; margin-top: 0; }
.kl-footer .kl-row { background: none !important; padding: 56px 0 32px; }
.kl-footer h1, .kl-footer h2, .kl-footer h3, .kl-footer h4 { color: #fff !important; font-size: 1.05rem; margin: 0 0 1em; letter-spacing: .02em; }
.kl-footer a { color: #fff !important; text-decoration: none; }
.kl-footer a:hover { color: var(--kl-gold) !important; }
.kl-footer ul { list-style: none; padding: 0; margin: 0; }
.kl-footer li { padding: 3px 0; }
.kl-footer-bar { border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.kl-footer-bar-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; padding-bottom: 18px; }
.kl-footer-bar p { margin: 0; }
.kl-footer-menu ul { display: flex; gap: 18px; }

/* Back to top + mobile call bar */
.kl-totop { position: fixed; right: 18px; bottom: 18px; width: 44px; height: 44px; border-radius: 50%; background: var(--kl-navy); box-shadow: var(--kl-shadow); opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 800; }
.kl-totop::before { content: ""; position: absolute; left: 50%; top: 55%; width: 10px; height: 10px; border-left: 2px solid #fff; border-top: 2px solid #fff; transform: translate(-50%, -50%) rotate(45deg); }
.kl-totop.is-visible { opacity: 1; visibility: visible; }
.kl-mobilebar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .kl-menu-link, .kl-menu-item > .kl-nav-label { padding-left: 9px; padding-right: 9px; font-size: 14px; }
  .kl-menu-item.has-children > .kl-menu-link, .kl-menu-item.has-children > .kl-nav-label { padding-right: 22px; }
  .kl-nav-cta .kl-btn-ghost { display: none; }
  .kl-brand img { width: 220px; }
}
@media (max-width: 1100px) {
  .kl-has-left .kl-columns, .kl-has-right .kl-columns, .kl-has-left.kl-has-right .kl-columns { grid-template-columns: minmax(0, 1fr); }
  .kl-sidebar-left { order: 2; }
  .kl-grid { grid-template-columns: repeat(min(var(--cols, 1), 2), minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  html { scroll-padding-top: 76px; }
  .kl-header-inner { min-height: 68px; justify-content: space-between; }
  .kl-brand img { width: 200px; }
  .kl-burger { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 46px; height: 46px; padding: 0 11px; border: 1px solid var(--kl-line); border-radius: 8px; background: #fff; cursor: pointer; }
  .kl-burger span { display: block; height: 2px; background: var(--kl-navy); border-radius: 2px; transition: transform .2s, opacity .2s; }
  .kl-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .kl-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .kl-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .kl-nav { position: fixed; top: 109px; left: 0; right: 0; bottom: 0; z-index: 899; display: block; background: #fff; padding: 8px 20px 120px; overflow-y: auto; transform: translateX(100%); transition: transform .25s ease; visibility: hidden; }
  .kl-nav.is-open { transform: none; visibility: visible; }
  .kl-menu { display: block; }
  .kl-menu-item { border-bottom: 1px solid var(--kl-line); display: grid; grid-template-columns: 1fr 48px; align-items: center; }
  .kl-menu-link, .kl-menu-item > .kl-nav-label { padding: 16px 4px; font-size: 16px; }
  .kl-menu-link::after, .kl-menu-item > .kl-nav-label::after, .kl-menu-item.has-children > .kl-menu-link::before, .kl-menu-item.has-children > .kl-nav-label::before { display: none; }
  .kl-sub-toggle { display: block; width: 48px; height: 48px; border: 0; background: none; position: relative; cursor: pointer; }
  .kl-sub-toggle::before { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-right: 2px solid var(--kl-gold); border-bottom: 2px solid var(--kl-gold); transform: translate(-50%, -70%) rotate(45deg); transition: transform .2s; }
  .kl-sub-toggle[aria-expanded="true"]::before { transform: translate(-50%, -30%) rotate(-135deg); }
  .kl-sub, .kl-menu-item.is-mega > .kl-sub { grid-column: 1 / -1; position: static; width: auto; min-width: 0; transform: none !important; opacity: 1; visibility: visible; display: none; box-shadow: none; border: 0; border-radius: 0; padding: 0 0 12px 8px; }
  .kl-menu-item.is-open > .kl-sub { display: block; }
  .kl-menu-item:hover > .kl-sub { display: none; }
  .kl-menu-item.is-open:hover > .kl-sub { display: block; }
  .kl-mega { display: block; }
  .kl-mega-col:first-child ul { columns: 1; }
  .kl-mega-title { margin-top: 10px; }
  .kl-nav-cta { margin-top: 20px; flex-direction: column; }
  .kl-nav-cta .kl-btn-ghost { display: inline-flex; }
  .kl-nav-cta .kl-btn { width: 100%; padding: 14px; }
  body.kl-nav-open { overflow: hidden; }
  .kl-columns { padding-top: 32px; }
}
@media (max-width: 760px) {
  body.kl-site { font-size: 16px; padding-bottom: 64px; }
  .kl-container { padding: 0 18px; }
  .kl-topbar { font-size: 13px; }
  .kl-topbar-info { display: none !important; }
  .kl-topbar-inner { justify-content: center; }
  .kl-topbar-contact { gap: 14px !important; justify-content: center; }
  .kl-topbar-contact li:not(.kl-lang):not(:last-of-type) { display: none; }
  .kl-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .kl-row { padding: 32px 0; }
  .kl-footer-bar-inner { flex-direction: column; align-items: flex-start; }
  .kl-mobilebar { display: grid; grid-template-columns: 1fr 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; box-shadow: 0 -4px 18px rgba(0, 34, 75, .18); }
  .kl-mobilebar a { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 56px; font-weight: 700; font-size: 16px; text-decoration: none; color: #fff !important; }
  .kl-mobilebar-call { background: var(--kl-gold); }
  .kl-mobilebar-write { background: var(--kl-navy); }
  .kl-totop { bottom: 74px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print { .kl-topbar, .kl-header, .kl-mobilebar, .kl-totop, .kl-footer { display: none !important; } }
