/* Y-Partner — main stylesheet */

:root {
  --navy: #0e1a2b;
  --navy-2: #16253b;
  --navy-3: #1f3250;
  --ink: #1a2230;
  --text: #2c3544;
  --muted: #5d6878;
  --line: #e2e6ee;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --accent: #f2a623;
  --accent-ink: #9a5a00;
  --blue: #3d6df2;
  --radius: 16px;
  --shadow: 0 10px 30px -12px rgba(14, 26, 43, .22);
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.7 var(--font-body);
  overflow-x: hidden;
}

img { max-width: 100%; }
a { color: var(--blue); }
a:hover { color: #2350c8; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 840px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--accent); color: var(--navy); padding: 10px 16px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}

.header__inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 68px;
}

.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: #fff; text-decoration: none; margin-right: auto;
}
.logo:hover { color: #fff; }
.logo__mark {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #ff7a45);
  color: var(--navy); font: 800 22px/1 var(--font-head);
}
.logo__text { font: 800 20px/1.1 var(--font-head); letter-spacing: .2px; }
.logo__text small {
  display: block; margin-top: 3px;
  font: 500 12px/1.2 var(--font-body); color: #9fb0c8; letter-spacing: 0;
}

/* Language switcher */
.lang ul { display: flex; gap: 4px; margin: 0; padding: 4px; list-style: none; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.lang a {
  display: block; min-width: 42px; padding: 6px 10px; border-radius: 999px;
  color: #cfd9e8; text-align: center; text-decoration: none;
  font: 700 13px/1.2 var(--font-head); letter-spacing: .5px;
}
.lang a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.lang a.is-active { background: var(--accent); color: var(--navy); }

.nav-toggle {
  display: none;
  width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px;
  background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer;
  position: relative;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: ""; position: absolute; left: 12px; width: 20px; height: 2px; border-radius: 2px; background: currentColor;
  transition: transform .2s, opacity .2s;
}
.nav-toggle__bar { top: 21px; }
.nav-toggle__bar::before { left: 0; top: -6px; }
.nav-toggle__bar::after { left: 0; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(6px) rotate(45deg); background: #fff; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-6px) rotate(-45deg); background: #fff; }

.site-nav { background: var(--navy-2); border-top: 1px solid rgba(255, 255, 255, .06); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 auto; padding-top: 8px; padding-bottom: 8px; list-style: none; }
.site-nav a {
  display: block; padding: 8px 14px; border-radius: 10px;
  color: #d5deeb; text-decoration: none; font: 600 15px/1.3 var(--font-head);
}
.site-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.site-nav a[aria-current="page"] { color: var(--accent); background: rgba(242, 166, 35, .12); }

/* ---------- Article ---------- */

.article { padding: 32px 0 56px; }

.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: #a6afbd; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--blue); text-decoration: underline; }

.article__header { margin-bottom: 26px; }

.tag {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: rgba(242, 166, 35, .16); color: var(--accent-ink);
  font: 700 12px/1.4 var(--font-head); letter-spacing: .6px; text-transform: uppercase;
}

h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.25; }

.article h1 {
  margin: 14px 0 14px;
  font-size: clamp(28px, 4.4vw, 44px); font-weight: 800; letter-spacing: -.5px;
  overflow-wrap: break-word;
}

.meta { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font-size: 15px; }

/* Framed images: fixed 16:9 box, image centered and never stretched */
.frame {
  margin: 0 0 32px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: calc(var(--radius) - 6px);
  background: var(--navy-2);
}

.toc {
  margin: 0 0 32px; padding: 20px 24px;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 12px;
}
.toc__title { margin: 0 0 8px; font: 800 16px/1.3 var(--font-head); color: var(--ink); }
.toc ol { margin: 0; padding-left: 22px; }
.toc li { margin: 4px 0; font-size: 15.5px; line-height: 1.5; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--blue); text-decoration: underline; }

/* Prose */
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { margin: 1.9em 0 .7em; font-size: clamp(23px, 3vw, 30px); font-weight: 800; letter-spacing: -.3px; }
.prose h3 { margin: 1.5em 0 .5em; font-size: 21px; font-weight: 700; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.3em; padding-left: 0; list-style: none; }
.prose li { position: relative; margin: 0 0 .7em; padding-left: 32px; }
.prose ul > li::before {
  content: ""; position: absolute; left: 8px; top: .62em;
  width: 9px; height: 9px; border-radius: 3px; background: var(--accent); transform: rotate(45deg);
}
.prose ol { counter-reset: item; }
.prose ol > li { counter-increment: item; }
.prose ol > li::before {
  content: counter(item); position: absolute; left: 0; top: .2em;
  display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%;
  background: var(--navy); color: #fff; font: 700 12.5px/1 var(--font-head);
}
.prose .frame { margin: 2em 0; }

.prose blockquote {
  position: relative; margin: 2em 0; padding: 26px 28px 26px 30px;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 100%);
  border-radius: var(--radius); color: #e9eef6;
  font: 500 19px/1.6 var(--font-head);
}
.prose blockquote::before {
  content: ""; position: absolute; left: 0; top: 22px; bottom: 22px; width: 4px; border-radius: 0 4px 4px 0; background: var(--accent);
}
.prose blockquote p { margin: 0; }

