/**
 * Языкотека hub — hero & direction cards
 * /yazykoteka/index.html
 */

:root {
  --yz-ivory: #faf6ef;
  --yz-cream: #f3ede4;
  --yz-paper: #fbf9f6;
  --yz-ink: #2a3344;
  --yz-ink-muted: #4d5a6c;
  --yz-navy: #2c4a66;
  --yz-navy-deep: #1e3550;
  --yz-gold: #c4a574;
  --yz-gold-soft: rgba(196, 165, 116, 0.35);
  --yz-gold-line: rgba(196, 165, 116, 0.55);
  --yz-border: rgba(44, 74, 102, 0.12);
  --yz-shadow: 0 4px 24px rgba(30, 53, 80, 0.07);
  --yz-shadow-hover: 0 12px 36px rgba(30, 53, 80, 0.11);
}

body.theme-yazykoteka.lr-page {
  background: var(--yz-paper);
}

/* ——— Hero ——— */

.yz-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--yz-border);
  background:
    radial-gradient(ellipse 70% 55% at 12% 20%, rgba(59, 95, 127, 0.08), transparent 58%),
    radial-gradient(ellipse 55% 45% at 88% 75%, rgba(196, 165, 116, 0.1), transparent 52%),
    linear-gradient(165deg, var(--yz-ivory) 0%, var(--yz-paper) 45%, #eef3f7 100%);
}

.yz-hero__paper {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 31px,
      rgba(59, 95, 127, 0.03) 31px,
      rgba(59, 95, 127, 0.03) 32px
    );
}

.yz-hero__wave {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  height: 4rem;
  opacity: 0.45;
}

.yz-hero__wave--top {
  top: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 80' preserveAspectRatio='none'%3E%3Cpath d='M0 40 Q300 0 600 40 T1200 40 V80 H0 Z' fill='none' stroke='%23c4a574' stroke-width='1' opacity='0.5'/%3E%3Cpath d='M0 55 Q400 20 800 55 T1200 50' fill='none' stroke='%232c4a66' stroke-width='0.75' opacity='0.2'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}

.yz-hero__wave--bottom {
  bottom: 2.75rem;
  height: 3rem;
  opacity: 0.3;
}

.yz-hero__accent {
  pointer-events: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3.25rem;
  overflow: hidden;
}

.yz-hero__accent-wave {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 52' preserveAspectRatio='none'%3E%3Cpath d='M0 28 C200 8 400 44 600 24 S1000 6 1200 26' fill='none' stroke='%231e3550' stroke-width='1.1' opacity='0.28'/%3E%3Cpath d='M0 36 C250 18 450 40 700 30 S950 22 1200 34' fill='none' stroke='%23c4a574' stroke-width='0.85' opacity='0.38'/%3E%3C/svg%3E") center bottom / 100% 100% no-repeat;
}

.yz-hero__accent-spine {
  position: absolute;
  left: 50%;
  bottom: 0.35rem;
  width: min(12rem, 28vw);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(30, 53, 80, 0.22) 20%, rgba(196, 165, 116, 0.45) 50%, rgba(30, 53, 80, 0.22) 80%, transparent);
}

.yz-hero__letters {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.yz-hero__letter {
  position: absolute;
  font-family: var(--font-heading);
  font-weight: 400;
  line-height: 1;
  color: var(--yz-navy);
  opacity: 0.06;
  user-select: none;
}

.yz-hero__letter--a {
  top: 18%;
  right: 14%;
  font-size: clamp(5rem, 14vw, 9rem);
}

.yz-hero__letter--b {
  top: 42%;
  right: 28%;
  font-size: clamp(3.5rem, 10vw, 6.5rem);
  opacity: 0.05;
}

.yz-hero__letter--c {
  bottom: 22%;
  right: 8%;
  font-size: clamp(4rem, 11vw, 7rem);
  opacity: 0.04;
}

.yz-hero__inner {
  position: relative;
  display: grid;
  gap: var(--space-8);
  align-items: center;
  max-width: var(--container-wide);
  margin-inline: auto;
  padding: clamp(3rem, 8vw, 5.5rem) var(--section-padding-x) clamp(3.25rem, 6.5vw, 5rem);
}

@media (min-width: 768px) {
  .yz-hero__inner {
    grid-template-columns: 1fr auto;
    gap: var(--space-10);
  }
}

.yz-hero__content {
  max-width: 36rem;
}

.yz-hero__emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  margin-bottom: var(--space-5);
  color: var(--yz-navy);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(243, 237, 228, 0.6));
  border: 1px solid var(--yz-gold-line);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--yz-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.yz-hero__emblem svg {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
}

.yz-hero__tags {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--yz-gold);
}

.yz-hero__title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: clamp(2.75rem, 7vw, 4.25rem);
  font-weight: var(--font-weight-heading);
  line-height: 1.05;
  letter-spacing: var(--letter-spacing-heading);
  color: var(--yz-navy-deep);
}

.yz-hero__lead {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: clamp(1.2rem, 2.8vw, 1.5rem);
  font-weight: 400;
  line-height: var(--leading-normal);
  color: var(--yz-navy);
}

.yz-hero__studio {
  margin: 0;
  padding-top: var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--yz-ink-muted);
  border-top: 1px solid var(--yz-gold-soft);
}

.yz-hero__visual {
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
}

@media (min-width: 768px) {
  .yz-hero__visual {
    display: flex;
  }
}

.yz-hero__brand-mark {
  display: block;
  width: clamp(10rem, 20vw, 14rem);
  max-height: min(18rem, 42vh);
  margin: 0;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 10px 28px rgba(30, 53, 80, 0.06));
}

/* ——— Directions ——— */

