body { margin: 0;}

* { box-sizing: border-box; }
*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body{
  font-family: var(--font-base);
  font-weight: 400;
  color: #1b1b1b;
  line-height: 1.6;
  background: #fff;
}


.work-page {
    padding-block: clamp(80px, 12vh, 140px);
    width: min(100% - 2rem, 860px);
    margin-inline: auto;
}

/* --- HEADER --- */
.work-head {
    text-align: center;
    margin-bottom: clamp(60px, 8vh, 100px);
}

.work-title {
  margin: 0;
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-dark);
  font-family: var(--font-display);
  font-size: var(--fs-h2);
}

.work-intro {
  margin: 10px auto 0;
  max-width: 60ch;
  font-family: var(--font-base);
  font-weight: 400;
  font-size: clamp(14px, 1vw + 0.35rem, 18px);
  line-height: 1.5;
  color: #6b544b;
  text-wrap: balance;
}

/*  Cards */
.work-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(20px, 3vw, 40px);
}

.work-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
}

.work-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.work-card_image {
    margin: 0;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f4f4f4;
}

.work-card_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.work-card_body {
    padding: 20px 15px;
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.05);

    display: grid;
    place-items: center;
    flex-grow: 1;
}

.work-card_title {
    margin: 0;
    font-family: var(--font-base);
    font-size: 16px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}

.gallery-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 30px;
}

.gallery-pill {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #1b1b1b;
    font-family: var(--font-base);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #fff;
}

.gallery-pill:hover {
    border-color: #999;
}

.gallery-pill.is-active {
    background: #f0f0f0;
    border-color: #ccc;
    color: #000;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 50px;
    gap: 20px;
}

.gallery-item {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f4f4f4;
    cursor: zoom-in;
    margin: 0;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
    font-weight: 500;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.back-link {
    color: #6b544b;
    text-decoration: none;
    font-size: 14px;
}
.back-link:hover {
    text-decoration: underline;
}


.carousel-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    width: 100%;
}

.carousel-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: transform 0.2s;
}
.carousel-arrow:hover {
    transform: scale(1.2);
}

.carousel-slots {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gallery-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;

    width: 180px;
    height: 60px;

    border: 1px solid #DCCBC6;
    border-radius: 6px;
    text-decoration: none;

    color: #1b1b1b;
    font-family: var(--font-base);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
    background: #fff;

    transition: all 0.2s ease;
}

.gallery-pill.is-active {
    background: #f0f0f0;
    border-color: #ccc;
    font-weight: 500;
    transform: scale(1.05);
    cursor: default;
    pointer-events: none;
}


.gallery-pill:not(.is-active):hover {
    border-color: #b0aead;
    background: #fafafa;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .gallery-pill {
        width: 100px;
        font-size: 13px;
        padding: 0 5px;
        height: 50px;
    }
    .carousel-wrapper {
        gap: 5px;
    }
}

@media (max-width: 500px) {
    .gallery-pill {
        display: none;
    }
    .gallery-pill.is-active {
        display: flex;
        width: 200px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 900px) {
    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .work-grid {
        grid-template-columns: 1fr;
    }

    .work-page {
        padding-block: 60px;
    }
}


