/* ==========================================================================
   Single Resource Page Styles
   ========================================================================== */

/* --- General Container & Layout --- */

.single-resource-page .single-resource-container {
    max-width: 1100px; /* Adjust as needed */
    margin: 2rem auto;
    padding: 1rem 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; /* Match list view */
    font-size: 15px; /* Slightly larger base for readability */
    color: #333;
    line-height: 1.7; /* More line height for content */
}

.resource-article {
    background-color: #fff;
    padding: 2rem 2.5rem; /* Padding inside the article */
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    margin-bottom: 2.5rem; /* Space before comments */
}

/* --- Header --- */

.resource-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    position: relative; /* For positioning edit link */
}

.resource-header .entry-title {
    font-size: 2.2em; /* Larger title for single view */
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: #1d2327;
    line-height: 1.3;
}

.resource-header .edit-link {
    position: absolute;
    top: 0;
    right: 0;
    font-size: 13px;
}
.resource-header .edit-link a {
    color: #0073aa;
    text-decoration: none;
}
.resource-header .edit-link a:hover {
    text-decoration: underline;
}

/* --- Two Column Layout (Content & Sidebar) --- */

.resource-layout-wrapper {
    display: flex;
    flex-wrap: wrap; /* Allow stacking on smaller screens */
    gap: 3rem; /* Space between content and sidebar */
    margin-top: 1.5rem;
}

.resource-main-content {
    flex: 1; /* Allow content to grow */
    min-width: 60%; /* Ensure content takes up reasonable space */
}

.resource-sidebar {
    flex-basis: 280px; /* Fixed width sidebar */
    flex-grow: 0;
    flex-shrink: 0;
}

/* --- Main Content Styling --- */

.resource-main-content h1,
.resource-main-content h2,
.resource-main-content h3,
.resource-main-content h4,
.resource-main-content h5,
.resource-main-content h6 {
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    line-height: 1.4;
    font-weight: 600;
    color: #1d2327;
}
.resource-main-content h1 { font-size: 1.8em; }
.resource-main-content h2 { font-size: 1.6em; }
.resource-main-content h3 { font-size: 1.4em; }
.resource-main-content h4 { font-size: 1.2em; }

.resource-main-content p {
    margin-bottom: 1.5em;
}
.resource-main-content ul,
.resource-main-content ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
}
.resource-main-content li {
    margin-bottom: 0.5em;
}
.resource-main-content a {
    color: #0073aa;
    text-decoration: underline;
}
.resource-main-content a:hover {
    color: #005a87;
}
.resource-main-content img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
}

/* --- Sidebar Styling --- */

.resource-sidebar .sidebar-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: #f9f9f9; /* Subtle background */
    border: 1px solid #eee;
    border-radius: 3px;
}

.resource-sidebar .sidebar-title {
    font-size: 1em; /* Smaller sidebar titles */
    font-weight: 700;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e5e5;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #333;
}

/* Meta Details List */
.resource-meta-details ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 13px; /* Smaller font for details */
}
.resource-meta-details li {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px dotted #e5e5e5; /* Dotted separator */
    display: flex; /* Layout label and value */
    flex-wrap: wrap;
    gap: 5px;
}
.resource-meta-details li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.resource-meta-details strong {
    display: block; /* Make label take full width */
    width: 100%;
    color: #50575e; /* WP Admin subtle text */
    font-weight: 600;
    margin-bottom: 3px;
}
.resource-meta-details span {
    display: block;
    width: 100%;
    color: #333;
    word-wrap: break-word; /* Break long strings */
}
.resource-meta-details a {
    color: #0073aa;
    text-decoration: none;
}
.resource-meta-details a:hover {
    text-decoration: underline;
}

/* File Attachment */
.resource-files .file-item {
    display: flex;
    align-items: center;
    padding: 8px 0; /* Spacing around file item */
    font-size: 13px;
}
.resource-files .file-item .dashicons {
    font-size: 24px; /* Icon size */
    margin-right: 10px;
    color: #787c82; /* Icon color */
    flex-shrink: 0;
}
.resource-files .file-item a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
    word-break: break-all; /* Break long filenames */
}
.resource-files .file-item a:hover {
    text-decoration: underline;
    color: #005a87;
}
.resource-files .file-item .file-size {
    margin-left: 8px;
    font-size: 0.9em;
    color: #787c82;
    white-space: nowrap;
}

