/* ===== LePet.sk Species Page Redesign ===== */

.sp-page {
    background: #f5f7f5;
    font-family: 'Inter', sans-serif;
    color: #333;
    line-height: 1.7;
}

.sp-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Breadcrumb --- */
.sp-breadcrumb {
    background: #1a332a;
    padding: 10px 0;
    font-size: 13px;
}

.sp-breadcrumb a {
    color: #9fbfa0;
    text-decoration: none;
}

.sp-breadcrumb a:hover {
    color: #66BB6A;
}

.sp-breadcrumb span {
    color: #ccc;
}

.sp-bc-sep {
    margin: 0 8px;
    color: #5a7a5e;
}

/* --- Hero / Header Section --- */
.sp-hero {
    background: linear-gradient(135deg, #0f1f15 0%, #1a332a 100%);
    padding: 30px 0 0;
    color: #fff;
}

.sp-hero-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 40px;
    overflow: hidden;
    align-items: flex-start;
}

.sp-hero-photo {
    flex: 0 0 clamp(250px, 35%, 400px);
    max-height: 400px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    position: relative;
    z-index: 2;
}

.sp-hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sp-hero-text {
    flex: 1;
    min-width: 0;
    padding: 20px 0 40px;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.sp-genus {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #66BB6A;
    margin: 0 0 8px;
}

.sp-hero-text h1 {
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
    text-align: left;
    overflow-wrap: break-word;
}

.sp-hero-text h2 {
    font-size: clamp(16px, 2.5vw, 22px);
    font-weight: 400;
    font-style: italic;
    margin: 0 0 20px;
    color: #66BB6A;
    overflow-wrap: break-word;
    text-align: left;
}

.sp-quick-facts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.sp-fact {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 12px 16px;
    text-align: center;
}

.sp-fact-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    display: block;
    margin-bottom: 4px;
}

.sp-fact-value {
    font-size: 18px;
    font-weight: 600;
    color: #FFD54F;
}

.sp-fact-cites {
    border-color: rgba(239,83,80,0.3);
    background: rgba(239,83,80,0.1);
}

.sp-fact-cites .sp-fact-value {
    color: #ef5350;
}

.sp-fact-cites .sp-fact-value i {
    margin-right: 4px;
}

/* --- Main Content --- */
.sp-content {
    padding: 60px 0 40px;
}

.sp-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
}

/* --- Description Card --- */
.sp-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 32px;
    margin-bottom: 24px;
}

.sp-card h3 {
    font-size: 22px;
    font-weight: 600;
    color: #1a332a;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #66BB6A;
}

.sp-card p {
    font-size: 16px;
    color: #444;
    margin: 0 0 12px;
    text-align: justify;
}

.sp-card p:last-child {
    margin-bottom: 0;
}

.sp-card strong {
    color: #1a332a;
}

/* --- Accordion Sections --- */
.sp-accordion {
    margin-bottom: 8px;
}

.sp-accordion-btn {
    width: 100%;
    background: #f0f4f0;
    border: 1px solid #dde5dd;
    border-radius: 8px;
    padding: 16px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #1a332a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s, border-color 0.2s;
    font-family: 'Inter', sans-serif;
}

.sp-accordion-btn:hover {
    background: #e4ede4;
    border-color: #66BB6A;
}

.sp-accordion-btn .sp-acc-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #2E7D32;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 400;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.sp-accordion-btn.sp-open .sp-acc-icon {
    transform: rotate(45deg);
}

.sp-accordion-body {
    display: none;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #dde5dd;
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 16px;
    color: #444;
    text-align: justify;
    line-height: 1.8;
}

.sp-accordion-body.sp-open {
    display: block;
}

.sp-accordion-btn.sp-open {
    border-radius: 8px 8px 0 0;
    background: #e4ede4;
}

