/* Derived from artefacts/sunday_school_artifact.html — scoped for site embed */

/* Scoped reset: only inside the report wrapper */
.sunday-school-report-wrap *,
.sunday-school-report-wrap *::before,
.sunday-school-report-wrap *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

    :root {
      --deep-space: #0D1B2A;
      --deep-space-mid: #142233;
      --pumpkin: #C8602A;
      --pumpkin-light: #D97A47;
      --pumpkin-pale: #f5e8e0;
      --ivory: #FAF7F2;
      --warm-white: #FFFEFB;
      --ink: #1A1A1A;
      --ink-mid: #3A3530;
      --ink-soft: #6B6259;
      --rule: #D8CFC4;
      --gold: #B8966A;
    }

    .sunday-school-report-wrap {
      font-family: 'Inter', sans-serif;
      background: #E8E2D9;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 40px 20px 60px;
      color: var(--ink);
    }

    /* Dark mode wrapper */
    .dark .sunday-school-report-wrap {
      background: #1a2332;
    }

    /* ── Toolbar ── */
    .sunday-school-report-wrap .toolbar {
      width: 100%;
      max-width: 760px;
      display: flex;
      justify-content: flex-end;
      gap: 10px;
      margin-bottom: 16px;
    }

    .sunday-school-report-wrap .btn {
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      font-weight: 500;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      padding: 8px 20px;
      border: 1.5px solid var(--deep-space);
      background: transparent;
      color: var(--deep-space);
      cursor: pointer;
      border-radius: 2px;
      transition: all 0.18s ease;
    }
    .sunday-school-report-wrap .btn:hover { background: var(--deep-space); color: #fff; }
    .sunday-school-report-wrap .btn.primary { background: var(--pumpkin); border-color: var(--pumpkin); color: #fff; }
    .sunday-school-report-wrap .btn.primary:hover { background: #b05222; border-color: #b05222; }
    .sunday-school-report-wrap .btn.save { background: #1a3a1a; border-color: #2d6b2d; color: #7ecb7e; }
    .sunday-school-report-wrap .btn.save:hover { background: #2d6b2d; color: #c8f0c8; }
    .sunday-school-report-wrap .btn.save:disabled { opacity: 0.5; cursor: wait; }
    @keyframes pulse { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
    .sunday-school-report-wrap .btn.save.loading { animation: pulse 0.9s ease-in-out infinite; }

    /* ── Document Shell ── */
    .sunday-school-report-wrap .document {
      width: 100%;
      max-width: 760px;
      background: var(--warm-white);
      box-shadow:
        0 2px 4px rgba(0,0,0,0.06),
        0 8px 24px rgba(0,0,0,0.12),
        0 24px 60px rgba(0,0,0,0.08);
      position: relative;
      overflow: hidden;
    }

    /* ── Header ── */
    .sunday-school-report-wrap .doc-header {
      background: var(--deep-space);
      padding: 0;
      position: relative;
      overflow: hidden;
    }

    /* Decorative geometric background */
    .sunday-school-report-wrap .doc-header::before {
      content: '';
      position: absolute;
      inset: 0;
      background-image:
        repeating-linear-gradient(
          -45deg,
          transparent,
          transparent 28px,
          rgba(255,255,255,0.018) 28px,
          rgba(255,255,255,0.018) 29px
        );
      pointer-events: none;
    }

    /* Cross motif */
    .sunday-school-report-wrap .cross-motif {
      position: absolute;
      right: -20px;
      top: 50%;
      transform: translateY(-50%);
      opacity: 0.06;
      width: 180px;
      height: 180px;
    }
    .sunday-school-report-wrap .cross-motif::before,
    .sunday-school-report-wrap .cross-motif::after {
      content: '';
      position: absolute;
      background: #fff;
      border-radius: 2px;
    }
    .sunday-school-report-wrap .cross-motif::before {
      width: 28px; height: 180px;
      left: 50%; top: 0;
      transform: translateX(-50%);
    }
    .sunday-school-report-wrap .cross-motif::after {
      width: 130px; height: 28px;
      top: 45px; left: 50%;
      transform: translateX(-50%);
    }

    /* Pumpkin accent stripe */
    .sunday-school-report-wrap .accent-stripe {
      height: 4px;
      background: linear-gradient(90deg, var(--pumpkin) 0%, var(--pumpkin-light) 60%, transparent 100%);
    }

    .sunday-school-report-wrap .header-inner {
      padding: 24px 20px 20px;
      position: relative;
      z-index: 1;
      display: flex;
      align-items: flex-end;
      justify-content: space-between;
      gap: 16px;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .header-inner {
        padding: 32px 44px 28px;
        gap: 20px;
      }
    }

    .sunday-school-report-wrap .brand-logo {
      display: block;
      height: 48px;
      width: auto;
      background: #fff;
      border-radius: 6px;
      padding: 5px 8px;
      box-shadow: 0 1px 6px rgba(0,0,0,0.25);
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .brand-logo {
        height: 64px;
        padding: 7px 12px;
      }
    }

    .sunday-school-report-wrap .doc-type-block {
      text-align: right;
    }
    .sunday-school-report-wrap .doc-type-label {
      font-family: 'Inter', sans-serif;
      font-size: 10px;
      letter-spacing: 0.25em;
      text-transform: uppercase;
      color: rgba(255,255,255,0.4);
      margin-bottom: 4px;
    }
    .sunday-school-report-wrap .doc-type-title {
      font-family: 'Playfair Display', serif;
      font-size: 17px;
      font-weight: 600;
      color: var(--pumpkin-light);
      letter-spacing: 0.04em;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .doc-type-label { font-size: 11px; }
      .sunday-school-report-wrap .doc-type-title { font-size: 20px; }
    }

    /* ── Date Banner ── */
    .sunday-school-report-wrap .date-banner {
      background: var(--deep-space-mid);
      padding: 10px 20px;
      display: flex;
      align-items: center;
      gap: 12px;
      flex-wrap: wrap;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .date-banner {
        padding: 12px 44px;
        gap: 16px;
      }
    }

    .sunday-school-report-wrap .date-label {
      font-family: 'Inter', sans-serif;
      font-size: 10px;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--pumpkin-light);
      flex-shrink: 0;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .date-label { font-size: 11px; }
    }

    .sunday-school-report-wrap .date-field {
      font-family: 'Inter', sans-serif;
      font-size: 14px;
      font-weight: 500;
      color: rgba(255,255,255,0.88);
      letter-spacing: 0.02em;
      min-width: 140px;
      outline: none;
      border: none;
      background: transparent;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .date-field {
        font-size: 16px;
        min-width: 180px;
      }
    }

    .sunday-school-report-wrap .date-field:focus { border-bottom: 1px solid var(--pumpkin); }
    .sunday-school-report-wrap .date-field::before { content: attr(data-placeholder); color: rgba(255,255,255,0.3); }
    .sunday-school-report-wrap .date-field:not(:empty)::before { display: none; }
    .sunday-school-report-wrap .banner-sep {
      width: 1px; height: 18px;
      background: rgba(255,255,255,0.15);
      flex-shrink: 0;
    }

    /* ── Body ── */
    .sunday-school-report-wrap .doc-body {
      padding: 28px 20px 32px;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .doc-body {
        padding: 44px 44px 48px;
      }
    }

    /* ── Section ── */
    .sunday-school-report-wrap .section {
      margin-bottom: 36px;
    }
    .sunday-school-report-wrap .section:last-child { margin-bottom: 0; }

    .sunday-school-report-wrap .section-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 14px;
    }
    .sunday-school-report-wrap .section-number {
      font-family: 'Playfair Display', serif;
      font-size: 11px;
      color: var(--pumpkin);
      font-weight: 600;
      letter-spacing: 0.12em;
      flex-shrink: 0;
      padding-top: 1px;
    }
    .sunday-school-report-wrap .section-rule {
      height: 1px;
      background: var(--rule);
      flex: 1;
    }
    .sunday-school-report-wrap .section-label {
      font-family: 'Inter', sans-serif;
      font-size: 11px;
      letter-spacing: 0.2em;
      text-transform: uppercase;
      color: var(--ink-soft);
      font-weight: 500;
    }

    /* Topic / Lesson Title */
    .sunday-school-report-wrap .topic-field {
      font-family: 'Playfair Display', serif;
      font-size: 22px;
      font-weight: 600;
      color: var(--deep-space);
      line-height: 1.3;
      outline: none;
      border: none;
      width: 100%;
      min-height: 1.2em;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .topic-field {
        font-size: 28px;
        line-height: 1.2;
      }
    }

    .sunday-school-report-wrap .topic-field:focus { border-bottom: 2px solid var(--pumpkin-pale); }
    .sunday-school-report-wrap .placeholder-style { color: #C9C0B5; }

    /* Scripture block */
    .sunday-school-report-wrap .scripture-block {
      background: var(--ivory);
      border-left: 4px solid var(--pumpkin);
      padding: 16px 16px 16px 20px;
      position: relative;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .scripture-block {
        padding: 20px 24px 20px 28px;
      }
    }

    .sunday-school-report-wrap .scripture-block::before {
      content: '\201C';
      position: absolute;
      top: -8px;
      left: 12px;
      font-family: 'Playfair Display', serif;
      font-size: 56px;
      line-height: 1;
      color: var(--pumpkin);
      opacity: 0.18;
      pointer-events: none;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .scripture-block::before {
        left: 18px;
        font-size: 72px;
      }
    }

    .sunday-school-report-wrap .scripture-text {
      font-family: 'Playfair Display', serif;
      font-size: 17px;
      font-style: italic;
      font-weight: 300;
      color: var(--ink-mid);
      line-height: 1.65;
      outline: none;
      width: 100%;
      min-height: 2em;
      position: relative;
      z-index: 1;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .scripture-text {
        font-size: 20px;
      }
    }

    .sunday-school-report-wrap .scripture-ref {
      margin-top: 10px;
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      font-weight: 600;
      letter-spacing: 0.06em;
      color: var(--pumpkin);
      outline: none;
      display: inline-block;
      min-width: 100px;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .scripture-ref {
        font-size: 14px;
        min-width: 120px;
      }
    }

    /* Notes / Summary */
    .sunday-school-report-wrap .notes-field {
      font-family: 'Inter', sans-serif;
      font-size: 14px;
      font-weight: 400;
      line-height: 1.85;
      color: var(--ink-mid);
      outline: none;
      width: 100%;
      min-height: 120px;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .notes-field {
        font-size: 15px;
      }
    }

    /* Ruled lines under notes */
    .sunday-school-report-wrap .notes-wrapper {
      position: relative;
      padding: 4px 0;
    }
    .sunday-school-report-wrap .notes-wrapper::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 1px;
      background: var(--rule);
    }

    /* Assignment */
    .sunday-school-report-wrap .assignment-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }
    .sunday-school-report-wrap .assignment-item {
      display: flex;
      align-items: flex-start;
      gap: 12px;
    }
    .sunday-school-report-wrap .assign-checkbox {
      flex-shrink: 0;
      width: 18px;
      height: 18px;
      border: 2px solid var(--pumpkin);
      border-radius: 3px;
      margin-top: 3px;
      cursor: pointer;
      transition: all 0.15s;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .sunday-school-report-wrap .assign-checkbox.checked {
      background: var(--pumpkin);
    }
    .sunday-school-report-wrap .assign-checkbox.checked::after {
      content: '\2713';
      color: #fff;
      font-size: 11px;
      line-height: 1;
    }
    .sunday-school-report-wrap .assign-text {
      font-family: 'Inter', sans-serif;
      font-size: 14px;
      font-weight: 400;
      line-height: 1.5;
      color: var(--ink-mid);
      outline: none;
      flex: 1;
      min-height: 1.5em;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .assign-text {
        font-size: 15px;
      }
    }

    .sunday-school-report-wrap .assign-add {
      margin-top: 8px;
      padding-left: 30px;
    }
    .sunday-school-report-wrap .assign-add-btn {
      font-family: 'Inter', sans-serif;
      font-size: 13px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--pumpkin);
      background: none;
      border: none;
      cursor: pointer;
      padding: 4px 0;
      opacity: 0.7;
      transition: opacity 0.15s;
    }
    .sunday-school-report-wrap .assign-add-btn:hover { opacity: 1; }

    /* ── Footer ── */
    .sunday-school-report-wrap .doc-footer {
      border-top: 1px solid var(--rule);
      margin: 0 20px;
      padding: 16px 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .doc-footer {
        margin: 0 44px;
        padding: 20px 0;
      }
    }

    .sunday-school-report-wrap .footer-left {
      font-family: 'Inter', sans-serif;
      font-size: 11px;
      color: var(--ink-soft);
      letter-spacing: 0.08em;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .footer-left { font-size: 12px; }
    }

    .sunday-school-report-wrap .footer-right {
      font-family: 'Playfair Display', serif;
      font-size: 12px;
      font-weight: 600;
      color: var(--deep-space);
      opacity: 0.35;
      letter-spacing: 0.05em;
    }

    @media (min-width: 640px) {
      .sunday-school-report-wrap .footer-right { font-size: 13px; }
    }

    /* ── Editable focus styling ── */
    .sunday-school-report-wrap [contenteditable]:focus {
      outline: none;
      background: rgba(200, 96, 42, 0.03);
      border-radius: 2px;
    }

    .sunday-school-report-wrap [contenteditable]:empty::before {
      content: attr(data-placeholder);
      color: #C9C0B5;
      pointer-events: none;
      font-style: italic;
    }

    /* ── Animation on load ── */
    @keyframes fadeSlideUp {
      from { opacity: 0; transform: translateY(18px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .sunday-school-report-wrap .document {
      animation: fadeSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
    }
    .sunday-school-report-wrap .toolbar {
      animation: fadeSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.1s both;
    }

    /* ── Print styles ── */
    @media print {
      @page {
        size: A5;
        margin: 10mm 12mm;
      }
      .sunday-school-report-wrap {
        background: none;
        padding: 0;
        display: block;
      }
      .sunday-school-report-wrap .toolbar { display: none !important; }
      .sunday-school-report-wrap .document {
        box-shadow: none;
        max-width: 100%;
        animation: none;
      }
      .sunday-school-report-wrap .doc-body { padding: 36px 40px 40px; }
      .sunday-school-report-wrap .assign-add { display: none; }
      .sunday-school-report-wrap [contenteditable]:focus { background: transparent; }
      .sunday-school-report-wrap .accent-stripe { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
      .sunday-school-report-wrap .doc-header,
      .sunday-school-report-wrap .date-banner { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
      .sunday-school-report-wrap .scripture-block { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    }

/* Hide artefact toolbar if pasted into report HTML */
.sunday-school-report-wrap .toolbar { display: none !important; }

/* When embedded under site chrome (not full standalone page) */
.sunday-school-report-wrap.is-embedded-on-site {
  min-height: auto;
  background: transparent;
  padding: 0 16px 48px;
}

@media (min-width: 640px) {
  .sunday-school-report-wrap.is-embedded-on-site {
    padding: 0 24px 48px;
  }
}

.dark .sunday-school-report-wrap.is-embedded-on-site {
  background: transparent;
}
