/*
Theme Name: Grafika Test
Author: Codex
Description: Minimal theme for the grafika quiz.
Version: 0.1.0
Text Domain: grafika
*/

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600&family=Space+Grotesk:wght@400;500;600&display=swap&subset=latin-ext');

:root {
  --cursor-illustrator: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M5 3l0 24 6-6 4 8 4-2-4-8 8 0z' fill='%23000' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") 4 4, auto;
  --editor-bg: #202124;
  --editor-panel: #2b2d31;
  --editor-panel-strong: #1c1d20;
  --editor-panel-soft: #34363c;
  --editor-ink: #f5f1e8;
  --editor-muted: rgba(245, 241, 232, 0.6);
  --editor-accent: #5cc8a1;
  --editor-accent-2: #f5b352;
  --editor-shadow: 0 20px 45px rgba(10, 10, 10, 0.35);
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: #1f1b16;
  background: #f8f5ef;
  cursor: var(--cursor-illustrator);
}

html,
body {
  height: 100%;
}

body.home {
  overflow: hidden;
}

a,
button,
label {
  cursor: var(--cursor-illustrator);
}

input,
textarea,
select,
[contenteditable="true"] {
  cursor: text;
}

a {
  color: #e4572e;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.grafika-home {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(32px, 5vw, 72px);
  display: grid;
  gap: 48px;
}

.grafika-home__intro h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(32px, 5vw, 48px);
  margin: 0 0 12px;
}

.grafika-home__intro p {
  max-width: 640px;
  margin: 0;
  margin-bottom: 15px;
  margin-left: 10px;
  line-height: 1.5rem;

}

.grafika-activity-grid,
.grafika-activity-list {
  display: grid;
  gap: 16px;
}

.grafika-activity-card {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(31, 27, 22, 0.12);
  background: #fff;
}

.grafika-activity-card.is-featured {
  border-color: rgba(228, 87, 46, 0.4);
  background: rgba(228, 87, 46, 0.08);
}

.grafika-activity-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.grafika-activity-card__meta {
  margin: 0;
  font-size: 13px;
  color: rgba(31, 27, 22, 0.6);
}

.grafika-home__all-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.grafika-home__search input {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 27, 22, 0.2);
  min-width: 220px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.grafika-editor {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  background:
    radial-gradient(circle at 15% 20%, rgba(92, 200, 161, 0.18), transparent 55%),
    radial-gradient(circle at 85% 15%, rgba(245, 179, 82, 0.22), transparent 50%),
    linear-gradient(135deg, #1c1d20 0%, #23252a 55%, #1f2125 100%);
  color: var(--editor-ink);
}

.grafika-editor__appbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 12px 20px;
  background: linear-gradient(90deg, #1b1c1f 0%, #25272c 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.grafika-editor__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.grafika-editor__badge {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: var(--editor-accent);
  color: #0d0f11;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: lowercase;
}

.grafika-editor__mode {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--editor-muted);
}

.grafika-editor__menu {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.grafika-editor__menu button {
  background: transparent;
  border: none;
  color: var(--editor-ink);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 10px;
}

.grafika-editor__menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.grafika-editor__meta {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--editor-muted);
}

.grafika-editor__zoom {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--editor-ink);
}

.grafika-editor__body {
  display: grid;
  grid-template-columns: 76px 1fr 280px;
  min-height: 0;
}

.grafika-editor__tools {
  background: var(--editor-panel-strong);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grafika-tool {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--editor-ink);
  border-radius: 16px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 10px;
}

.grafika-tool.is-active {
  background: rgba(92, 200, 161, 0.2);
  border-color: rgba(92, 200, 161, 0.6);
  color: #fff;
}

.grafika-tool--trash {
  margin-top: auto;
  border-color: rgba(255, 132, 132, 0.5);
  color: #ffb3b3;
}

.grafika-tool--trash:hover {
  background: rgba(255, 132, 132, 0.16);
}

