/**
 * @filename      assets/css/theme.css
 * @author        Plantnimals Team
 * @created       2025-10-18
 * @version       1.4.16
 * @modified      10/12/2025
 * @description   Custom styles supplementing Tailwind for the Plantnimals theme
 *                (prose, maps, gallery, and lightbox polish).
 */

/* ==========================================================================
   PROSE TYPOGRAPHY (Article Content)
   ========================================================================== */

.prose {
    color: #334155;
    line-height: 1.75;
}

.prose h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #065f46;
    padding-bottom: 0.5rem;
    display: inline-block;
}

.prose h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose p {
    margin-bottom: 1.5rem;
}

.prose a {
    color: #065f46;
    text-decoration: underline;
    font-weight: 500;
}

.prose a:hover {
    color: #064e3b;
}

.prose strong {
    font-weight: 600;
    color: #0f172a;
}

.prose em {
    font-style: italic;
}

/* Lists */
.prose ul,
.prose ol {
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    padding-left: 1.625rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.prose li>p {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Nested lists */
.prose ul ul,
.prose ul ol,
.prose ol ul,
.prose ol ol {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

/* Callout Boxes / Blockquotes */
.prose blockquote {
    font-style: italic;
    border-left: 4px solid #065f46;
    padding-left: 1.5rem;
    margin: 2rem 0;
    color: #64748b;
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
}

.prose blockquote p {
    margin: 0;
}

/* Code blocks */
.prose code {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: 'Courier New', monospace;
    color: #065f46;
}

.prose pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.prose pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Tables */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.prose th {
    background: #f1f5f9;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.prose td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

/* Images */
.prose img {
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.prose figure {
    margin: 2rem 0;
}

.prose figcaption {
    text-align: center;
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.75rem;
}

/* Horizontal Rule */
.prose hr {
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 3rem 0;
}

/* ==========================================================================
   MAP MODAL STYLES
   ========================================================================== */

#map-modal {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#map-modal button:hover {
    background: #f1f5f9;
}

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */

@media (max-width: 768px) {
    .prose h2 {
        font-size: 1.5rem;
    }

    .prose h3 {
        font-size: 1.25rem;
    }

    #map-modal {
        padding: 1rem;
    }
}

/* ==========================================================================
   GLIGHTBOX POLISH (NAV + CAPTION)
   ========================================================================== */

.glightbox-clean .gprev,
.glightbox-clean .gnext {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.glightbox-clean .gprev:hover,
.glightbox-clean .gnext:hover {
    background: rgba(0, 0, 0, 0.75);
}

.glightbox-clean .gprev svg,
.glightbox-clean .gnext svg {
    display: none;
}

.glightbox-clean .gprev::after,
.glightbox-clean .gnext::after {
    content: '';
    width: 14px;
    height: 14px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.glightbox-clean .gprev::after {
    background-image: url('../images/icons/arrow-left.svg');
}

.glightbox-clean .gnext::after {
    background-image: url('../images/icons/arrow-right.svg');
}

.glightbox-clean .gslide-description {
    background: rgba(0, 0, 0, 0.65);
    color: #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
}

.glightbox-clean .gslide-description .gslide-title {
    color: #fff;
    font-weight: 700;
    margin-bottom: 6px;
}

.glightbox-clean .gslide-description p {
    color: #e2e8f0;
    margin: 0;
}

/* ==========================================================================
   CONSERVATION BADGES
   ========================================================================== */

.pn-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #e2e8f0;
    color: #0f172a;
}

.pn-badge::before {
    content: '';
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 9999px;
    background: currentColor;
    opacity: 0.9;
}

.pn-badge--least-concern {
    background: #ecfdf3;
    color: #166534;
    border-color: #bbf7d0;
}

.pn-badge--near-threatened {
    background: #fefce8;
    color: #854d0e;
    border-color: #fde68a;
}

.pn-badge--vulnerable {
    background: #fff7ed;
    color: #9a3412;
    border-color: #fed7aa;
}

.pn-badge--endangered {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecdd3;
}

.pn-badge--critically-endangered {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}

.pn-badge--extinct-in-the-wild,
.pn-badge--extinct {
    background: #0f172a;
    color: #f8fafc;
    border-color: #1f2937;
}

.pn-badge--data-deficient {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.pn-badge--not-evaluated {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}

/* ==========================================================================
   MOBILE NAV
   ========================================================================== */
#primary-navigation.mobile-nav {
    display: none;
}

#primary-navigation.mobile-nav.is-open {
    display: block;
}

body.nav-open {
    overflow: hidden;
}