/**
 * Shared styles for consent, engagement, integrations and smart media.
 * This file is loaded by both the local React preview and WordPress.
 */

img[data-smart-focal] {
  object-position: var(--smart-focal-x, 50%) var(--smart-focal-y, 50%);
  transition:
    object-position 420ms ease,
    transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.detail-like-button b,
.detail-like-button small {
  font: inherit;
}

.detail-like-button small {
  min-width: 1.35rem;
  display: inline-grid;
  place-items: center;
  padding: 2px 6px;
  background: rgba(82, 96, 59, 0.1);
  border-radius: 999px;
  font-size: 0.7rem;
}

.detail-like-button.is-liked {
  color: var(--paper);
  background: var(--oxblood);
  border-color: var(--oxblood);
}

.detail-like-button.is-liked small {
  background: rgba(255, 255, 255, 0.16);
}

.detail-like-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.detail-player {
  position: relative;
  overflow: hidden;
  background: var(--olive-dark);
}

.media-consent-gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 26px;
  color: var(--paper);
  background:
    radial-gradient(circle at 50% 38%, rgba(140, 152, 117, 0.34), transparent 36%),
    linear-gradient(135deg, #29331f, #172014);
  border: 0;
  cursor: pointer;
  text-align: center;
}

.media-consent-gate[hidden] {
  display: none;
}

.media-consent-gate > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding-left: 4px;
  background: var(--paper);
  color: var(--oxblood);
  border-radius: 50%;
  font-size: 1rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.24);
}

.media-consent-gate strong {
  margin-top: 6px;
  font-size: 0.9rem;
}

.media-consent-gate small {
  color: rgba(255, 253, 247, 0.72);
  font-size: 0.74rem;
}

.ad-placeholder.is-configured {
  display: block;
  padding: 15px 18px 18px;
}

.ad-placeholder.is-configured > span {
  display: block;
  margin-bottom: 8px;
  text-align: center;
}

.adsbygoogle {
  width: 100%;
  min-height: 90px;
}

.ad-consent-note {
  padding-block: 30px 14px;
}

.footer-consent-settings {
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition: color 180ms ease;
}

.footer-consent-settings:hover,
.footer-consent-settings:focus-visible {
  color: var(--oxblood);
}

body.consent-modal-open {
  overflow: hidden;
}

.consent-banner[hidden],
.consent-modal[hidden] {
  display: none;
}

.consent-banner {
  position: fixed;
  right: 24px;
  bottom: 24px;
  left: 24px;
  z-index: 760;
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 24px 26px;
  color: var(--ink);
  background: rgba(255, 253, 247, 0.98);
  border: 1px solid rgba(53, 64, 39, 0.28);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(20, 25, 17, 0.26);
  backdrop-filter: blur(14px);
  animation: consent-rise 300ms cubic-bezier(0.2, 0.8, 0.25, 1) both;
}

.consent-kicker {
  margin: 0 0 7px;
  color: var(--olive);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.consent-banner h2,
.consent-dialog h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.2vw, 1.9rem);
  line-height: 1.12;
}

.consent-banner-copy > p:last-child,
.consent-dialog > p {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.consent-banner-copy a,
.consent-dialog-actions a {
  color: var(--oxblood);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-banner-actions {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 8px;
}

.consent-banner-actions .button {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.75rem;
}

.consent-customize {
  grid-column: 1 / -1;
  padding: 5px;
  color: var(--olive-dark);
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 800;
}

.consent-modal {
  position: fixed;
  inset: 0;
  z-index: 780;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(22, 26, 18, 0.68);
  backdrop-filter: blur(8px);
}

.consent-dialog {
  position: relative;
  width: min(100%, 650px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 34px;
  background: var(--paper);
  border: 1px solid rgba(53, 64, 39, 0.28);
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(17, 21, 14, 0.34);
}

.consent-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--muted);
  background: var(--milk);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
}

.consent-category-list {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}

.consent-category {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 15px 17px;
  background: rgba(222, 208, 184, 0.18);
  border: 1px solid rgba(37, 38, 31, 0.1);
  border-radius: 13px;
}

.consent-category strong {
  color: var(--olive-dark);
  font-size: 0.82rem;
}

.consent-category p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.consent-category > span {
  color: var(--olive);
  font-size: 0.68rem;
  font-weight: 800;
}

.consent-category:is(label) {
  cursor: pointer;
}

.consent-switch-control {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 42px;
  display: block;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
}

.consent-switch-input {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.consent-switch-visual {
  position: absolute;
  inset: 0;
  display: block;
  background: rgba(222, 208, 184, 0.72);
  border: 1px solid rgba(82, 96, 59, 0.42);
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(37, 38, 31, 0.08);
  transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.consent-switch-visual::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  content: "";
  background: var(--paper);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(37, 38, 31, 0.2);
  transition: transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

.consent-switch-input:checked + .consent-switch-visual {
  background: var(--olive);
  border-color: var(--olive-dark);
  box-shadow: 0 4px 12px rgba(53, 64, 39, 0.2);
}

.consent-switch-input:checked + .consent-switch-visual::after {
  transform: translateX(18px);
}

.consent-switch-input:focus-visible + .consent-switch-visual {
  outline: 3px solid rgba(123, 48, 43, 0.34);
  outline-offset: 3px;
}

.consent-switch-input:active + .consent-switch-visual::after {
  transform: scale(0.9);
}

.consent-switch-input:checked:active + .consent-switch-visual::after {
  transform: translateX(18px) scale(0.9);
}

.consent-dialog-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 22px;
}

.consent-dialog-actions .button {
  min-height: 46px;
}

.consent-dialog-actions a {
  font-size: 0.78rem;
  font-weight: 700;
}

@keyframes consent-rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 760px) {
  .consent-banner {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: calc(100% - 24px);
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 21px;
    border-radius: 18px;
  }

  .consent-banner-actions {
    grid-template-columns: 1fr 1fr;
  }

  .consent-dialog {
    padding: 29px 20px 22px;
  }

  .consent-dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .consent-dialog-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  img[data-smart-focal],
  .consent-banner {
    animation: none;
    transition: none;
  }
}
