.tg-section, .tg-dialog { font-family: Golos, Arial, sans-serif; color: #1a1d22; }
.tg-section { container-type: inline-size; scroll-margin-top: 86px; margin: clamp(24px, 3vw, 42px) auto; }
main > .tg-section, body > .tg-section { width: min(calc(100% - clamp(40px, 6vw, 88px)), 1332px); }
.tg-card { display: grid; overflow: hidden; border: 1px solid #dfdfdb; border-radius: 20px; background: #fff; }
.tg-copy { padding: clamp(24px, 3.7cqw, 52px) clamp(20px, 4.4cqw, 60px); align-self: center; }
#telegram .tg-channel { margin: 0 0 12px; color: #055a8c; font-size: 13px; font-weight: 500; }
#telegram .tg-title, .tg-dialog .tg-title { margin: 0; max-width: 650px; font: 400 clamp(30px, 4.5cqw, 50px)/1.06 Spectral, Georgia, serif; letter-spacing: -.035em; text-wrap: balance; }
#telegram .tg-description, .tg-dialog .tg-description { max-width: 470px; margin: 12px 0 0; color: #4e5257; font-size: 15px; line-height: 1.6; }
.tg-description span { white-space: nowrap; }
#telegram .tg-subscribe, .tg-dialog .tg-subscribe {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 50px;
  padding: 12px 16px; border-radius: 8px; background: #1a1d22; color: #fff;
  font-size: 14px; font-weight: 500; text-decoration: none; transition: background .2s;
}
#telegram .tg-subscribe { width: 100%; margin-top: 24px; }
#telegram .tg-subscribe:hover, .tg-dialog .tg-subscribe:hover { background: #055a8c; }
#telegram .tg-subscribe:focus-visible, .tg-dialog :is(a,button):focus-visible { outline: 2px solid #055a8c; outline-offset: 3px; }
.tg-subscribe span { font-size: 20px; line-height: 1; }
.tg-photo { position: relative; min-height: clamp(140px, 34cqw, 190px); background: #e7e9e8; }
.tg-card .tg-photo img, .tg-dialog .tg-photo img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: cover; object-position: center 62%; }
@container (min-width: 620px) {
  .tg-card { grid-template-columns: minmax(0, 1fr) 40%; }
  .tg-card .tg-photo { min-height: 0; }
  #telegram .tg-subscribe { width: auto; }
}

.tg-dialog {
  position: fixed; inset: 0; width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 32px);
  margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain; border: 0;
  border-radius: 18px; background: #fff; box-shadow: 0 24px 90px rgb(12 20 28 / 32%);
}
.tg-dialog::backdrop { background: rgb(16 24 32 / 68%); backdrop-filter: blur(3px); }
html:has(.tg-dialog[open]) { overflow: hidden; }
.tg-invite-card { position: relative; display: grid; grid-template-columns: minmax(160px, 272px) minmax(0, 1fr); }
.tg-invite-copy { padding: 39px 44px 24px; }
.tg-label { margin: 0 0 14px; color: #055a8c; font-size: 11px; font-weight: 600; line-height: 1.4; letter-spacing: .13em; text-transform: uppercase; }
.tg-dialog .tg-title { font-size: clamp(35px, 5vw, 44px); line-height: .99; outline: none; }
.tg-dialog .tg-description { margin: 17px 0 22px; }
.tg-dialog .tg-subscribe { display: flex; width: 100%; min-height: 52px; background: #066fae; }
.tg-close, .tg-dismiss { border: 0; cursor: pointer; }
.tg-close { position: absolute; top: 10px; right: 10px; display: grid; width: 44px; height: 44px; place-items: center; border-radius: 50%; background: #f1f1ee; color: #1a1d22; font: 25px/1 Arial, sans-serif; }
.tg-dismiss { display: block; min-height: 44px; margin: 4px auto 0; padding-inline: 12px; background: none; color: #4e5257; font-size: 14px; }
.tg-dismiss:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .tg-dialog { max-width: 440px; }
  .tg-invite-card { grid-template-columns: minmax(0, 1fr); }
  .tg-invite-card .tg-photo { min-height: clamp(110px, 19dvh, 160px); }
  .tg-invite-copy { padding: 24px 24px 12px; }
  .tg-label { margin-bottom: 9px; }
  .tg-dialog .tg-title { font-size: clamp(32px, 8.3vw, 39px); }
  .tg-dialog .tg-description { margin-block: 12px 18px; }
}
