/* Вид материала — cards.html design */
.material-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  width: 100%;
  max-width: 1180px;
  margin-bottom: 40px;
  align-items: stretch;
}

.material-cards-grid .material-card {
  background: #fbfbfc;
  border-radius: 22px;
  overflow: visible;
  border: 1px solid #ececf0;
  box-shadow: 0 2px 10px rgba(44, 42, 57, 0.05);
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  height: 100%;
}

.material-cards-grid .material-card-top {
  position: relative;
  margin: 3px 3px 0;
  padding: 14px 12px 12px;
  border-radius: 16px;
  background: #e8f4fc;
  overflow: visible;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.material-cards-grid .material-card-top--ministry {
  padding-right: 118px;
}

.material-cards-grid .material-card-top--glow {
  z-index: 0;
  isolation: isolate;
  overflow: hidden;
  background: #e8f4fc;
  background-image: linear-gradient(
    112deg,
    #e8f4fc 0%,
    #e8f4fc 42%,
    rgba(61, 57, 244, 0.22) 50%,
    #e8f4fc 58%,
    #e8f4fc 100%
  );
  background-size: 200% 200%;
  animation: ministry-header-glow 18s linear infinite;
  will-change: background-position;
}

.material-cards-grid .material-card-top--glow::after {
  content: "";
  position: absolute;
  inset: -2px;
  z-index: 0;
  pointer-events: none;
  border-radius: 18px;
  padding: 2px;
  background: linear-gradient(
    90deg,
    #e8f4fc 0%,
    #e8f4fc 44%,
    rgba(61, 57, 244, 0.55) 50%,
    #e8f4fc 56%,
    #e8f4fc 100%
  );
  background-size: 200% 100%;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: ministry-header-glow 18s linear infinite;
  will-change: background-position;
}

.material-cards-grid .material-card-top--glow > * {
  position: relative;
  z-index: 1;
}

@keyframes ministry-header-glow {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .material-cards-grid .material-card-top--glow,
  .material-cards-grid .material-card-top--glow::after {
    animation: none;
  }
}

.material-cards-grid .material-card-ministry {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  max-width: 108px;
  text-align: right;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.material-cards-grid .material-card-ministry:hover {
  opacity: 0.82;
}

.material-cards-grid .material-card-ministry:focus-visible {
  outline: 2px solid #3d39f4;
  outline-offset: 2px;
  border-radius: 8px;
}

.material-cards-grid .material-card-ministry__text {
  font-size: 11px;
  line-height: 1.3;
  font-family: inherit;
  font-style: normal;
  font-weight: 400;
  color: #3d39f4;
}

.material-cards-grid .material-card--stack {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
  overflow: hidden;
}

.material-cards-grid .material-card-stack {
  grid-row: 1 / -1;
  grid-column: 1 / -1;
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 22px;
}

.material-cards-grid .material-card-track {
  display: flex;
  width: 200%;
  height: 100%;
  min-height: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.material-cards-grid .material-card--stack.is-letter-open .material-card-track {
  transform: translateX(-50%);
}

.material-cards-grid .material-card-track .material-card-layer--front,
.material-cards-grid .material-card-track .material-card-layer--letter {
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  min-height: 0;
  position: relative;
}

.material-cards-grid .material-card-track .material-card-layer--front {
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.material-cards-grid .material-card-track .material-card-top {
  min-height: 0;
  flex: 0 0 auto;
  z-index: 2;
}

.material-cards-grid .material-card-track .material-card-body {
  flex: 1 1 auto;
  min-height: 0;
}

.material-cards-grid .material-card-track .material-card-bottom {
  flex: 0 0 auto;
  margin-top: auto;
}

.material-cards-grid .material-card-layer--front {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  background: #fbfbfc;
  border: 1px solid #ececf0;
  box-shadow: 0 2px 10px rgba(44, 42, 57, 0.05);
}

.material-cards-grid .material-card-layer--letter {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #ececf0;
  box-shadow: 0 2px 10px rgba(44, 42, 57, 0.05);
}

@media (prefers-reduced-motion: reduce) {
  .material-cards-grid .material-card-track {
    transition-duration: 0.2s;
  }
}

.material-cards-grid .material-letter {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 18px 16px 14px;
}

.material-cards-grid .material-letter__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #ececef;
}

.material-cards-grid .material-letter__logo {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.material-cards-grid .material-letter__org {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
  color: #111113;
}

.material-cards-grid .material-letter__meta {
  margin: 0;
  font-size: 10px;
  line-height: 1.3;
  color: #6b6b70;
}

.material-cards-grid .material-letter__body {
  flex: 1 1 auto;
  overflow: auto;
  font-size: 12px;
  line-height: 1.55;
  color: #2c2c30;
  padding-right: 2px;
}

.material-cards-grid .material-letter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #ececef;
}

.material-cards-grid .material-letter__back,
.material-cards-grid .material-letter__open {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  border: none;
}

.material-cards-grid .material-letter__back {
  background: #f0f0f2;
  color: #2c2c30;
}

.material-cards-grid .material-letter__open {
  background: #3d39f4;
  color: #fff;
}

.material-cards-grid .ac-hours-tip {
  position: relative;
  display: inline;
  cursor: help;
  border-bottom: 1px dashed rgba(44, 44, 48, 0.35);
}

.ac-hours-tip__popup {
  position: fixed;
  top: 0;
  left: 0;
  width: max-content;
  max-width: 260px;
  padding: 14px 16px 12px;
  background: #3d3b44;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  z-index: 99999;
  text-align: left;
  box-shadow: 0 10px 28px rgba(28, 26, 36, 0.22);
}

.ac-hours-tip__popup.is-open {
  opacity: 1;
  visibility: visible;
}

.ac-hours-tip__popup::after {
  content: "";
  position: absolute;
  top: 100%;
  bottom: auto;
  left: var(--ac-hours-tip-arrow-left, 24px);
  transform: none;
  border: 7px solid transparent;
  border-top-color: #3d3b44;
  border-bottom-color: transparent;
}

.ac-hours-tip__title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.3;
  margin-bottom: 6px;
  color: #fff;
}

.ac-hours-tip__text {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.82);
}

@media (max-width: 768px) {
  .ac-hours-tip__popup {
    max-width: min(280px, calc(100vw - 32px));
  }
}

.material-cards-grid .top-text {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.material-cards-grid .tag {
  display: block;
  color: #2c2c30;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}

.material-cards-grid .meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #2c2c30;
  flex-wrap: wrap;
  margin-top: auto;
}

.material-cards-grid .meta .item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.material-cards-grid .meta .item strong {
  font-weight: 600;
}

.material-cards-grid .meta .dot {
  color: #9a9aa0;
}

.material-cards-grid .meta svg {
  width: 19px;
  height: 19px;
  opacity: 0.85;
  flex: 0 0 19px;
}

.material-cards-grid .meta .currency-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  color: #2c2c30;
  opacity: 0.85;
  flex: 0 0 19px;
}

.material-cards-grid .cluster {
  display: none;
}

.material-cards-grid .blob {
  position: absolute;
}

.material-cards-grid .round { border-radius: 50%; }
.material-cards-grid .round::after {
  content: "";
  position: absolute;
  top: 16%;
  left: 22%;
  width: 32%;
  height: 28%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 70%);
}