.yz-directions {
  padding-block: clamp(3rem, 7vw, 5rem);
  background: linear-gradient(180deg, var(--yz-paper) 0%, #f5f8fa 100%);
}

.yz-directions__inner {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--section-padding-x);
}

.yz-directions__header {
  max-width: 32rem;
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-12));
}

.yz-directions__label {
  margin: 0 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--yz-gold);
}

.yz-directions__title {
  margin: 0 0 var(--space-3);
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--yz-ink);
}

.yz-directions__lead {
  margin: 0;
  max-width: 34rem;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--yz-ink-muted);
}

.yz-direction-grid {
  display: grid;
  gap: clamp(var(--space-6), 3vw, var(--space-8));
  align-items: stretch;
}

@media (min-width: 640px) {
  .yz-direction-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.yz-direction-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--yz-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--yz-shadow);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

@media (min-width: 640px) {
  .yz-direction-card {
    flex-direction: row;
    align-items: stretch;
    min-height: 17.75rem;
  }
}

.yz-direction-card:hover,
.yz-direction-card:focus-within {
  border-color: rgba(59, 95, 127, 0.22);
  box-shadow: var(--yz-shadow-hover);
  transform: translateY(-2px);
}

.yz-direction-card__media {
  flex: 0 0 auto;
  padding: var(--space-5);
  background: linear-gradient(165deg, #faf6ef 0%, #f3ede4 100%);
  border-bottom: 1px solid var(--yz-border);
}

@media (min-width: 640px) {
  .yz-direction-card__media {
    flex: 0 0 clamp(7.25rem, 30%, 9.75rem);
    display: flex;
    align-items: center;
    border-bottom: none;
    border-right: 1px solid var(--yz-border);
  }
}

.yz-direction-card__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 11rem;
  margin-inline: auto;
  aspect-ratio: 1;
  padding: var(--space-3);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.65), transparent 55%),
    #f7f2ea;
  border: 1px solid var(--yz-gold-line);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 3px 14px rgba(30, 53, 80, 0.05);
}

@media (min-width: 640px) {
  .yz-direction-card__frame {
    max-width: none;
    min-height: 7.25rem;
    height: 100%;
  }
}

.yz-direction-card__frame img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 10rem;
  object-fit: contain;
  object-position: center;
}

@media (min-width: 640px) {
  .yz-direction-card__frame img {
    max-height: none;
  }
}

.yz-direction-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: clamp(var(--space-5), 3vw, var(--space-6));
}

.yz-direction-card__label {
  margin: 0 0 var(--space-3);
  font-size: 0.6875rem;
  font-weight: var(--font-weight-medium);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--yz-navy);
  opacity: 0.75;
}

.yz-direction-card__title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  line-height: var(--leading-tight);
  color: var(--yz-ink);
}

.yz-direction-card__text {
  flex: 1 1 auto;
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--yz-ink-muted);
}

.yz-direction-card__btn {
  align-self: flex-start;
  margin-top: auto;
  padding-top: var(--space-4);
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.25rem;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(145deg, var(--yz-navy) 0%, var(--yz-navy-deep) 100%);
  border: 1px solid rgba(30, 53, 80, 0.2);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 8px rgba(30, 53, 80, 0.15);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.yz-direction-card__btn:hover {
  color: #ffffff;
  text-decoration: none;
  background: linear-gradient(145deg, #345a7a 0%, var(--yz-navy) 100%);
  box-shadow: 0 4px 14px rgba(30, 53, 80, 0.22);
  transform: translateY(-1px);
}

.yz-direction-card__btn:focus-visible {
  outline: 2px solid var(--yz-gold);
  outline-offset: 3px;
}

.yz-notice {
  margin-top: clamp(var(--space-8), 4vw, var(--space-12));
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--yz-ink-muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--yz-border);
  border-radius: var(--radius-lg);
}

@media (max-width: 767px) {
  .yz-hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .yz-hero__content {
    order: 1;
  }

  .yz-hero__letter {
    opacity: 0.025;
  }

  .yz-hero__letter--a {
    display: none;
  }

  .yz-hero__letter--b,
  .yz-hero__letter--c {
    display: none;
  }

  .yz-hero__visual {
    display: flex;
    order: 2;
    justify-content: center;
    padding: 0;
    margin-top: var(--space-2);
  }

  .yz-hero__brand-mark {
    width: min(9rem, 48vw);
    max-height: 11rem;
  }
}

/* ——— Open materials & communities (moved from /contacts/) ——— */

.yz-resources {
  padding-block: clamp(3rem, 7vw, 5rem);
  background: linear-gradient(180deg, #eef3f7 0%, var(--yz-paper) 100%);
  border-top: 1px solid var(--yz-border);
}

.yz-resources__inner {
  max-width: var(--container-default);
  margin-inline: auto;
  padding-inline: var(--section-padding-x);
}

.yz-resources__header {
  max-width: 40rem;
  margin-bottom: clamp(var(--space-8), 4vw, var(--space-12));
}

.yz-resources__label {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--yz-gold);
}

.yz-resources__title {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  color: var(--yz-ink);
}

.yz-resources__lead {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--yz-ink-muted);
}

.yz-resources__block + .yz-resources__block {
  margin-top: clamp(var(--space-8), 4vw, var(--space-12));
}

.yz-resources__subtitle {
  margin: 0 0 var(--space-4);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--yz-navy);
}

.yz-resources__note {
  margin: 0 0 var(--space-5);
  max-width: 40rem;
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--yz-ink-muted);
}

.yz-resource-grid {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .yz-resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.yz-resource-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--yz-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

a.yz-resource-card:hover {
  border-color: rgba(44, 74, 102, 0.28);
  box-shadow: var(--yz-shadow);
  text-decoration: none;
}

.yz-resource-card__title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--yz-ink);
}

.yz-resource-card__text {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--yz-ink-muted);
}
