/* The space publishing page (spaces/sites/edit) — split from share-dialog.css when
   publishing graduated from a dialog to a page. */

/* Publish hero — the one instant action, lifted out of the forms into a header
   live switch (auto-submits to the publication endpoint). */
.publish-hero {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-spring-wood-600);
  background: var(--color-white);
  margin-bottom: var(--space-xl);
}

.publish-hero--live {
  border-color: color-mix(in srgb, oklch(60% 0.12 155) 35%, var(--color-spring-wood-600));
  background: color-mix(in srgb, oklch(60% 0.12 155) 12%, var(--color-white));
}

.publish-hero__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-full);
  background: var(--color-spring-wood-300);
  color: var(--color-armadillo-500);
  font-size: 1.125rem;
}

.publish-hero--live .publish-hero__icon {
  background: oklch(60% 0.12 155);
  color: var(--color-white);
}

.publish-hero__body {
  flex: 1;
  min-width: 0;
}

.publish-hero__label {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-armadillo-900);
}

.publish-hero__hint {
  font-size: 0.8125rem;
  color: var(--color-armadillo-500);
  margin-top: 0.25rem;
}

.publish-hero__link {
  margin-top: var(--space-md);
}

.publish-hero__switch {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
}

.publish-hero__switch-cap {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-armadillo-500);
}

.publish-hero--live .publish-hero__switch-cap {
  color: oklch(46% 0.1 155);
}

@media (max-width: 30rem) {
  .publish-hero {
    flex-wrap: wrap;
  }

  .publish-hero__switch {
    order: -1;
    margin-left: auto;
    flex-direction: row;
    align-items: center;
  }
}

/* The published checkbox rendered as a switch: keeps real form semantics
   (posts on Save, no JS) while matching the .toggle look. */
.publish-row__switch {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.5rem;
  padding: 0.125rem;
  border-radius: var(--radius-full);
  background: var(--color-spring-wood-400);
  cursor: pointer;
  transition: background-color var(--transition-normal);
}

.publish-row__switch::before {
  content: "";
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: var(--radius-full);
  background: var(--color-white);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
  transition: transform var(--transition-normal);
}

.publish-row__switch:checked {
  background: oklch(60% 0.12 155);
}

.publish-row__switch:checked::before {
  transform: translateX(1rem);
}

.publish-row__switch:focus-visible {
  outline: 2px solid var(--color-primary-900);
  outline-offset: 2px;
}

/* Sections — a titled L2 inset (tint box holding a header label + a white content
   box; mirrors the team-settings .members pattern). Below the rail breakpoint the
   boxes collapse to labelled groups (three containers don't survive a phone). */
.publish-section {
  margin-top: var(--space-lg);
  background: rgb(0 0 0 / 0.03);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
}

.publish-section__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-inline: var(--space-xs);
  margin-bottom: var(--space-md);
}

.publish-section__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-armadillo-900);
}

.publish-section__status {
  font-size: 0.8125rem;
  color: var(--color-armadillo-500);
}

.publish-section__body {
  background: var(--color-white);
  border: 1px solid rgb(0 0 0 / 0.04);
  border-radius: calc(var(--radius-lg) - 1px);
  padding: var(--space-lg);
}

.publish-section__body > .form__field:last-child {
  margin-bottom: 0;
}

@media (max-width: 1023px) {
  .publish-section {
    margin-top: var(--space-xl);
    background: none;
    border-radius: 0;
    padding: 0;
  }

  .publish-section__header {
    padding-inline: 0;
    margin-bottom: var(--space-md);
  }

  .publish-section__title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-armadillo-500);
  }

  .publish-section__body {
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0;
  }
}

/* Each section saves itself: a hairline footer with its own Save, inside the body
   so the Save's scope == the box you can see. */
.publish-section__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-spring-wood-500);
}