.material-cards-grid .cube { border-radius: 6px; }
.material-cards-grid .pill { border-radius: 999px; }
.material-cards-grid .pill::after {
  content: "";
  position: absolute;
  top: 14%;
  left: 18%;
  width: 22%;
  height: 60%;
  border-radius: 999px;
  background: linear-gradient(rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
}

.material-cards-grid .pink .p1 {
  width: 42px; height: 42px; top: 28px; left: 12px;
  background: radial-gradient(circle at 34% 28%, #fff 0%, #ff8dc1 30%, #e8388c 70%, #a3175e 100%);
  box-shadow: inset -6px -7px 13px rgba(120, 0, 55, 0.5), 0 7px 12px rgba(180, 30, 110, 0.35);
}
.material-cards-grid .pink .p2 {
  width: 22px; height: 22px; top: 4px; left: 50px; transform: rotate(-15deg);
  background: linear-gradient(135deg, #ffd0e6, #f06aaa);
  box-shadow: inset -3px -3px 6px rgba(120, 0, 55, 0.4), 0 4px 7px rgba(180, 30, 110, 0.3);
}
.material-cards-grid .pink .p3 {
  width: 16px; height: 34px; top: 38px; left: 58px; transform: rotate(20deg);
  background: linear-gradient(110deg, #ffe2ef, #f48cbe);
  box-shadow: inset -3px 0 6px rgba(120, 0, 55, 0.4), 0 4px 7px rgba(180, 30, 110, 0.3);
}

.material-cards-grid .blue .p1 {
  width: 40px; height: 40px; top: 6px; left: 14px;
  background: conic-gradient(from 210deg, #bcdcff, #5d9af0, #1f63c4, #0f3f8c, #1f63c4, #5d9af0, #bcdcff);
  -webkit-mask: radial-gradient(circle, transparent 32%, #000 34%);
  mask: radial-gradient(circle, transparent 32%, #000 34%);
  box-shadow: 0 6px 10px rgba(20, 60, 130, 0.3);
  transform: rotate(-10deg);
}
.material-cards-grid .blue .p2 {
  width: 30px; height: 30px; top: 40px; left: 22px;
  background: radial-gradient(circle at 34% 28%, #fff 0%, #7eb2f5 32%, #2f7fe0 72%, #134a96 100%);
  box-shadow: inset -5px -6px 11px rgba(6, 32, 78, 0.5), 0 6px 10px rgba(20, 60, 130, 0.35);
}
.material-cards-grid .blue .p3 {
  width: 18px; height: 18px; top: 16px; left: 58px;
  background: linear-gradient(135deg, #cfe2ff, #6aa3ee);
  box-shadow: inset -3px -3px 6px rgba(6, 32, 78, 0.4), 0 4px 7px rgba(20, 60, 130, 0.3);
}

.material-cards-grid .yellow .p1 {
  width: 18px; height: 46px; top: 22px; left: 14px; transform: rotate(-18deg);
  background: linear-gradient(110deg, #fffbe0, #ffe06a 40%, #d29a10);
  box-shadow: inset -3px 0 7px rgba(120, 80, 0, 0.45), 0 5px 9px rgba(200, 150, 20, 0.3);
}
.material-cards-grid .yellow .p2 {
  width: 36px; height: 36px; top: 8px; left: 40px;
  background: radial-gradient(circle at 34% 28%, #fffbe0 0%, #ffe06a 32%, #e0ad14 72%, #9c7208 100%);
  box-shadow: inset -5px -6px 11px rgba(120, 80, 0, 0.45), 0 6px 10px rgba(200, 150, 20, 0.35);
}
.material-cards-grid .yellow .p3 {
  width: 20px; height: 20px; top: 50px; left: 56px; transform: rotate(18deg);
  background: linear-gradient(135deg, #fff2bf, #efcb55);
  box-shadow: inset -3px -3px 6px rgba(120, 80, 0, 0.4), 0 4px 7px rgba(200, 150, 20, 0.3);
}

.material-cards-grid .green .p1 {
  width: 38px; height: 38px; top: 30px; left: 10px; transform: rotate(-10deg);
  background: linear-gradient(135deg, #a4eeb2, #34b455 60%, #167a34);
  box-shadow: inset -5px -6px 11px rgba(15, 70, 32, 0.45), 0 6px 10px rgba(30, 120, 55, 0.35);
}
.material-cards-grid .green .p2 {
  width: 28px; height: 28px; top: 4px; left: 46px;
  background: radial-gradient(circle at 34% 28%, #fff 0%, #84e399 30%, #34b455 72%, #167a34 100%);
  box-shadow: inset -4px -5px 9px rgba(15, 70, 32, 0.4), 0 5px 9px rgba(30, 120, 55, 0.35);
}
.material-cards-grid .green .p3 {
  width: 18px; height: 18px; top: 46px; left: 58px;
  background: linear-gradient(135deg, #d2f7da, #74da90);
  box-shadow: inset -3px -3px 6px rgba(15, 70, 32, 0.4), 0 4px 7px rgba(30, 120, 55, 0.3);
}

.material-cards-grid .material-card-body {
  padding: 12px 12px 6px;
  display: flex;
  flex-direction: column;
  background: #fbfbfc;
  min-height: 0;
}

.material-cards-grid .features-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #9a9aa0;
  margin-bottom: 12px;
}

.material-cards-grid .features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.material-cards-grid .features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #2c2c30;
  line-height: 1.45;
  min-width: 0;
}

.material-cards-grid .features .feature-text {
  flex: 1;
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
}

.material-cards-grid .check {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #3d39f4;
  margin-top: 1px;
}

.material-cards-grid .check--cross {
  background: #b8b8be;
}

.material-cards-grid .check svg {
  width: 11px;
  height: 11px;
}

.material-cards-grid .progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: auto 0 10px;
  padding-top: 18px;
}

.material-cards-grid .progress-head span {
  font-size: 14px;
  color: #4a4a4e;
}

.material-cards-grid .progress-head .pct {
  font-weight: 700;
  color: #111113;
}

.material-cards-grid .bar {
  height: 8px;
  border-radius: 999px;
  background: #ececef;
  position: relative;
}

.material-cards-grid .bar .fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: #3d39f4;
  border-radius: 999px;
}

.material-cards-grid .bar .knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3d39f4;
  transform: translate(-50%, -50%);
}

.material-cards-grid .material-card-bottom {
  padding: 12px 12px 14px;
  background: #fbfbfc;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@supports not (grid-template-rows: subgrid) {
  .material-cards-grid .material-card-top {
    min-height: 108px;
  }
}

.material-cards-grid .material-card-bottom .info {
  font-size: 14px;
  color: #4a4a4e;
}

.material-cards-grid .material-card-bottom .info strong {
  color: #111113;
  font-weight: 700;
}

.material-cards-grid .material-card-bottom .actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.material-cards-grid .btn-plan {
  background: transparent;
  color: #3d39f4;
  border: 1px solid #3d39f4;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.material-cards-grid .btn-main {
  background: #3d39f4;
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 1024px) {
  .material-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .material-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
  }

  .material-cards-grid .material-card {
    border-radius: 18px;
  }

  .material-cards-grid .material-card-top {
    margin: 2px 2px 0;
    padding: 12px 10px 10px;
    border-radius: 14px;
  }

  .material-cards-grid .material-card-top--ministry {
    padding-right: 96px;
  }

  .material-cards-grid .material-card-ministry {
    top: 8px;
    right: 8px;
    max-width: 88px;
  }

  .material-cards-grid .material-card-ministry__text {
    font-size: 10px;
  }

  .material-cards-grid .material-letter__logo {
    width: 48px;
    height: 48px;
  }

  .material-cards-grid .material-card--stack,
  .material-cards-grid .material-card-stack,
  .material-cards-grid .material-card-track {
    min-height: 360px;
  }

  .material-cards-grid .material-card:not(.material-card--stack) .material-card-layer--front {
    min-height: 360px;
  }

  .material-cards-grid .material-letter {
    padding: 14px 12px 12px;
  }

  .material-cards-grid .material-letter__body {
    font-size: 11px;
  }

  .material-cards-grid .material-letter__actions {
    flex-direction: column;
  }

  .material-cards-grid .material-letter__back,
  .material-cards-grid .material-letter__open {
    width: 100%;
    text-align: center;
  }

  .material-cards-grid .top-text {
    max-width: 100%;
  }

  .material-cards-grid .cluster {
    width: 44px;
    height: 42px;
    right: 4px;
    top: 10px;
    transform: scale(0.82);
    transform-origin: top right;
  }

  .material-cards-grid .material-card-body {
    padding: 10px 12px 6px;
  }

  .material-cards-grid .material-card-bottom {
    padding: 10px 12px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .material-cards-grid .material-card-bottom .actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .material-cards-grid .btn-plan,
  .material-cards-grid .btn-main {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

@media (max-width: 380px) {
  .material-cards-grid .material-card-bottom .actions {
    grid-template-columns: 1fr;
  }

  .material-cards-grid .cluster {
    display: none;
  }

  .material-cards-grid .top-text {
    max-width: 100%;
  }
}
