/* Resource Plugin Styles 
 * Theme-agnostic styling for the Lawrence Resources plugin
 */

/* Custom wrapper for the full-width resource archive page */
.lawrence-resources-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background-color: white;
}

/* CSS Variables - Can be overridden by theme */
:root {
    /* Primary colors - these can be overridden by the theme */
    --resource-primary-color: #078572;
    --resource-secondary-color: #9bdad9;
    --resource-text-color: #2C2C2C;
    --resource-bg-color: #ffffff;
    --resource-accent-color: #0030cc;
    
    /* Spacing variables */
    --resource-padding-sm: 15px;
    --resource-padding-md: 20px;
    --resource-padding-lg: 30px;
    --resource-margin-sm: 15px;
    --resource-margin-md: 20px;
    --resource-margin-lg: 30px;
    
    /* Card dimensions */
    --resource-card-width: 350px;
}

/* Resource Card Styles */
.resource-item {
    margin-bottom: var(--resource-margin-lg);
    display: none; /* Hidden by default, shown when filtered */
}

.resource-card {
    background-color: #ffffff;
    width: var(--resource-card-width);
    margin: var(--resource-margin-md);
    height: 100%;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.resource-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1;
}

.entry-content {
    padding: var(--resource-padding-lg) var(--resource-padding-lg) 
             var(--resource-padding-sm) var(--resource-padding-lg);
}

.resource-card-meta {
    padding: var(--resource-padding-sm) var(--resource-padding-lg) 
             0 var(--resource-padding-lg);
}

.resource-card-meta ul {
    padding: 0;
    margin: 0;
    list-style-type: none;
    display: flex;
    flex-wrap: wrap;
}

.resource-card-meta li {
    margin: 0;
    padding: 0;
    margin-bottom: var(--resource-padding-sm);
}

/* Filter Container Styles */
.filter-container {
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: var(--resource-padding-md) clamp(20px, 5%, 55px);
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--resource-primary-color);
    color: white;
    box-sizing: border-box;
}

.lawrence-resources-wrapper h2,
.resource-card .entry-title {
    font-size: 2.1rem;
}

.filter-container h1, 
.filter-container p {
    color: white;
}

.filter-container input[type="text"] {
    border: 2px solid white;
    background-color: var(--resource-primary-color);
    color: white;
    padding: 12px 5px;
    width: 100%;
    max-width: 300px;
    min-width: 300px;
    margin: var(--resource-margin-sm);
    box-sizing: border-box;
    height: 54px;
    font-size: 20px;
}

/* Custom Dropdown Styles */
.custom-dropdown-wrapper {
    position: relative;
    margin: var(--resource-margin-sm);
    width: 100%;
    max-width: 300px;
    min-width: 300px;
}

.dropdown-trigger {
    border: 2px solid white;
    background-color: var(--resource-primary-color);
    color: white;
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 54px;
    box-sizing: border-box;
    font-size: 16px;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.dropdown-trigger.active .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    border: 1px solid var(--resource-primary-color);
    border-top: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 4px 4px;
    visibility: hidden; /* Hide completely when not active */
    border-width: 0; /* Remove border when not active */
}

.custom-dropdown.active {
    max-height: 300px;
    overflow-y: auto;
    visibility: visible;
    border-width: 1px;
}

.checkbox-container {
    padding: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--resource-text-color);
    cursor: pointer;
    font-size: 14px;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 10px;
}

.clear-all-filters {
    background: none;
    border: 2px solid white;
    color: white;
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin: var(--resource-margin-sm);
    transition: background-color 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.clear-all-filters:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.filter-container input::placeholder {
    color: white;
    opacity: 0.8;
}

.filter-container input[type="text"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14.9' height='14.9' viewBox='0 0 14.9 14.9'%3E%3Cpath id='Path_3404' data-name='Path 3404' d='M14.9,13.8,9.933,8.83a5.4,5.4,0,0,0,1.1-3.311A5.485,5.485,0,0,0,5.519,0,5.485,5.485,0,0,0,0,5.519a5.485,5.485,0,0,0,5.519,5.519,5.4,5.4,0,0,0,3.311-1.1L13.8,14.9ZM1.577,5.519A3.9,3.9,0,0,1,5.519,1.577,3.9,3.9,0,0,1,9.46,5.519,3.9,3.9,0,0,1,5.519,9.46,3.9,3.9,0,0,1,1.577,5.519Z' fill='%23fff'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 20px) center;
    padding-right: 45px;
}

/* Resources Results Container */
#resources-results {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background-color: white;
    padding-top: var(--resource-padding-md);
    padding-bottom: 80px;
}

/* Filter Form Styles */
#filter-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0 auto;
    padding: var(--resource-padding-md);
    flex-wrap: wrap;
    max-width: 100%;
    box-sizing: border-box;
}

.bcrumb {
    padding: 1vw 5vw;
    text-align: left;
    width: 100%;
}

