/* ==================================================================
   КОМПЛЕКСИ НА НАЧАЛНАТА (templates/modules/home_complexes.html)

   Големи снимкови карти, по две на ред. Броят решава подредбата:
   един -> цял ред; нечетен брой -> първият на цял ред (`:nth-last-child(odd)`
   на първата карта е вярно само при нечетен брой), останалите по два.
   Цветовете идват от темата (--accent, --ink), с резервни стойности.
================================================================== */
.hc {
  --hc-accent: var(--accent, var(--brand-accent, #c8743c));
  --hc-ink: var(--ink, #101820);
  /* акцентът върху тъмната снимка - изсветлен, за да се вижда и при тъмносин скин */
  --hc-glow: color-mix(in srgb, var(--hc-accent) 45%, #ffffff);
  --hc-radius: 26px;
  --hc-ease: cubic-bezier(.16, 1, .3, 1);
  position: relative;
  padding: clamp(56px, 7vw, 112px) 0;
  background:
    radial-gradient(1200px 420px at 100% 0%, color-mix(in srgb, var(--hc-accent) 9%, transparent), transparent 70%),
    var(--paper, #fff);
  overflow: hidden;
}

/* ---------- заглавие ---------- */
.hc-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 40px;
  margin-bottom: clamp(28px, 3.4vw, 48px);
}
.hc-head__text { max-width: 760px; }
.hc-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--hc-accent);
}
.hc-eyebrow span { width: 34px; height: 2px; background: currentColor; border-radius: 2px; }
.hc-title {
  margin: 0;
  font-family: var(--font-head, inherit);
  font-size: clamp(2.1rem, 1.2rem + 3.2vw, 3.9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--hc-ink);
}
.hc-edit { margin-left: 10px; font-size: .5em; vertical-align: middle; }
.hc-lead { margin-top: 16px; font-size: 1.05rem; line-height: 1.6; color: color-mix(in srgb, var(--hc-ink) 68%, transparent); }
.hc-lead p:last-child { margin-bottom: 0; }
.hc-head__side { display: flex; align-items: flex-end; gap: 22px; flex-shrink: 0; }
.hc-total {
  font-family: var(--font-head, inherit);
  font-size: clamp(3.6rem, 2rem + 5vw, 7rem);
  font-weight: 800;
  line-height: .78;
  letter-spacing: -.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--hc-ink) 22%, transparent);
  user-select: none;
}
.hc-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 20px 13px 22px;
  border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--hc-ink) 16%, transparent);
  font-weight: 700;
  font-size: .95rem;
  color: var(--hc-ink) !important;
  text-decoration: none !important;
  white-space: nowrap;
  transition: background .3s var(--hc-ease), color .3s var(--hc-ease), border-color .3s var(--hc-ease);
}
.hc-all .material-icons-outlined { font-size: 19px; transition: transform .3s var(--hc-ease); }
.hc-all:hover { background: var(--hc-ink); border-color: var(--hc-ink); color: #fff !important; }
.hc-all:hover .material-icons-outlined { transform: translateX(4px); }

/* ---------- мрежата ---------- */
.hc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 28px);
}
.hc-grid > .hc-card:first-child:nth-last-child(odd) { grid-column: 1 / -1; }

/* ---------- картата ---------- */
.hc-card {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(460px, 44vw, 600px);
  border-radius: var(--hc-radius);
  overflow: hidden;
  background: #1b2430;
  color: #fff;
  box-shadow: 0 2px 4px rgba(16, 24, 32, .06), 0 30px 60px -36px rgba(16, 24, 32, .55);
  transition: transform .6s var(--hc-ease), box-shadow .6s var(--hc-ease);
}
.hc-card:hover { transform: translateY(-6px); box-shadow: 0 4px 8px rgba(16, 24, 32, .08), 0 44px 80px -40px rgba(16, 24, 32, .7); }
.hc-card:focus-within { outline: 3px solid var(--hc-accent); outline-offset: 4px; }
.hc-grid > .hc-card:first-child:nth-last-child(odd) { min-height: clamp(460px, 38vw, 640px); }

.hc-media { position: absolute; inset: 0; z-index: -2; }
.hc-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 1.4s ease, transform 2.4s var(--hc-ease);
}
.hc-media img.is-on { opacity: 1; transform: scale(1); }
.hc-card:hover .hc-media img.is-on { transform: scale(1.07); }
.hc-media__empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px !important; color: rgba(255, 255, 255, .18); }
.hc-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(8, 12, 20, .42) 0%, rgba(8, 12, 20, 0) 26%),
    linear-gradient(0deg, rgba(8, 12, 20, .9) 0%, rgba(8, 12, 20, .55) 34%, rgba(8, 12, 20, 0) 64%);
  transition: opacity .6s var(--hc-ease);
}

