/**
 * Artifact Template Styles
 * 
 * Styles for single-artifact.php template
 * Include this file in your theme's style.css or enqueue it separately
 * 
 * @package Pen-Based Computing Theme
 */

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */

.artifact-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Main layout with sidebar */
.artifact-main-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    margin-top: 30px;
}

.artifact-main-content {
    min-width: 0; /* Prevent grid blowout */
}

.artifact-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* Relevant Timeline Events Sidebar */
.relevant-posts {
    background: #f9f9f9;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.relevant-posts h3 {
    font-size: 0.95em;
    margin: 0 0 20px 0;
    color: #333;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 2px solid #3d7d8a;
}

.relevant-post-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

.relevant-post-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.relevant-post-item h4 {
    font-size: 0.8em;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.relevant-post-item h4 a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
}

.relevant-post-item h4 a:hover {
    color: #3d7d8a;
}

.relevant-post-meta {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 8px;
}

.relevant-post-excerpt {
    font-size: 0.75em;
    color: #555;
    line-height: 1.5;
    margin: 0;
}

.relevant-posts-read-more {
    display: block;
    margin: 16px auto 0 auto;
    padding: 6px 12px;
    background: #3d7d8a;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.68em;
    font-weight: 600;
    transition: background 0.3s;
    text-align: center;
    width: fit-content;
}

.relevant-posts-read-more:hover {
    background: #2c5f6a;
}

/* Breadcrumb */
.artifact-breadcrumb {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 30px;
}

.artifact-breadcrumb a {
    color: #666;
    text-decoration: none;
}

.artifact-breadcrumb a:hover {
    color: #3d7d8a;
}

/* Top Section */
.artifact-hero {
    display: flex;
    gap: 40px;
    margin-bottom: 40px;
}

.artifact-gallery {
    flex: 0 0 400px;
}

.artifact-main-image-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    overflow: hidden;
    cursor: zoom-in;
    background: #f9f9f9;
}

.artifact-main-image {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease-out;
    position: relative;
}

.artifact-main-image.sliding {
    transition: transform 0.4s ease-out;
}

.artifact-main-image-new {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    transition: transform 0.4s ease-out;
}

.artifact-main-image-container:hover .artifact-main-image {
    transform: scale(2);
}

.zoom-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.zoom-icon:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.artifact-thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.artifact-thumbnail {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.5;
}

.artifact-thumbnail:hover {
    opacity: 1;
}

