/* ═══════════════════════════════════════════════════════════════════
   THE DALLAS REGISTRY — Write Room Styles
   [tdr_write_room]
   Residential. Architectural. Refined.
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --tdr-gold:  #c9a551;
  --tdr-gold2: #a8832f;
  --tdr-ink:   #111118;
  --tdr-navy:  #102a52;
  --tdr-mid:   #6b7280;
  --tdr-light: #f7f7f5;
  --tdr-rule:  #e5e7eb;
  --tdr-serif: 'Playfair Display', Georgia, serif;
  --tdr-sans:  'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Wrap ──────────────────────────────────────────────────────────── */
.tdr-wr-wrap {
  background: var(--tdr-light);
  min-height: 100vh;
  font-family: var(--tdr-sans);
}

/* ── Top bar ───────────────────────────────────────────────────────── */
.tdr-wr-topbar {
  background: var(--tdr-ink);
  border-bottom: 2px solid var(--tdr-gold);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 32px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 200;
}
.tdr-wr-topbar-brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}
.tdr-wr-topbar-logo {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .22em;
  color: #fff;
  text-transform: uppercase;
}
.tdr-wr-topbar-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--tdr-gold);
  text-transform: uppercase;
  padding-left: 10px;
  border-left: 1px solid rgba(255,255,255,.15);
}
.tdr-wr-topbar-author {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255,255,255,.7);
}
.tdr-wr-topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(201,165,81,.4);
}
.tdr-wr-topbar-since {
  font-size: 11px;
  color: rgba(255,255,255,.35);
}
/* Founding Member badge on the dark topbar — invert to gold-on-transparent */
.tdr-wr-topbar-since .tdr-founding-badge {
  background: rgba(201,165,81,.15);
  color: #c9a551;
  border-color: rgba(201,165,81,.4);
}
/* a:visited (0,1,1) outguns a bare class (0,1,0) — pin every link state
   to gold or the theme paints "My Account" unreadable blue on the dark bar */
a.tdr-wr-topbar-exit,
a.tdr-wr-topbar-exit:visited,
a.tdr-wr-topbar-exit:active,
.tdr-wr-topbar-exit {
  font-size: 12px;
  color: var(--tdr-gold) !important;
  text-decoration: none;
  white-space: nowrap;
  padding: 6px 14px;
  border: 1px solid rgba(201,165,81,.3);
  transition: border-color .15s;
}
.tdr-wr-topbar-exit:hover { border-color: var(--tdr-gold); }

/* ── Notice ────────────────────────────────────────────────────────── */
.tdr-wr-notice {
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 500;
}
.tdr-wr-notice--error {
  background: #fef2f2;
  border-left: 3px solid #dc2626;
  color: #dc2626;
}
.tdr-wr-notice--revision {
  background: #fff7ed;
  border-left: 3px solid #f97316;
  color: #92400e;
  line-height: 1.6;
}
.tdr-wr-revision-quote {
  margin: 8px 0 0;
  padding: 8px 14px;
  background: #ffedd5;
  border-left: 2px solid #f97316;
  font-style: italic;
  color: #7c2d12;
  font-size: 13px;
  line-height: 1.7;
}

/* ── Stage ─────────────────────────────────────────────────────────── */
.tdr-wr-stage {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ── Type selector ─────────────────────────────────────────────────── */
.tdr-wr-type-selector {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.tdr-wr-type-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tdr-mid);
}
.tdr-wr-type-btns { display: flex; gap: 10px; }
.tdr-wr-type-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #fff;
  border: 1px solid var(--tdr-rule);
  font-family: var(--tdr-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--tdr-mid);
  cursor: pointer;
  transition: all .15s;
}
.tdr-wr-type-btn:hover {
  border-color: var(--tdr-gold);
  color: var(--tdr-ink);
}
.tdr-wr-type-btn--active {
  background: var(--tdr-ink);
  border-color: var(--tdr-ink);
  color: #fff;
}
.tdr-wr-type-icon { font-size: 18px; }

/* ── Form sections ─────────────────────────────────────────────────── */
.tdr-wr-form { display: flex; flex-direction: column; gap: 0; }

.tdr-wr-section {
  background: #fff;
  border: 1px solid var(--tdr-rule);
  border-bottom: none;
  padding: 24px 28px;
}
.tdr-wr-section:first-child { border-top-width: 1px; }
.tdr-wr-section:last-of-type { border-bottom: 1px solid var(--tdr-rule); }

.tdr-wr-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* ── Labels ────────────────────────────────────────────────────────── */
.tdr-wr-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tdr-mid);
  margin-bottom: 10px;
}
.tdr-wr-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
  color: #9ca3af;
}

