/* ==========================================================================
   3alamtaney — Pan-Arab Greeting Cards Generator (مولّد بطاقات التهنئة العربية) v1.0.0
   Strict 0 rem (Bricks 62.5% safe), Tajawal font, Native Light & Dark Mode
   ========================================================================== */
article#brx-content.type-page > h1:first-of-type { display: none !important; }
article#brx-content.type-page { padding-top: 24px !important; }

.agc-app {
  --agc-bg: #f8fafc;
  --agc-surface: #ffffff;
  --agc-surface-2: #f1f5f9;
  --agc-border: #e2e8f0;
  --agc-text: #0f172a;
  --agc-muted: #475569;
  --agc-accent: #0f766e;
  --agc-accent-soft: rgba(15, 118, 110, 0.12);
  --agc-gold: #d97706;
  --agc-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  font-family: 'Tajawal', sans-serif;
  color: var(--agc-text);
  max-width: 1120px;
  margin: 0 auto 40px;
  direction: rtl;
  text-align: right;
  line-height: 1.65;
  font-size: 16px;
  box-sizing: border-box;
}
.agc-app *, .agc-app *::before, .agc-app *::after { box-sizing: border-box; }

@media (prefers-color-scheme: dark) {
  .agc-app {
    --agc-bg: #0f1419;
    --agc-surface: #161d24;
    --agc-surface-2: #1d2630;
    --agc-border: #2a3644;
    --agc-text: #f1f5f9;
    --agc-muted: #94a3b8;
    --agc-accent: #2dd4bf;
    --agc-accent-soft: rgba(45, 212, 191, 0.14);
    --agc-gold: #fbbf24;
    --agc-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  }
}
.dark .agc-app, [data-theme="dark"] .agc-app, body.dark-mode .agc-app, html.dark .agc-app {
  --agc-bg: #0f1419;
  --agc-surface: #161d24;
  --agc-surface-2: #1d2630;
  --agc-border: #2a3644;
  --agc-text: #f1f5f9;
  --agc-muted: #94a3b8;
  --agc-accent: #2dd4bf;
  --agc-accent-soft: rgba(45, 212, 191, 0.14);
  --agc-gold: #fbbf24;
  --agc-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}
[data-theme="light"] .agc-app, html.light .agc-app {
  --agc-bg: #f8fafc;
  --agc-surface: #ffffff;
  --agc-surface-2: #f1f5f9;
  --agc-border: #e2e8f0;
  --agc-text: #0f172a;
  --agc-muted: #475569;
  --agc-accent: #0f766e;
  --agc-accent-soft: rgba(15, 118, 110, 0.12);
  --agc-gold: #d97706;
  --agc-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Hero */
.agc-hero {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #0b1419;
  margin-bottom: 20px;
  border: 1px solid var(--agc-border);
  box-shadow: var(--agc-shadow);
}
.agc-hero-img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
  opacity: 0.44;
}
.agc-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 20, 25, 0.3) 0%, rgba(11, 20, 25, 0.92) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px 28px;
  color: #f8fafc;
}
.agc-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.16);
  border: 1px solid rgba(45, 212, 191, 0.42);
  color: #5eead4;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.agc-hero h1 {
  margin: 0 0 8px;
  font-size: 29px;
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
}
.agc-hero p {
  margin: 0;
  font-size: 15px;
  color: #cbd5e1;
  max-width: 760px;
}

