/**
 * Email DNS Generator — tool styles
 *
 * Layout, the record readout and the table's typography. Cards, fields, alerts,
 * badges and the table itself are frikwork's; nothing here restyles one.
 */

/**
 * `[hidden]` only sets `display: none` in the user-agent stylesheet, and any
 * author-origin `display` on the same element outranks it regardless of
 * specificity — so `hidden` silently stops working the moment an element also
 * carries `.fw-btn` (inline-flex) or a grid class. frikwork restores it
 * per-component the same way (`.fw-dropdown__panel[hidden]`, `.fw-command__item[hidden]`).
 * Everything this tool toggles carries .edns-hideable so the attribute means
 * what it says.
 */
.edns-hideable[hidden] { display: none; }

/* Config on the left, the generated record on the right, for both sections. */
.edns-split {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 1fr;
  gap: var(--fw-space-xl);
  align-items: start;
}

/* Grid children default to min-content width, which would let a long SPF record
   stretch the column instead of wrapping inside it. */
.edns-config,
.edns-out { min-width: 0; }

.edns-presets,
.edns-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--fw-space-sm);
}

.edns-presets .fw-btn { flex: 1 1 auto; }

/* Mechanism lists are read character by character — proportional type makes a
   stray space or a confusable character invisible. */
[data-edns-mono] {
  font-family: var(--fw-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.85rem;
  line-height: 1.6;
}

/* --- The record readout --------------------------------------------------- */

.edns-record {
  display: flex;
  align-items: flex-start;
  gap: var(--fw-space-sm);
  padding: var(--fw-space-md);
  min-height: 5rem;
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-md);
  background: var(--fw-bg-2);
}

.edns-record__text {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--fw-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.6;
  color: var(--fw-text);
  overflow-wrap: anywhere;
  /* The whole record is one value — a double-click should take all of it. */
  -webkit-user-select: all;
  user-select: all;
}

.edns-record__text--empty {
  font-weight: 400;
  color: var(--fw-text-muted);
  -webkit-user-select: none;
  user-select: none;
}

/* --- Record details ------------------------------------------------------- */

.edns-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--fw-space-md);
  margin-top: var(--fw-space-md);
  padding: var(--fw-space-md);
  border: 1px solid var(--fw-border);
  border-radius: var(--fw-radius-md);
}

.edns-details__item { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }

.edns-details__value {
  font-family: var(--fw-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.9rem;
  color: var(--fw-text);
  overflow-wrap: anywhere;
}

.edns-details__value small {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--fw-text-muted);
}

.edns-warnings {
  display: flex;
  flex-direction: column;
  gap: var(--fw-space-sm);
}
.edns-warnings:not(:empty) { margin-top: var(--fw-space-md); }

/* --- Paired selects ------------------------------------------------------- */

.edns-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--fw-space-md);
}

/* --- Records table -------------------------------------------------------- */

.edns-table td { vertical-align: top; }

.edns-val {
  font-family: var(--fw-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.85rem;
  color: var(--fw-text);
  overflow-wrap: anywhere;
}

/* A long SPF record would otherwise squeeze Host and TTL to nothing. */
.edns-val--wrap { display: inline-block; max-width: 70ch; }

.edns-copy-cell { width: 1%; white-space: nowrap; text-align: right; }

.edns-note { margin: var(--fw-space-md) 0 0; }

/* --- About ---------------------------------------------------------------- */

.edns-about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--fw-space-xl);
}

.edns-about__title {
  margin: 0 0 var(--fw-space-sm);
  font-size: 0.95rem;
}
.edns-about__title i { color: var(--fw-brand-text); margin-right: 0.35rem; }

.edns-about p { color: var(--fw-text-2); }
.edns-about__sub { margin-bottom: var(--fw-space-xs); }

.edns-about ul {
  margin: 0 0 var(--fw-space-md);
  padding-left: 1.25rem;
  color: var(--fw-text-2);
  font-size: 0.88rem;
}
.edns-about li { margin-bottom: 0.3rem; }
.edns-about li:last-child { margin-bottom: 0; }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 1100px) {
  .edns-split { grid-template-columns: 1fr; gap: var(--fw-space-lg); }
  .edns-about { grid-template-columns: 1fr; gap: var(--fw-space-lg); }
}

@media (max-width: 560px) {
  .edns-pair { grid-template-columns: 1fr; }
  .edns-val--wrap { max-width: none; }
}
