
/* =====================================================
   NOTESREALM - LEARNING CATEGORIES
   Centered icons and responsive card layout
   ===================================================== */

.categories-section,
.categories-section * {
    box-sizing: border-box;
}

.categories-section {
    width: 100%;
    padding: 76px 20px;
    background: var(--bg, #f8fafc);
    overflow: hidden;
}

.categories-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* SECTION HEADING */

.categories-heading {
    max-width: 720px;
    margin: 0 auto 42px;
    text-align: center;
}

.categories-heading .section-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--secondary, #0891b2);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.4px;
}

.categories-heading h2 {
    margin: 0 0 14px;
    color: var(--text, #172033);
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 750;
    line-height: 1.2;
}

.categories-heading p {
    max-width: 650px;
    margin: 0 auto;
    color: var(--muted, #64748b);
    font-size: 1rem;
    line-height: 1.65;
}

/* CATEGORY GRID */

.categories-grid {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

/* CATEGORY CARDS */

.categories-section .category-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 100%;
    padding: 23px 20px;

    background: var(--surface, #ffffff);
    border: 1px solid var(--border, #dbe4ee);
    border-radius: var(--radius, 16px);

    box-shadow: 0 3px 14px rgba(15, 23, 42, 0.045);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

.categories-section .category-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent, #22d3ee);
    box-shadow: var(--shadow, 0 8px 24px rgba(15, 23, 42, 0.10));
}

/* CATEGORY ICONS */

.categories-section .category-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 48px;
    width: 48px;
    height: 48px;

    margin-bottom: 17px;
    border-radius: 12px;

    font-size: 1.4rem;
    font-weight: 700;
}

.icon-programming {
    background: #e8f2fb;
    color: #0f4c81;
}

.icon-security {
    background: #e6f7f8;
    color: #0891b2;
}

.icon-mathematics {
    background: #eef2ff;
    color: #4f46e5;
}

.icon-science {
    background: #ecfdf5;
    color: #059669;
}

.icon-business {
    background: #fff7ed;
    color: #c2410c;
}

.icon-language {
    background: #fdf2f8;
    color: #be185d;
}

.icon-humanities {
    background: #f5f3ff;
    color: #7c3aed;
}

.icon-practical {
    background: #ecfeff;
    color: #0e7490;
}

/* CARD CONTENT */

.categories-section .category-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.categories-section .category-content h3 {
    margin: 0 0 10px;
    color: var(--text, #172033);
    font-size: 1.03rem;
    font-weight: 700;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.categories-section .category-content p {
    margin: 0 0 17px;
    color: var(--muted, #64748b);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* SUBJECT TAGS */

.categories-section .category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: auto 0 17px;
}

.categories-section .category-tags span {
    display: inline-block;
    padding: 5px 8px;
    background: #f1f7fa;
    border: 1px solid var(--border, #dbe4ee);
    border-radius: 20px;
    color: var(--muted, #64748b);
    font-size: 0.7rem;
}

/* CATEGORY LINKS */

.categories-section .category-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: auto;
    color: var(--primary, #0f4c81);
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
}

.categories-section .category-link:hover {
    color: var(--secondary, #0891b2);
}

/* SECTION FOOTER */

.categories-footer {
    margin-top: 32px;
    text-align: center;
}

.categories-footer p {
    margin: 0;
    color: var(--muted, #64748b);
    font-size: 0.88rem;
}

/* =====================================================
   TABLET
   ===================================================== */

@media screen and (max-width: 1100px) {
    .categories-section {
        padding: 60px 22px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

/* =====================================================
   TABLET AND MOBILE
   Center icon and title
   ===================================================== */

@media screen and (max-width: 767px) {
    .categories-section {
        padding: 45px 16px;
    }

    .categories-heading {
        margin-bottom: 27px;
    }

    .categories-heading .section-eyebrow {
        font-size: 0.72rem;
        margin-bottom: 9px;
    }

    .categories-heading h2 {
        font-size: 1.7rem;
        margin-bottom: 10px;
    }

    .categories-heading p {
        font-size: 0.9rem;
    }

    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 13px;
    }

    .categories-section .category-card {
        min-height: 125px;
        padding: 16px 12px;

        align-items: center;
        justify-content: center;
        text-align: center;

        border-radius: 13px;
    }

    .categories-section .category-icon {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;

        margin: 0 auto 11px;

        border-radius: 10px;
        font-size: 1.2rem;
    }

    .categories-section .category-content {
        width: 100%;
        align-items: center;
        text-align: center;
    }

    .categories-section .category-content h3 {
        width: 100%;
        margin: 0;

        font-size: 1rem;
        line-height: 1.4;
        font-weight: 700;
        text-align: center;
    }

    /* Hide additional card information */
    .categories-section .category-content p,
    .categories-section .category-tags,
    .categories-section .category-link {
        display: none;
    }

    .categories-footer {
        margin-top: 22px;
    }

    .categories-footer p {
        font-size: 0.82rem;
    }
}

/* =====================================================
   SMALL MOBILE
   ===================================================== */

@media screen and (max-width: 480px) {
    .categories-section {
        padding: 38px 12px;
    }

    .categories-heading {
        margin-bottom: 22px;
    }

    .categories-heading h2 {
        font-size: 1.55rem;
    }

    .categories-heading p {
        font-size: 0.86rem;
        line-height: 1.5;
    }

    .categories-grid {
        gap: 10px;
    }

    .categories-section .category-card {
        min-height: 118px;
        padding: 14px 10px;
    }

    .categories-section .category-icon {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        margin-bottom: 10px;
        font-size: 1.1rem;
    }

    .categories-section .category-content h3 {
        font-size: 0.96rem;
        line-height: 1.4;
    }
}

/* =====================================================
   VERY NARROW MOBILE
   ===================================================== */

@media screen and (max-width: 359px) {
    .categories-section {
        padding: 32px 10px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .categories-section .category-card {
        min-height: 108px;
        padding: 12px 8px;
    }

    .categories-section .category-icon {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        margin-bottom: 9px;
        font-size: 1rem;
    }

    .categories-section .category-content h3 {
        font-size: 0.88rem;
        line-height: 1.35;
    }

    .categories-heading h2 {
        font-size: 1.4rem;
    }
}

/* ACCESSIBILITY */

@media (hover: none) {
    .categories-section .category-card:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .categories-section .category-card {
        transition: none;
    }

    .categories-section .category-card:hover {
        transform: none;
    }
}
