/* Italmebli — main stylesheet */
:root {
  --ink: #16142e;
  --ink-2: #3b3957;
  --muted: #6b6984;
  --line: #e6e3f0;
  --bg: #f7f6fb;
  --paper: #ffffff;
  --accent: #5b3df5;
  --accent-2: #ff7a59;
  --accent-soft: #efebff;
  --night: #14123a;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 20, 46, .06), 0 12px 32px -12px rgba(22, 20, 46, .18);
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 130px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 18px/1.7 var(--serif);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #3a1fd1; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.container--narrow { max-width: 780px; }
.container--wide { max-width: 1040px; }
@media (min-width: 720px) { .container { padding: 0 28px; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; font-family: var(--sans); }
.skip:focus { left: 8px; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--night);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  font-family: var(--sans);
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; padding-top: 12px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand__mark {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #9b5cff 60%, var(--accent-2));
  color: #fff; font: 800 17px/1 var(--sans); letter-spacing: .02em; box-shadow: 0 6px 16px -6px rgba(91, 61, 245, .7);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__tag { font-size: 13px; color: var(--muted); font-weight: 600; }
.main-nav {
  display: flex; flex-wrap: wrap; gap: 4px; width: 100%;
  padding-top: 8px; border-top: 1px solid rgba(255, 255, 255, .08);
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  color: #c9c7e6; text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap;
  padding: 8px 11px; border-radius: 10px; transition: background .2s, color .2s;
}
.main-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.main-nav a[aria-current="page"] { background: rgba(185, 169, 255, .16); color: #fff; }

.lang ul { list-style: none; margin: 0; padding: 4px; display: flex; gap: 2px; border-radius: 12px; }
.lang a {
  display: block; min-width: 42px; text-align: center; padding: 6px 10px; border-radius: 9px;
  font: 700 13px/1.2 var(--sans); letter-spacing: .04em; text-decoration: none; transition: background .2s, color .2s;
}
.lang--header ul, .lang--footer ul { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.lang--header a, .lang--footer a { color: #c9c7e6; }
.lang--header a:hover, .lang--footer a:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.lang--header a[aria-current="true"], .lang--footer a[aria-current="true"] { background: #fff; color: var(--night); }

@media (max-width: 760px) {
  .brand__tag { display: none; }
  .main-nav { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .main-nav a { padding: 6px 10px; font-size: 14px; }
}

/* ---------- Post ---------- */
.post__head { padding-top: 56px; padding-bottom: 28px; }
.crumbs { font: 600 14px/1.4 var(--sans); color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.kicker {
  display: inline-block; margin: 0 0 16px; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font: 700 13px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase;
}
h1, h2, h3 { font-family: var(--sans); color: var(--ink); letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: clamp(30px, 5vw, 48px); font-weight: 800; margin: 0 0 22px; line-height: 1.12; }
.post__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font: 600 14px/1.4 var(--sans); color: var(--muted); }
.post__author { color: var(--ink); }
.dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .5; }

.post__hero { margin-bottom: 12px; }
.post__hero .frame { margin: 0; }

.post__body { padding-top: 36px; padding-bottom: 40px; }
.post__body > p:first-child { font-size: 1.12em; color: var(--ink-2); }
.post__body p { margin: 0 0 1.2em; }
.post__body h2 { font-size: clamp(24px, 3.2vw, 32px); font-weight: 800; margin: 1.9em 0 .7em; }
.post__body h3 { font-size: 21px; font-weight: 700; margin: 1.6em 0 .5em; }
.post__body ul, .post__body ol { padding-left: 0; margin: 0 0 1.4em; list-style: none; counter-reset: li; }
.post__body li {
  position: relative; padding: 14px 18px 14px 52px; margin-bottom: 10px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
}
.post__body ul li::before {
  content: ""; position: absolute; left: 20px; top: 24px; width: 12px; height: 12px; border-radius: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); transform: rotate(45deg);
}
.post__body ol li { counter-increment: li; }
.post__body ol li::before {
  content: counter(li); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; background: var(--ink); color: #fff; font: 800 13px/1 var(--sans);
}
.post__body strong { font-weight: 600; color: var(--ink); }
.post__body blockquote {
  margin: 2em 0; padding: 28px 30px 28px 34px; position: relative; overflow: hidden;
  background: var(--night); color: #ecebff; border-radius: var(--radius); font-size: 1.08em; font-style: italic;
}
.post__body blockquote::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: linear-gradient(var(--accent), var(--accent-2));
}
.post__body blockquote p { margin: 0; }
.callout {
  margin: 2em 0; padding: 22px 24px; border-radius: var(--radius); background: var(--accent-soft);
  border: 1px solid #ddd4ff; font-size: .98em;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- Image frames: fixed ratio, centred, never stretched ---------- */
.frame { margin: 2.2em 0; }
.frame__media {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  border-radius: var(--radius); background: #e9e6f5;
  padding: 0; box-shadow: var(--shadow);
  outline: 1px solid rgba(22, 20, 46, .08); outline-offset: -1px;
}
.frame__media::after {
  content: ""; position: absolute; inset: 8px; border-radius: calc(var(--radius) - 8px);
  border: 1px solid rgba(255, 255, 255, .35); pointer-events: none;
}
.frame__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center center;
}
.frame figcaption { margin-top: 12px; font: 500 14px/1.5 var(--sans); color: var(--muted); text-align: center; }

/* ---------- FAQ ---------- */
.faq { margin-top: 2.6em; }
.faq__item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 14px; }
.faq__item h3 { margin: 0 0 8px; font-size: 19px; }
.faq__item p { margin: 0; color: var(--ink-2); }

/* ---------- Article cards ---------- */
.more { padding: 64px 0 80px; background: linear-gradient(180deg, var(--bg), #eeebfa); border-top: 1px solid var(--line); }
.more__head { max-width: 680px; margin-bottom: 30px; }
.more__head h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; margin: 0 0 8px; }
.more__head p { margin: 0; color: var(--muted); font-family: var(--sans); font-size: 16px; }
.cards { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #e9e6f5; border-bottom: 1px solid var(--line); }
.card__media img { width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform .5s; }
.card:hover .card__media img { transform: scale(1.04); }
.card__body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.card__date { font: 700 12px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.card__title { margin: 0; font-size: 19px; line-height: 1.3; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--accent); }
.card__excerpt { margin: 0; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; flex: 1; }
.card__more { font: 700 14px/1 var(--sans); text-decoration: none; margin-top: 4px; }
.more__back { margin: 36px 0 0; }
.btn {
  display: inline-block; padding: 12px 20px; border-radius: 12px; background: var(--ink); color: #fff;
  font: 700 15px/1 var(--sans); text-decoration: none;
}
.btn:hover { background: var(--accent); color: #fff; }

/* ---------- Footer ---------- */
.site-footer { background: var(--night); color: #c9c7e6; font-family: var(--sans); font-size: 15px; line-height: 1.65; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: #b9a9ff; }
.site-footer__grid { display: grid; gap: 36px; padding-top: 56px; padding-bottom: 44px; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 860px) { .site-footer__grid { grid-template-columns: 1fr; } }
.brand--light, .brand--light:hover { color: #fff; }
.brand--light .brand__tag { color: #9c9ac0; }
.site-footer__about p { margin: 18px 0 0; max-width: 440px; }
.site-footer__title { color: #fff; font-size: 14px; letter-spacing: .1em; text-transform: uppercase; margin: 6px 0 16px; }
.site-footer__links, .site-footer__contacts { list-style: none; margin: 0; padding: 0; }
.site-footer__links li { margin-bottom: 10px; }
.site-footer__contacts li { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ico { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: rgba(255, 255, 255, .08); color: #b9a9ff; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .1); }
.site-footer__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; }
.site-footer__bar p { margin: 0; color: #9c9ac0; font-size: 14px; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .post__head { padding-top: 32px; }
  .post__body li { padding: 12px 14px 12px 44px; }
  .post__body ul li::before { left: 17px; top: 22px; }
  .post__body ol li::before { left: 10px; top: 12px; }
  .post__body blockquote { padding: 22px 20px 22px 26px; }
  .frame__media { border-radius: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .card__media img { transition: none; }
}
