/*
 * OMP Custom Theme Stylesheet
 * ----------------------------
 * This stylesheet replicates the visual appearance of the OMP catalog page
 * found at https://omp.openjournaltheme.com/catalog. It uses modern
 * CSS practices including variables, Flexbox, and Grid for a responsive
 * and maintainable design.
 */

/* 1. Font Import */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap');

/* 2. Global Styles & Variables */
:root {
    --primary-dark-teal: #1A3D4F;
    --primary-bright-blue: #007AB2;
    --background-light-gray: #F0F0F0;
    --content-white: #FFFFFF;
    --text-dark-gray: #333333;
    --border-light-gray: #DDDDDD;
}

body {
    background-color: var(--background-light-gray);
    font-family: 'Lato', sans-serif;
    color: var(--text-dark-gray);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1, h2, h3 {
    color: var(--primary-dark-teal);
    font-weight: 700;
}

a {
    color: var(--primary-bright-blue);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 3. Page Layout & Structure */
.pkp_structure_page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.pkp_structure_content {
    display: flex;
    gap: 30px; /* Provides space between sidebar and main content */
}

.pkp_structure_sidebar_left {
    flex: 0 0 250px;
    /* margin-right is handled by the 'gap' property in .pkp_structure_content */
}

.pkp_block {
    background-color: var(--content-white);
    border: 1px solid var(--border-light-gray);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
}

#main-content {
    flex: 1;
    min-width: 0; /* Prevents flex items from overflowing */
}


/* 4. Component-Specific Styling */

/* Header Navigation */
.pkp_navigation_primary {
    background-color: var(--primary-dark-teal);
    border-radius: 8px;
    margin-bottom: 30px;
}

.pkp_navigation_primary ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
}

.pkp_navigation_primary ul a {
    color: var(--content-white);
    padding: 15px;
    font-weight: 700;
    display: block;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}

.pkp_navigation_primary ul a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* Book Grid */
.obj_monograph_catalog_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Individual Book Item */
.obj_monograph_catalog_grid_entry {
    background: var(--content-white);
    border: 1px solid var(--border-light-gray);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.obj_monograph_catalog_grid_entry:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Book Item Elements */
.obj_monograph_catalog_grid_entry .cover img {
    max-width: 100%;
    height: auto;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.obj_monograph_catalog_grid_entry .title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark-teal);
    margin: 0 0 10px 0;
}

.obj_monograph_catalog_grid_entry .creator {
    font-size: 0.9rem;
    color: var(--text-dark-gray);
    margin-bottom: 15px;
    flex-grow: 1; /* Pushes button to the bottom */
}

.read_open_access a {
    display: inline-block;
    background-color: var(--primary-bright-blue);
    color: var(--content-white);
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease-in-out;
}

.read_open_access a:hover {
    background-color: #005f8a; /* Darker shade of --primary-bright-blue */
    text-decoration: none;
    color: var(--content-white);
}


/* 5. Responsiveness (Media Queries) */

@media (max-width: 992px) {
    /* On tablets, hide the sidebar for a more focused content view */
    .pkp_structure_sidebar_left {
        display: none;
    }
}

@media (max-width: 768px) {
    /* On mobile devices, stack the main layout */
    .pkp_structure_content {
        flex-direction: column;
    }
    
    .pkp_structure_sidebar_left {
        /* Re-display sidebar if needed, or keep hidden from 992px rule */
        /* If you want it to appear on mobile but not tablet, uncomment the line below */
        /* display: block; */
        flex: 0 0 auto; /* Reset flex property */
        margin-right: 0;
    }

    .obj_monograph_catalog_grid {
        /* Adjust grid for smaller screens for better spacing */
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}
