/* ==========================================================================
   Електронни покани — /pokana/ и страниците по теми (invitation.php).
   Цветовете идват от темата като CSS променливи:
     --inv-1 основен · --inv-2 тъмен/контраст · --inv-3 акцент
     --inv-soft лек тон на основния (изчислява се в шаблона)
   ========================================================================== */

/* ---------- HUB: /pokana/ ---------- */

.inv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.inv-card {
  position: relative;
  display: block;
  background: var(--bg-white);
  border: 2px solid var(--line);
  border-radius: var(--r, 20px);
  padding: 26px 22px 24px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.inv-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--inv-1);
}

.inv-card:hover {
  transform: translateY(-6px);
  border-color: var(--inv-1);
  box-shadow: 0 16px 34px rgba(18, 48, 90, 0.14);
}

.inv-card__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--inv-2);
  color: var(--inv-3);
  margin-bottom: 16px;
}

.inv-card__badge .icon { width: 26px; height: 26px; }

/* Героят на темата — голяма прозрачна картинка върху лек тематичен фон. */
.inv-card__char {
  display: block;
  width: 100%;
  height: 210px;
  object-fit: contain;
  object-position: center bottom;
  padding: 14px 14px 0;
  margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--inv-soft, rgba(47, 143, 224, 0.07)) 0%, transparent 70%);
}

/* Фото-темата отпадна — всички стилове са прозрачни PNG герои. */

.inv-card__swatches {
  position: absolute;
  top: 26px;
  right: 20px;
  display: flex;
}

.inv-card__swatches i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  margin-left: -6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.inv-card__title {
  font-size: 1.35rem;
  margin: 0 0 6px;
  color: var(--c-navy);
}

.inv-card__tag {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--inv-2);
  margin: 0 0 10px;
}

.inv-card__about {
  font-size: 0.96rem;
  line-height: 1.55;
  color: var(--c-ink-2);
  margin: 0 0 18px;
}

.inv-card__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  color: var(--inv-2);
}

.inv-card__go .icon { width: 18px; height: 18px; }
.inv-card:hover .inv-card__go .icon { transform: translateX(4px); transition: transform 0.2s ease; }

/* Форма „Направи покана" — най-горе на хъба */
.inv-builder {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 34px;
  align-items: start;
}

.inv-builder__intro h2 { margin: 12px 0 14px; color: var(--c-navy); }
.inv-builder__intro p { color: var(--c-ink-2); line-height: 1.65; margin: 0 0 18px; }

.inv-builder__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.inv-builder__list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 700;
  color: var(--c-ink);
}

.inv-builder__list .icon {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--c-mint, #2fd48f);
  margin-top: 2px;
}

.inv-form { box-shadow: 10px 10px 0 rgba(18, 48, 90, 0.15); }

.inv-form__themes { border: 0; padding: 0; margin: 0 0 4px; }

.inv-form__themes legend {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 9px;
  color: var(--c-ink);
  padding: 0;
}

.inv-form__themes .req { color: var(--c-coral); }

.inv-form__themes-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
}

.inv-form__theme {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-cream);
  border: 2px solid var(--line);
  border-radius: var(--r-sm, 12px);
  padding: 11px 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.25;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.inv-form__theme i {
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--inv-1) 0 50%, var(--inv-2) 50% 100%);
  box-shadow: 0 0 0 2px #fff inset;
}

/* Героят на темата в полето за избор. */
.inv-form__theme-img {
  width: 52px;
  height: 56px;
  flex: none;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 2px 3px rgba(18, 48, 90, 0.18));
}

.inv-form__theme input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.inv-form__theme:hover { border-color: var(--inv-1); }

.inv-form__theme:has(input:checked) {
  border-color: var(--inv-1);
  background: #fff;
  box-shadow: 0 0 0 3px var(--inv-soft, rgba(47, 143, 224, 0.16));
}

.inv-form__theme:has(input:focus-visible) {
  outline: 3px solid var(--c-blue);
  outline-offset: 2px;
}

/* Стъпки „как работи" */
.inv-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.inv-step {
  background: var(--bg-white);
  border-radius: var(--r, 20px);
  padding: 28px 24px;
  box-shadow: var(--sh-sm);
  text-align: center;
}