/* --- Source --- */
.sp-source {
    font-size: 13px;
    color: #888;
    font-style: italic;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.sp-source a {
    color: #2E7D32;
    text-decoration: none;
}

.sp-source a:hover {
    text-decoration: underline;
}

/* --- Sidebar --- */
.sp-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sp-sidebar-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    overflow: hidden;
}

.sp-sidebar-card h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #1a332a;
    margin: 0;
    padding: 14px 20px;
}

.sp-map-img {
    width: 100%;
    display: block;
}

/* --- Map Tabs --- */
.sp-map-tabs {
    display: flex;
    border-bottom: 2px solid #e0e0e0;
}

.sp-map-tab {
    flex: 1;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #888;
    background: #f8f8f8;
    border: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.sp-map-tab:hover {
    color: #333;
    background: #f0f0f0;
}

.sp-map-tab-active {
    color: #2E7D32;
    background: #fff;
    border-bottom: 2px solid #2E7D32;
    margin-bottom: -2px;
}

.sp-map-panel {
    display: none;
}

.sp-map-panel-active {
    display: block;
}

#sp-leaflet-map {
    z-index: 1;
}

.sp-map-label {
    font-size: 10px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    text-shadow: 1px 1px 2px #fff, -1px -1px 2px #fff, 1px -1px 2px #fff, -1px 1px 2px #fff;
    pointer-events: none;
    transition: opacity 0.2s;
}

.sp-map-legend {
    background: rgba(255,255,255,0.92);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.8;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.sp-map-legend span {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    vertical-align: middle;
    margin-right: 6px;
}

.sp-map-text {
    padding: 16px 20px;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
}

.sp-map-text strong {
    color: #1a332a;
}

/* --- Video --- */
.sp-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.sp-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.sp-video-item {
    padding: 16px;
}

.sp-video-item + .sp-video-item {
    padding-top: 0;
}

/* --- Foreign Names --- */
.sp-names {
    padding: 16px 20px;
    font-size: 13px;
    color: #555;
    line-height: 2;
}

.sp-names p {
    margin: 0;
}

.sp-names strong {
    color: #1a332a;
}

/* --- AdSense container --- */
.sp-ad {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    padding: 16px;
    text-align: center;
    overflow: hidden;
}

.sp-ad-inline {
    padding: 16px 0 0;
    max-width: 1100px;
    margin: 0 auto;
}

/* --- Related Species --- */
.sp-related {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.sp-related h3 {
    font-size: 22px;
    font-weight: 600;
    color: #1a332a;
    margin: 0 0 20px;
}

.sp-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.sp-related-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    text-decoration: none;
    color: #333;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sp-related-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.sp-related-card .sp-rel-icon {
    width: 48px;
    height: 48px;
    background: #e8f5e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sp-related-card .sp-rel-icon i {
    color: #2E7D32;
    font-size: 20px;
}

.sp-related-card .sp-rel-name {
    font-weight: 600;
    font-size: 15px;
    color: #1a332a;
}

.sp-related-card .sp-rel-latin {
    font-size: 13px;
    font-style: italic;
    color: #888;
}

/* --- Genus cards (continent pages) --- */
.sp-related-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.sp-related-card span {
    font-weight: 600;
    font-size: 16px;
    color: #1a332a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* --- Species section on genus pages --- */
.sp-species-section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 40px;
}

.sp-species-heading {
    font-size: 22px;
    font-weight: 600;
    color: #1a332a;
    margin: 0 0 20px;
}

.sp-species-section .sp-related-card {
    display: grid;
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
    gap: 2px 14px;
    align-items: center;
    overflow: hidden;
}

.sp-species-section .sp-related-card img {
    grid-row: 1 / -1;
}

.sp-related-card .sp-related-name {
    font-weight: 600;
    font-size: 14px;
    color: #1a332a;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    align-self: end;
}

.sp-related-card .sp-related-latin {
    font-size: 12px;
    font-style: italic;
    color: #888;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    align-self: start;
}

.sp-related-card .sp-related-no-img {
    width: 80px;
    height: 80px;
    background: #e8f5e9;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #2E7D32;
    font-size: 24px;
    grid-row: 1 / -1;
}

/* --- Lightbox --- */
.sp-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

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

.sp-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: background 0.2s;
}

