/* =========================================
   Global Styles & Variables (from globals.css)
   ========================================= */
:root {
    /* Species360 Colors */
    --primary-color: #15b79e;
    --primary-hover: #129c86;
    --secondary-color: #1D2939;
    --text-main: #1D2939;
    --text-light: #667085;
    --background-light: #FBFBFB;
    --background-white: #FFFFFF;
    --border-color: #EAECF0;
    --accent-color: #15b79e;

    /* Fonts */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --container-max-width: 1200px;
    --header-height: 80px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--background-light);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

button {
    font-family: var(--font-heading);
    cursor: pointer;
}

.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Utilities */
.text-primary {
    color: var(--primary-color);
}

.bg-primary {
    background-color: var(--primary-color);
}

/* =========================================
     Header Styles (from Layout.module.css)
     ========================================= */
.header {
    background-color: var(--background-white);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 2rem 0 1rem;
}

.header__logo-img {
    height: 50px;
    width: auto;
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav__link {
    font-family: var(--font-heading);
    font-weight: 500;
    color: var(--secondary-color);
    font-size: 0.95rem;
}

.nav__link:hover {
    color: var(--primary-color);
}

/* Language Selector Styling */
.language-selector {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--background-white);
    margin-left: 1rem;
}

/* =========================================
     Home Page Styles (from Home.module.css)
     ========================================= */
.hero {
    background-color: var(--secondary-color);
    color: #fff;
    padding: 4rem 1.5rem;
    text-align: center;
    margin-bottom: 3rem;
    /* Full width trick */
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
    overflow: hidden;
}

.hero__title {
    font-size: 3rem;
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    color: #fff;
    position: relative;
    z-index: 2;
}

.hero__subtitle {
    font-size: 1.5rem;
    font-family: var(--font-heading);
    margin-bottom: 2rem;
    color: var(--primary-color);
    opacity: 0.9;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

.hero__tagline {
    font-size: 1.25rem;
    font-family: var(--font-body);
    opacity: 0.8;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    white-space: pre-line;
    position: relative;
    z-index: 2;
}

/* Background Slider */
.background-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    height: 100%;
    z-index: 0;
    /* Opacity removed to match original site configuration */
    overflow: hidden;
    pointer-events: none;
}

.background-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;

}

.background-slide.active {
    opacity: 1;
}

/* Content Section */
.section {
    margin-bottom: 4rem;
    padding-bottom: 120px;
    position: relative;
}

.section__title {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: var(--secondary-color);
    position: relative;
    display: inline-block;
    width: 100%;
    z-index: 1;
}

.section__title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Updated to 4 columns per previous context */
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

@media (max-width: 1200px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.card__content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card__title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.card__desc {
    color: var(--text-light);
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

.card__action {
    margin-top: auto;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
}

.card__action:hover {
    gap: 0.8rem;
}

/* =========================================
     Modal Styles
     ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    padding: 0;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.open .modal-content {
    transform: translateY(0);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--secondary-color);
}

.modal-body {
    padding: 1.5rem;
}

/* Modal Specifics */
.modal-btn {
    display: block;
    width: 100%;
    text-align: center;
    background-color: var(--primary-color);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s;
}

.modal-btn:hover {
    background-color: var(--primary-hover);
}

/* =========================================
     Footer Styles
     ========================================= */
.footer {
    background-color: #0a1118;
    color: #ffffff;
    padding: 4rem 0 2rem;
    margin-top: auto;
}

.footer__container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.footer__column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer__title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #fff;
}

.footer__text {
    font-family: 'Gibson', sans-serif;
    /* fallback */
    font-weight: 300;
    opacity: 0.9;
    line-height: 1.6;
    max-width: 400px;
}

.footer__social {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.footer__social-link {
    color: #fff;
    font-size: 1.2rem;
    transition: opacity 0.2s;
}

.footer__social-link:hover {
    opacity: 0.8;
}

.footer__link {
    color: #fff;
    font-family: 'Gibson', sans-serif;
    font-size: 1.1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    width: fit-content;
    transition: color 0.2s;
}

.footer__link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.footer__copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 3rem;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Search Box (Help Library) */
.search-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
    min-height: 400px;
}

#search-disclaimer a {
    color: #0c5460;
    text-decoration: underline;
    font-weight: 600;
}

#search-disclaimer a:hover {
    color: #000;
}

@media (max-width: 768px) {
    .footer__container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}