.filter-container .bcrumb a {
    color: white;
    text-decoration: underline;
}

.resource-content {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-gap: 20px;
    margin-bottom: 40px;
    padding: 0 5vw;
}

.entry-text {
    grid-column: 1 / span 6;
}

.meta-container {
    grid-column: 7 / span 6;
}

.resource-meta {
    margin: var(--resource-margin-md);
    padding: var(--resource-padding-lg);
    background-color: var(--resource-secondary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.resource-meta ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.resource-meta li {
    display: block;
    padding-left: 0;
    margin-bottom: 5px;
}

.resource-meta h3 {
    margin-top: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.resource-meta h4 {
	text-align: center;
}

/* PDF Attachments */
.pdf-attachments {
    margin-top: 40px;
}

.pdf-group {
    display: flex;
    margin-bottom: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.pdf-thumbnail {
    margin-right: 20px;
    flex-shrink: 0;
}

.pdf-thumbnail img {
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    max-width: 100px;
    height: auto;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.pdf-thumbnail img:hover {
    transform: scale(1.05);
}

.pdf-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.pdf-title-link:hover {
    color: var(--resource-accent-color);
    text-decoration: underline;
}

.pdf-title-link code span:before
{
    content: "";
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13.437' height='15.137' viewBox='0 0 13.437 15.137'%3E%3Cg id='Right_Arrrow' data-name='Right Arrrow' transform='translate(12.719) rotate(90)'%3E%3Cline id='Line_7' data-name='Line 7' x2='14' transform='translate(0 6)' fill='none' stroke='%230030CC' stroke-width='2'/%3E%3Cpath id='Path_103' data-name='Path 103' d='M0,0,6.2,6,0,12' transform='translate(7.5)' fill='none' stroke='%230030CC' stroke-width='2'/%3E%3C/g%3E%3C/svg%3E");
    background-position: 6px 5px;
    height: 90px;
    width: 50px;
    background-repeat: no-repeat;
    padding-left: 20px;
    padding-right: 2px;
    position: relative;
    z-index: 3;
    left: 0px;
    top: 0px;
}

.resources-hr {
    border: 0;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.2);
    margin: 40px 0;
}

/* Video Container */
.video-container {
    margin-bottom: 30px;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

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

/* Video in meta container (where featured image would be) */
.meta-video {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

.meta-video .video-title {
    padding: 10px;
    font-weight: 500;
    display: block;
    border-bottom: 1px solid #eee;
    background-color: #f9f9f9;
}

.video-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

/* External Link Icon */
.external-link-icon {
    display: inline-block;
    font-size: 0.8em;
    margin-left: 5px;
    position: relative;
    top: -1px;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Single template h1 styling */
.entry-text h1.title {
    font-size: 50px;
    line-height: 1.1;
}

/* No Results Message */
.no-results-message {
    text-align: center;
    padding: var(--resource-padding-lg);
    margin: var(--resource-margin-lg);
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: var(--resource-text-color);
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.no-results-message p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* Term count styling */
.term-count {
    color: #666;
    font-size: 0.9em;
    font-weight: normal;
}

/* Media Queries */
@media screen and (max-width: 1000px) {
    .pdf-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .pdf-thumbnail {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

@media screen and (max-width: 768px) {
    .resource-content {
        display: block;
    }
    
    .entry-text,
    .meta-container {
        width: 100%;
    }
    
    .resource-meta {
        margin: var(--resource-margin-md) 0;
    }
    
    .video-title,
    .pdf-title {
        font-size: 1.1rem;
    }
    
    #filter-form input,
    .custom-dropdown-wrapper {
        max-width: 100%;
        min-width: auto;
        width: 100%;
    }
}

/* Program Badges - overlaid on card thumbnails, matches theme post-badge on exhibit cards */
.resource-card .entry-thumbnail {
    position: relative;
}

.resource-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    padding: 10px;
    font-size: 1.4rem;
    line-height: 1.2;
    font-weight: 600;
}

/* BEETLES - orlando */
.resource-badge--beetles {
    background-color: #078572;
    color: #ffffff;
}

/* OBIS - ultraviolet */
.resource-badge--obis {
    background-color: #debdea;
    color: #2c2c2c;
}

/* MARE - orbit */
.resource-badge--mare {
    background-color: #0030cc;
    color: #ffffff;
}

/* Program badge link in the single post meta box */
.resource-meta .resource-badge {
    position: static;
    display: inline-block;
    padding: 4px 10px;
    text-decoration: none;
}

.resource-meta a.resource-badge:hover,
.resource-meta a.resource-badge:focus {
    text-decoration: underline;
}

.resource-meta a.resource-badge--beetles,
.resource-meta a.resource-badge--mare {
    color: #ffffff;
}

.resource-meta a.resource-badge--obis {
    color: #2c2c2c;
}
