/* ------------------------------------------------------------------
   Sysprotec — Projects grid (overview) + project detail pages
------------------------------------------------------------------ */

/* ============ Overview grid: 3-column tiles with title overlay ============ */

.projects-grid {
    row-gap: 30px;
}

.project-tile {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .12);
    background: #111;
    transition: box-shadow .3s ease;
}
.project-tile:hover,
.project-tile:focus {
    box-shadow: 0 12px 28px rgba(15, 23, 42, .22);
}

.project-tile-frame {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio, keeps the grid uniform regardless of source image shape */
    overflow: hidden;
}
.project-tile-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s ease;
    display: block;
}
.project-tile:hover .project-tile-frame img,
.project-tile:focus .project-tile-frame img {
    transform: scale(1.06);
}

.project-tile-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 36px 18px 16px;
    background: linear-gradient(to top, rgba(10, 12, 18, .88) 0%, rgba(10, 12, 18, .55) 55%, rgba(10, 12, 18, 0) 100%);
    color: #fff;
    pointer-events: none;
}
.project-tile-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 3px;
    color: #fff;
}
.project-tile-subtitle {
    font-size: 13px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
}

.project-tile-placeholder .project-tile-overlay {
    background: linear-gradient(to top, rgba(10, 12, 18, .72) 0%, rgba(10, 12, 18, .3) 60%, rgba(10, 12, 18, 0) 100%);
}
.project-tile-placeholder .project-tile-subtitle {
    font-style: italic;
    color: rgba(255, 255, 255, .6);
}

/* ============ Detail page ============ */

.project-detail-hero {
    position: relative;
    margin: 2.5em 0 3em;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .15);
    cursor: zoom-in;
    display: block;
}
.project-detail-hero img {
    width: 100%;
    display: block;
}

.project-detail-body {
    max-width: 760px;
}
.project-detail-title {
    margin-bottom: .8em;
    line-height: 1.25;
}
.project-detail-body p {
    margin-bottom: 1.1em;
}
.project-detail-body > .project-detail-text > *:first-child {
    margin-top: 0;
}
.project-detail-text h3 {
    font-size: 20px;
    margin-top: 1.8em;
    margin-bottom: .6em;
}
.project-detail-specs {
    background: #f7f8fa;
    border-radius: 6px;
    padding: 22px 26px;
    margin: 1.5em 0;
}
.project-detail-specs h6 {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 10px;
}
.project-detail-specs p {
    margin-bottom: .4em;
}

.project-detail-completed {
    display: table;
    background: #f7f8fa;
    border-left: 3px solid #6b7280;
    border-radius: 0 4px 4px 0;
    padding: 10px 18px;
    margin: 1.5em 0 0;
    font-size: 15px;
    color: #4b5563;
}

.project-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}
.project-detail-back-top {
    margin-bottom: 40px;
}
.project-detail-back-bottom {
    display: flex;
    width: fit-content;
    margin-top: 56px;
}

/* ---- Detail galleries (projects with several photos / drawings) ----
   Rendered below the text by [slug].astro when a project defines `galerie`
   and/or `plaene`. Both grids share one lightbox with the hero image. */
.project-gallery {
    margin-top: 3em;
}
.project-gallery-title {
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 13px;
    font-weight: 700;
    color: #6b7280;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(53, 72, 121, .18);
}
.project-gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
}
.project-gallery-item {
    margin: 0;
}
.project-gallery-link {
    display: block;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .1);
    cursor: zoom-in;
    background: #f7f8fa;
}
.project-gallery-link img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .35s ease;
}
.project-gallery-link:hover img {
    transform: scale(1.04);
}
.project-gallery-item figcaption {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
}

/* Photos and drawings share the same landscape frame, so both grids line up.
   Photos fill it; drawings are never cropped — they sit on white and are
   letterboxed, with the lightbox available for reading the detail. */
.project-gallery .project-gallery-link {
    aspect-ratio: 4 / 3;
}
.project-plans .project-gallery-link {
    background: #fff;
    border: 1px solid rgba(53, 72, 121, .12);
    box-shadow: none;
}
.project-plans .project-gallery-link img {
    object-fit: contain;
}
.project-plans .project-gallery-link:hover img {
    transform: none;
}

@media (max-width: 575.98px) {
    .project-gallery-grid {
        grid-template-columns: 1fr;
    }
}

.project-detail-placeholder-note {
    background: #fffaf0;
    border: 1px dashed #e5c98e;
    border-radius: 6px;
    padding: 16px 20px;
    color: #8a6d2f;
    font-size: 14px;
    margin-bottom: 1.5em;
}

@media (max-width: 767px) {
    .project-tile-frame { padding-top: 68%; }
    .project-tile-title { font-size: 16px; }
}
