/* PAGE & SECTION */

body {
    overflow-x: hidden;
}

.page {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.section {
    max-width: 1440px;
    margin: 6rem auto 80px;
    /*padding: 0 4rem;*/
    padding: 0 clamp(1rem, 4vw, 4rem);
    flex: 1 0 auto;
}

.section-title {
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.section-subtitle {
    font-size: 1rem;
    opacity: 0.75;
    margin: 0 0 0.75rem;
}


/* VIEWS */

.views-container {
    position: relative;
    min-height: 260px;
}

.content-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
    box-sizing: border-box;
}

.pattern-view {
    display: none;
}

.pattern-view.active {
    display: block;
}


/* LIST */

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project {
    display: grid;
    /*grid-template-columns: 300px 200px 1fr;*/
    grid-template-columns: clamp(180px, 25vw, 260px) clamp(140px, 18vw, 180px) minmax(0, 1fr);
    gap: 40px;
    padding: 1rem 0;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.project-image-wrapper {
    height: 180px;
    overflow: hidden;
    border-radius: var(--border-radius);
}

.project-titleblock {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-width: clamp(200px, 24vw, 240px);
}

.project-titleblock h2 {
    margin: 0 0 0.25rem;
    font-weight: 400;
    font-size: clamp(1.125rem, 1.8vw, 1.5rem);
    line-height: 1.2;
}

.project-meta {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.7;
}

.project-desc {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    opacity: 0.9;
    overflow: hidden;
    min-width: 0;
    display: -webkit-box;
    /*-webkit-line-clamp: 4;*/
    -webkit-box-orient: vertical;
}


/* GRID */

.grid-section {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 100%, 1fr));
}

.grid-item {
    background: linear-gradient(135deg, rgba(248, 247, 243, 0.96), rgba(230, 228, 220, 0.96));
    border-radius: var(--border-radius);
    border: 1px solid rgba(9, 52, 63, 0.16);
    height: clamp(220px, 32vw, 280px);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.grid-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    border-color: rgba(9, 52, 63, 0.3);
}

.grid-slideshow {
    flex: 0 0 clamp(130px, 20vw, 160px);
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
}

.grid-slideshow img {
    transition: transform 0.4s ease;
}

.grid-item:hover .grid-slideshow img {
    transform: scale(1);
}

.grid-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.grid-item-title {
    font-size: clamp(1.125rem, 1.6vw, 1.375rem);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.grid-item:hover .grid-item-title {
    transform: translateY(-2px);
}

.grid-item-meta {
    font-size: 0.875rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.2s ease;
}

.grid-item:hover .grid-item-meta {
    opacity: 0.9;
}


/* VIEW SWITCH */

.view-switch {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 30;
    display: flex;
    gap: 8px;
    background: rgba(248, 247, 243, 0.9);
    border-radius: 999px;
    border: 1px solid rgba(9, 52, 63, 0.16);
    padding: 4px 6px;
    backdrop-filter: blur(12px);
}

.view-switch button {
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.9rem;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.15s ease;
}

.view-switch button.active {
    background: var(--text-primary);
    color: var(--background-color);
    opacity: 1;
    transform: translateY(-1px);
}

.view-switch button:hover {
    opacity: 0.9;
}


/* MODAL */

.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.image-modal.open {
    display: flex;
}

.image-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
    display: block;
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}


/* ==========================
   PROJECT DETAIL MODAL
========================== */

.project-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.project-modal.open {
    display: flex;
}

.project-modal-inner {
    width: min(1000px, 92vw);
    max-height: 90vh;
    background: var(--background-color);
    border-radius: var(--border-radius);
    padding: 0;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}


/* Close Button */

.project-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
}


/* Bildbereich */

.project-modal-image {
    width: 100%;
    height: 320px;
    border-radius: var(--border-radius);
    overflow: hidden;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.project-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-modal-text {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-modal-text h2 {
    font-size: 1.5rem;
    line-height: 1.2;
}

.project-modal-text .project-meta {
    font-size: 0.85rem;
    opacity: 0.6;
}

.project-modal-text .full {
    line-height: 1.5;
    opacity: 0.9;
}


/* SWIPER */

.swiper {
    width: 100%;
    height: 100%;
}

.swiper-button-prev,
.swiper-button-next {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    color: #fff;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    opacity: 1;
    transform: scale(1.1);
}


/* Pfeil-Icons kleiner machen */

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 14px;
}


/* Position leicht reinziehen */

.swiper-button-prev {
    left: 8px;
}

.swiper-button-next {
    right: 8px;
}

.swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-swiper {
    width: 90vw;
    max-width: 1200px;
    height: 90vh;
}

.modal-swiper img {
    object-fit: contain;
}


/* Responsive: mobile / tablet / desktop */

@media (max-width: 600px) {
    .grid-section {
        grid-template-columns: 1fr;
        /* Smartphone: 1 Spalte */
    }
}

@media (min-width: 601px) and (max-width: 900px) {
    .grid-section {
        grid-template-columns: repeat(2, 1fr);
        /* Tablet: 2 Spalten */
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .grid-section {
        grid-template-columns: repeat(3, 1fr);
        /* Laptop: 3 Spalten */
    }
}

@media (min-width: 1201px) {
    .grid-section {
        grid-template-columns: repeat(4, 1fr);
        /* Desktop: 4 Spalten */
    }
}

@media (hover: none) {
    .grid-item:hover {
        transform: none;
        box-shadow: none;
    }
    .grid-item:hover .grid-slideshow img {
        transform: none;
    }
}