/* ACN Red Wednesday — Profile Photo Frame
   Scoped under .redw-pf so it never leaks into the rest of the page. */

.redw-pf {
  --pf-red: #bb2525;
  --pf-red-dark: #9e1d1d;
  --pf-ink: #2b2b2b;
  --pf-muted: #6b6b6b;
  --pf-line: #e6e6e6;
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
  font-family: inherit;
  color: var(--pf-ink);
}

.redw-pf-title { font-size: 1.55rem; margin: 0 0 .35rem; line-height: 1.2; }
.redw-pf-sub { color: var(--pf-muted); margin: 0 auto 1.4rem; font-size: .95rem; line-height: 1.5; max-width: 30rem; }

.redw-pf-stage {
  position: relative;
  width: min(420px, 82vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: repeating-conic-gradient(#f4f4f4 0% 25%, #fafafa 0% 50%) 50% / 28px 28px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .10);
}
.redw-pf-stage.is-drag { cursor: grabbing; }
.redw-pf-stage canvas { width: 100%; height: 100%; display: block; }

.redw-pf-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
  color: var(--pf-muted); font-size: .95rem; padding: 1.5rem; text-align: center;
  pointer-events: none;
}

.redw-pf-controls { display: flex; flex-direction: column; gap: .9rem; align-items: center; }

.redw-pf-seg {
  display: flex; flex-wrap: wrap; max-width: 400px;
  border: 1px solid var(--pf-line); border-radius: 9px; overflow: hidden;
}
.redw-pf-seg button {
  flex: 1 1 0; min-width: 0; border: 0; background: #fff; color: var(--pf-ink);
  font: inherit; font-weight: 600; padding: .55rem .7rem; cursor: pointer; transition: .15s;
  white-space: nowrap;
}
.redw-pf-seg button + button { border-left: 1px solid var(--pf-line); }
/* "both languages" sits full-width on its own row */
.redw-pf-seg button[data-pf-settag="both"] {
  flex-basis: 100%; border-left: 0; border-top: 1px solid var(--pf-line);
}
.redw-pf-seg button.is-active { background: var(--pf-red); color: #fff; }

/* On/off switch for the top solidarity line */
.redw-pf-switch {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .9rem; color: var(--pf-ink); cursor: pointer; user-select: none;
}
.redw-pf-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.redw-pf-switch .redw-pf-track {
  flex: 0 0 auto; width: 42px; height: 24px; border-radius: 999px;
  background: #cfcfcf; position: relative; transition: .15s;
}
.redw-pf-switch .redw-pf-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: .15s;
}
.redw-pf-switch input:checked + .redw-pf-track { background: var(--pf-red); }
.redw-pf-switch input:checked + .redw-pf-track::after { transform: translateX(18px); }
.redw-pf-switch input:focus-visible + .redw-pf-track {
  outline: 2px solid rgba(187, 37, 37, .55); outline-offset: 2px;
}
/* "both hashtags" selected → the top line has no single language */
.redw-pf-topctl { display: flex; flex-direction: column; align-items: center; gap: .3rem; }
.redw-pf-switch.is-disabled { opacity: .5; cursor: not-allowed; }
.redw-pf-switch.is-disabled .redw-pf-track { cursor: not-allowed; }
.redw-pf-note {
  margin: 0; font-size: .8rem; line-height: 1.35; color: var(--pf-red); max-width: 28rem;
}
.redw-pf-note[hidden] { display: none; }

.redw-pf-zoom { display: flex; align-items: center; gap: .65rem; width: 100%; max-width: 420px; }
.redw-pf-zoom span { font-size: .85rem; color: var(--pf-muted); min-width: 2.6rem; text-align: left; }
.redw-pf-zoom input[type="range"] { flex: 1; accent-color: var(--pf-red); }

.redw-pf-buttons { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }

.redw-pf-btn {
  font: inherit; font-weight: 600; border-radius: 9px; border: 1px solid var(--pf-line);
  background: #fff; color: var(--pf-ink); padding: .65rem 1.1rem; cursor: pointer; transition: .15s;
  display: inline-flex; align-items: center; margin: 0;
}
.redw-pf-btn:hover { border-color: #cfcfcf; }
.redw-pf-btn--primary { background: var(--pf-red); border-color: var(--pf-red); color: #fff; }
.redw-pf-btn--primary:hover { background: var(--pf-red-dark); border-color: var(--pf-red-dark); }
.redw-pf-btn:disabled { opacity: .45; cursor: not-allowed; }

.redw-pf-hint { font-size: .78rem; color: var(--pf-muted); margin: .2rem 0 0; }

/* ---- Modal mode ([redw_profile_frame mode="modal"]) ---- */
.redw-pf-launch { text-align: center; margin: 1.25rem auto; }
/* Force brand red across ALL states — dark themes often repaint
   button:focus / :active black, which is what turned the CTA dark after
   it was clicked. !important keeps our colour regardless of theme rules. */
.redw-pf-open,
.redw-pf-open:link,
.redw-pf-open:visited,
.redw-pf-open:focus,
.redw-pf-open:focus-visible {
  font: inherit; font-weight: 700; font-size: 1.05rem;
  background-color: #bb2525 !important; color: #fff !important;
  border: 0 !important; border-radius: 10px; padding: .95rem 1.9rem; cursor: pointer;
  box-shadow: 0 6px 18px rgba(187, 37, 37, .28); transition: .15s;
  text-decoration: none;
}
.redw-pf-open:hover,
.redw-pf-open:active {
  background-color: #9e1d1d !important; color: #fff !important;
  transform: translateY(-1px);
}
.redw-pf-open:focus-visible { outline: 3px solid rgba(187, 37, 37, .55); outline-offset: 3px; }

.redw-pf-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.redw-pf-modal[hidden] { display: none; }
.redw-pf-modal-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.redw-pf-modal-card {
  position: relative; z-index: 1; background: #fff; border-radius: 16px;
  max-width: 720px; width: 100%; max-height: 92vh; overflow: auto;
  padding: 2.25rem 1.25rem 1.5rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.redw-pf-modal-close {
  position: absolute; top: .6rem; right: .7rem;
  width: 2.2rem; height: 2.2rem; border: 0; border-radius: 50%;
  background: #f1f1f1; color: #333; font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.redw-pf-modal-close:hover { background: #e3e3e3; }