.artifact-thumbnail.active {
    opacity: 1;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    padding: 60px 20px 20px 20px;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    background: none;
    border: none;
    line-height: 1;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 60px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 20px;
    z-index: 10001;
    line-height: 1;
    transition: background 0.3s;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev {
    left: 20px;
}

.lightbox-nav.next {
    right: 20px;
}

.lightbox-counter {
    position: fixed;
    top: 20px;
    left: 30px;
    color: white;
    font-size: 18px;
    z-index: 10001;
}

.lightbox-caption {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 16px;
    text-align: center;
    max-width: 80%;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 4px;
}

.artifact-info {
    flex: 1;
}

.artifact-info h1 {
    font-size: 1.5em;
    margin: 0 0 25px 0;
    color: #000;
    font-weight: 700;
    line-height: 1.2;
}

.artifact-status-badge {
    display: inline-block;
    padding: 4px 8px;
    background: #EFEB4D;
    color: #000;
    border: 1px solid #000;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.75em;
    text-align: center;
}

.artifact-status-badge.looking-to-acquire {
    background: #a8d8f0;
}

.artifact-badge-container {
    text-align: center;
    margin-top: 25px;
    margin-bottom: 25px;
}

.artifact-part-of {
    font-size: 0.8em;
    line-height: 1.4;
    margin-bottom: 25px;
    color: #333;
}

.artifact-part-of strong {
    color: #000;
    font-weight: 700;
}

.artifact-part-of a {
    color: #0066cc;
    text-decoration: none;
}

.artifact-part-of a:hover {
    color: #004499;
    text-decoration: underline;
}

.artifact-description {
    font-size: 0.75em;
    line-height: 1.4;
    color: #333;
    margin-bottom: 25px;
}

.artifact-description p {
    margin-bottom: 0.5em;
}

.artifact-description p:last-child {
    margin-bottom: 0;
}

.artifact-question {
    background: transparent;
    padding: 0;
    border-radius: 0;
    margin-bottom: 25px;
    font-size: 0.8em;
    line-height: 1.4;
}

.artifact-question strong {
    display: inline;
    margin-bottom: 0;
    color: #000;
    font-weight: 700;
}

.artifact-question a {
    color: #0066cc;
    text-decoration: none;
}

.artifact-question a:hover {
    color: #004499;
    text-decoration: underline;
}

.artifact-categories {
    font-size: 0.8em;
    color: #666;
    line-height: 1.6;
    border-top: 1px solid #ddd;
    padding-top: 15px;
    margin-top: 15px;
}

.artifact-categories strong {
    color: #000;
}

.artifact-categories a {
    color: #0066cc;
    text-decoration: none;
}

.artifact-categories a:hover {
    text-decoration: underline;
}

/* Tabbed Section - Clean Minimalist Style */
/* ============================================
   TABS - OPTION 6: SUBTLE BACKGROUND (ENHANCED ORIGINAL)
   Strong specificity to override WordPress styles
   ============================================ */

.artifact-tabs {
    border: none !important;
    border-bottom: 1px solid #a3c9a3 !important;
    margin-bottom: 0 !important;
    background: transparent !important;
    padding: 0 !important;
}

.artifact-tabs-nav {
    display: flex !important;
    gap: 0 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-wrap: wrap !important;
}

.artifact-tabs-nav li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

/* Maximum specificity for tab buttons - all possible selectors */
.artifact-tabs-nav button,
.artifact-tabs-nav li button,
.artifact-tabs .tab-button,
.tab-button,
button.tab-button {
    padding: 11px 19px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: 3px solid transparent !important;
    cursor: pointer !important;
    font-size: 0.69em !important;
    color: #444 !important;
    transition: all 0.25s ease !important;
    white-space: nowrap !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.62px !important;
    text-decoration: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Hover state - maximum specificity */
.artifact-tabs-nav button:hover,
.artifact-tabs-nav li button:hover,
.artifact-tabs .tab-button:hover,
.tab-button:hover,
button.tab-button:hover,
.artifact-tabs-nav button:focus,
.artifact-tabs-nav li button:focus,
.artifact-tabs .tab-button:focus,
.tab-button:focus,
button.tab-button:focus {
    color: #2c5f2d !important;
    border-bottom-color: #a8d5a1 !important;
    border-bottom: 3px solid #a8d5a1 !important;
    background: rgba(44, 95, 45, 0.08) !important;
    background-color: rgba(44, 95, 45, 0.08) !important;
    outline: none !important;
}

/* Active state - maximum specificity */
.artifact-tabs-nav button.active,
.artifact-tabs-nav li button.active,
.artifact-tabs .tab-button.active,
.tab-button.active,
button.tab-button.active {
    color: #000 !important;
    border-bottom-color: #2c5f2d !important;
    border-bottom: 3px solid #2c5f2d !important;
    font-weight: 700 !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
}
.artifact-tab-content {
    display: none;
    padding: 30px;
    border: 1px solid #a3c9a3;
    border-top: none;
    background: #fff;
}

.artifact-tab-content.active {
    display: block;
}

.artifact-tab-content h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: #1a1a1a;
    border-bottom: 3px solid #2c5f2d;
    padding-bottom: 0.5rem;
}

/* Style tab content paragraphs to match artifact details */
.artifact-tab-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: #1a1a1a;
    margin-bottom: 1.2em;
}

.artifact-tab-content p:last-child {
    margin-bottom: 0;
}

/* Style lists to match artifact details */
.artifact-tab-content ul,
.artifact-tab-content ol {
    font-size: 1rem;
    line-height: 1.8;
    color: #1a1a1a;
    margin-bottom: 1.2em;
    padding-left: 1.5em;
}

.artifact-tab-content li {
    margin-bottom: 0.5em;
}

.artifact-tab-content li:last-child {
    margin-bottom: 0;
}

.artifact-details-grid {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 1.5rem;
    box-shadow: none;
}

.artifact-details-grid:hover {
    box-shadow: none;
}

/* Group wrapper for section spacing */
.artifact-detail-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
    padding: 0.25rem 0;
    background-color: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 0;
}

.artifact-detail-group:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 0.4rem;
    margin-bottom: 0.25rem;
}

/* Base row styling - stacked layout with labels on top */
.artifact-detail-row {
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 0;
}

.artifact-detail-label {
    font-size: 0.813rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #666;
    flex-shrink: 0;
}

.artifact-detail-value {
    font-size: 1rem;
    color: #1a1a1a;
    font-weight: 400;
    line-height: 1.5;
    flex: 1;
}

/* ============================================
   GROUP-SPECIFIC STYLING
   Target entire groups with data-group
   ============================================ */

/* Basic Info Group - No special styling, uses default group style */

/* Dating Group */
.artifact-detail-group[data-group="dating"] {
    /* Add custom styling for dating fields */
}

/* Physical Description Group - Textarea fields span full width */
.artifact-detail-group[data-group="physical"] .artifact-detail-row[data-type="textarea"] {
    grid-column: 1 / -1;
}

/* Identification Numbers Group */
.artifact-detail-group[data-group="identification"] {
    /* Add custom styling for ID numbers */
}

/* Pricing Group */
.artifact-detail-group[data-group="pricing"] {
    /* Add custom styling for prices */
}

