/* ============================================
   SECONDARY SUBJECTS LISTING
   Shared styles for /junior-sec and /senior-sec.
   Assumes styles.css is loaded first.
   ============================================ */

/* ---------- HERO ---------- */
.page-hero {
    padding: 3rem 0 2rem;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(244, 67, 54, 0.06) 0%, transparent 55%),
        var(--bg-primary);
}

.page-title {
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.5rem;
}

.page-sub {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0 auto 2rem;
    max-width: 540px;
    line-height: 1.5;
}

/* ---------- SEARCH ---------- */
.subject-search-wrap {
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: var(--bg-surface);
    border: 1px solid var(--divider-color);
    border-radius: 12px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.subject-search-wrap .material-icons-round {
    font-size: 20px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

.subject-search-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    min-width: 0;
}

.subject-search-wrap input::placeholder {
    color: var(--text-tertiary);
}

/* ---------- LISTING SECTION ---------- */
.subject-listing {
    padding: 1rem 0 4rem;
}

/* ---------- GRID ---------- */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    perspective: 1000px;
}

/* ---------- CARD ---------- */
.subject-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 1.6rem 18px;
    background: var(--bg-surface);
    border: 1px solid var(--divider-color);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    position: relative;
    transform-style: preserve-3d;
    transition: border-color var(--transition-fast),
                transform 0.15s ease-out,
                box-shadow var(--transition-fast);
    will-change: transform;
}

.subject-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        400px circle at var(--mx, 50%) var(--my, 50%),
        rgba(244, 67, 54, 0.06),
        transparent 40%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.subject-card:hover::before {
    opacity: 1;
}

.subject-card > * {
    position: relative;
    z-index: 1;
}

/* ---------- ICON ---------- */
.subject-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.subject-icon .material-icons-round {
    font-size: 26px;
    color: #ffffff;
}

/* ---------- BODY ---------- */
.subject-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.subject-name {
    font-size: 1.55rem;
    letter-spacing: .1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.subject-meta {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- ARROW ---------- */
.subject-arrow {
    flex-shrink: 0;
    color: var(--text-tertiary);
    font-size: 22px;
    transition: transform var(--transition-fast), color var(--transition-fast);
}


/* ---------- EMPTY STATE ---------- */
.subject-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-tertiary);
}

.subject-empty .material-icons-round {
    font-size: 44px;
    opacity: 0.55;
}

/* ---------- TOUCH + REDUCED MOTION ---------- */
@media (hover: none) {
    .subject-card { transform: none !important; }
    .subject-card::before { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .subject-card { transform: none !important; }
}

/* ---------- MOBILE ---------- */
@media (max-width: 600px) {
    .page-hero { padding: 2rem 0 1.5rem; }
    .subject-grid { grid-template-columns: 1fr; gap: 10px; }
    .subject-card { padding: 1.6rem 14px; gap: 12px; }
    .subject-icon { width: 46px; height: 46px; }
    .subject-icon .material-icons-round { font-size: 22px; }
    .subject-name { font-size: 1.4rem; }
}