/* ============================================================
   int.css — Integers topic pages
   ใช้ร่วมกับ page.css
   ============================================================ */

/* ── Number Line Styling ── */
.number-line-wrap {
    background: #fff;
    border-radius: var(--radius);
    padding: 30px 20px;
    margin: 30px 0;
    box-shadow: var(--shadow);
    text-align: center;
}

.number-line-wrap h2 {
    color: var(--primary);
    margin-bottom: 8px;
}

.nl-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 40px;
}

.number-line {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 60px 0 40px;
    /* More space for labels/arrows */
    padding: 0 40px;
    position: relative;
}

.nl-line {
    flex: 1;
    height: 3px;
    /* Slightly thinner for sharpness */
    background: var(--border);
    position: relative;
    /* Arrows integrated via pseudo-elements */
}

.nl-line::before,
.nl-line::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

.nl-line::before {
    left: -15px;
    border-right: 15px solid var(--border);
}

.nl-line::after {
    right: -15px;
    border-left: 15px solid var(--border);
}

.nl-tick {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    /* Sharp vertical line */
    height: 16px;
    background: var(--border);
    transition: transform 0.2s, background 0.2s, height 0.2s;
}

.nl-tick span {
    position: absolute;
    top: 22px;
    /* Positioned below the tick */
    left: 50%;
    transform: translateX(-50%);
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Colors for specific types */
.nl-tick.neg {
    background: var(--negative);
    height: 18px;
}

.nl-tick.pos {
    background: var(--positive);
    height: 18px;
}

.nl-tick.zero {
    background: var(--zero);
    width: 4px;
    /* Slightly thicker for zero */
    height: 24px;
    z-index: 2;
}

.nl-tick.neg span {
    color: var(--negative);
}

.nl-tick.pos span {
    color: var(--positive);
}

.nl-tick.zero span {
    color: var(--zero);
    font-size: 1.3rem;
}

/* Highlight state (for comparison or specific demos) */
.nl-tick.nl-highlight {
    transform: translate(-50%, -50%) scale(1.2);
    background: var(--primary);
    width: 3px;
    height: 30px;
    z-index: 3;
}

.nl-tick.nl-highlight::before {
    content: '↓';
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: inherit;
    animation: bounce 1.5s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, -8px);
    }
}

/* ── Specific Demo Boxes ── */
.rule-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.rule-card {
    background: rgba(255, 255, 255, 0.6);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    gap: 15px;
}

.rule-icon {
    font-size: 1.5rem;
}

.rule-title {
    font-weight: 700;
    margin-bottom: 5px;
    color: var(--text-main);
}

.rule-example {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: 800;
}

.rule-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.r-pos {
    border-left: 4px solid var(--positive);
}

.r-neg {
    border-left: 4px solid var(--negative);
}

.r-zero {
    border-left: 4px solid var(--zero);
}

.r-mix {
    border-left: 4px solid var(--primary);
}