/* ==========================================================================
   Görsel atölyesi (#122): mdosc/gorsel-atolyesi.php · assets/js/modules/gorsel-atolyesi.js
   Düzen: başlık → solda ayarlar kartı, sağda önizleme + düzenleme kartları → önceki görseller
   ========================================================================== */

.ga-sayfa { background: var(--bg-alt); }

/* ---------- Başlık ---------- */
.ga-bas { padding: calc(var(--header-h) + clamp(20px, 3vw, 36px)) 0 clamp(20px, 2.5vw, 28px); }
.ga-bas .breadcrumb { margin-bottom: 16px; }
.ga-bas h1 { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 0 8px; font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); letter-spacing: -.025em; }
.ga-bas h1 span { padding: 4px 10px; border-radius: 999px; background: var(--green-100); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--green-700); }
.ga-bas p { max-width: 720px; margin: 0; font-size: 1.0625rem; line-height: 1.6; color: var(--ink-2); }

/* ---------- Izgara ---------- */
.ga-calisma { padding-bottom: clamp(48px, 6vw, 80px); }
.ga-izgara { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); align-items: start; gap: 20px; }
.ga-kart { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.ga-sag { display: grid; gap: 20px; }

/* ---------- Form öğeleri ---------- */
.ga-form, .ga-duzen { display: grid; gap: 20px; padding: 22px; }
.ga-grup { display: grid; gap: 8px; min-width: 0; }
.ga-etiket { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.ga-ipucu { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.ga-form textarea, .ga-duzen input[type="text"], .ga-duzen textarea, .ga-ayarlar input[type="text"] {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  resize: vertical;
  transition: border-color .2s, box-shadow .2s;
}
.ga-form textarea:focus, .ga-duzen input:focus, .ga-duzen textarea:focus, .ga-ayarlar input[type="text"]:focus { outline: none; border-color: var(--navy-700); box-shadow: 0 0 0 3px var(--navy-50); }
.ga-duzen textarea[readonly] { background: var(--surface-2); color: var(--ink-2); }
.ga-ikili { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Hap seçimler */
.ga-hap { display: flex; flex-wrap: wrap; gap: 6px; }
.ga-hap label { position: relative; cursor: pointer; }
.ga-hap input { position: absolute; opacity: 0; pointer-events: none; }
.ga-hap span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-2); transition: border-color .2s, background-color .2s, color .2s; }
.ga-hap label:hover span { border-color: var(--navy-700); color: var(--ink); }
.ga-hap input:checked + span { border-color: var(--navy-900); background: var(--navy-900); color: #fff; }
.ga-hap input:focus-visible + span { outline: 2px solid var(--navy-700); outline-offset: 2px; }

/* Konu önerileri */
.ga-oneriler { display: flex; flex-wrap: wrap; gap: 6px; }
.ga-oneriler button { padding: 5px 11px; border: 1px dashed var(--line-2); border-radius: 999px; background: var(--surface); font: inherit; font-size: 12.5px; color: var(--ink-2); text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s, color .2s; }
.ga-oneriler button:hover, .ga-oneriler button.is-secili { border-style: solid; border-color: var(--navy-700); background: var(--navy-50); color: var(--ink); }

.ga-ek { display: grid; gap: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.ga-ek summary { display: flex; align-items: center; gap: 8px; width: fit-content; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; list-style: none; }
.ga-ek summary::-webkit-details-marker { display: none; }
.ga-ek summary::before { content: ""; width: 0; height: 0; border-left: 5px solid var(--muted); border-block: 4px solid transparent; transition: transform .2s; }
.ga-ek[open] summary::before { transform: rotate(90deg); }
.ga-ek:not([open]) { gap: 0; }
.ga-ek .btn { justify-self: start; }
.ga-dosya { position: relative; display: inline-flex; width: fit-content; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ga-dosya:hover, .ga-dosya:focus-within { border-color: var(--navy-700); color: var(--ink); }
.ga-dosya input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.ga-uret .i { width: 18px; height: 18px; }
.ga-kisayol { margin: -12px 0 0; font-size: 12.5px; text-align: center; color: var(--muted); }
.ga-alt-baglar { display: flex; justify-content: center; gap: 8px; margin-top: -8px; }
.ga-alt-baglar button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.ga-alt-baglar button:hover { border-color: var(--navy-700); color: var(--ink); }
.ga-alt-baglar .i { width: 14px; height: 14px; }

/* ---------- Önizleme ---------- */
.ga-onizleme { display: grid; gap: 14px; padding: 20px; }
.ga-tuval { position: relative; display: grid; width: 100%; max-width: 620px; max-height: 78vh; aspect-ratio: var(--o); margin-inline: auto; overflow: hidden; border-radius: 12px; background: var(--bg-alt); transition: aspect-ratio .3s var(--ease-out); }
.ga-tuval canvas { display: block; width: 100%; height: 100%; }
.ga-bos, .ga-yukleniyor { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; padding: 28px; text-align: center; color: var(--muted); }
.ga-bos { border: 2px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); }
.ga-bos .i { width: 36px; height: 36px; margin-bottom: 4px; color: var(--navy-200); }
.ga-bos b, .ga-yukleniyor b { font-size: 16px; color: var(--ink); }
.ga-bos span, .ga-yukleniyor span:last-child { max-width: 300px; font-size: 13.5px; line-height: 1.5; }
.ga-yukleniyor { background: rgb(255 255 255 / .86); backdrop-filter: blur(4px); }
.ga-yukleniyor[hidden], .ga-bos[hidden], .ga-eylemler[hidden], .ga-duzen[hidden], .ga-onceki[hidden] { display: none; }
.ga-spin { width: 34px; height: 34px; margin-bottom: 8px; border: 3px solid var(--navy-50); border-top-color: var(--navy-800); border-radius: 50%; animation: ga-don .8s linear infinite; }
@keyframes ga-don { to { transform: rotate(360deg); } }
.ga-eylemler { display: flex; flex-wrap: wrap; gap: 8px; max-width: 620px; width: 100%; margin-inline: auto; }
.ga-eylemler .btn .i { width: 17px; height: 17px; }
.ga-sag-dugme { margin-left: auto; }

/* Düzenleme */
.ga-onay { display: flex; align-items: center; gap: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.ga-onay input { width: 18px; height: 18px; accent-color: var(--navy-800); }
.ga-uyari { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--amber-600); }
.ga-uyari .i { flex: none; width: 15px; height: 15px; }
.ga-hata { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--red-50); color: var(--red-700); font-size: 14px; line-height: 1.5; }
.ga-hata[hidden] { display: none; }

/* ---------- Önceki görseller ---------- */
.ga-onceki { margin-top: 28px; }
.ga-onceki h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; font-size: 1.25rem; letter-spacing: -.01em; }
.ga-onceki h2 span { font-size: 13px; font-weight: 600; color: var(--muted); }
.ga-onceki ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.ga-onceki li { position: relative; }
.ga-onceki button.ga-onceki__ac { display: grid; gap: 8px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; text-align: left; color: var(--ink-2); cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.ga-onceki button.ga-onceki__ac:hover, .ga-onceki button.ga-onceki__ac.is-secili { border-color: var(--navy-700); box-shadow: var(--shadow-sm); }
.ga-onceki img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; background: var(--bg-alt); }
.ga-onceki small { overflow: hidden; font-size: 12.5px; white-space: nowrap; text-overflow: ellipsis; }
.ga-onceki__sil { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .92); font-size: 16px; line-height: 1; color: var(--ink-2); cursor: pointer; box-shadow: var(--shadow-sm); }
.ga-onceki__sil:hover { color: var(--red-600); }
.ga-taslak { margin: 24px 0 0; font-size: 12.5px; text-align: center; color: var(--muted); }

/* ---------- Ofis bilgileri penceresi ---------- */
.ga-ayarlar { width: min(520px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); color: var(--ink); }
.ga-ayarlar::backdrop { background: rgb(7 19 40 / .5); backdrop-filter: blur(3px); }
.ga-ayarlar[open] { animation: ga-ac .22s var(--ease-out); }
@keyframes ga-ac { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.ga-ayarlar__form { display: grid; gap: 16px; padding: 22px; }
.ga-ayarlar__bas { display: flex; align-items: center; justify-content: space-between; }
.ga-ayarlar__bas h2 { margin: 0; font-size: 1.125rem; }
.ga-x { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 10px; background: var(--bg-alt); color: var(--ink-2); cursor: pointer; }
.ga-x .i { width: 18px; height: 18px; }
.ga-logo-satir { display: flex; align-items: center; gap: 10px; }
.ga-logo-kutu { display: grid; place-items: center; width: 44px; height: 44px; overflow: hidden; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); }
.ga-logo-kutu img { width: 100%; height: 100%; object-fit: contain; }
.ga-metin-dugme { padding: 0; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.ga-metin-dugme:hover { color: var(--red-600); }
.ga-renkler { display: flex; gap: 10px; }
.ga-renkler label { position: relative; cursor: pointer; }
.ga-renkler input { position: absolute; opacity: 0; pointer-events: none; }
.ga-renkler i { display: block; width: 28px; height: 28px; border: 2px solid var(--surface); border-radius: 50%; background: var(--r); box-shadow: 0 0 0 1px var(--line-2); }
.ga-renkler input:checked + i { box-shadow: 0 0 0 2px var(--navy-900); }
.ga-renkler input:focus-visible + i { outline: 2px solid var(--navy-700); outline-offset: 3px; }
.ga-ayarlar__alt { display: flex; justify-content: flex-end; }

/* ---------- Duyarlı ---------- */
@media (max-width: 960px) {
  .ga-izgara { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .ga-form, .ga-duzen, .ga-onizleme { padding: 16px; }
  .ga-ikili { grid-template-columns: 1fr; }
  .ga-sag-dugme { margin-left: 0; }
  .ga-onceki ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .ga-tuval, .ga-ayarlar[open] { transition: none; animation: none; }
  .ga-spin { animation-duration: 3s; }
}
