/* =============================================
   SUBPAGE.CSS — Modern 2026 Species Pages
   ============================================= */

:root {
    --sp-bg:       #020b18;
    --sp-mid:      #041428;
    --sp-card:     rgba(4, 20, 40, 0.85);
    --sp-border:   rgba(0, 212, 255, 0.15);
    --sp-cyan:     #00d4ff;
    --sp-teal:     #00ffcc;
    --sp-text:     #e8f4ff;
    --sp-muted:    #8ab4d4;
}

body {
    background: var(--sp-bg);
    color: var(--sp-text);
}

/* ── Hero ── */
.sp-hero {
    position: relative;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, #020b18 0%, #041c35 60%, #020b18 100%);
    margin-top: 76px;
}

.sp-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 15% 60%, rgba(0,212,255,0.1) 0%, transparent 55%),
        radial-gradient(ellipse at 85% 30%, rgba(0,255,204,0.07) 0%, transparent 50%);
    animation: spGlow 7s ease-in-out infinite alternate;
}

@keyframes spGlow {
    0%   { opacity: 0.5; }
    100% { opacity: 1; }
}

.sp-hero .sp-bubbles {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.sp-bubble {
    position: absolute;
    bottom: -10px;
    border-radius: 50%;
    background: rgba(0,212,255,0.12);
    border: 1px solid rgba(0,212,255,0.25);
    animation: spRise linear infinite;
}
.sp-bubble:nth-child(1) { width:6px;  height:6px;  left:8%;  animation-duration:7s;  }
.sp-bubble:nth-child(2) { width:10px; height:10px; left:22%; animation-duration:9s;  animation-delay:1.5s; }
.sp-bubble:nth-child(3) { width:5px;  height:5px;  left:45%; animation-duration:6s;  animation-delay:2s; }
.sp-bubble:nth-child(4) { width:8px;  height:8px;  left:65%; animation-duration:8s;  animation-delay:0.5s; }
.sp-bubble:nth-child(5) { width:12px; height:12px; left:82%; animation-duration:11s; animation-delay:3s; }

@keyframes spRise {
    0%   { transform:translateY(0) scale(1);    opacity:0.8; }
    80%  { opacity:0.3; }
    100% { transform:translateY(-100vh) scale(1.2); opacity:0; }
}

.sp-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 1rem;
}

.sp-hero-content .sp-tag {
    display: inline-block;
    font-family: 'Bebas Neue', cursive;
    font-size: 0.75rem;
    letter-spacing: 4px;
    color: var(--sp-cyan);
    background: rgba(0,212,255,0.08);
    border: 1px solid rgba(0,212,255,0.25);
    border-radius: 20px;
    padding: 0.2rem 1rem;
    margin-bottom: 0.75rem;
}