.sp-lightbox-close:hover {
    background: rgba(255,255,255,0.3);
}

.sp-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.sp-lightbox iframe {
    width: 90vw;
    height: 50.6vw;
    max-width: 1200px;
    max-height: 675px;
    border: 0;
    border-radius: 8px;
}

.sp-clickable {
    cursor: zoom-in;
    position: relative;
}

.sp-zoom-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 2;
    pointer-events: none;
}

.sp-clickable:hover .sp-zoom-icon {
    opacity: 1;
}

.sp-video-click {
    cursor: pointer;
    position: relative;
}

.sp-video-click img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(0,0,0,0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    transition: background 0.2s, transform 0.2s;
    z-index: 2;
}

.sp-video-click:hover .sp-video-play {
    background: #ef5350;
    transform: translate(-50%, -50%) scale(1.1);
}

.sp-video-expand {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.5);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s;
}

.sp-video-click:hover .sp-video-expand {
    opacity: 1;
}

/* --- Photo Gallery --- */
.sp-gallery-wrap {
    padding: 16px;
}

.sp-gallery-wrap h3 {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1a332a !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 0 14px !important;
}

.sp-gallery-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
}

.sp-gallery-thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: zoom-in;
    max-height: 120px;
}

.sp-gallery-thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.3s;
    max-width: 100% !important;
}

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

.sp-gallery-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10001;
}

.sp-gallery-prev,
.sp-gallery-next {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.sp-gallery-prev:hover,
.sp-gallery-next:hover {
    background: rgba(255,255,255,0.35);
}

.sp-gallery-counter {
    color: rgba(255,255,255,0.7);
    font-size: 14px;
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .sp-hero-inner {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .sp-hero-photo {
        flex: none;
        width: 100%;
        max-width: 400px;
        max-height: 350px;
    }

    .sp-hero-text {
        text-align: center;
        padding: 10px 0 30px;
    }

    .sp-hero-text h1 {
        font-size: 32px;
        text-align: center;
    }

    .sp-hero-text h2 {
        text-align: center;
    }

    .sp-quick-facts {
        grid-template-columns: repeat(2, 1fr);
    }

    .sp-grid {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 600px) {
    .sp-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .sp-gallery-wrap {
        margin: 0;
    }

    .sp-hero-text h1 {
        font-size: 26px;
    }

    .sp-hero-text h2 {
        font-size: 18px;
    }

    .sp-quick-facts {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .sp-fact {
        padding: 10px 12px;
    }

    .sp-fact-value {
        font-size: 15px;
    }

    .sp-card {
        padding: 20px;
        border-radius: 8px;
    }

    .sp-hero-photo {
        max-width: 100%;
        max-height: 300px;
        border-radius: 8px;
    }

    .sp-related-grid {
        grid-template-columns: 1fr;
    }

    .sp-map-label {
        font-size: 8px;
    }

    .sp-sidebar-card {
        margin: 0 -10px;
        border-radius: 0;
    }

    .sp-breadcrumb {
        font-size: 13px;
        padding: 8px 10px;
    }

    .sp-accordion-btn {
        font-size: 14px;
        padding: 12px 14px;
    }

}

@media (max-width: 400px) {
    .sp-hero-inner {
        padding: 0 10px;
    }

    .sp-hero-photo {
        max-height: 250px;
    }

    .sp-hero-text h1 {
        font-size: 22px;
    }

    .sp-hero-text h2 {
        font-size: 16px;
    }

    .sp-quick-facts {
        grid-template-columns: 1fr;
    }

    .sp-map-label {
        display: none;
    }

    .sp-wrap {
        padding: 0 10px;
    }
}
