/* MASALİA — Boyama Atölyesi (boyama.php)
   Ana sayfada kullanılmaz; yalnızca bu sayfa yükler. */

/* --- Galeri --- */
.boyama-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: clamp(14px, 2.2vw, 20px);
}
.boyama-card {
  background: var(--card-bg); border: 2px solid var(--card-border);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; transition: transform .2s var(--ease-spring), box-shadow .2s;
}
.boyama-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.boyama-card__imglink { display: block; background: #fff; }
.boyama-card__imglink img {
  width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; display: block;
  background: #fff;
}
.boyama-card__body { padding: 10px 12px 13px; display: grid; gap: 9px; }
.boyama-card__body h3 { margin: 0; font-size: 15.5px; font-weight: 800; color: var(--text); }
.boyama-card__btns { display: flex; gap: 7px; }
.boyama-card__btns .btn { flex: 1; justify-content: center; }

/* --- PDF kartı (rapor kartı ritmi) --- */
.boyama-pdfcard {
  display: grid; grid-template-columns: auto 1fr auto; gap: clamp(14px, 3vw, 24px);
  align-items: center; padding: clamp(16px, 3vw, 24px);
  background: var(--card-bg); border: 2px solid var(--card-border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.boyama-pdfcard__ico { font-size: clamp(30px, 5vw, 44px); }
.boyama-pdfcard__body h2 { margin: 0 0 4px; font-size: clamp(17px, 2.4vw, 21px); }
.boyama-pdfcard__body p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

@media (max-width: 560px) {
  .boyama-pdfcard { grid-template-columns: auto 1fr; }
  .boyama-pdfcard__btn { grid-column: 1 / -1; justify-content: center; }
}

/* --- Editör katmanı --- */
.boyama-editor {
  position: fixed; inset: 0; z-index: 1200;
  background: var(--bg, #fdf9f3);
  display: flex; flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.boyama-editor[hidden] { display: none; }
body.boyama-lock { overflow: hidden; }

.boyama-editor__bar {
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-top, 0px) + 8px) 12px 8px;
  border-bottom: 2px solid var(--card-border); background: var(--card-bg);
}
.boyama-editor__bar strong { flex: 1; text-align: center; font-size: 15.5px; }

.boyama-editor__stage {
  flex: 1; min-height: 0; overflow: auto;
  display: grid; place-items: center; padding: 10px;
  background: repeating-conic-gradient(var(--card-border) 0% 25%, transparent 0% 50%) 50% / 22px 22px;
}
#boyamaCanvas {
  background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm);
  max-width: min(100%, 720px); max-height: 100%;
  touch-action: none; cursor: crosshair;
}

.boyama-editor__tools {
  background: var(--card-bg); border-top: 2px solid var(--card-border);
  padding: 9px 10px calc(9px + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 8px;
}
.boyama-modes, .boyama-acts { display: flex; gap: 6px; }
.boyama-chip {
  border: 2px solid var(--card-border); background: var(--surface);
  color: var(--text); font-weight: 800; font-size: 13px;
  padding: 7px 11px; border-radius: 999px; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.boyama-chip.is-active { background: var(--accent); color: var(--accent-ink, #fff); border-color: transparent; }
.boyama-chip--ghost { background: transparent; }

.boyama-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.boyama-color {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--card-border), 0 2px 6px rgba(43, 33, 88, .18);
  cursor: pointer; transition: transform .15s var(--ease-spring), box-shadow .15s;
  flex: none;
}
.boyama-color:hover { transform: scale(1.12); }
.boyama-color.is-active { box-shadow: 0 0 0 3px var(--accent), 0 3px 8px rgba(43, 33, 88, .22); transform: scale(1.1); }

.boyama-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.boyama-sizes { display: flex; gap: 8px; align-items: center; }
.boyama-size {
  width: 40px; height: 40px; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--card-border); background: var(--surface);
  display: grid; place-items: center; transition: border-color .15s, background-color .15s;
}
.boyama-size.is-active { border-color: var(--accent); background: rgba(138, 100, 214, .12); }
.boyama-size span { border-radius: 50%; background: var(--text); display: block; }

/* --- Hero aksiyonları --- */
.boyama-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.boyama-hero__actions .btn { justify-content: center; }

/* --- Haftanın sayfası --- */
.boyama-featured {
  display: grid; grid-template-columns: minmax(190px, 280px) 1fr;
  gap: clamp(16px, 3vw, 30px); align-items: center;
  padding: clamp(16px, 3vw, 26px);
  background:
    radial-gradient(120% 160% at 0% 0%, rgba(255, 215, 110, .22), transparent 60%),
    var(--card-bg);
  border: 2px solid var(--card-border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}
.boyama-featured__art { position: relative; display: block; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: var(--shadow-sm); }
.boyama-featured__art img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.boyama-featured__badge {
  position: absolute; top: 10px; left: 10px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(43, 33, 88, .86); color: #ffe9a8;
  font-size: 11.5px; font-weight: 800; letter-spacing: .02em;
}
.boyama-featured__badge .icon { width: 14px; height: 14px; }
.boyama-featured__kicker {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 6px;
  font-size: 12.5px; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: var(--accent);
}
.boyama-featured__kicker .icon { width: 16px; height: 16px; }
.boyama-featured__body h2 { margin: 0 0 8px; font-size: clamp(21px, 3vw, 28px); }
.boyama-featured__body p { margin: 0 0 16px; color: var(--muted); line-height: 1.65; max-width: 56ch; }
.boyama-featured__btns { display: flex; flex-wrap: wrap; gap: 10px; }

/* --- Kartlarda haftanın sayfası rozeti --- */
.boyama-card__imglink { position: relative; }
.boyama-card__star {
  position: absolute; top: 8px; left: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 999px;
  background: rgba(43, 33, 88, .86); color: #ffe9a8;
  font-size: 10.5px; font-weight: 800;
}
.boyama-card__star .icon { width: 12px; height: 12px; }
.boyama-card.is-featured { border-color: rgba(234, 176, 75, .75); box-shadow: 0 8px 22px rgba(234, 176, 75, .18); }

/* --- Cihazdaki galeri --- */
.boyama-gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: clamp(12px, 2vw, 18px);
}
.boyama-gallery__card {
  background: var(--card-bg); border: 2px solid var(--card-border);
  border-radius: var(--r-lg); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.boyama-gallery__img { display: block; background: #fff; }
.boyama-gallery__img img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.boyama-gallery__body { padding: 9px 10px 11px; display: grid; gap: 4px; }
.boyama-gallery__body b { font-size: 13.5px; }
.boyama-gallery__body small { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.boyama-gallery__acts { display: flex; gap: 6px; margin-top: 5px; }
.boyama-gallery__acts .btn { flex: 1; justify-content: center; padding: 7px 8px; font-size: 12px; }
.boyama-gallery__acts .boyama-gallery__del { flex: 0 0 auto; }
.boyama-gallery__empty { color: var(--muted); font-weight: 700; }
.boyama-gallery__empty[hidden] { display: none; }

/* --- Editör taslak notu --- */
.boyama-draft-note {
  margin: 0; padding: 2px 4px 0; text-align: center;
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.boyama-draft-note[hidden] { display: none; }
#boyamaReset { border-color: rgba(138, 100, 214, .5); }

@media (max-width: 620px) {
  .boyama-featured { grid-template-columns: 1fr; }
  .boyama-featured__art { max-width: 280px; margin-inline: auto; }
}
@media (max-width: 560px) {
  .boyama-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