/* ── Inputs ────────────────────────────────────────────────────────── */
.tdr-wr-input,
.tdr-wr-textarea,
.tdr-wr-select {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--tdr-sans);
  font-size: 14px;
  color: var(--tdr-ink);
  background: #fff;
  border: 1px solid var(--tdr-rule);
  outline: none;
  transition: border-color .15s;
  appearance: none;
}
.tdr-wr-input:focus,
.tdr-wr-textarea:focus,
.tdr-wr-select:focus {
  border-color: var(--tdr-gold);
  box-shadow: 0 0 0 2px rgba(201,165,81,.12);
}
.tdr-wr-input--title {
  font-family: var(--tdr-serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -.01em;
  padding: 14px 16px;
}
.tdr-wr-textarea { resize: vertical; min-height: 100px; line-height: 1.6; }
.tdr-wr-field { display: flex; flex-direction: column; }

/* ── Add / Remove buttons ──────────────────────────────────────────── */
.tdr-wr-add-btn {
  font-family: var(--tdr-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--tdr-gold2);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tdr-wr-add-btn:hover { color: var(--tdr-gold); }
.tdr-wr-remove-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #9ca3af;
  font-size: 13px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .12s;
}
.tdr-wr-remove-btn:hover { color: #dc2626; }

/* ── Ingredient rows ───────────────────────────────────────────────── */
.tdr-wr-ingredient-list,
.tdr-wr-step-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tdr-wr-ingredient-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tdr-wr-row-handle {
  color: #d1d5db;
  cursor: grab;
  font-size: 16px;
  flex-shrink: 0;
}
.tdr-wr-ingredient-row .tdr-wr-input { flex: 1; }

/* ── Step rows ─────────────────────────────────────────────────────── */
.tdr-wr-step-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.tdr-wr-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--tdr-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}
.tdr-wr-step-ta { flex: 1; }

/* ── Image uploader ────────────────────────────────────────────────── */
.tdr-wr-uploader { display: flex; flex-direction: column; gap: 8px; }

.tdr-wr-upload-zone {
  position: relative;
  height: 180px;
  border: 2px dashed var(--tdr-rule);
  background: var(--tdr-light);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.tdr-wr-upload-zone:hover { border-color: var(--tdr-gold); }
.tdr-wr-upload-zone--has-image { border-style: solid; }

.tdr-wr-file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.tdr-wr-upload-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--tdr-mid);
  font-size: 12px;
  font-weight: 500;
  pointer-events: none;
  padding: 12px;
  text-align: center;
}
.tdr-wr-upload-zone--has-image .tdr-wr-upload-prompt {
  background: rgba(0,0,0,.55);
  color: #fff;
  width: 100%;
  height: 100%;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.tdr-wr-upload-zone--has-image:hover .tdr-wr-upload-prompt { opacity: 1; }

.tdr-wr-upload-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(0,0,0,.1);
}
.tdr-wr-upload-bar {
  height: 100%;
  width: 0;
  background: var(--tdr-gold);
  transition: width .2s;
}
.tdr-wr-remove-photo {
  font-size: 11px;
  font-family: var(--tdr-sans);
  color: #dc2626;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 0;
}
.tdr-wr-upload-error {
  font-size: 12px;
  color: #dc2626;
}

/* ── Extra photos grid ─────────────────────────────────────────────── */
.tdr-wr-photo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.tdr-wr-photo-slot .tdr-wr-upload-zone { height: 120px; }

/* ── Submit bar ────────────────────────────────────────────────────── */
.tdr-wr-submit-bar {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.tdr-wr-submit-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--tdr-mid);
  max-width: 420px;
  line-height: 1.5;
}
.tdr-wr-submit-note svg { flex-shrink: 0; margin-top: 1px; }
.tdr-wr-submit-btn {
  background: var(--tdr-gold);
  color: var(--tdr-ink);
  border: none;
  font-family: var(--tdr-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 14px 32px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: background .15s;
}
.tdr-wr-submit-btn:hover { background: var(--tdr-gold2); color: #fff; }
.tdr-wr-btn-ghost {
  font-size: 13px;
  color: var(--tdr-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-block;
}

/* ── Success screen ────────────────────────────────────────────────── */
.tdr-wr-success {
  max-width: 540px;
  margin: 80px auto;
  text-align: center;
  background: #fff;
  border: 1px solid var(--tdr-rule);
  padding: 52px 48px;
}
.tdr-wr-success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--tdr-gold);
  color: var(--tdr-ink);
  font-size: 28px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.tdr-wr-success-title {
  font-family: var(--tdr-serif);
  font-size: 28px;
  font-weight: 900;
  color: var(--tdr-ink);
  margin-bottom: 14px;
  letter-spacing: -.02em;
}
.tdr-wr-success-body {
  font-size: 15px;
  color: var(--tdr-mid);
  line-height: 1.6;
  margin-bottom: 32px;
}
.tdr-wr-success-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* ═══════════════════════════════════════════════════════════════════
   RECIPE DISPLAY TEMPLATE
   ═══════════════════════════════════════════════════════════════════ */

.tdr-recipe {
  font-family: var(--tdr-sans);
  color: var(--tdr-ink);
  max-width: 760px;
  margin: 0 auto;
}

.tdr-recipe-intro {
  font-size: 17px;
  line-height: 1.75;
  color: #374151;
  margin-bottom: 40px;
}

.tdr-recipe-section { margin-bottom: 40px; }

.tdr-recipe-rule {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
}
.tdr-recipe-rule::before,
.tdr-recipe-rule::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--tdr-gold);
  opacity: .4;
}
.tdr-recipe-rule::before { margin-right: 16px; }
.tdr-recipe-rule::after  { margin-left: 16px; }
.tdr-recipe-rule span {
  font-family: var(--tdr-sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--tdr-gold2);
  white-space: nowrap;
}

