/* Weber Xanten Projects - Modern CSS Design System */

:root {
    --io-project-accent: #0e9f8d;
    --io-project-accent-dark: #0b8071;
    --io-project-accent-light: rgba(14, 159, 141, 0.08);
    --io-project-text-title: #111827; /* Near black */
    --io-project-text-body: #4b5563;  /* Soft grey-black */
    --io-project-text-muted: #6b7280; /* Neutral grey */
    --io-project-bg-card: #ffffff;
    --io-project-border: #f3f4f6;     /* Extremely light grey */
    --io-project-radius: 8px;
    --io-project-modal-radius: 16px;
    --io-project-shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.03), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    --io-project-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    --io-project-shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
    --io-project-transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Teaser Grid Layout
   ========================================================================== */

.io-projects-container {
    width: 100%;
    margin: 30px 0 50px;
    font-family: inherit;
}

.io-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 35px;
}

/* Premium Card Design */
.io-project-card {
    background: var(--io-project-bg-card);
    border: 1px solid var(--io-project-border);
    border-radius: var(--io-project-radius);
    overflow: hidden;
    box-shadow: var(--io-project-shadow-sm);
    transition: var(--io-project-transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

.io-project-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--io-project-shadow-lg);
    border-color: rgba(14, 159, 141, 0.15);
}

/* Card Image Wrapper with Zoom Effect */
.io-project-card-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 230px;
    background-color: #f3f4f6;
}

.io-project-card-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: var(--io-project-transition);
}

.io-project-card:hover .io-project-card-image {
    transform: scale(1.06);
}

/* Subtle Gradient Overlay always visible, darkens on hover */
.io-project-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0) 60%);
    opacity: 0.8;
    transition: var(--io-project-transition);
}

.io-project-card:hover .io-project-card-overlay {
    background: linear-gradient(to top, rgba(15, 23, 42, 0.4) 0%, rgba(15, 23, 42, 0.05) 70%);
}

/* Card Body */
.io-project-card-body {
    padding: 28px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.io-project-card-header-meta {
    margin-bottom: 12px;
}

/* Small uppercase subtitle/category tag */
.io-project-card-meta {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--io-project-accent);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
    display: block;
}

.io-project-card-title {
    font-size: 19px;
    line-height: 1.35;
    color: var(--io-project-text-title);
    margin: 0 !important;
    font-weight: 800;
    letter-spacing: -0.2px;
    transition: color 0.2s ease;
}

.io-project-card:hover .io-project-card-title {
    color: var(--io-project-accent);
}

.io-project-card-teaser {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--io-project-text-body);
    margin: 0 0 25px 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Premium Card Footer with Link & Arrow Icon */
.io-project-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--io-project-border);
    padding-top: 18px;
    margin-top: auto;
    font-size: 14px;
    font-weight: 700;
    color: var(--io-project-text-title);
    transition: var(--io-project-transition);
}

.io-project-card-link {
    position: relative;
}

.io-project-card-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 2px;
    background-color: var(--io-project-accent);
    transition: var(--io-project-transition);
}

.io-project-card:hover .io-project-card-link {
    color: var(--io-project-accent);
}

.io-project-card:hover .io-project-card-link::after {
    width: 100%;
}

.io-project-card-arrow-icon {
    font-size: 16px;
    font-weight: bold;
    color: var(--io-project-text-title);
    transition: var(--io-project-transition);
}

.io-project-card:hover .io-project-card-arrow-icon {
    transform: translateX(6px);
    color: var(--io-project-accent);
}

/* ==========================================================================
   Homepage Shortcut / View
   ========================================================================== */

.io-projects-view-homepage .io-projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.io-projects-view-homepage .io-project-card-image-wrapper {
    height: 200px;
}

.io-projects-homepage-footer {
    text-align: center;
    margin-top: 40px;
}

/* Ghost Button Styling for Homepage */
.io-projects-more-btn {
    display: inline-block;
    background-color: transparent;
    border: 2px solid var(--io-project-accent);
    color: var(--io-project-accent) !important;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    border-radius: var(--io-project-radius);
    transition: var(--io-project-transition);
}

.io-projects-more-btn:hover {
    background-color: var(--io-project-accent);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(14, 159, 141, 0.15);
}

/* ==========================================================================
   Modal Dialog Layout (<dialog>)
   ========================================================================== */

