/* social.css — Sosyal yayın sayfası (#socialOverlay) ve stüdyo sohbetindeki .social-chat kartı.
   Not: .social-chat de .social-board sınıfını taşır; sayfa kuralları #socialOverlay altında daraltılmıştır. */

/* ---------- Sayfa yerleşimi ---------- */
.social-scroll { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
#socialOverlay .social-prepare, #socialOverlay .social-history, #socialOverlay .social-settings {
  min-width: 0; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
#socialOverlay fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
#socialOverlay legend { margin-bottom: 8px; padding: 0; color: var(--ink-2); font-size: var(--text-13); font-weight: 500; }
#socialOverlay input:not([type="checkbox"]):not([type="file"]), #socialOverlay select { min-height: 44px; }

/* Hazırlama formu */
.social-prepare { display: flex; flex-direction: column; gap: 8px; }
.social-prepare > label { color: var(--ink-2); font-size: var(--text-13); font-weight: 500; }
.social-prepare > select { margin-bottom: 8px; }
#socialChannels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
#socialChannels label {
  min-width: 0; min-height: 56px; display: grid; grid-template-columns: 18px minmax(0, 1fr); align-content: center; column-gap: 10px; row-gap: 2px;
  padding: 12px 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  font-size: var(--text-14); font-weight: 500; line-height: 1.4; cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease;
}
#socialChannels label:hover { background: var(--surface-2); }
#socialChannels label:has(input:checked) { background: var(--green-soft); border-color: var(--green); }
#socialChannels label:has(input:focus-visible) { outline: 2px solid var(--green); outline-offset: 2px; }
#socialChannels label:has(input:disabled) { color: var(--muted); background: var(--surface-2); border-color: var(--line); cursor: not-allowed; }
#socialChannels input { align-self: center; cursor: inherit; }
#socialChannels small { grid-column: 2; color: var(--muted); font-size: var(--text-12); font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.social-hint { color: var(--muted); font-size: var(--text-13); line-height: 1.55; overflow-wrap: anywhere; }
.social-hint:empty { display: none; }
.social-prepare > .btn { align-self: flex-start; margin-top: 4px; }
.social-feedback { color: var(--ink-2); font-size: var(--text-14); line-height: 1.55; overflow-wrap: anywhere; }
.social-feedback:empty { display: none; }

/* Gönderiler ve yayın sonuçları */
.social-history > .row-between { gap: 12px; }
.social-history h2 { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1.2; }
#socialJobs > .social-hint { margin-top: 12px; }
.social-job { min-width: 0; padding: 16px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
#socialJobs > .social-job:first-child { margin-top: 16px; }
#socialJobs > .social-job:last-child { padding-bottom: 0; }
.social-job-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px 12px; }
.social-job-head > div { flex: 1 1 240px; min-width: 0; }
.social-job-head h3 { color: var(--ink); font-size: var(--text-15); font-weight: 600; line-height: 1.4; }
.social-job-head span { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-13); font-variant-numeric: tabular-nums; }
.social-job-head .btn { flex: 0 0 auto; }
.social-job > .social-hint, .social-job > .social-error { margin-top: 8px; }
.social-error { color: var(--red); font-size: var(--text-13); line-height: 1.5; overflow-wrap: anywhere; }
.social-results { list-style: none; display: grid; gap: 6px; margin-top: 12px; font-size: var(--text-13); line-height: 1.5; }
.social-results li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.social-results strong { color: var(--ink); font-weight: 600; }
.social-results span { color: var(--muted); }
.social-results p { flex-basis: 100%; color: var(--ink-2); line-height: 1.55; }