.tdr-recipe-ingredients {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 40px;
}
.tdr-recipe-ing-col {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tdr-recipe-ing-col li {
  font-size: 15px;
  line-height: 1.6;
  padding: 7px 0;
  border-bottom: 1px solid var(--tdr-rule);
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.tdr-recipe-ing-col li::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--tdr-gold);
  flex-shrink: 0;
  margin-bottom: 1px;
}

.tdr-recipe-steps {
  counter-reset: recipe-steps;
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.tdr-recipe-steps > li {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  counter-increment: recipe-steps;
}
.tdr-recipe-steps > li::before {
  content: counter(recipe-steps);
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--tdr-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tdr-recipe-steps > li p {
  margin: 0;
  font-size: 15px;
  line-height: 1.7;
  color: #374151;
  padding-top: 6px;
}

.tdr-recipe-photo-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 40px;
  scrollbar-width: thin;
}
.tdr-recipe-photo-item {
  flex-shrink: 0;
  width: 220px;
  height: 160px;
  overflow: hidden;
}
.tdr-recipe-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tdr-recipe-notes {
  font-size: 15px;
  line-height: 1.75;
  color: #374151;
  background: rgba(201,165,81,.06);
  border-left: 3px solid var(--tdr-gold);
  padding: 20px 24px;
}

.tdr-recipe-print { text-align: right; margin-top: 32px; }
.tdr-recipe-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--tdr-sans);
  font-size: 12px;
  font-weight: 600;
  color: var(--tdr-mid);
  background: none;
  border: 1px solid var(--tdr-rule);
  padding: 8px 16px;
  cursor: pointer;
  transition: all .15s;
}
.tdr-recipe-print-btn:hover {
  border-color: var(--tdr-gold);
  color: var(--tdr-ink);
}

/* ═══════════════════════════════════════════════════════════════════
   BYLINE SYSTEM
   ═══════════════════════════════════════════════════════════════════ */
.tdr-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  padding: 20px 0;
  border-top: 1px solid var(--tdr-rule);
  border-bottom: 1px solid var(--tdr-rule);
}
.tdr-byline-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--tdr-rule);
}
.tdr-byline-name {
  font-family: var(--tdr-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--tdr-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tdr-byline-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--tdr-gold2);
  background: rgba(201,165,81,.1);
  padding: 2px 8px;
  border: 1px solid rgba(201,165,81,.3);
}
.tdr-byline-meta {
  font-family: var(--tdr-sans);
  font-size: 12px;
  color: var(--tdr-mid);
  margin-top: 3px;
}

/* ── Founding Member badge — gold/navy pill ─────────────────────── */
.tdr-founding-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--tdr-navy, #102a52);
  color: #c9a551;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 1px solid rgba(201,165,81,.45);
  vertical-align: middle;
  line-height: 1.5;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════════
   MY SUBMISSIONS TAB
   ═══════════════════════════════════════════════════════════════════ */
.tdr-acct-submissions { }
.tdr-badge-pending { background: #fef3c7; color: #92400e; }

/* ═══════════════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════════════ */
@media print {
  .tdr-wr-topbar,
  .tdr-masthead,
  #tdr-masthead,
  .tdr-recipe-print { display: none !important; }

  .tdr-recipe {
    max-width: 100%;
    margin: 0;
  }

  .tdr-recipe-ingredients { grid-template-columns: 1fr 1fr; }
  .tdr-recipe-photo-strip { display: none; }

  .tdr-byline,
  .tdr-article-related { display: none; }
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .tdr-wr-topbar { padding: 0 16px; }
  .tdr-wr-topbar-since { display: none; }
  .tdr-wr-stage { padding: 20px 12px 60px; }
  .tdr-wr-section { padding: 18px 16px; }
  .tdr-wr-type-selector { flex-direction: column; align-items: flex-start; }
  .tdr-wr-photo-grid { grid-template-columns: repeat(3, 1fr); }
  .tdr-wr-submit-bar { flex-direction: column; align-items: stretch; }
  .tdr-wr-submit-btn { text-align: center; }

  .tdr-recipe-ingredients { grid-template-columns: 1fr; }
  .tdr-recipe-photo-strip { }
  .tdr-recipe-photo-item { width: 160px; height: 120px; }

  .tdr-wr-success { padding: 32px 20px; }
}
