/**
 * Single Resource Page Styles - ResourceBoy Match
 * Exact match to ResourceBoy.com single resource page design
 */

/* ===================================
   PAGE CONTAINER
   =================================== */
.single-resource-page {
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 0;
}

.single-resource-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===================================
   HEADER - TITLE
   =================================== */
.resource-single-header {
    padding: 48px 0 32px;
    text-align: left;
}

.resource-single-title {
    font-size: 42px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin: 0 0 20px 0;
    letter-spacing: -0.02em;
}

/* ===================================
   VIEW & DOWNLOAD COUNTERS
   =================================== */
.resource-counters {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.resource-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.resource-counter:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.resource-counter-icon {
    color: #6b7280;
    flex-shrink: 0;
}

.resource-counter-views .resource-counter-icon {
    color: #3b82f6;
}

.resource-counter-downloads .resource-counter-icon {
    color: #ED1C24;
}

.resource-counter-value {
    font-size: 18px;
    font-weight: 700;
    color: #131314;
    line-height: 1;
}

.resource-counter-label {
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    line-height: 1;
}

/* ===================================
   SOCIAL SHARING BUTTONS (SIDEBAR)
   =================================== */
.resource-social-share-sidebar {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.social-share-sidebar-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 12px;
    text-align: center;
}

.social-share-sidebar-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.social-share-sidebar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.social-share-sidebar-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.social-share-sidebar-btn:active {
    transform: translateY(-1px);
}

/* Facebook */
.social-share-sidebar-btn.social-share-facebook {
    background: #1877f2;
    color: #ffffff;
}

.social-share-sidebar-btn.social-share-facebook:hover {
    background: #145dbf;
    box-shadow: 0 6px 16px rgba(24, 119, 242, 0.4);
}

/* Twitter */
.social-share-sidebar-btn.social-share-twitter {
    background: #1da1f2;
    color: #ffffff;
}

.social-share-sidebar-btn.social-share-twitter:hover {
    background: #0d8ecf;
    box-shadow: 0 6px 16px rgba(29, 161, 242, 0.4);
}

/* Pinterest */
.social-share-sidebar-btn.social-share-pinterest {
    background: #e60023;
    color: #ffffff;
}

.social-share-sidebar-btn.social-share-pinterest:hover {
    background: #bd001c;
    box-shadow: 0 6px 16px rgba(230, 0, 35, 0.4);
}

/* WhatsApp (Hidden on desktop, shown on mobile) */
.social-share-sidebar-btn.social-share-whatsapp {
    background: #25d366;
    color: #ffffff;
    display: none;
}

.social-share-sidebar-btn.social-share-whatsapp:hover {
    background: #1da851;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

/* Copy Link */
.social-share-sidebar-btn.social-share-copy {
    background: #6b7280;
    color: #ffffff;
}

.social-share-sidebar-btn.social-share-copy:hover {
    background: #4b5563;
    box-shadow: 0 6px 16px rgba(107, 114, 128, 0.4);
}

.social-share-sidebar-btn.social-share-copy.copied {
    background: #10b981;
}

.social-share-sidebar-btn.social-share-copy.copied:hover {
    background: #059669;
}

/* ===================================
   FAVORITE (Save button – matches Download & File Info style)
   =================================== */
.resource-favorite-rating {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.resource-favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resource-favorite-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.resource-favorite-btn:hover {
    border-color: #ED1C24;
    color: #ED1C24;
    background: #fef2f2;
}

.resource-favorite-btn.is-favorite {
    background: #ED1C24;
    border-color: #ED1C24;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(237, 28, 36, 0.25);
}

.resource-favorite-btn.is-favorite:hover {
    background: #c9181f;
    border-color: #c9181f;
    box-shadow: 0 4px 12px rgba(237, 28, 36, 0.3);
    transform: translateY(-1px);
}

.resource-favorite-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

.resource-favorite-btn:focus {
    outline: 2px solid #ED1C24;
    outline-offset: 2px;
}

.login-to-fav a {
    color: #ED1C24;
    text-decoration: none;
}

.login-to-fav a:hover {
    text-decoration: underline;
}

/* ===================================
   TWO-COLUMN LAYOUT (ResourceBoy style)
   =================================== */
.resource-single-content {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 40px;
    align-items: start;
    margin-bottom: 48px;
}

.resource-single-main {
    min-width: 0;
}

/* Sticky sidebar: File Info + Download stays visible (user-friendly) */
.resource-single-sidebar {
    position: sticky;
    top: 24px;
}

.resource-single-sidebar .file-info-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 24px 28px 28px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

/* ===================================
   DESCRIPTION SECTION
   =================================== */
.resource-description-section {
    margin-bottom: 48px;
}

.resource-featured-image {
    margin-bottom: 32px;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

/* Slideshow (when more than 1 image) - full width */
.resource-slideshow-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.resource-slideshow-track {
    display: flex;
    transition: transform 0.4s ease-out;
    will-change: transform;
    width: 100%;
}

.resource-slideshow-slide {
    min-width: 100%;
    width: 100%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
}

.resource-slideshow-slide .resource-main-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.resource-slideshow-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(19, 19, 20, 0.75);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.resource-slideshow-arrow:hover {
    background: rgba(237, 28, 36, 0.9);
}

.resource-slideshow-prev {
    left: 12px;
}

.resource-slideshow-next {
    right: 12px;
}

.resource-featured-image .resource-main-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
}

.resource-description-text {
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
}

.resource-description-text p {
    margin-bottom: 16px;
}

.resource-description-text p:last-child {
    margin-bottom: 0;
}

.resource-description-text a {
    color: #ED1C24;
    text-decoration: none;
}

.resource-description-text a:hover {
    text-decoration: underline;
}

/* Category SEO paragraph (end of resource, same style as description) */
.resource-category-seo-paragraph {
    margin-top: 20px;
    font-size: 16px;
    line-height: 1.7;
    color: #374151;
}

.resource-category-seo-paragraph p {
    margin-bottom: 12px;
}

.resource-category-seo-paragraph p:last-child {
    margin-bottom: 0;
}

.resource-category-seo-paragraph a {
    color: #ED1C24;
    text-decoration: none;
}

.resource-category-seo-paragraph a:hover {
    text-decoration: underline;
}

/* ===================================
   GALLERY: glimpse of next image + Show more (ResourceBoy style)
   =================================== */
.resource-gallery-wrap {
    margin-bottom: 32px;
}

/* Row: glimpse (peek of next image) + Show more button */
.resource-gallery-glimpse-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

/* Little glimpse of the next image */
.resource-gallery-glimpse {
    flex: 1;
    min-width: 120px;
    max-width: 280px;
    height: 72px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}

.resource-gallery-glimpse-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.resource-gallery-show-more-wrap {
    flex-shrink: 0;
}

.resource-gallery-show-more-btn {
    padding: 12px 24px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.resource-gallery-show-more-btn:hover {
    border-color: #ED1C24;
    color: #ED1C24;
    background: #f8f9fa;
}

.resource-gallery-show-more-btn:focus {
    outline: 2px solid #ED1C24;
    outline-offset: 2px;
}

/* Expanded gallery (all images, revealed by Show more) */
.resource-gallery-expanded[hidden] {
    display: none !important;
}

.resource-gallery-expanded {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.resource-gallery-expanded .resource-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.resource-gallery-expanded .resource-gallery-show-less-wrap {
    margin-top: 20px;
    text-align: center;
}

.resource-gallery-item {
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}

.resource-gallery-img {
    width: 100%;
    height: auto;
    display: block;
    vertical-align: middle;
}

/* ===================================
   FILE INFO SECTION (identical to reference)
   =================================== */
.file-info-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

/* File Info heading: bold, dark #131314, thin line below */
.file-info-heading {
    font-size: 18px;
    font-weight: 700;
    color: #131314;
    margin: 0 0 0;
    letter-spacing: -0.01em;
}

.file-info-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 14px 0 20px;
}

/* Category pills: light grey oval tags */
.file-info-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.file-info-cat-link {
    display: inline-block;
    padding: 6px 14px;
    background-color: #e6e6e6;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: #505050;
    text-decoration: none;
    transition: all 0.2s ease;
}

.file-info-cat-link:hover {
    background-color: #d8d8d8;
    color: #131314;
}

/* Info rows: label (with icon) + value */
.file-info-rows {
    margin-bottom: 24px;
}

.file-info-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.file-info-row:last-of-type {
    margin-bottom: 0;
}

.file-info-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: #131314;
    font-size: 15px;
}

.file-info-icon {
    flex-shrink: 0;
    color: #6b7280;
}

.file-info-value {
    color: #646464;
    font-size: 14px;
    line-height: 1.5;
    padding-left: 24px;
}

.file-info-value a,
.file-info-value-category a,
.file-info-show-all {
    color: #ED1C24;
    text-decoration: none;
}

.file-info-value a:hover,
.file-info-show-all:hover {
    text-decoration: underline;
}

.file-info-value-category .file-info-show-all {
    display: block;
    margin-top: 2px;
}

/* ===================================
   DOWNLOAD BUTTON (full width, red, centered)
   =================================== */
.resource-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 24px;
    background: #ED1C24;
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    text-decoration: none !important;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, color 0.2s ease;
    box-shadow: 0 2px 8px rgba(237, 28, 36, 0.25);
    margin-bottom: 10px;
}

.resource-download-btn:hover {
    background: #b9151b;
    color: #ffffff !important;
    box-shadow: 0 6px 16px rgba(237, 28, 36, 0.35);
    transform: translateY(-2px);
}

.resource-download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(237, 28, 36, 0.3);
}

.resource-download-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.download-note {
    font-size: 12px;
    color: #646464;
    margin: 0 0 16px;
    line-height: 1.4;
}

/* ===================================
   ATTRIBUTION (Designed by: Author)
   =================================== */
.resource-attribution-text {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    font-size: 14px;
    color: #646464;
}

.resource-attribution-text a {
    color: #ED1C24;
    font-weight: 600;
    text-decoration: none;
}

.resource-attribution-text a:hover {
    text-decoration: underline;
}

.resource-attribution-text strong {
    font-weight: 600;
    color: #131314;
}

/* ===================================
   RELATED RESOURCES SECTION (match home page .latest-section exactly)
   =================================== */
.related-resources-section {
    margin-top: 0;
    background-color: #ffffff;
    /* Same vertical padding as .latest-section on homepage */
    padding: 48px 0;
}

.related-resources-heading {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: 700;
    color: #131314;
    margin: 0 0 32px;
    letter-spacing: -0.02em;
}

/* Related uses .resource-grid – same layout as home page (columns, gap from global CSS) */
.related-resources-section .resource-grid {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .related-resources-section {
        padding: 64px 0;
    }
    .related-resources-heading {
        margin-bottom: 40px;
    }
}

@media (min-width: 1024px) {
    .related-resources-section {
        padding: 80px 0;
    }
    .related-resources-heading {
        margin-bottom: 48px;
    }
}

/* ===================================
   LOAD MORE BUTTON
   =================================== */
.load-more-section {
    text-align: center;
    padding: 32px 0;
}

.load-more-btn {
    padding: 14px 40px;
    background-color: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    border-color: #ED1C24;
    color: #ED1C24;
    background-color: #f8f9fa;
}

/* ===================================
   RESPONSIVE BREAKPOINTS
   =================================== */

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) {
    .resource-single-title {
        font-size: 36px;
    }

    .resource-single-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .resource-single-sidebar {
        position: static;
    }

    .resource-single-sidebar .file-info-section {
        margin-top: 24px;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    .single-resource-container {
        padding: 0 16px;
    }

    .resource-single-header {
        padding: 32px 0 24px;
    }

    .resource-single-title {
        font-size: 28px;
    }
    
    /* Counter responsive */
    .resource-counters {
        justify-content: center;
        gap: 16px;
    }
    
    .resource-counter {
        padding: 8px 14px;
        gap: 6px;
    }
    
    .resource-counter-icon {
        width: 18px;
        height: 18px;
    }
    
    .resource-counter-value {
        font-size: 16px;
    }
    
    .resource-counter-label {
        font-size: 13px;
    }
    
    /* Social share sidebar responsive */
    .resource-social-share-sidebar {
        margin-top: 20px;
        padding-top: 16px;
    }
    
    .social-share-sidebar-label {
        font-size: 13px;
    }
    
    .social-share-sidebar-buttons {
        gap: 8px;
    }
    
    .social-share-sidebar-btn {
        width: 44px;
        height: 44px;
    }
    
    /* Show WhatsApp on mobile */
    .social-share-sidebar-btn.social-share-whatsapp {
        display: flex;
    }

    .resource-single-content {
        gap: 24px;
    }

    .resource-single-sidebar .file-info-section {
        padding: 20px;
    }

    .resource-gallery-glimpse-row {
        flex-direction: column;
        align-items: stretch;
    }

    .resource-gallery-glimpse {
        max-width: none;
        height: 64px;
    }

    .resource-description-section {
        margin-bottom: 32px;
    }

    .resource-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .resource-description-text {
        font-size: 15px;
    }

    .file-info-section {
        margin-top: 32px;
        padding-top: 32px;
    }

    .file-info-heading {
        font-size: 17px;
    }

    .file-info-label {
        font-size: 14px;
    }

    .file-info-value {
        font-size: 13px;
        padding-left: 24px;
    }

    .resource-download-btn {
        padding: 12px 20px;
        font-size: 15px;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 479px) {
    .resource-single-title {
        font-size: 24px;
    }

    .resource-single-content {
        padding: 20px;
    }
}

/* ===================================
   PRINT STYLES
   =================================== */
@media print {
    .resource-download-btn,
    .load-more-btn,
    .file-info-cats {
        display: none !important;
    }

    .resource-single-content {
        box-shadow: none;
        border: 1px solid #000;
    }

    .resource-single-page {
        background-color: #ffffff;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */
.resource-download-btn:focus,
.resource-favorite-btn:focus,
.load-more-btn:focus,
.file-info-cat-link:focus {
    outline: 2px solid #ED1C24;
    outline-offset: 2px;
}

/* Skip to content */
.skip-to-resource {
    position: absolute;
    top: -40px;
    left: 0;
    background: #ED1C24;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 100;
}

.skip-to-resource:focus {
    top: 0;
}

/* ===================================
   ANIMATION & TRANSITIONS
   =================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resource-single-content {
    animation: fadeIn 0.5s ease-out;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}