/* горе: номер, етап, точките на снимките */
.hc-top { display: flex; align-items: center; gap: 10px; padding: clamp(18px, 2vw, 26px); }
.hc-num,
.hc-stage {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .22);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
}
.hc-num { font-variant-numeric: tabular-nums; }
.hc-stage i { width: 8px; height: 8px; border-radius: 50%; background: var(--hc-glow); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hc-glow) 30%, transparent); }
.hc-dots { display: flex; gap: 5px; margin-left: auto; }
.hc-dots b { width: 7px; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .45); transition: width .5s var(--hc-ease), background .5s; }
.hc-dots b.is-on { width: 22px; background: #fff; }

/* долу: локация, име, текст, етап, оферти */
.hc-body { padding: clamp(22px, 2.6vw, 38px); }
.hc-loc {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .78);
}
.hc-loc .material-icons-outlined { font-size: 17px; color: var(--hc-glow); }
.hc-name {
  margin: 0;
  max-width: 18ch;
  font-family: var(--font-head, inherit);
  font-size: clamp(1.7rem, 1rem + 1.9vw, 2.7rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.hc-grid > .hc-card:first-child:nth-last-child(odd) .hc-name { max-width: 22ch; font-size: clamp(2rem, 1rem + 3vw, 3.8rem); }
.hc-link { color: #fff !important; text-decoration: none !important; }
.hc-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }   /* цялата карта е линк */
.hc-link:focus { outline: none; }
.hc-text {
  max-width: 54ch;
  margin: 14px 0 0;
  font-size: 1rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, .82);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* на компютър текстът излиза при посочване - картата остава чиста */
@media (hover: hover) and (min-width: 992px) {
  .hc-text { max-height: 0; margin-top: 0; opacity: 0; transform: translateY(10px); transition: max-height .6s var(--hc-ease), margin .6s var(--hc-ease), opacity .5s ease, transform .6s var(--hc-ease); }
  .hc-card:hover .hc-text,
  .hc-card:focus-within .hc-text { max-height: 4.7em; margin-top: 14px; opacity: 1; transform: none; }
  .hc-grid > .hc-card:first-child:nth-last-child(odd) .hc-text { max-height: 4.7em; margin-top: 16px; opacity: 1; transform: none; }
}
.hc-bar { height: 3px; margin-top: 22px; border-radius: 3px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.hc-bar span { display: block; height: 100%; border-radius: inherit; background: var(--hc-glow); transform-origin: left; transition: transform 1.2s var(--hc-ease); }
.hc-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; }
.hc-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--hc-accent);
  color: var(--accent-ink, #fff);
  font-size: 14px;
  font-weight: 600;
}
.hc-chip b { font-size: 17px; font-weight: 800; }
.hc-chip--muted { background: rgba(255, 255, 255, .16); color: rgba(255, 255, 255, .85); }
.hc-go { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; }
.hc-go__btn {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  color: var(--hc-ink);
  transition: transform .5s var(--hc-ease), background .3s ease, color .3s ease;
}
.hc-go__btn .material-icons-outlined { font-size: 24px; transform: rotate(-45deg); transition: transform .5s var(--hc-ease); }
.hc-card:hover .hc-go__btn { background: var(--hc-accent); color: #fff; transform: scale(1.06); }
.hc-card:hover .hc-go__btn .material-icons-outlined { transform: rotate(0); }

/* ---------- телефон и таблет ---------- */
@media (max-width: 991.98px) {
  .hc-head { flex-direction: column; align-items: flex-start; }
  .hc-head__side { width: 100%; justify-content: space-between; }
}
@media (max-width: 767.98px) {
  .hc-grid { grid-template-columns: minmax(0, 1fr); }
  .hc-card,
  .hc-grid > .hc-card:first-child:nth-last-child(odd) { min-height: 470px; }
  .hc-go__text { display: none; }
  .hc-total { display: none; }
  .hc-head__side { width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .hc-card, .hc-media img, .hc-text, .hc-go__btn, .hc-go__btn .material-icons-outlined { transition: none !important; }
  .hc-card:hover { transform: none; }
  .hc-card:hover .hc-media img.is-on { transform: none; }
}