.io-project-dialog-modal {
    border: none;
    border-radius: var(--io-project-modal-radius);
    padding: 0;
    max-width: 1050px;
    width: 90%;
    max-height: 80vh;
    box-shadow: var(--io-project-shadow-modal);
    background: #ffffff;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Soft Blurred glassmorphic backdrop matching modern OS overlay styles */
.io-project-dialog-modal::backdrop {
    background-color: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(12px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.io-project-dialog-modal[open] {
    opacity: 1;
    transform: scale(1);
}

.io-project-dialog-modal[open]::backdrop {
    opacity: 1;
}

.io-modal-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

/* Premium Floating Round Close Button */
.io-modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffffff;
    border: 1px solid var(--io-project-border);
    color: var(--io-project-text-title);
    font-size: 26px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: var(--io-project-transition);
}

.io-modal-close-btn:hover {
    background: var(--io-project-border);
    transform: scale(1.05);
}

/* Grid Inside Modal */
.io-modal-content-grid {
    display: grid;
    grid-template-columns: 50% 50%;
    height: 100%;
    max-height: 80vh;
}

/* Left Pane: Gallery Viewport */
.io-modal-gallery-pane {
    background: #0b0f19; /* High-contrast deep dark grey/blue */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 80vh;
    padding: 25px;
    box-sizing: border-box;
}

.io-modal-main-image-viewport {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.io-modal-main-image-viewport img {
    max-width: 100%;
    max-height: 75%;
    object-fit: contain;
    border-radius: var(--io-project-radius);
    box-shadow: 0 15px 35px rgba(0,0,0,0.45);
}

.io-modal-image-caption {
    width: 100%;
    color: #94a3b8; /* Cool grey slate */
    font-size: 13.5px;
    line-height: 1.5;
    text-align: center;
    padding: 20px 10px 0;
    box-sizing: border-box;
}

/* Thumbnail bar underneath */
.io-modal-thumbnails-container {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 15px 0 5px;
    margin-top: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.io-modal-thumbnails-container::-webkit-scrollbar {
    height: 4px;
}
.io-modal-thumbnails-container::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.io-modal-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border: 2px solid transparent;
    border-radius: var(--io-project-radius);
    overflow: hidden;
    cursor: pointer;
    opacity: 0.4;
    transition: var(--io-project-transition);
}

.io-modal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.io-modal-thumb.active,
.io-modal-thumb:hover {
    opacity: 1;
    border-color: var(--io-project-accent);
}

/* Right Pane: Text and Description */
.io-modal-text-pane {
    padding: 50px;
    overflow-y: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
}

.io-modal-meta {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--io-project-accent);
    letter-spacing: 1.5px;
    margin-bottom: 8px;
}

.io-modal-title {
    font-size: 25px;
    line-height: 1.3;
    color: var(--io-project-text-title);
    margin: 0 0 24px 0 !important;
    font-weight: 800;
    letter-spacing: -0.5px;
    border-bottom: 2px solid var(--io-project-border);
    padding-bottom: 20px;
}

.io-modal-full-text {
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--io-project-text-body);
}

.io-modal-full-text p {
    margin-bottom: 20px !important;
}

.io-modal-full-text h3 {
    font-size: 19px;
    color: var(--io-project-text-title);
    margin: 30px 0 15px 0 !important;
    font-weight: 800;
}

.io-modal-full-text ul {
    margin: 0 0 25px 25px !important;
    padding: 0 !important;
    list-style-type: square !important;
}

.io-modal-full-text li {
    margin-bottom: 10px !important;
    font-size: 15px;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 900px) {
    .io-modal-content-grid {
        grid-template-columns: 1fr;
        max-height: 85vh;
    }
    
    .io-project-dialog-modal {
        max-height: 85vh;
        width: 92%;
    }
    
    .io-modal-wrapper {
        max-height: 85vh;
    }
    
    .io-modal-gallery-pane {
        height: 40vh;
        padding: 15px;
    }
    
    .io-modal-main-image-viewport img {
        max-height: 65%;
    }
    
    .io-modal-image-caption {
        font-size: 12.5px;
        padding-top: 8px;
    }
    
    .io-modal-text-pane {
        max-height: 45vh;
        padding: 30px;
    }
    
    .io-modal-title {
        font-size: 21px;
        margin-bottom: 18px !important;
        padding-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .io-projects-grid {
        grid-template-columns: 1fr;
    }
    
    .io-modal-gallery-pane {
        height: 35vh;
    }
    
    .io-modal-text-pane {
        max-height: 50vh;
        padding: 22px;
    }
    
    .io-modal-thumb {
        width: 65px;
        height: 50px;
    }
}