.inv-step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--inv-1, var(--c-blue));
  color: #fff;
  font-family: var(--f-display);
  font-size: 1.3rem;
  margin-bottom: 14px;
}

.inv-step h3 { margin: 0 0 8px; font-size: 1.15rem; color: var(--c-navy); }
.inv-step p { margin: 0; color: var(--c-ink-2); line-height: 1.6; }

/* ---------- СТРАНИЦА НА ПОКАНАТА ---------- */

/* Hero */
/* Hero — тъмната половина е отляво (където е текстът), тематичният цвят
   влига от дясно: бял текст се чете на всяка палитра, включително жълтата. */
.inv-hero {
  position: relative;
  background: linear-gradient(110deg, var(--inv-2) 0%, var(--inv-2) 46%, var(--inv-1) 100%);
  color: #fff;
  padding: 46px 0 62px;
  overflow: hidden;
}

.inv-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--inv-1);
  opacity: 0.3;
  pointer-events: none;
}

.inv-hero .container { position: relative; z-index: 1; }

/* Текстът винаги е отпред на героя. */
.inv-hero .inv-crumb,
.inv-hero .eyebrow,
.inv-hero h1,
.inv-hero .inv-badges,
.inv-hero .btn-row {
  position: relative;
  z-index: 1;
}

.inv-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
  margin-bottom: 24px;
  opacity: 0.85;
}

.inv-crumb a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.inv-crumb a:hover { opacity: 0.8; }

