/* Essential � Typo styles (Frontify-aligned) */

.essential-section--typo-styles {
  position: relative;
}

.essential-typo-styles-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 18px;
}

.essential-typo-styles-head h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.essential-typo-styles-list {
  display: grid;
  gap: 16px;
}

.essential-typo-style-card {
  display: grid;
  grid-template-columns: minmax(160px, 200px) minmax(0, 1fr) minmax(200px, 240px);
  gap: 14px 18px;
  align-items: stretch;
  padding: 16px;
  border: 1px solid rgba(27, 24, 20, 0.1);
  border-radius: 12px;
  background: #fff;
}

.essential-typo-style-card.is-editing {
  border-color: rgba(11, 90, 59, 0.35);
  box-shadow: 0 0 0 1px rgba(11, 90, 59, 0.12);
}

.essential-typo-style-name {
  display: block;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.essential-typo-style-props {
  margin: 0;
  font-size: 0.72rem;
}

.essential-typo-style-props div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  margin-bottom: 4px;
}

.essential-typo-style-props dt {
  margin: 0;
  color: rgba(27, 24, 20, 0.48);
  font-weight: 600;
}

.essential-typo-style-props dd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.68rem;
}

.essential-typo-prop-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.essential-typo-style-preview {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid rgba(27, 24, 20, 0.06);
}

.essential-typo-style-preview-line {
  margin: 0 0 8px;
  font-weight: inherit;
}

.essential-typo-style-preview-desc {
  margin: 0;
  font-size: 0.82em;
  opacity: 0.85;
}

.essential-typo-style-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}

.essential-typo-style-control-row {
  display: grid;
  gap: 6px;
}

.essential-typo-style-control-label {
  font-size: 0.72rem;
  font-weight: 650;
  color: rgba(27, 24, 20, 0.55);
}

.essential-typo-style-swatches {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.essential-typo-swatch {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.essential-typo-swatch-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.essential-typo-swatch.is-active {
  border-color: #1b1814;
}

.essential-typo-swatch.is-forbidden .essential-typo-swatch-fill {
  opacity: 0.45;
}

.essential-typo-swatch-check {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.essential-typo-swatch-forbidden {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #dc2626;
  font-size: 1rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 4px;
}

.essential-typo-style-edit-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
}

.essential-typo-style-settings-btn,
.essential-typo-style-delete {
  align-self: flex-start;
  font-size: 0.78rem;
}

.essential-typo-style-delete {
  color: #dc2626;
}

.essential-typo-styles-empty {
  padding: 32px 20px;
  text-align: center;
  border: 1px dashed rgba(27, 24, 20, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
}

.essential-typo-style-settings {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1180;
  width: min(360px, 100vw);
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(27, 24, 20, 0.1);
  background: #fff;
  box-shadow: -12px 0 40px rgba(27, 24, 20, 0.12);
}

.essential-typo-style-settings header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(27, 24, 20, 0.08);
}

.essential-typo-style-settings header h3 {
  margin: 0;
  font-size: 0.92rem;
}

.essential-typo-style-settings-body {
  flex: 1;
  overflow: auto;
  padding: 14px 16px;
}

.essential-typo-style-settings-body label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 0.78rem;
  font-weight: 650;
}

.essential-typo-style-settings-body input,
.essential-typo-style-settings-body select,
.essential-typo-style-settings-body textarea {
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid rgba(27, 24, 20, 0.12);
  border-radius: 8px;
  font: inherit;
}

.essential-typo-style-settings-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(27, 24, 20, 0.08);
}

.essential-typo-picker {
  position: fixed;
  z-index: 1190;
  top: 50%;
  right: min(380px, calc(100vw - 24px));
  transform: translateY(-50%);
  width: min(320px, calc(100vw - 48px));
  max-height: min(70vh, 520px);
  overflow: auto;
  padding: 14px;
  border-radius: 12px;
  background: #2a2d32;
  color: #fff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
}

.essential-typo-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.essential-typo-picker-head h3 {
  margin: 0;
  font-size: 0.88rem;
}

.essential-typo-picker-close {
  width: 32px;
  height: 32px;
  padding: 0;
  color: #fff;
}

.essential-typo-picker-hint {
  margin: 0 0 12px;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
}

.essential-typo-picker-group {
  margin-bottom: 14px;
}

.essential-typo-picker-group-label {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.essential-typo-picker-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

@media (max-width: 960px) {
  .essential-typo-style-card {
    grid-template-columns: 1fr;
  }

  .essential-typo-picker {
    right: 12px;
    left: 12px;
    width: auto;
    transform: none;
    top: auto;
    bottom: 12px;
  }
}