/* Quick Country Bar */
.agc-country-strip {
  background: var(--agc-surface);
  border: 1px solid var(--agc-border);
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 18px;
  box-shadow: var(--agc-shadow);
}
.agc-strip-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--agc-text);
  margin: 0 0 10px;
}
.agc-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.agc-chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--agc-border);
  background: var(--agc-surface-2);
  color: var(--agc-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 180ms;
}
.agc-chip:hover { border-color: var(--agc-accent); color: var(--agc-accent); }
.agc-chip.active {
  background: var(--agc-accent);
  border-color: var(--agc-accent);
  color: #ffffff;
}
.dark .agc-chip.active, [data-theme="dark"] .agc-chip.active { color: #0f1419; }

/* Main Studio Grid */
.agc-studio {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 20px;
  align-items: start;
  margin-bottom: 26px;
}
.agc-panel {
  background: var(--agc-surface);
  border: 1px solid var(--agc-border);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--agc-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.agc-panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--agc-text);
}
.agc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agc-field label {
  font-size: 14px;
  font-weight: 700;
  color: var(--agc-muted);
}
.agc-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.agc-input, .agc-select, .agc-textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid var(--agc-border);
  background: var(--agc-surface-2);
  color: var(--agc-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 180ms;
}
.agc-input, .agc-select { height: 48px; }
.agc-textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.agc-input:focus, .agc-select:focus, .agc-textarea:focus {
  border-color: var(--agc-accent);
}
.agc-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.agc-mini-btn {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--agc-accent);
  background: var(--agc-accent-soft);
  color: var(--agc-accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.agc-mini-btn:active { transform: scale(0.97); }

/* Theme Swatches */
.agc-themes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.agc-theme-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 2px solid var(--agc-border);
  background: var(--agc-surface-2);
  color: var(--agc-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 180ms;
}
.agc-theme-btn.active {
  border-color: var(--agc-accent);
  background: var(--agc-accent-soft);
}
.agc-swatch {
  width: 100%;
  height: 24px;
  border-radius: 7px;
  display: block;
}

/* Ratio Pills */
.agc-ratios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.agc-ratio-btn {
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--agc-border);
  background: var(--agc-surface-2);
  color: var(--agc-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.agc-ratio-btn.active {
  background: var(--agc-accent);
  border-color: var(--agc-accent);
  color: #ffffff;
}
.dark .agc-ratio-btn.active, [data-theme="dark"] .agc-ratio-btn.active { color: #0f1419; }

/* Preview Stage */
.agc-preview-panel {
  position: sticky;
  top: 20px;
}
.agc-canvas-wrap {
  width: 100%;
  background: var(--agc-surface-2);
  border: 1px solid var(--agc-border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.agc-canvas {
  max-width: 100%;
  max-height: 540px;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  display: block;
}
.agc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.agc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--agc-border);
  background: var(--agc-surface-2);
  color: var(--agc-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms, border-color 180ms;
}
.agc-btn:hover { border-color: var(--agc-accent); transform: translateY(-1px); }
.agc-btn:active { transform: scale(0.97); }
.agc-btn.primary {
  background: var(--agc-accent);
  border-color: var(--agc-accent);
  color: #ffffff;
}
.dark .agc-btn.primary, [data-theme="dark"] .agc-btn.primary { color: #0f1419; }
.agc-btn.wa {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}
.agc-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Occasion Directory + SEO */
.agc-seo {
  background: var(--agc-surface);
  border: 1px solid var(--agc-border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--agc-shadow);
}
.agc-seo h2 { margin: 0 0 10px; font-size: 21px; font-weight: 800; }
.agc-seo p { margin: 0 0 14px; color: var(--agc-muted); font-size: 15px; }
.agc-faq { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 20px; }
.agc-faq details {
  border: 1px solid var(--agc-border);
  border-radius: 12px;
  padding: 12px 16px;
  background: var(--agc-surface-2);
}
.agc-faq summary { font-size: 15px; font-weight: 800; cursor: pointer; }
.agc-faq details p { margin: 8px 0 0; font-size: 14px; }
.agc-links { display: flex; flex-wrap: wrap; gap: 10px; }
.agc-link {
  display: inline-flex;
  align-items: center;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--agc-accent-soft);
  color: var(--agc-accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.agc-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #0f172a;
  color: #f8fafc;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms, transform 220ms;
  z-index: 9999;
}
.agc-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 880px) {
  .agc-studio { grid-template-columns: 1fr; }
  .agc-preview-panel { position: static; }
}
@media (max-width: 560px) {
  .agc-hero-img { height: 210px; }
  .agc-hero-overlay { padding: 18px; }
  .agc-hero h1 { font-size: 22px; }
  .agc-row-2, .agc-actions { grid-template-columns: 1fr; }
  .agc-themes { grid-template-columns: repeat(2, 1fr); }
}

/* v2.0.0 Illustrated Art Thumbnails, Stickers & Photo Upload (0 rem) */
.agc-art-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.agc-art-btn {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--agc-border);
  background: var(--agc-surface-2);
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: center;
  transition: transform 180ms, border-color 180ms;
}
.agc-art-btn:hover { transform: translateY(-2px); border-color: var(--agc-accent); }
.agc-art-btn.active { border-color: var(--agc-accent); box-shadow: 0 0 0 3px var(--agc-accent-soft); }
.agc-art-thumb {
  width: 100%;
  height: 74px;
  object-fit: cover;
  display: block;
}
.agc-art-name {
  padding: 6px 4px;
  font-family: 'Tajawal', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--agc-text);
  background: var(--agc-surface);
}
.agc-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.agc-upload-lbl {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1px dashed var(--agc-accent);
  background: var(--agc-accent-soft);
  color: var(--agc-accent);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.agc-stickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.agc-sticker-btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--agc-border);
  background: var(--agc-surface-2);
  color: var(--agc-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 160ms;
}
.agc-sticker-btn.active {
  background: var(--agc-accent);
  border-color: var(--agc-accent);
  color: #ffffff;
}
.dark .agc-sticker-btn.active, [data-theme="dark"] .agc-sticker-btn.active { color: #0f1419; }
@media (max-width: 560px) {
  .agc-art-grid { grid-template-columns: repeat(2, 1fr); }
}
