/*
 * Name Tracing Worksheets – V2.0 (Premium 2026)
 * Aligned with worksheet-base.css / sheet-common.css design system
 * Uses sheet-common.css for .sheet sizing and .sheet-header
 */

/* =========================================
   1. TRACING BODY
   ========================================= */
.nt-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}


/* =========================================
   2. TRACING ROW
   ========================================= */
.nt-row {
    position: relative;
    display: flex;
    align-items: flex-end;
    width: 100%;
    box-sizing: border-box;
}

/* ── Size variants ── */
.nt-size-small .nt-row {
    height: 18mm;
}

.nt-size-medium .nt-row {
    height: 24mm;
}

.nt-size-large .nt-row {
    height: 32mm;
}


/* =========================================
   3. GUIDE LINES
   ========================================= */
.nt-guides {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.nt-guide-top,
.nt-guide-mid,
.nt-guide-base,
.nt-guide-bottom {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-bottom: 1px solid;
}

/* Top line (ascender) */
.nt-guide-top {
    top: 10%;
    border-color: #93c5fd;
    border-bottom-style: dashed;
}

/* Mid line (x-height) */
.nt-guide-mid {
    top: 45%;
    border-color: #bfdbfe;
    border-bottom-style: dotted;
}

/* Base line (main writing line) */
.nt-guide-base {
    top: 75%;
    border-color: #60a5fa;
    border-bottom-width: 1.5px;
}

/* Bottom line (descender) */
.nt-guide-bottom {
    top: 95%;
    border-color: #93c5fd;
    border-bottom-style: dashed;
}


/* =========================================
   4. LETTERS
   ========================================= */
.nt-letters {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    padding-top: 2%;
}

.nt-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: 'Patrick Hand', 'Comic Neue', cursive;
    font-weight: 400;
    color: #1f2937;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
}

/* ── Font sizes by variant ── */
.nt-size-small .nt-letter {
    font-size: 36px;
    min-width: 0.55em;
}

.nt-size-medium .nt-letter {
    font-size: 52px;
    min-width: 0.55em;
}

.nt-size-large .nt-letter {
    font-size: 72px;
    min-width: 0.55em;
}

.nt-space {
    min-width: 0.4em;
}


/* =========================================
   5. MODEL ROW (solid, fully opaque)
   ========================================= */
.nt-model-row .nt-letter {
    color: #1f2937;
    opacity: 1;
    font-weight: 700;
}


/* =========================================
   6. TRACING STYLES
   ========================================= */

/* Dotted outline letters (repeating-gradient approach) */
.nt-style-dotted .nt-letter {
    color: transparent;
    -webkit-text-stroke: 0;
    text-stroke: 0;
    background: repeating-linear-gradient(90deg,
            #9ca3af 0px, #9ca3af 2px,
            transparent 2px, transparent 5px);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700 !important;
}

/* Dashed outline letters */
.nt-style-dashed .nt-letter {
    color: transparent;
    -webkit-text-stroke: 1.5px #9ca3af;
    text-stroke: 1.5px #9ca3af;
}

/* Light gray solid letters */
.nt-style-light .nt-letter {
    color: #d1d5db;
    font-weight: 600;
}


/* =========================================
   7. HINT TEXT
   ========================================= */
.nt-hint {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--c-text-muted, #9ca3af);
    line-height: 1.4;
}


/* ── Preset Buttons ── */
.preset-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.btn-preset {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--c-border, #e5e7eb);
    border-radius: 6px;
    background: var(--c-bg-card, #fff);
    color: var(--c-text, #1f2937);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.4;
}

.btn-preset:hover {
    background: var(--c-primary, #3b82f6);
    color: #fff;
    border-color: var(--c-primary, #3b82f6);
}


/* ── Font Family Variants ── */
.nt-font-print .nt-letter {
    font-family: 'Patrick Hand', cursive;
}

.nt-font-manuscript .nt-letter {
    font-family: 'ABeeZee', sans-serif;
}

.nt-font-cursive .nt-letter {
    font-family: 'Dancing Script', cursive;
}

.nt-font-block .nt-letter {
    font-family: 'Comic Neue', cursive;
    font-weight: 700;
}


/* ── Starting Dot ── */
.nt-start-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #22c55e;
    flex-shrink: 0;
    margin-right: 4px;
    align-self: center;
}

.nt-size-medium .nt-start-dot {
    width: 8px;
    height: 8px;
    margin-right: 5px;
}

.nt-size-large .nt-start-dot {
    width: 10px;
    height: 10px;
    margin-right: 6px;
}


/* ── Practice Row ── */
.nt-practice-row {
    border-bottom: 1px solid #e5e7eb;
}


/* =========================================
   8. PRINT OVERRIDES
   ========================================= */
@media print {

    /*
     * Sheet sizing + header pinning is in sheet-common.css.
     * Here we only add name-tracing-specific print rules.
     */

    /* Let tracing body fill remaining space, no shrink */
    .nt-body {
        flex: 1 0 auto;
    }

    /* Prevent rows from compressing */
    .nt-row {
        flex-shrink: 0;
    }

    /* Color fidelity */
    .nt-guide-top,
    .nt-guide-mid,
    .nt-guide-base,
    .nt-guide-bottom {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nt-model-row .nt-letter {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nt-style-dotted .nt-letter,
    .nt-style-dashed .nt-letter,
    .nt-style-light .nt-letter {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nt-row {
        break-inside: avoid;
    }

    .nt-start-dot {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .nt-practice-row {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}