/* Taxonomy Terms */
.resource-sidebar .taxonomy-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Spacing between terms */
}
.resource-sidebar .term-link {
    display: inline-block;
    padding: 4px 10px;
    background-color: #eef4fa; /* Light blue background */
    border: 1px solid #d0e0ef; /* Light blue border */
    border-radius: 3px;
    font-size: 12px;
    color: #005a87; /* Darker blue text */
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}
.resource-sidebar .term-link:hover {
    background-color: #dbeaf7;
    border-color: #b0cbe0;
    color: #003c5c;
}

/* --- Comments Area Styling --- */

.resource-comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #eee;
    background-color: #fff;
    padding: 2rem 2.5rem; /* Match article padding */
    border: 1px solid #e5e5e5;
    border-radius: 4px;
}

/* Use default WP comment styling where possible, or override */
.resource-comments-area .comment-reply-title,
.resource-comments-area .comments-title {
    font-size: 1.6em;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #1d2327;
}

.resource-comments-area .comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}
.resource-comments-area .comment {
    margin-bottom: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
    background-color: #fdfdfd;
}
.resource-comments-area .comment-body {
    position: relative;
}
.resource-comments-area .comment-author .avatar {
    float: left;
    margin-right: 15px;
    border-radius: 50%;
    border: 1px solid #eee;
}
.resource-comments-area .comment-author .fn {
    font-weight: 600;
    font-size: 1.1em;
    color: #1d2327;
}
.resource-comments-area .comment-metadata {
    font-size: 0.9em;
    color: #787c82;
    margin-bottom: 0.8em;
}
.resource-comments-area .comment-metadata a {
    color: #787c82;
    text-decoration: none;
}
.resource-comments-area .comment-metadata a:hover {
    text-decoration: underline;
}
.resource-comments-area .comment-content {
    clear: both;
    padding-top: 5px;
    line-height: 1.7;
    font-size: 14px;
}
.resource-comments-area .comment-content p:last-child {
    margin-bottom: 0;
}
.resource-comments-area .reply {
    margin-top: 1rem;
    font-size: 0.9em;
    text-align: right;
}
.resource-comments-area .comment-reply-link {
    color: #0073aa;
    text-decoration: none;
    border: 1px solid #ccc;
    padding: 4px 8px;
    border-radius: 3px;
    background: #f7f7f7;
}
.resource-comments-area .comment-reply-link:hover {
    background: #f0f0f0;
    border-color: #999;
    color: #005a87;
}

/* Comment Form Styling */
.resource-comments-area .comment-respond {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 3px;
}
.resource-comments-area .comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 13px;
    color: #50575e;
}
.resource-comments-area .comment-form input[type="text"],
.resource-comments-area .comment-form input[type="email"],
.resource-comments-area .comment-form input[type="url"],
.resource-comments-area .comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccd0d4;
    border-radius: 3px;
    margin-bottom: 1rem;
    box-sizing: border-box;
    font-size: 14px;
    background-color: #fff;
}
.resource-comments-area .comment-form input[type="text"]:focus,
.resource-comments-area .comment-form input[type="email"]:focus,
.resource-comments-area .comment-form input[type="url"]:focus,
.resource-comments-area .comment-form textarea:focus {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
    outline: none;
}
.resource-comments-area .comment-form .form-submit input[type="submit"] {
    background-color: #0073aa; /* Primary button */
    color: #fff;
    border: 1px solid #0073aa;
    border-radius: 3px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}
.resource-comments-area .comment-form .form-submit input[type="submit"]:hover {
    background-color: #005a87;
    border-color: #005a87;
}


/* --- Responsive Adjustments for Single View --- */

@media (max-width: 768px) {
    .single-resource-page .single-resource-container {
        padding: 1rem;
    }
    .resource-article, .resource-comments-area {
        padding: 1.5rem; /* Reduce padding on smaller screens */
    }
    .resource-layout-wrapper {
        flex-direction: column; /* Stack content and sidebar */
        gap: 2rem;
    }
    .resource-sidebar {
        flex-basis: auto; /* Allow sidebar to take full width */
        width: 100%;
        order: -1; /* Optional: Move sidebar above content */
    }
    .resource-header .entry-title {
        font-size: 1.8em;
    }
}

@media (max-width: 480px) {
    .resource-article, .resource-comments-area {
        padding: 1rem;
    }
    .resource-header .entry-title {
        font-size: 1.6em;
    }
    .resource-sidebar .sidebar-section {
        padding: 0.8rem;
    }
    .resource-comments-area .comment {
        padding: 1rem;
    }
    .resource-comments-area .comment-form {
        padding: 1rem;
    }
}

/* Styling for the featured image on the single resource page */
.resource-featured-image {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    background-color: #f0f0f1; /* A light background color for images that might not fully cover */
}