.eyebrow--light {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.inv-hero h1 {
  font-family: var(--f-display);
  /* 7.5vw, а не 5vw: на 390px вторият ред („Александра става на 7“) трябва
     да се събере в колоната, иначе възрастта пада на отделен ред.
     В горния край 3.2rem, не 3.4rem — при 900–920px дясното поле на
     героя стеснява колоната под 604px и редът пак се пренасяше. */
  font-size: clamp(1.5rem, 7.5vw, 3.2rem);
  line-height: 1.12;
  margin: 16px 0 30px;
  color: #fff;
  max-width: 26ch;
}

/* Първият ред — поканата, вторият — името. Трябват се да изглеждат различно,
   затова редът с поканата е на друг шрифт, по-голям отпреди, но пак по-малък
   от името, и по-широко разстояние между буквите; между двата реда има и
   отстояние — и на телефон, и на десктоп. Цветът е чисто бял, не прозрачен:
   при темите със светъл градиент (Ледена, Подводно) полупрозрачният падаше
   под 4.5:1 на най-светлото място под текста. */
.inv-hero__lead {
  display: block;
  margin-bottom: 16px;
  font-family: var(--f-body);
  font-size: clamp(1.15rem, 4.6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: #fff;
}

.inv-hero__name {
  display: block;
  font-weight: 700;
}

/* Героят на темата — на малък екран е ред над баджовете,
   на голям излиза вдясно и гледа към текста. */
.inv-hero__char {
  display: block;
  width: auto;
  height: 170px;
  margin: 0 auto 20px;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 14px 22px rgba(10, 24, 48, 0.35));
}

@media (min-width: 900px) {
  .inv-hero .container {
    padding-right: clamp(240px, 30%, 420px);
  }

  .inv-hero__char {
    position: absolute;
    right: 0;
    bottom: 0;
    height: 100%;
    max-height: 470px;
    width: auto;
    max-width: 42%;
    margin: 0;
    z-index: 0;
  }
}

.inv-badges { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.inv-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.95rem;
}

.inv-badge .icon { width: 18px; height: 18px; color: var(--inv-3); }

/* Адресът в hero-то е линк към Google Maps (нов прозорец). */
a.inv-badge {
  color: inherit;
  text-decoration: none;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

a.inv-badge:hover,
a.inv-badge:focus-visible {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
}

a.inv-badge .inv-badge__maps { width: 16px; height: 16px; margin-left: 4px; opacity: 0.85; }

.btn--inv {
  background: var(--inv-3);
  color: var(--inv-2);
  border: 2px solid var(--inv-3);
}

.btn--inv:hover { filter: brightness(1.06); transform: translateY(-2px); }

.btn--inv-ghost {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.btn--inv-ghost:hover { background: rgba(255, 255, 255, 0.14); }

.btn--inv-ghost.is-done { background: rgba(255, 255, 255, 0.26); border-color: #fff; }

/* Обратно броене */
.section--inv-soft { background: var(--inv-soft, var(--bg-cream)); }

.inv-count {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 130px));
  justify-content: center;
  gap: 16px;
}

.inv-count__box {
  background: #fff;
  border-radius: var(--r, 20px);
  padding: 18px 8px 14px;
  text-align: center;
  box-shadow: var(--sh-sm);
  border-top: 5px solid var(--inv-1);
}

.inv-count__box b {
  display: block;
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1;
  color: var(--inv-2);
}

.inv-count__box span { font-size: 0.9rem; font-weight: 700; color: var(--c-ink-2); }

.inv-count__note {
  text-align: center;
  font-weight: 700;
  color: var(--c-ink-2);
  margin: 16px 0 0;
}

/* Детайли — факти с цвета на темата (само 1 и 2: c3 е бяло при някои
   палитри и би изчезнало на белия фон) */
.inv .fact { border-bottom-color: var(--inv-1); }
.inv .fact:nth-child(4n + 2) { border-bottom-color: var(--inv-2); }
.inv .fact:nth-child(4n + 3) { border-bottom-color: var(--inv-1); }
.inv .fact:nth-child(4n + 4) { border-bottom-color: var(--inv-2); }
.inv .fact__value { color: var(--inv-2); }

/* Иконката в етикета — на същия ред с текста и центрирана с него.
   Общото `svg { display: block }` я слагаше сама на ред отляво,
   заради което „датата и часът“ изглеждаха нецентрирани. */
.inv .fact__label svg {
  display: inline-block;
  width: 18px;
  height: 18px;
  vertical-align: -0.18em;
  margin-right: 6px;
}

.inv-address {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-white);
  border: 2px solid var(--line);
  border-left: 6px solid var(--inv-1);
  border-radius: var(--r, 20px);
  padding: 22px 24px;
  margin-top: 24px;
}

.inv-address > .icon { width: 26px; height: 26px; color: var(--inv-1); flex: none; margin-top: 2px; }
.inv-address b { display: block; font-size: 1.05rem; color: var(--c-navy); margin-bottom: 6px; }
.inv-address p { margin: 0 0 8px; color: var(--c-ink-2); line-height: 1.6; }
.inv-address__link { font-weight: 800; color: var(--inv-2); }

/* Програма */
.inv-prog { list-style: none; margin: 0; padding: 0; }

.inv-prog li {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  border-radius: 14px;
  padding: 14px 20px;
  margin-bottom: 10px;
  box-shadow: var(--sh-sm);
}

.inv-prog b {
  flex: none;
  min-width: 68px;
  text-align: center;
  background: var(--inv-1);
  color: var(--inv-on1, #fff);
  border-radius: 999px;
  padding: 7px 6px;
  font-family: var(--f-display);
  font-size: 0.98rem;
}

.inv-prog span { color: var(--c-ink); font-weight: 700; }

/* Снимки */
.inv-photos {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.inv-photos__item {
  margin: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sh-sm);
  aspect-ratio: 4 / 3;
}

.inv-photos__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.inv-photos__item:hover img { transform: scale(1.05); }

.inv-photos__more { text-align: center; margin-top: 20px; font-weight: 800; }
.inv-photos__more a { color: var(--inv-2); }

/* Въпроси */
.inv-faq { display: grid; gap: 12px; }

.inv-faq__item {
  background: #fff;
  border-radius: 16px;
  padding: 18px 22px;
  box-shadow: var(--sh-sm);
  border-left: 5px solid var(--inv-1);
}

.inv-faq__item b { display: block; color: var(--c-navy); margin-bottom: 6px; }
.inv-faq__item p { margin: 0; color: var(--c-ink-2); line-height: 1.6; }

/* Край на поканата */
.inv-end { text-align: center; margin-top: 34px; padding-top: 26px; border-top: 2px dashed var(--line); }

.inv-end p { color: var(--c-ink-2); margin: 6px 0 16px; }

.inv-end .inv-end__note {
  font-size: 0.92rem;
  line-height: 1.6;
  max-width: 46ch;
  margin: 0 auto 16px;
}

.inv-end .inv-end__note a { color: var(--inv-2); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Бутонът тук е на светъл фон — variant-ът btn--inv-ghost е за тъмен. */
.inv-end .btn--inv-ghost {
  color: var(--inv-2);
  border-color: var(--inv-2);
}

.inv-end .btn--inv-ghost:hover {
  background: var(--inv-2);
  color: #fff;
}

/* Панел „Готово“ — след създаване на покана */
.inv-done {
  background: #fff;
  border: 2px solid var(--inv-1);
  border-radius: 20px;
  padding: 30px 26px;
  text-align: center;
  box-shadow: var(--sh-sm);
}

.inv-done h2 { margin: 12px 0 10px; color: var(--c-navy); }
.inv-done p { margin: 0 0 14px; color: var(--c-ink-2); line-height: 1.6; }
.inv-done .btn-row { justify-content: center; margin-top: 18px; }

.inv-done__lead { font-size: 1.02rem; }

/* Големият „Копирай линка“ — основното действие след създаване. */
.btn--copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 420px);
  padding: 20px 30px;
  margin: 6px auto 16px;
  border: 2px solid var(--inv-1);
  border-radius: 999px;
  background: var(--inv-1);
  color: var(--inv-on1, #fff);
  font-family: var(--f-display);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn--copy .icon { width: 24px; height: 24px; }

.btn--copy:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(18, 48, 90, 0.18);
  filter: brightness(1.05);
}

.btn--copy.is-done {
  background: var(--c-mint, #2fd48f);
  border-color: var(--c-mint, #2fd48f);
  color: #0b3a24;
}

.inv-done .btn--copy { display: flex; }

.inv-done__link {
  font-family: var(--f-mono, monospace);
  font-size: 0.95rem;
  word-break: break-all;
}

.inv-done__link a { color: var(--inv-2); text-decoration: underline; }

/* Бутоните тук са на светъл фон — вариантът btn--inv-ghost е за тъмен. */
.inv-done .btn--inv-ghost {
  color: var(--inv-2);
  border-color: var(--inv-2);
}

.inv-done .btn--inv-ghost:hover {
  background: var(--inv-2);
  color: #fff;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1100px) {
  .inv-grid { grid-template-columns: repeat(2, 1fr); }
  .inv-photos { grid-template-columns: repeat(2, 1fr); }
  .inv-builder { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .inv-steps { grid-template-columns: 1fr; }
  .inv-count { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .inv-form__themes-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .inv-grid { grid-template-columns: 1fr; }
  .inv-photos { grid-template-columns: 1fr; }
  .inv-count__box { padding: 14px 4px 12px; }
  .inv-prog li { gap: 12px; padding: 12px 14px; }
  .inv-address { flex-direction: column; gap: 10px; }

  /* Героят в поканата — на телефон 170px беше твърде дребен. */
  .inv-hero__char { height: 240px; margin-bottom: 24px; }

  /* Цялата покана на центъра — снимката е отгоре, текстът под нея:
     чворовете, етикетът, двата реда на заглавието и датата/часа. */
  .inv-hero .container { text-align: center; }
  .inv-hero .inv-crumb,
  .inv-hero .inv-badges { justify-content: center; }
  .inv-hero h1 { margin-left: auto; margin-right: auto; }

  /* Картичките на хъба: портретната графика се събираше в 117px. */
  .inv-card__char { height: 264px; padding-top: 18px; }
  .inv-card__about { font-size: 1rem; }

  /* Бутоните един под друг и цялата ширина — вместо три различни. */
  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-row .btn { width: 100%; }

  /* Изборът на стил: снимката отгоре, етикетът под нея —
     две колони с текст вдясно оставяха тесни редове. */
  .inv-form__theme {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 12px 8px;
  }
  .inv-form__theme-img { width: 64px; height: 68px; }
}

/* На самата покана няма долен борд „Обади се/Viber“ (виж footer.php),
   затова и запасът от 84px — място за борда — не е нужен: под футъра и
   под отвореното меню оставаше празна ивица. */
@media (max-width: 720px) {
  .page-template-invitation-php .site-footer { padding-bottom: 0; }
  .page-template-invitation-php .main-nav { padding-bottom: 22px; }
}