.callout {
  margin: 1.8em 0; padding: 18px 22px;
  background: #fff8ea; border: 1px solid #f6dca8; border-radius: 12px;
}
.callout p:last-child { margin-bottom: 0; }

.table-wrap { margin: 1.6em 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.prose table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.prose th, .prose td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: #eef2f8; color: var(--ink); font: 700 14.5px/1.4 var(--font-head); }
.prose tr:last-child td { border-bottom: 0; }

.btn {
  display: inline-block; padding: 12px 22px; border-radius: 12px;
  background: var(--navy); color: #fff; text-decoration: none; font: 700 15px/1.2 var(--font-head);
}
.btn:hover { background: var(--navy-3); color: #fff; }

/* ---------- Related article cards ---------- */

.related { padding: 56px 0 72px; background: #e9edf4; border-top: 1px solid var(--line); }
.related__title { margin: 0 0 26px; font-size: clamp(24px, 3vw, 32px); font-weight: 800; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }

.card { display: flex; }
.card__link {
  display: flex; flex-direction: column; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none; overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card__link:hover { color: inherit; transform: translateY(-4px); box-shadow: var(--shadow); }
.card__media { margin: 0; padding: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.card__media img { border-radius: 0; }
.card__body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1; padding: 18px 20px 22px; }
.card__title { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.35; color: var(--ink); }
.card__excerpt { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
.card__more { margin-top: auto; padding-top: 6px; color: var(--blue); font: 700 14.5px/1.3 var(--font-head); }
.card__link:hover .card__more { text-decoration: underline; }

/* ---------- Footer ---------- */

.site-footer { color: #c3cedd; }
.footer__top { background: var(--navy-2); }
.footer__top-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 28px; padding-top: 22px; padding-bottom: 22px; }
.logo--footer { margin-right: 0; }
.footer__nav { flex: 1; }
.footer__nav ul { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0; padding: 0; list-style: none; }
.footer__nav a { color: #c3cedd; text-decoration: none; font: 600 14.5px/1.6 var(--font-head); }
.footer__nav a:hover, .footer__nav a[aria-current="page"] { color: var(--accent); }

.footer__bottom { background: var(--navy); padding: 26px 0 30px; font-size: 14.5px; line-height: 1.65; }
.footer__about { max-width: 900px; margin: 0 0 12px; }
.footer__copy { margin: 0; color: #8495ad; font-size: 13.5px; }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: 12px 14px; }
  .logo__text small { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }
  .container { padding: 0 16px; }
  .header__inner { gap: 10px; min-height: 62px; }
  .logo__mark { width: 36px; height: 36px; font-size: 20px; }
  .logo__text { font-size: 18px; }
  .lang a { min-width: 36px; padding: 6px 7px; font-size: 12px; }
  .article { padding: 22px 0 40px; }
  .frame:not(.card__media) { padding: 5px; border-radius: 12px; }
  .frame:not(.card__media) img { border-radius: 8px; }
  .toc { padding: 16px 18px; }
  .prose blockquote { padding: 20px 20px 20px 24px; font-size: 17px; }
  .cards { grid-template-columns: 1fr; gap: 18px; }
  .related { padding: 40px 0 52px; }
  .footer__top-inner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card__link { transition: none; }
}
