/* ============================================
   PROJEKTER - Specifikke styles for projekter.html
   ============================================ */

/* Breadcrumb Navigation */
.breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.breadcrumb a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--accent);
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: var(--muted);
}

.breadcrumb-current {
    color: var(--text);
    font-weight: 500;
}

/* Projects Controls (Filters and Sort) */
.projects-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
    gap: 1rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.sub-subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.filter-btn {
    padding: 0.5rem 1rem;
    padding-right: 2rem;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-transform: none;
    position: relative;
}

.filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.filter-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.filter-close {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    padding: 0 0.25rem;
}

.filter-close:hover {
    opacity: 1;
}

.filter-btn.active .filter-close {
    color: #fff;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-controls label {
    font-size: 0.9rem;
    color: var(--text);
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.sort-select:hover,
.sort-select:focus {
    border-color: var(--accent);
    outline: none;
}

.projects-info {
    margin-bottom: 1.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.projects-info #count {
    font-weight: 700;
    color: var(--text);
}

/* Mobile responsive for controls */
@media (max-width: 799px) {
    .projects-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filters {
        width: 100%;
    }
    
    .filter-btn {
        flex: 1;
        min-width: calc(50% - 0.375rem);
    }
    
    .subcategories {
        width: 100%;
    }
    
    .subcategory-btn {
        flex: 1;
        min-width: calc(50% - 0.375rem);
    }
    
    .sub-subcategories {
        width: 100%;
    }
    
    .sub-subcategory-btn {
        flex: 1;
        min-width: calc(50% - 0.375rem);
    }
    
    .sort-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .sort-select {
        flex: 1;
        max-width: 200px;
    }
}

/* Hide mobile project title by default (will be shown on touch devices) */
.project-title-mobile {
    display: none;
}

/* Show mobile title on touch devices (pointer: coarse) */
@media (pointer: coarse) {
    .project-title-mobile {
        display: block;
        font-size: 0.7rem;
        padding: 5px 0 0 0;
        font-weight: normal;
        color: var(--text);
        text-align: center;
    }
    
    .project-card .hover-overlay {
        display: none;
    }
}

/* Project cards */
.project-card {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    cursor: pointer;
    outline: none;
    border: none;
}

.project-card:focus {
    outline: none;
}

.project-card img {
    width: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

.project-card .hover-overlay {
    position: absolute;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    transition: opacity .25s;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none
}

.project-card .hover-title {
    color: #fff;
    font-weight: 700;
    letter-spacing: .05em;
    text-align: center;
    font-size: 1.2rem;
    padding: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5)
}

.project-card:hover .hover-overlay {
    opacity: 1
}

/* Desktop 800px+: 3 projects per line, 225x150 */
@media (min-width: 800px) {
    .project-card {
        width: 225px;
    }
    
    .project-card img {
        width: 225px;
        height: 150px;
        object-fit: cover;
    }
}

/* Desktop 1200px+: 4 projects per line, 225x150 */
@media (min-width: 1200px) {
    .project-card {
        width: 260px;
    }
    
    .project-card img {
        width: 260px;
        height: 170px;
        object-fit: cover;
    }
}



/* Mobile: 2 projects per line, 150x100 */
@media (max-width: 799px) {
    .project-card {
        width: 100%;
        min-width: 0;
        height: 225px;
        justify-self: stretch;
    }
    
    .project-card img {
        width: 100%;
        min-width: 0;
        min-height: 100px;
        height: 200px;
        object-fit: cover;
    }

}

@media (max-width: 599px) {
    .project-card {
        height: 175px;
    }

    .project-card img {
        height: 150px;
    }
}

/* Very small screens: 1 column */
@media (max-width: 400px) {
    .project-card {
        min-width: 0;
        width: 100%;
        max-width: 100%;
        height: 275px;
    }
    
    .project-card img {
        min-width: 0;
        width: 100%;
        height: 250px;
        aspect-ratio: 3/2;
    }
}

@media (max-width: 350px) {
    .filters {
        display: grid;
        grid-column: max(1);
    }
}

@media (max-width: 320px) {
    .project-card {
        min-width: 0;
        width: 100%;
        height: 200px;
    }
    
    .project-card img {
        min-width: 0;
        width: 100%;
        height: 175px;
    }
}

/* ============================================
   MODAL STYLES
   ============================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--bg);
    margin: 3% auto;
    padding: 2rem;
    border-radius: 0;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text);
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent);
}

#modalTitle {
    color: var(--text);
    margin-bottom: 1rem;
    font-size: 2rem;
    font-weight: 700;
}

#modalDescription {
    color: var(--muted);
    line-height: 1.8;
    margin-top: 1rem;
}

.modal-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.modal-gallery img {
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}

.modal-gallery img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }
    
    #modalTitle {
        font-size: 1.5rem;
    }
    
    .modal-gallery {
        grid-template-columns: 1fr;
    }
}