/* Acquisition Group */
.artifact-detail-group[data-group="acquisition"] {
    /* Add custom styling for acquisition info */
}

/* Cataloging Group */
.artifact-detail-group[data-group="cataloging"] {
    /* Add custom styling for catalog info */
}

/* ============================================
   FIELD-SPECIFIC STYLING
   Target individual fields with data-field
   ============================================ */

/* Model field - keep prominent styling */
.artifact-detail-row[data-field="model"] .artifact-detail-value {
    font-size: 1.1rem;
    font-weight: 500;
    color: #1a1a1a;
}

/* Date field */
.artifact-detail-row[data-field="date"] .artifact-detail-value {
    font-weight: 400;
}

/* Description and Contents - span full width */
.artifact-detail-row[data-field="description"],
.artifact-detail-row[data-field="contents"] {
    grid-column: 1 / -1;
}

/* Condition - make it stand out with badge styling */
.artifact-detail-row[data-field="condition"] .artifact-detail-value {
    font-weight: 500;
}

.artifact-detail-row[data-field="condition"] .artifact-detail-value .condition-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #e3f3dd;
    color: #2c5f2d;
    border: 1px solid #a8d5a1;
}

/* Currency fields */
.artifact-detail-row[data-type="currency"] .artifact-detail-value {
    font-weight: 500;
}

/* ============================================
   TYPE-SPECIFIC STYLING
   Target by field type with data-type
   ============================================ */

/* Textarea type fields - span full width */
.artifact-detail-row[data-type="textarea"] {
    grid-column: 1 / -1;
}

.artifact-detail-row[data-type="textarea"] .artifact-detail-value {
    width: 100%;
}

/* ============================================
   COMBINATION SELECTORS
   Mix group + field for ultra-specific styling
   ============================================ */

/* Model field within basic-info group */
.artifact-detail-group[data-group="basic-info"] .artifact-detail-row[data-field="model"] {
    /* Ultra-specific styling */
}

/* All text fields in acquisition group */
.artifact-detail-group[data-group="acquisition"] .artifact-detail-row[data-type="text"] {
    /* Style all text fields in acquisition group */
}

.artifact-detail-value p {
    display: block;
    margin: 0;
}

.artifact-detail-value p + p {
    margin-top: 0.75em;
}

.artifact-detail-value ul,
.artifact-detail-value ol {
    list-style: revert;
    margin: 0.5em 0;
    padding-left: 1.5em;
}

.artifact-detail-value ul { list-style-type: disc; }
.artifact-detail-value ol { list-style-type: decimal; }

.artifact-detail-value li {
    margin: 0.15em 0;
}

.artifact-detail-value blockquote {
    margin: 0.5em 0;
    padding-left: 1em;
    border-left: 3px solid #ddd;
    color: #555;
}

/* Related Section */
.artifact-related {
    margin-top: 30px;
    padding-top: 0;
    border-top: none;
}

.artifact-related h2 {
    font-size: 1.26em;
    margin-bottom: 30px;
    color: #1a1a1a;
}

.artifact-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.artifact-related-item {
    text-align: center;
}

.artifact-related-item a {
    outline: none !important;
    border: none !important;
    text-decoration: none;
    display: inline-block;
}

.artifact-related-item a:focus {
    outline: none !important;
    border: none !important;
    box-shadow: none !important;
}

.artifact-related-item a:active {
    outline: none !important;
    border: none !important;
}

.artifact-related-item img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border: none !important;
    outline: none !important;
    margin-bottom: 15px;
}

.artifact-related-item h3 {
    font-size: 0.7em;
    margin: 0;
    line-height: 1.4;
}

.artifact-related-item h3 a {
    color: #333;
    text-decoration: none;
}

.artifact-related-item h3 a:hover {
    color: #3d7d8a;
}

/* Responsive */
@media (max-width: 1024px) {
    .artifact-main-wrapper {
        grid-template-columns: 1fr 280px;
        gap: 30px;
    }
    
    .relevant-posts {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .artifact-hero {
        flex-direction: column;
    }
    
    .artifact-gallery {
        flex: 1;
    }
    
    /* Make detail groups single column on mobile */
    .artifact-detail-group {
        grid-template-columns: 1fr;
    }
    
    .artifact-related-grid {
        grid-template-columns: 1fr;
    }
    
    .artifact-tabs-nav {
        font-size: 0.9em;
    }
    
    .artifact-tabs-nav button {
        padding: 12px 15px;
    }
    
    .lightbox-nav {
        font-size: 40px;
        padding: 15px;
    }
    
    /* Move sidebar to bottom on mobile */
    .artifact-main-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .artifact-sidebar {
        position: static;
        order: 2;
    }
    
    .artifact-main-content {
        order: 1;
    }
    
    .relevant-posts {
        margin-top: 30px;
    }
}