
/* Placeholder copy is filled client-side from location.pathname before it is
   revealed. This prevents cached/TranslatePress RO text from flashing on /ru/. */
.gda-external-embed[data-gda-ui-ready="0"] .gda-external-embed__placeholder {
  visibility: hidden;
}

.gda-external-embed {
  --gda-external-embed-ratio: 16 / 9;
  position: relative;
  width: 100%;
  margin: 1.2em 0;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f6f4;
  border: 1px solid rgba(33, 69, 49, .13);
  container-type: inline-size;
}

/* One universal card composition for every provider and every embed width.
   The service copy always gets the full readable row; actions never steal a
   third column from it. This makes Facebook, generic hosts, maps, video and
   widgets render with the same geometry. */
.gda-external-embed__placeholder {
  min-height: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  font-synthesis: none;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-areas:
    "icon copy"
    "actions actions";
  align-items: start;
  gap: 15px 16px;
  padding: clamp(18px, 4cqi, 28px);
  text-align: left;
}

.gda-external-embed__icon {
  grid-area: icon;
  align-self: start;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-top: 1px;
  border-radius: 50%;
  background: #C96A3B;
  color: #fff;
}

/* Decorative play glyph is pure CSS, not a Unicode character. Some mobile
   browsers substitute emoji/symbol fonts for ▶ and distort its metrics. */
.gda-external-embed__icon::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #fff;
}

.gda-external-embed__copy {
  grid-area: copy;
  min-width: 0;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 0;
}

.gda-external-embed__title {
  display: block;
  margin: 0;
  color: #1f2e26;
  font-size: 16px;
  line-height: 1.28;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.gda-external-embed__text {
  display: block;
  margin: 0;
  color: #5a6760;
  font-size: 13.5px;
  line-height: 1.45;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.gda-external-embed__provider {
  display: block;
  margin-top: 1px;
  color: #C96A3B;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.gda-external-embed__actions {
  grid-area: actions;
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gda-external-embed__privacy,
.gda-external-embed__source {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  box-sizing: border-box;
  margin: 0;
  border-radius: 8px;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font: inherit;
  font-size: 12.75px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-decoration: none !important;
  cursor: pointer;
}

.gda-external-embed__privacy {
  border: 1px solid #C96A3B;
  background: #C96A3B;
  color: #fff;
}

.gda-external-embed__source {
  border: 1px solid #ccd6d0;
  background: #fff;
  color: #34424d !important;
}

.gda-external-embed--unconfigured .gda-external-embed__icon {
  background: #6c746f;
}

.gda-external-embed--unconfigured .gda-external-embed__provider {
  color: #6c746f;
}

.gda-external-embed--active {
  overflow: visible;
  border: 0;
  background: transparent;
  border-radius: 0;
  container-type: normal;
}

.gda-external-embed__live,
.gda-external-embed__live > iframe,
.gda-external-embed__live > video,
.gda-external-embed__live > object,
.gda-external-embed__live > embed {
  max-width: 100%;
}

.gda-external-embed__live > iframe {
  width: 100%;
}

/* Container-query, not viewport-query: an embed can be narrow inside a
   sidebar or card even on desktop. The card keeps the same visual language,
   only collapsing its internal grid when its own width requires it. */
@container (max-width: 340px) {
  .gda-external-embed__placeholder {
    grid-template-columns: 1fr;
    grid-template-areas:
      "icon"
      "copy"
      "actions";
    gap: 12px;
    text-align: left;
  }
  .gda-external-embed__icon {
    width: 46px;
    height: 46px;
  }
  .gda-external-embed__actions {
    grid-template-columns: 1fr;
  }
}

/* External-content permissions. Site-owned UI, intentionally modeled on
   the visual grammar of the compact InMobi Preferences screen without mixing
   the two consent stores. Only providers actually detected on this site are
   listed. */
.gda-external-settings-modal[hidden] { display: none !important; }
.gda-external-settings-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(37,45,51,.76);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.gda-external-settings-modal__panel {
  width: min(620px, 100%);
  max-height: min(720px, calc(100dvh - 36px));
  overflow: hidden;
  box-sizing: border-box;
  border-radius: 10px;
  background: #fff;
  color: #202d26;
  box-shadow: 0 14px 46px rgba(0,0,0,.24);
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  font-synthesis: none;
}
.gda-external-settings-modal__head {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 10px 18px;
  border-bottom: 1px solid #e5e8e6;
}
.gda-external-settings-modal__head h2 {
  margin: 0;
  color: #202d26;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
}
.gda-external-settings-modal__desc {
  flex: 0 0 auto;
  margin: 0 !important;
  padding: 4px 18px 3px !important;
  border-bottom: 1px solid #eef1ef;
  color: #68736d;
  font-size: 12px;
  line-height: 1.3;
}
.gda-external-settings-modal__list {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(360px, 50dvh);
  margin: 0 !important;
  padding: 0 !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fff;
}
.gda-external-settings-modal__row {
  height: 30px;
  min-height: 30px;
  max-height: 30px;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0 18px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #edf0ee;
  background: #fff;
}
.gda-external-settings-modal__row:last-child {
  border-bottom: 0;
}
.gda-external-settings-modal__name {
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  color: #202d26;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.gda-external-settings-modal__switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c6ceca;
  cursor: pointer;
  transition: background .14s ease;
}
.gda-external-settings-modal__switch.is-on { background: #C96A3B; }
.gda-external-settings-modal__switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .14s ease;
}
.gda-external-settings-modal__switch.is-on .gda-external-settings-modal__switch-knob { transform: translateX(18px); }
.gda-external-settings-modal__empty {
  padding: 24px 22px;
  color: #68736d;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
}
.gda-external-settings-modal__actions {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 9px;
  margin: 0 !important;
  padding: 4px 18px 5px !important;
  border-top: 1px solid #e5e8e6;
  background: #fff;
}
.gda-external-settings-modal__action {
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  margin: 0 !important;
  padding: 0 12px !important;
  box-sizing: border-box;
  border: 1px solid #ccd3d7;
  border-radius: 4px;
  background: #fff;
  color: #27352e;
  font-family: inherit !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-transform: none !important;
  text-align: center;
  cursor: pointer;
}
.gda-external-settings-modal__action--save {
  border-color: #C96A3B;
  color: #C96A3B;
}
.gda-external-settings-modal__action--accept {
  border-color: #C96A3B;
  background: #C96A3B;
  color: #fff;
}

@media (max-width: 560px) {
  .gda-external-settings-modal { padding: 10px; }
  .gda-external-settings-modal__panel { max-height: calc(100dvh - 20px); }
  .gda-external-settings-modal__head { min-height: 54px; padding: 8px 14px; }
  .gda-external-settings-modal__head h2 { font-size: 17px; }
  .gda-external-settings-modal__desc { padding: 6px 14px 5px !important; }
  .gda-external-settings-modal__row { height: 36px; min-height: 36px; max-height: 36px; padding: 0 14px !important; }
  .gda-external-settings-modal__actions { gap: 6px; padding: 5px 10px 7px !important; }
  .gda-external-settings-modal__action { height: 38px; min-height: 38px; max-height: 38px; padding: 0 5px; white-space: normal; }
}