.grafika-tool__icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.grafika-editor__canvas {
  background: #1e1f22;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.grafika-editor__workspace {
  padding: clamp(20px, 4vw, 48px);
  min-height: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.grafika-editor__artboard {
  position: relative;
  width: 3200px;
  height: 1600px;
  flex: 0 0 auto;
  border-radius: 28px;
  background-color: #f8f4ea;
  background-image:
    linear-gradient(rgba(31, 27, 22, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 27, 22, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  box-shadow: var(--editor-shadow);
  padding: 32px;
  overflow: hidden;
  touch-action: none;
  transform-origin: 0 0;
}

.grafika-editor__draw {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: auto;
}

.grafika-editor__draw [data-selected="true"] {
  filter: drop-shadow(0 0 6px rgba(92, 200, 161, 0.6));
}

.grafika-block {
  position: absolute;
  z-index: 2;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 22px;
  border: 1px solid rgba(220, 211, 197, 0.9);
  box-shadow: 0 18px 36px rgba(31, 27, 22, 0.16);
  padding: 20px 22px 24px;
  color: #1f1b16;
}

.grafika-block--all {
  border-color: rgba(92, 200, 161, 0.45);
  box-shadow:
    0 0 0 1px rgba(92, 200, 161, 0.3),
    0 18px 36px rgba(31, 27, 22, 0.16);
}

.grafika-block.is-selected {
  box-shadow:
    0 0 0 2px rgba(92, 200, 161, 0.25),
    0 18px 36px rgba(31, 27, 22, 0.18);
}

.grafika-block__handle {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: #55c9a1;
  margin: 0 0 10px;
  cursor: grab;
}

.grafika-block__handle:active {
  cursor: grabbing;
}

.grafika-block h1 {
  font-family: "Fraunces", "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 42px);
  margin: 0;
}

.grafika-block p {
  margin: 0;
  line-height: 1.6;
}

.grafika-block [data-editable] {
  min-height: 1em;
}

.grafika-block [data-editable]:focus {
  outline: 2px dashed rgba(92, 200, 161, 0.6);
  outline-offset: 6px;
}

.grafika-selection {
  position: absolute;
  border: 1.5px dashed rgba(92, 200, 161, 0.75);
  border-radius: 18px;
  z-index: 4;
  pointer-events: none;
  cursor: move;
}

.grafika-selection.is-hidden {
  display: none;
}

.grafika-selection__handle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #55c9a1;
  box-shadow: 0 4px 10px rgba(31, 27, 22, 0.2);
  pointer-events: auto;
  touch-action: none;
}

.grafika-selection__handle[data-handle="nw"] {
  left: -7px;
  top: -7px;
  cursor: nwse-resize;
}

.grafika-selection__handle[data-handle="n"] {
  left: 50%;
  top: -7px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.grafika-selection__handle[data-handle="ne"] {
  right: -7px;
  top: -7px;
  cursor: nesw-resize;
}

.grafika-selection__handle[data-handle="e"] {
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.grafika-selection__handle[data-handle="se"] {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}

.grafika-selection__handle[data-handle="s"] {
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.grafika-selection__handle[data-handle="sw"] {
  left: -7px;
  bottom: -7px;
  cursor: nesw-resize;
}

.grafika-selection__handle[data-handle="w"] {
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.grafika-editor .grafika-activity-grid,
.grafika-editor .grafika-activity-list {
  display: grid;
  gap: 12px;
}

.grafika-editor .grafika-activity-card {
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid rgba(215, 204, 187, 0.9);
  background: #fffdf8;
  box-shadow: 0 10px 16px rgba(31, 27, 22, 0.08);
}

.grafika-editor .grafika-activity-card.is-featured {
  border-color: rgba(244, 171, 94, 0.7);
  background: rgba(244, 171, 94, 0.18);
}

.grafika-editor .grafika-activity-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.grafika-editor .grafika-activity-card a {
  color: #1f1b16;
  text-decoration: none;
}

.grafika-editor .grafika-activity-card a:hover {
  text-decoration: underline;
}

.grafika-activity-empty {
  margin: 0;
  font-size: 14px;
  color: rgba(31, 27, 22, 0.6);
}

.grafika-editor .grafika-home__all-head {
  margin-bottom: 12px;
}

.grafika-editor .grafika-home__search input {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(31, 27, 22, 0.18);
  width: 100%;
  background: rgba(248, 245, 239, 0.9);
}

.grafika-editor__props {
  background: var(--editor-panel-strong);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.grafika-panel {
  background: var(--editor-panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.grafika-panel h3 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--editor-muted);
}

.grafika-panel__hint {
  margin: 0;
  font-size: 12px;
  color: var(--editor-muted);
}

.grafika-prop {
  display: grid;
  gap: 8px;
}

.grafika-prop__label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--editor-muted);
}

.grafika-prop__control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grafika-prop input[type="color"] {
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
}

.grafika-prop input[type="range"] {
  width: 100%;
}

.grafika-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--editor-ink);
}

.grafika-colorwheel {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #ff6b6b, #f6d365, #6ee7b7, #60a5fa, #c084fc, #ff6b6b);
  position: relative;
  margin: 0 auto;
  box-shadow: inset 0 0 0 10px rgba(0, 0, 0, 0.15);
}

.grafika-colorwheel::after {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, rgba(255, 255, 255, 0.2) 70%, rgba(255, 255, 255, 0) 100%);
}

.grafika-colorwheel__thumb {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
}

@media (max-width: 1100px) {
  .grafika-editor__body {
    grid-template-columns: 72px 1fr;
    grid-template-rows: 1fr auto;
  }

  .grafika-editor__props {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .grafika-panel {
    flex: 1 1 240px;
  }
}

@media (max-width: 840px) {
  .grafika-editor__appbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .grafika-editor__meta {
    justify-content: flex-start;
  }

  .grafika-tool__label {
    display: none;
  }

  .grafika-editor__artboard {
    width: 2200px;
    height: 900px;
  }
}
