/* ============================================================
   ГО «Спілка майстрів мистецтва» — styles.css
   Тепла нейтральна база + один акцент (теракота).
   Шрифти: Lora (заголовки), Manrope (текст/UI) — з кирилицею.
   ============================================================ */

/* ---------- 1. Токени ---------- */
:root {
  --bg:            #F7F3EC;   /* тепла кремова база */
  --bg-alt:        #F1EADD;   /* злегка темніша секція */
  --surface:       #FFFFFF;   /* картки */
  --ink:           #241F1A;   /* основний текст */
  --muted:         #6B6258;   /* другорядний текст */
  --line:          #E6DDD0;   /* лінії/бордюри */
  --accent:        #A9502F;   /* теракота — єдиний акцент */
  --accent-dark:   #8A3D22;   /* ховер */
  --accent-soft:   #F3E4DC;   /* світлий фон акценту */
  --focus:         #2f6fb0;   /* контур фокусу (a11y) */

  --maxw:          1140px;
  --radius:        14px;
  --radius-sm:     10px;
  --shadow:        0 1px 2px rgba(36,31,26,.04), 0 8px 24px rgba(36,31,26,.06);
  --shadow-lg:     0 12px 40px rgba(36,31,26,.12);

  --font-head:     "Lora", Georgia, "Times New Roman", serif;
  --font-body:     "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- 2. Reset / база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--ink); font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.15rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
li { margin-bottom: .4em; }
strong { font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* Доступність: видимий фокус */
a:focus-visible, button:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip-link для клавіатури */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; color:#fff; text-decoration:none; }

/* ---------- 3. Розкладка ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 64px 0; }
.section--alt { background: var(--bg-alt); }
.section--tight { padding: 40px 0; }
.narrow { max-width: 760px; }
.center { text-align: center; }
.eyebrow {
  display: inline-block; font-family: var(--font-body); font-weight: 700;
  font-size: .8rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent); margin-bottom: .75rem;
}
.lead { font-size: 1.18rem; color: var(--muted); }
.section-head { max-width: 720px; margin-bottom: 2.5rem; }
.section-head.center { margin-left: auto; margin-right: auto; }

/* ---------- 4. Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-body); font-weight: 700; font-size: 1rem;
  padding: .8rem 1.5rem; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
  text-decoration: none; line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; text-decoration: none; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); text-decoration: none; }
.btn--on-dark { background: #fff; color: var(--ink); border-color: #fff; }
.btn--on-dark:hover { background: transparent; color: #fff; border-color: #fff; text-decoration:none; }
.btn--lg { padding: 1rem 1.9rem; font-size: 1.05rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------- 5. Хедер ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247,243,236,.9);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 70px; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-head); font-weight: 700; color: var(--ink); font-size: 1.05rem; text-decoration: none; margin-right: auto; }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand__mark { width: 38px; height: 38px; flex: none; border-radius: 9px; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__text small { font-family: var(--font-body); font-weight: 600; font-size: .68rem; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: .3rem; }
.nav a {
  color: var(--ink); font-weight: 600; font-size: .97rem;
  padding: .5rem .7rem; border-radius: 8px; text-decoration: none; white-space: nowrap;
}
.nav a:hover { background: var(--accent-soft); color: var(--accent-dark); }
/* Підсвітка активного пункту — але НЕ для кнопки-CTA:
   інакше текст стає теракотовим на теракотовому тлі й зникає. */
.nav a[aria-current="page"]:not(.btn) { color: var(--accent); }
.header-cta { margin-left: .4rem; }

.nav-toggle {
  display: none; margin-left: auto; width: 46px; height: 46px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 22px; height: 2px; background: var(--ink);
  position: relative; transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle span::before { position: absolute; top: -7px; }
.nav-toggle span::after  { position: absolute; top: 7px; }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 6. Hero ---------- */
.hero { padding: 72px 0 60px; position: relative; overflow: hidden; }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero h1 { margin-bottom: .4em; }
.hero .lead { margin-bottom: 1.6rem; max-width: 34ch; }
.hero__media { position: relative; }

/* ---------- 7. Плейсхолдер для фото ---------- */
.imgph {
  position: relative; display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(45deg, #efe6d6 0 14px, #ece1cf 14px 28px);
  color: var(--muted); border-radius: var(--radius); border: 1px dashed #d8cab2;
  font-size: .82rem; text-align: center; padding: 1rem; min-height: 220px;
  font-weight: 600; letter-spacing: .02em;
}
.imgph--tall { min-height: 420px; }
.imgph--wide { aspect-ratio: 16/9; min-height: 0; }
.imgph--card { aspect-ratio: 4/3; min-height: 0; border-radius: var(--radius) var(--radius) 0 0; }
.imgph span { display:block; opacity:.85; }

/* ---------- Реальні зображення ---------- */
.media-img {
  width: 100%; display: block; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.media-img--wide { aspect-ratio: 16 / 9; }
.media-img--hero { height: clamp(320px, 52vh, 520px); }

/* ---------- 8. Картки / сітки ---------- */
.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow); height: 100%;
  display: flex; flex-direction: column;
}
.card h3 { margin-bottom: .4rem; }
.card p { color: var(--muted); margin-bottom: 1rem; }
.card .card__link { margin-top: auto; font-weight: 700; }
.card__icon {
  width: 46px; height: 46px; border-radius: 11px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem; flex: none;
}
.card__icon svg { width: 24px; height: 24px; }

/* Медіа-картка (заходи) */
.card--media { padding: 0; overflow: hidden; }
.card--media .card__body { padding: 20px 22px 24px; display:flex; flex-direction:column; flex:1; }
.card__img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.card__meta { font-size: .82rem; font-weight: 700; color: var(--accent); letter-spacing: .03em; text-transform: uppercase; margin-bottom: .5rem; }
/* Тег заходу: обгортає текст і притискається донизу — щоб теги вирівнялись між картками */
.card__body .tag { align-self: flex-start; margin-top: auto; }

/* Список кроків */
.steps { display: grid; gap: 18px; counter-reset: step; }
.steps--row { grid-template-columns: repeat(4, 1fr); }
.step {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; position: relative;
}
.step__num {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; background: var(--accent); color: #fff;
  font-family: var(--font-head); font-weight: 700; margin-bottom: .8rem;
}
.step h3 { font-size: 1.08rem; }
.step p { color: var(--muted); margin: 0; font-size: .96rem; }

/* Вбудована карта */
.map-embed { display: block; width: 100%; border: 0; border-radius: var(--radius); box-shadow: var(--shadow); }

/* Керівництво / персона */
.person { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
.person__photo { min-height: 260px; border-radius: var(--radius); }
.person__photo img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius); }
.person__body h3 { margin-bottom: .25rem; }
.person__role { color: var(--accent); font-weight: 700; margin-bottom: .9rem; }
@media (max-width: 640px) {
  .person { grid-template-columns: 1fr; gap: 18px; }
  .person__photo { min-height: 220px; max-width: 260px; }
}

/* Секція-фіча (текст + медіа) */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; align-items: center; }
.feature--reverse .feature__media { order: -1; }

/* Смуга-виноска */
.callout {
  background: var(--accent-soft); border: 1px solid #e7cdbf; border-left: 4px solid var(--accent);
  border-radius: var(--radius-sm); padding: 20px 24px; margin: 1.5rem 0;
}
.callout p:last-child { margin-bottom: 0; }
.callout strong { color: var(--accent-dark); }

/* CTA-стрічка */
.ctaband { background: var(--ink); color: #F3ECE1; border-radius: 20px; padding: 48px; text-align: center; }
.ctaband h2 { color: #fff; }
.ctaband p { color: #d6ccbe; max-width: 52ch; margin: 0 auto 1.6rem; }
.ctaband .btn-row { justify-content: center; }

/* Список фактів (про/контакти) */
.factlist { list-style: none; padding: 0; margin: 0; }
.factlist li { display: flex; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--line); margin: 0; }
.factlist li:last-child { border-bottom: 0; }
.factlist dt, .factlist .k { font-weight: 700; min-width: 190px; flex: none; }
.factlist .v { color: var(--muted); }

/* ---------- 9. Форми ---------- */
.form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 700; margin-bottom: .35rem; font-size: .95rem; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: .7rem .85rem;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 130px; resize: vertical; }
.field .hint { font-size: .82rem; color: var(--muted); margin-top: .3rem; }
.form__note { font-size: .85rem; color: var(--muted); margin-top: .4rem; }
.form-status { margin-top: 1rem; font-weight: 600; display: none; }
.form-status.is-visible { display: block; }
.form-status.ok { color: #2e7d32; }
.form-status.err { color: #c62828; }

/* ---------- 10. Хлібні крихти ---------- */
.crumbs { font-size: .88rem; color: var(--muted); padding: 18px 0 0; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--ink); }

/* Заголовок сторінки */
.page-head { padding: 46px 0 8px; }
.page-head .lead { margin-top: .3rem; }

/* ---------- 11. Футер ---------- */
.site-footer { background: #211C18; color: #cfc5b7; margin-top: 72px; padding: 56px 0 28px; }
.site-footer a { color: #e7ddce; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; }
.footer-brand .brand { color: #fff; margin-bottom: 1rem; }
.footer-brand .brand small { color: #b3a897; }
.footer-brand p { color: #b3a897; font-size: .93rem; max-width: 38ch; }
.footer-col h4 { color: #fff; font-family: var(--font-body); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 1rem; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: .55rem; }
.footer-col a { font-size: .95rem; }
.footer-social { display: flex; gap: .6rem; margin-top: .4rem; }
.footer-social a { width: 40px; height: 40px; border: 1px solid #453d34; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.footer-social a:hover { background: #2e2822; }
.footer-social svg { width: 20px; height: 20px; }
.footer-bottom { border-top: 1px solid #3a332c; margin-top: 40px; padding-top: 22px; font-size: .85rem; color: #9c9081; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }
.footer-legal { max-width: 60ch; }

/* ---------- 12. Cookie-нотіс ---------- */
.cookie {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200;
  max-width: 620px; margin: 0 auto; background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); border-radius: var(--radius);
  padding: 18px 20px; display: none; gap: 14px; align-items: center; flex-wrap: wrap;
}
.cookie.is-visible { display: flex; }
.cookie p { margin: 0; font-size: .9rem; color: var(--muted); flex: 1 1 260px; }
.cookie .btn { padding: .5rem 1.1rem; font-size: .9rem; }

/* ---------- 13. Дрібне ---------- */
.tag { display: inline-block; background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; padding: .25rem .6rem; border-radius: 999px; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-muted { color: var(--muted); }
.visually-hidden { position:absolute!important; width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap; }

/* ---------- 14. Адаптив ---------- */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; gap: 32px; }
  .hero__media { order: -1; }
  .feature { grid-template-columns: 1fr; gap: 28px; }
  .feature--reverse .feature__media { order: 0; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .steps--row { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 992px) {
  /* Мобільне меню */
  .nav-toggle { display: flex; }
  .nav {
    position: fixed; inset: 70px 0 auto 0; flex-direction: column; align-items: stretch; z-index: 99;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 20px 20px;
    gap: .2rem; box-shadow: var(--shadow-lg); transform: translateY(-8px); opacity: 0;
    pointer-events: none; transition: opacity .18s ease, transform .18s ease; max-height: calc(100vh - 70px); overflow-y: auto;
  }
  .nav.is-open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .nav a { padding: .8rem .6rem; font-size: 1.05rem; border-radius: 8px; }
  .header-cta { margin: .6rem 0 0; }
  .header-cta .btn { width: 100%; justify-content: center; }
  .brand__text small { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 48px 0; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .steps--row { grid-template-columns: 1fr; }
  .ctaband { padding: 32px 22px; }
  .factlist li { flex-direction: column; gap: .1rem; }
  .factlist dt, .factlist .k { min-width: 0; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* Друк / доступність руху */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