/* AI önizlemesi */
.social-preview { margin-top: 12px; }
.social-preview summary, .social-preview-body details > summary {
  min-height: 44px; display: inline-flex; align-items: center; gap: 6px; color: var(--green-text);
  font-size: var(--text-14); font-weight: 600; cursor: pointer; border-radius: 6px;
}
.social-preview summary::after, .social-settings > summary::after {
  content: ""; width: 16px; height: 16px; flex: 0 0 16px; transition: transform var(--dur-fast) ease;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231d5b4b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.social-preview[open] > summary::after, .social-preview-body details[open] > summary::after, .social-settings[open] > summary::after { transform: rotate(180deg); }
.social-preview-body details > summary { font-size: var(--text-13); }
.social-preview-body { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 20px; padding-top: 8px; }
.social-preview-body > div { min-width: 0; }
.social-artwork-previews { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-content: start; align-items: start; }
.social-artwork-previews figure { min-width: 0; margin: 0; }
.social-artwork-previews img { display: block; width: 100%; height: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.social-artwork-previews figcaption { margin-top: 6px; color: var(--muted); font-size: var(--text-13); line-height: 1.45; }
.social-artwork-previews > p { grid-column: 1 / -1; color: var(--muted); font-size: var(--text-13); }
.social-preview-body section + section { margin-top: 12px; }
.social-preview-body h4 { margin-bottom: 4px; color: var(--ink-2); font-size: var(--text-13); font-weight: 600; }
.social-preview-body p { font-size: var(--text-14); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.social-preview-body details { margin-top: 8px; }
.social-preview-body details p { color: var(--ink-2); font-size: var(--text-13); }
.social-preview-body details p + p { margin-top: 6px; }

/* Hesap bağlantıları ve şablon */
#socialOverlay .social-settings { padding-block: 6px; }
.social-settings > summary {
  min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  color: var(--ink); font-size: var(--text-14); font-weight: 600; cursor: pointer; border-radius: 6px;
}
.social-settings > summary::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2344554c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.social-settings form { display: flex; flex-direction: column; gap: 14px; padding: 8px 0 14px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 16px; }
.social-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.social-settings-grid label, .social-settings form > label { min-width: 0; display: grid; gap: 6px; color: var(--ink-2); font-size: var(--text-13); font-weight: 500; }
.social-disconnect { display: flex; flex-wrap: wrap; column-gap: 16px; }
.social-disconnect legend { width: 100%; }
.social-disconnect label { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-size: var(--text-14); font-weight: 400; cursor: pointer; }
.social-settings form > .btn { align-self: flex-start; }

/* ---------- Stüdyo sohbetindeki sosyal kart ---------- */
.social-chat {
  align-self: stretch; width: 100%; min-width: 0; display: flex; flex-direction: column; gap: 8px; padding: 16px;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  font-size: var(--text-14); line-height: 1.6; overflow-wrap: anywhere;
}
.social-chat > h2 { font-family: var(--font-display); font-size: 20px; font-weight: 400; line-height: 1.25; }
.social-chat .social-chat-status { color: var(--muted); font-size: var(--text-13); }
.social-chat-jobs:empty, .social-chat-actions:empty { display: none; }
.social-chat .social-job { padding: 0; border-top: 0; }
.social-chat .social-job-head { flex-direction: column; align-items: stretch; gap: 10px; }
.social-chat .social-job-head > div { flex: 0 1 auto; }
.social-chat .social-job-head .btn { align-self: flex-start; }
.social-chat .social-preview-body { grid-template-columns: minmax(0, 1fr); gap: 16px; }
.social-chat .social-artwork-previews { max-width: 440px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.social-chat .social-post-image { aspect-ratio: 4 / 5; object-fit: cover; }
.social-chat .social-story-image { aspect-ratio: 9 / 16; object-fit: cover; }
.social-chat .btn { min-height: 44px; max-width: 100%; white-space: normal; text-align: center; }
.social-chat-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  #socialChannels { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Telefon ---------- */
@media (max-width: 760px) {
  .social-scroll { gap: 16px; }
  #socialOverlay .social-prepare, #socialOverlay .social-history { padding: 16px; }
  #socialOverlay .social-settings { padding: 4px 16px; }
  .social-prepare > .btn, .social-settings form > .btn { width: 100%; }
  #socialOverlay .social-job-head .btn { width: 100%; }
  .social-preview-body, .social-settings-grid { grid-template-columns: minmax(0, 1fr); }
  .social-artwork-previews { gap: 12px; }
}
@media (max-width: 430px) {
  .social-chat { padding: 14px; }
  .social-chat .social-artwork-previews { grid-template-columns: minmax(0, 260px); }
  .social-chat .social-job-head .btn { width: 100%; }
}