.sp-hero-content h1 {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(2rem, 6vw, 4.5rem);
    letter-spacing: 4px;
    background: linear-gradient(135deg, #fff 0%, var(--sp-cyan) 50%, var(--sp-teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.1;
}

.sp-breadcrumb {
    position: relative;
    z-index: 2;
    background: rgba(0,212,255,0.05);
    border-top: 1px solid rgba(0,212,255,0.1);
    padding: 0.55rem 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.sp-breadcrumb a {
    font-family: 'Bebas Neue', cursive;
    font-size: 0.82rem;
    letter-spacing: 2px;
    color: var(--sp-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.sp-breadcrumb a:hover { color: var(--sp-cyan); }
.sp-breadcrumb span { color: rgba(0,212,255,0.35); font-size:0.8rem; }
.sp-breadcrumb .active {
    font-family: 'Bebas Neue', cursive;
    font-size: 0.82rem;
    letter-spacing: 2px;
    color: var(--sp-cyan);
}

/* ── Back button ── */
.sp-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Bebas Neue', cursive;
    font-size: 0.85rem;
    letter-spacing: 2px;
    color: var(--sp-muted);
    background: rgba(0,212,255,0.06);
    border: 1px solid rgba(0,212,255,0.2);
    border-radius: 25px;
    padding: 0.4rem 1.2rem;
    text-decoration: none;
    transition: all 0.25s ease;
    margin-bottom: 2.5rem;
}
.sp-back-btn:hover {
    color: var(--sp-bg);
    background: var(--sp-cyan);
    border-color: var(--sp-cyan);
    text-decoration: none;
}

/* ── Main content ── */
.sp-main {
    background: var(--sp-bg);
    padding: 4rem 0 5rem;
    min-height: 60vh;
}

/* ── Subsection heading ── */
.sp-subsection {
    margin-bottom: 3rem;
}

.sp-subsection + .sp-subsection {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(0,212,255,0.08);
}

.sp-section-title {
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    letter-spacing: 3px;
    color: var(--sp-text);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sp-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(0,212,255,0.4), transparent);
    max-width: 300px;
}

.sp-section-count {
    font-family: 'Bebas Neue', cursive;
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: var(--sp-cyan);
    background: rgba(0,212,255,0.08);
    border: 1px solid rgba(0,212,255,0.2);
    border-radius: 20px;
    padding: 0.15rem 0.75rem;
}

/* ── Species Grid ── */
.sp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

@media (max-width: 576px) {
    .sp-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}

/* ── Species Card ── */
.sp-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--sp-card);
    border: 1px solid var(--sp-border);
    transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
    cursor: pointer;
}

.sp-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 40px rgba(0,0,0,0.5), 0 0 20px rgba(0,212,255,0.1);
    border-color: rgba(0,212,255,0.4);
}

.sp-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    loading: lazy;
}

.sp-card:hover img {
    transform: scale(1.08);
}

.sp-card .sp-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(2,11,24,0.92) 0%, rgba(2,11,24,0.3) 45%, transparent 75%);
    transition: opacity 0.3s ease;
}

.sp-card .sp-card-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 0.85rem;
    font-family: 'Bebas Neue', cursive;
    font-size: clamp(0.7rem, 1.8vw, 0.9rem);
    letter-spacing: 1.5px;
    color: #fff;
    line-height: 1.2;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.sp-card .sp-card-name small {
    display: block;
    font-size: 0.65rem;
    color: rgba(0,212,255,0.7);
    letter-spacing: 1px;
    margin-top: 0.1rem;
}

/* ── Count badge ── */
.sp-count-badge {
    display: inline-block;
    font-family: 'Bebas Neue', cursive;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--sp-muted);
    background: rgba(0,212,255,0.05);
    border: 1px solid rgba(0,212,255,0.12);
    border-radius: 20px;
    padding: 0.15rem 0.75rem;
    margin-bottom: 1.25rem;
}

/* ── Lightbox overlay ── */
.sp-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(1, 6, 14, 0.97);
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.sp-lightbox.open { display: flex; }

.sp-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
}

.sp-lightbox-inner img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(0,212,255,0.2);
}

.sp-lightbox-name {
    font-family: 'Bebas Neue', cursive;
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: var(--sp-cyan);
    margin-top: 0.75rem;
    text-align: center;
}

.sp-lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sp-cyan);
    color: var(--sp-bg);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
    font-weight: bold;
    line-height: 1;
    transition: transform 0.2s;
}

.sp-lightbox-close:hover { transform: scale(1.1); }

.sp-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background: rgba(0,212,255,0.15);
    border: 1px solid rgba(0,212,255,0.3);
    border-radius: 50%;
    color: var(--sp-cyan);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sp-lightbox-nav:hover {
    background: var(--sp-cyan);
    color: var(--sp-bg);
}

.sp-lightbox-prev { left: -60px; }
.sp-lightbox-next { right: -60px; }

@media (max-width: 768px) {
    .sp-lightbox-prev { left: 8px; }
    .sp-lightbox-next { right: 8px; }
    .sp-lightbox-inner img { max-height: 70vh; }
}

/* ── Fade in ── */
.sp-fade {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.sp-fade.visible { opacity: 1; transform: translateY(0); }
