/* ========================================
   COMPONENT: HOME GALLERY (single image + blur bg)
   ======================================== */

.c-gal {
  padding: var(--space-2xl) 0;
  background: var(--color-bg);
  overflow: hidden; /* zapobiega overflow z dzieci */
}

.c-gal__header {
  max-width: 980px;
  margin: 0 auto var(--space-xl);
  text-align: center;
}

.c-gal__title {
  margin: 0 0 var(--space-md);
}

.c-gal__layout{
  display:grid;
  grid-template-columns: 240px 1fr;
  align-items: stretch;

  width: 100%;
  box-sizing: border-box;
  height: 550px;
  background: var(--color-bg);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(31,31,41,0.08);
  padding-left: var(--space-xl);
}

/* menu */
.c-gal__menu {
  padding: 0;
  display: flex;
  align-items: center;
}

.c-gal__menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  gap: 10px;
  align-content: center;
}

.c-gal__menu-link {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--color-text);
  opacity: 0.92;
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  transition: color .15s ease, opacity .15s ease, background .15s ease, transform .15s ease;
}

.c-gal__menu-link:hover {
  opacity: 1;
  color: var(--color-primary);
  background: rgba(31,31,41,0.04);
  transform: translateY(-1px);
}

.c-gal__menu-link.is-active {
  opacity: 1;
  color: var(--color-primary);
  background: rgba(31,31,41,0.04);
}

/* card */
.c-gal__card{
  position: relative;
  height: 100%;
  overflow: hidden;
  border-radius: 0 18px 18px 0;
  padding: 22px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  contain: layout paint; /* izoluje dzieci, zapobiega overflow */
}

/* blur background */
.c-gal__bg{
  position: absolute;
  inset: 0;
  z-index: 0;

  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.12);
  opacity: 0.95;
}

/* sharp image wrapper */
.c-gal__sharp{
  position: relative;
  z-index: 1;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  place-items: center;
  background: rgba(245,240,235,0.18);
}

.c-gal__img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;

  object-fit: contain;
  object-position: center;

  display: block;

  border-radius: 18px;

  opacity: 1;
  transform: scale(1);
  transition: opacity .22s ease, transform .32s ease;
}

/* touch: karta jest linkiem nawigacyjnym */
@media (hover: none) {
  .c-gal__card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    transition: background .15s ease;
  }
  .c-gal__card:active::after {
    background: rgba(0, 0, 0, 0.08);
  }
}

/* animation on switch */
.c-gal.is-switching .c-gal__img{
  opacity: 0;
  transform: scale(0.99);
}

@media (max-width: 900px) {
  .c-gal__layout {
    grid-template-columns: 1fr;
    padding: var(--space-md); /* nadpisuje padding-left z desktop */
    height: auto;
    gap: var(--space-md);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .c-gal__menu {
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .c-gal__menu-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px;
    padding-bottom: 4px;
    width: 100%;
  }

  .c-gal__menu-list::-webkit-scrollbar {
    display: none;
  }

  .c-gal__menu-link {
    padding: 7px 12px;
    font-size: 13px;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: var(--color-sand-soft);
    white-space: nowrap;
  }

  .c-gal__menu-link.is-active {
    background: var(--color-primary);
    color: #fff;
    opacity: 1;
  }

  .c-gal__card {
    height: 340px;
    padding: 10px;
    border-radius: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .c-gal__sharp {
    border-radius: 12px;
    height: 100%;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    display: block;
  }

  .c-gal__img {
    border-radius: 12px;
    height: 100%;
    width: 100%;
    max-width: 100%;
    object-fit: cover;
  }
}

@media (max-width: 480px) {
  .c-gal__card {
    height: 260px;
  }
}