/* ============================================================
   Maryna Zagorodnia — site styles
   Palette: warm cream background, soft heather accent.
   ============================================================ */

:root {
  --bg:      #FAF6F0;   /* warm cream */
  --surface: #FFFFFF;
  --ink:     #33302B;   /* warm near-black */
  --muted:   #6B655C;
  --accent:  #8A6FA0;   /* soft heather / plum */
  --accent-2:#B07A57;   /* terracotta */
  --line:    #E7DFD4;

  --header-h: 132px;    /* updated by JS to the real header height */
  --maxw: 1080px;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin: 0 0 .6em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin: 0 0 .5em; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); margin: 1.4em 0 .4em; color: var(--accent); }
p  { margin: 0 0 1.1em; }

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

blockquote {
  margin: 1.4em 0;
  padding: .8em 1.4em;
  border-left: 3px solid var(--accent);
  background: rgba(138, 111, 160, 0.06);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--muted);
}
blockquote p { margin: 0 0 .4em; }
blockquote p:last-child { margin: 0; }
blockquote cite { font-size: .9rem; font-style: normal; color: var(--muted); }

/* ---------- Language toggle (CSS-driven, instant) ---------- */
/* Two rules only. Each element keeps its natural display value when shown. */
body:not(.lang-uk) .lang-uk { display: none; }
body.lang-uk       .lang-en { display: none; }

/* Blog is Ukrainian-only */
body:not(.lang-uk) .blog-only { display: none; }

/* ============================================================
   HEADER (sticky)
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 24px 14px;
  text-align: center;
  user-select: none;
}

.brand {
  display: inline-block;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
}
.brand:hover { color: var(--ink); }

/* Flags pinned top-right */
.lang-toggle {
  position: absolute;
  top: 18px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flag {
  background: none;
  border: 0;
  padding: 2px;
  cursor: pointer;
  border-radius: 3px;
  line-height: 0;
  opacity: .55;
  transition: opacity .2s ease, transform .2s ease;
}
.flag svg { border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
.flag:hover { opacity: 1; transform: translateY(-1px); }
body.lang-en .flag-en,
body.lang-uk .flag-uk { opacity: 1; }
.lang-sep { color: var(--line); }

/* Main nav */
.main-nav {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 26px;
}
.main-nav a {
  position: relative;
  color: var(--muted);
  font-weight: 500;
  font-size: 1.02rem;
  padding: 2px 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform .22s ease;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a.active { color: var(--ink); }
.main-nav a.active::after { transform: scaleX(1); }

/* Services sub-nav: hidden unless on services view */
.sub-nav {
  display: none;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
body.view-services .sub-nav { display: flex; }
.sub-nav a {
  position: relative;
  color: var(--muted);
  font-size: .95rem;
  padding: 2px 0;
}
.sub-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transition: transform .22s ease;
}
.sub-nav a:hover { color: var(--ink); }
.sub-nav a.active { color: var(--ink); }
.sub-nav a.active::after { transform: scaleX(1); }
.sub-sep { display: none; }

/* Blog sub-nav — same structure as services sub-nav */
.blog-sub-nav {
  display: none;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 26px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
body.view-blog .blog-sub-nav { display: flex; }
.blog-link {
  position: relative;
  color: var(--muted);
  font-size: .95rem;
  padding: 2px 0;
}
.blog-link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -3px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transition: transform .22s ease;
}
.blog-link:hover { color: var(--ink); }
.blog-link.active { color: var(--ink); }
.blog-link.active::after { transform: scaleX(1); }

.blog-item { display: none; }

/* ============================================================
   SECTIONS / LAYOUT
   ============================================================ */
.section { display: none; }
.section.is-active { display: block; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 24px 80px;
}
.wrap-narrow { max-width: 720px; }

.row { margin-bottom: 48px; }
.row:last-child { margin-bottom: 0; }

/* Two-column: text + media */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.one-col { max-width: 760px; }

/* Credentials / training list */
.creds { padding-left: 1.2em; margin: 0 0 1.1em; }
.creds li { margin-bottom: .25em; }
.creds li::marker { color: var(--accent); }

.col-media .framed {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(51, 48, 43, 0.12);
}

.service { display: none; }

.blog-item { margin-bottom: 64px; }
.blog-item:last-child { margin-bottom: 0; }

/* ---------- Learn More / Show Less details toggle ---------- */
.service-details { margin: 1.4em 0 0; text-align: center; }
.service-details summary {
  display: inline-block;
  list-style: none;
  cursor: pointer;
  border: 2px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 999px;
  padding: 10px 22px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  user-select: none;
  transition: background .2s ease, color .2s ease;
}
.details-body { text-align: left; }
.service-details summary::-webkit-details-marker { display: none; }
.service-details summary::marker { display: none; }
.service-details summary:hover { background: var(--accent); color: #fff; }
.service-details:not([open]) .text-less { display: none; }
.service-details[open] .text-more { display: none; }
.details-body { padding-top: 1.2em; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 1rem;
  border: 0;
  cursor: pointer;
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.btn:hover {
  color: #fff;
  background: var(--accent-2);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(138, 111, 160, 0.28);
}

/* ============================================================
   CONTACT FORM
   ============================================================ */
#contact-form label {
  display: block;
  margin: 22px 0 8px;
  font-weight: 500;
  color: var(--ink);
}
#contact-form input,
#contact-form textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
#contact-form input:focus,
#contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(138, 111, 160, 0.18);
}
#contact-form textarea { resize: vertical; }
.btn-send { margin-top: 24px; }
.form-status { margin-top: 16px; min-height: 1.4em; font-size: .98rem; }
.form-status.ok  { color: #4f7a4f; }
.form-status.err { color: #b3503e; }

/* ============================================================
   YOUTUBE FACADE (click to load — keeps page fast)
   ============================================================ */
.yt {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: linear-gradient(135deg, #6f5a82, #b07a57);
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 30px rgba(51, 48, 43, 0.12);
}
.yt-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 68px; height: 48px;
  background: rgba(0,0,0,.55);
  border-radius: 12px;
  transition: background .2s ease, transform .2s ease;
}
.yt-play::after {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-40%, -50%);
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent #fff;
}
.yt:hover .yt-play { background: #c8102e; transform: translate(-50%, -50%) scale(1.06); }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
  padding: 28px 24px;
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 760px) {
  body { font-size: 17px; }
  .two-col { grid-template-columns: 1fr; gap: 28px; }
  .col-media { order: -1; }              /* image above text on mobile */
  .lang-toggle { top: 14px; right: 16px; }
  .wrap { padding: 40px 18px 64px; }
}

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover, .flag:hover { transform: none; }
}