.publish-types {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.publish-type__text {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.publish-type__hint {
  font-size: 0.8125rem;
  color: var(--color-armadillo-600);
}

/* Display-type picker — selectable radio cards: the native radio is hidden and
   selection is carried by a soft tinted fill plus a custom dot. */
.publish-type {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: var(--space-sm) var(--space-md);
  position: relative;
  background: var(--color-white);
  border: 1px solid var(--color-spring-wood-500);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--transition-normal), background-color var(--transition-normal);
}

.publish-type input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.publish-type__dot {
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  border: 1px solid var(--color-spring-wood-700);
  border-radius: 50%;
  background: var(--color-white);
  flex-shrink: 0;
  position: relative;
}

.publish-type:has(input:checked) {
  border-color: var(--color-armadillo-400);
  background: var(--color-white);
}

.publish-type:has(input:checked) .publish-type__dot {
  border-color: var(--color-armadillo-700);
}

.publish-type:has(input:checked) .publish-type__dot::after {
  content: "";
  position: absolute;
  inset: 0.1875rem;
  border-radius: 50%;
  background: var(--color-armadillo-800);
}

.publish-type:has(input:focus-visible) {
  outline: 2px solid var(--color-primary-900);
  outline-offset: 2px;
}

/* Brand card — logo on the left, name fields on the right. */
.brand-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-lg);
  align-items: start;
  margin-bottom: var(--space-lg);
}

@media (max-width: 30rem) {
  .brand-card {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

.brand-card__logo {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.brand-card__logo-cap {
  font-size: 0.75rem;
  color: var(--color-armadillo-500);
  max-width: 7rem;
  line-height: 1.35;
}

.brand-card__fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  min-width: 0;
}

.brand-card__fields .form__field {
  margin-bottom: 0;
}

/* In-form logo — picks a local preview and commits only on Save (no auto-submit). */
.brand-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
}

.brand-logo__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.brand-logo__slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  font: inherit;
  color: inherit;
}

.brand-logo--empty .brand-logo__slot {
  border: 1.5px dashed var(--color-armadillo-200);
}

.brand-logo--empty .brand-logo__slot:hover {
  border-color: var(--color-armadillo-400);
  background: color-mix(in srgb, var(--color-armadillo-900) 3%, transparent);
}

.brand-logo__slot:focus-visible {
  outline: 2px solid var(--color-primary-900);
  outline-offset: 2px;
}

.brand-logo__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-logo--empty .brand-logo__image {
  display: none;
}

.brand-logo__placeholder {
  color: var(--color-armadillo-300);
  font-size: 1.125rem;
  line-height: 1;
}

.brand-logo:not(.brand-logo--empty) .brand-logo__placeholder {
  display: none;
}

.brand-logo__reset {
  border: 0;
  background: none;
  padding: 0;
  font-size: 0.75rem;
  color: var(--color-armadillo-500);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.brand-logo__reset:hover {
  color: var(--color-armadillo-800);
}

/* Override field — the inherited default is shown as the input's REAL (greyed)
   value, tagged Team default / Custom, with a Reset. Never a placeholder. */
.override-field__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.override-field__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-armadillo-900);
}

.override-field__state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.75rem;
}

.override-field__tag {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.override-field__tag--default {
  color: var(--color-armadillo-500);
}

.override-field__tag--custom {
  color: var(--color-armadillo-700);
}

.override-field__reset {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.75rem;
  color: var(--color-armadillo-500);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.override-field__reset:hover {
  color: var(--color-armadillo-800);
}

.override-field__source {
  font-size: 0.75rem;
  color: var(--color-armadillo-500);
  margin-top: 0.375rem;
  line-height: 1.4;
}

.override-field__source b {
  font-weight: 600;
  color: var(--color-armadillo-700);
}

.override-field--inherited .form__input {
  color: var(--color-armadillo-500);
  background: color-mix(in srgb, var(--color-spring-wood-300) 40%, var(--color-white));
}
