/**
 * @file
 * Component styles for Ptasie Wyprawy theme.
 */

/* ============================================================================
 * HEADER - Branding and Navigation
 * ============================================================================ */

.region-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100px;
}

#block-ptasiewyprawy-site-branding,
#block-ptasiewyprawy-main-menu {
  height: 50px;
  display: flex;
  align-items: center;
  line-height: 1em;
}

#block-ptasiewyprawy-site-branding {
  justify-content: flex-start;
  text-align: left;
  margin-top: 10px;
  /*margin-top: -40px;*/
  /*margin-bottom: 10px;*/
}

#block-ptasiewyprawy-site-branding a {
  text-decoration: none;
  font-size: 32px;
  padding-left: 10px;
  display: flex;
  align-items: center;
  line-height: 1;
  color: #333;
  z-index: 999;
}

#block-ptasiewyprawy-main-menu {
  justify-content: flex-end;
  text-align: right;
}

#block-ptasiewyprawy-main-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1em;
  line-height: 1;
}

#block-ptasiewyprawy-main-menu li {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  line-height: 1;
}

#block-ptasiewyprawy-main-menu a {
  display: flex;
  align-items: center;
  line-height: 1;
  color: var(--text-primary);
  transition: color 0.3s ease;
  font-weight: 500;
  padding: 0.5em;
}

#block-ptasiewyprawy-main-menu a:hover,
#block-ptasiewyprawy-main-menu a:focus {
  color: var(--accent-color);
}


/* Grid container - overflow hidden to prevent expansion */
.view-content-categories .views-view-responsive-grid {
  overflow: hidden;
}

.view-content-categories .views-view-responsive-grid__item {
  overflow: hidden;
}

.view-content-categories .views-view-responsive-grid__item-inner {
  position: relative;
  transition: transform 0.3s ease, border-color 0.3s ease;
  overflow: hidden;
  border: 1px solid var(--bg-accent);
  background: var(--bg-primary);
}

.view-content-categories .views-view-responsive-grid__item-inner:hover {
  transform: scale(1.03);
  border-color: var(--bg-accent);
  z-index: 99;
}

.view-content-categories .views-view-responsive-grid__item-inner img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.3s ease;
}

.view-content-categories .views-view-responsive-grid__item-inner:hover img {
  filter: brightness(0.6) contrast(1.05);
}


.view-content-categories .views-view-responsive-grid__item-inner .views-field-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  text-transform: uppercase;
  font-size: 2em;
  color: var(--text-inverse);
  background: linear-gradient(to top, var(--bg-title-in) 0%, var(--bg-title-out) 70%, transparent 100%);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.view-content-categories .views-field-name a:hover,
.view-content-categories .views-field-name a:focus {
  text-decoration: none;
}

.view-content-categories .views-view-responsive-grid__item-inner .views-field-name a {
  color: #fff;
}

/* ============================================================================
 * MOBILE STYLES
 * ============================================================================ */

@media (max-width: 767px) {
  /* Categories container - 95% width on mobile */
  .view-content-categories {
    width: 95%;
    margin: 0 auto;
  }

  /* Grid container - 100% width of parent */
  .view-content-categories .views-view-responsive-grid {
    width: 100%;
  }

  /* Grid items - 100% width */
  .view-content-categories .views-view-responsive-grid__item {
    width: 100%;
  }

  /* Images inside tiles - 100% width */
  .view-content-categories .views-view-responsive-grid__item-inner img {
    width: 100%;
    height: auto;
    display: block;
  }

  /* Reduce font size for category names on mobile */
  .view-content-categories .views-view-responsive-grid__item-inner .views-field-name {
    font-size: 1.5em;
    bottom: 0;
  }

  /* Disable hover effects on mobile (touch devices) */
  .view-content-categories .views-view-responsive-grid__item-inner:hover {
    transform: none;
    filter: none;
  }

  /* Header adjustments for mobile */
  .region-header {
    height: auto;
    min-height: 80px;
    flex-wrap: wrap;
    padding: 0.5em;
  }

  #block-ptasiewyprawy-site-branding,
  #block-ptasiewyprawy-main-menu {
    height: auto;
    min-height: 40px;
  }

  #block-ptasiewyprawy-site-branding {
    margin-top: 0;
    margin-bottom: 0;
  }

  #block-ptasiewyprawy-site-branding a {
    font-size: 24px;
  }

  #block-ptasiewyprawy-main-menu ul {
    flex-wrap: wrap;
    gap: 0.5em;
  }

  /* Node 124 - full width on mobile */
  .view-content-node-124 {
    width: 95%;
    margin: 0 auto 0;
    padding: 1.5em;
  }

  /* All views on mobile */
  .views-view-responsive-grid__item,
  .pw-taxonomies .views-view-responsive-grid__item,
  .pw-list .views-view-responsive-grid__item,
  #block-ptasiewyprawy-views-block-lista-galerii-block-1 .views-view-responsive-grid__item {
    border-width: 2px;
  }

  .views-view-responsive-grid__item .views-field-name,
  .pw-taxonomies .views-view-responsive-grid__item .views-field-name,
  .pw-list .views-view-responsive-grid__item .views-field-name,
  #block-ptasiewyprawy-views-block-lista-galerii-block-1 .views-view-responsive-grid__item .views-field-name {
    font-size: 1em;
  }

  .views-view-responsive-grid__item:hover,
  .pw-taxonomies .views-view-responsive-grid__item:hover,
  .pw-list .views-view-responsive-grid__item:hover,
  #block-ptasiewyprawy-views-block-lista-galerii-block-1 .views-view-responsive-grid__item:hover {
    transform: none;
  }
}

/* ============================================================================
 * ALL VIEWS - Consistent Bold Design
 * ============================================================================ */

/* General grid items */
.pw-taxonomies .views-view-responsive-grid__item,
.pw-list .views-view-responsive-grid__item {
  margin-bottom: 1.5em;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--bg-accent);
  background: var(--bg-primary);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.pw-taxonomies .views-view-responsive-grid__item:hover,
.pw-list .views-view-responsive-grid__item:hover {
  transform: scale(1.03);
  border-color: var(--bg-accent);
  z-index: 99;
}

/* Images in all views */
.views-view-responsive-grid__item img,
.pw-taxonomies .views-view-responsive-grid__item img,
.pw-list .views-view-responsive-grid__item img,
#block-ptasiewyprawy-views-block-lista-galerii-block-1 .views-view-responsive-grid__item img {
  display: block;
  width: 100%;
  height: auto;
  transition: filter 0.3s ease;
}

.views-view-responsive-grid__item:hover img,
.pw-taxonomies .views-view-responsive-grid__item:hover img,
.pw-list .views-view-responsive-grid__item:hover img,
#block-ptasiewyprawy-views-block-lista-galerii-block-1 .views-view-responsive-grid__item:hover img {
  filter: brightness(0.6) contrast(1.05);
}

/* Text overlays in all views */
.views-view-responsive-grid__item .views-field-name,
.pw-taxonomies .views-view-responsive-grid__item .views-field-name,
.pw-list .views-view-responsive-grid__item .views-field-name,
#block-ptasiewyprawy-views-block-lista-galerii-block-1 .views-view-responsive-grid__item .views-field-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  text-transform: uppercase;
  color: var(--text-inverse);
  background: linear-gradient(to top, var(--bg-title-in) 0%, var(--bg-title-out) 70%, transparent 100%);
  font-weight: 700;
  letter-spacing: 0.1em;
}


.views-field-name a {
  padding: 2em 1em 1em;
  font-size: 1em;
  color: #000;
  display: block;
}

/* Links in all views */
.views-field.views-field-title a,
.views-field.views-field-field-nazwa-angielska a,
.views-field.views-field-field-nazwa-lacinska a,
.views-view-responsive-grid__item a,
.pw-taxonomies .views-view-responsive-grid__item a,
.pw-list .views-view-responsive-grid__item a,
#block-ptasiewyprawy-views-block-lista-galerii-block-1 .views-view-responsive-grid__item a,
.views-field.views-field-name a {
  color: var(--text-inverse);
  text-decoration: none;
  transition: color 0.3s ease;
}

.views-view-responsive-grid__item:hover a,
.pw-taxonomies .views-view-responsive-grid__item:hover a,
.pw-list .views-view-responsive-grid__item:hover a,
#block-ptasiewyprawy-views-block-lista-galerii-block-1 .views-view-responsive-grid__item:hover a {
  color: var(--accent-color);
}

/* Specific view containers */
#block-ptasiewyprawy-views-block-lista-galerii-block-1 .views-view-responsive-grid__item,
.pw-taxonomies .views-view-responsive-grid__item,
.pw-list .views-view-responsive-grid__item {
  border: 1px solid var(--bg-accent);
  background: var(--bg-primary);
}

/* ============================================================================
 * PW-NODE - Simple styles for node view (zawartosc_galerii)
 * ============================================================================ */

/* Images field - display in line with gap, natural wrapping */
.pw-node {
  margin: 0 auto;
  display: block;
  width: 100%;
  max-width: 100%;
}

.pw-node .views-field-field-zdjecia .field-content {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

/*@media (min-width: 768px) {*/
/*  .pswp__img {*/
/*    height: auto !important;*/
/*    width: auto !important;*/
/*  }*/
/*}*/

@media (min-width: 767px) {
  .pswp__img {
    /*width: auto !important;*/
    /*max-width: 100vw;*/
    /*max-height: 100vh;*/
    /*object-fit: contain; !* ważne, żeby ładnie się zmniejszało *!*/
  }

  .view-content-node-124 {
    position: relative;
    top: -63px;
    padding-top: 1.4em;
    padding-bottom: 1em;;
  }

}


.views-view-responsive-grid__item-inner {
  position: relative;
}

.pw-list .views-field.views-field-title,
.pw-list .views-field.views-field-field-nazwa-angielska,
.pw-list .views-field.views-field-field-nazwa-lacinska {
  width: 100%;
  position: absolute;
  z-index: 9;
  top: 0;
  font-size: 1em;
  height: 3em;
  text-align: center;
  /*color: var(--bg-primary);*/
}

.pw-list .views-field.views-field-field-nazwa-lacinska {
  background: linear-gradient(to bottom, var(--bg-title-in) 0%, var(--bg-title-out) 70%, transparent 100%);
}

.views-field.views-field-title a,
.views-field.views-field-field-nazwa-angielska a,
.views-field.views-field-field-nazwa-lacinska a {
  color: var(--bg-primary);
}

.pw-list .views-field.views-field-title {
  top: 307px;
  z-index: 9;
  text-align: center;
  background: linear-gradient(to top, var(--bg-title-in) 0%, var(--bg-title-out) 90%, transparent 100%);
}

.pw-list .views-field.views-field.views-field-field-nazwa-angielska {
  background: linear-gradient(to top, var(--bg-title-in) 90%, var(--bg-title-out) 10%, transparent 100%);
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  padding-top: 10px;
  vertical-align: middle;
  top: 351px;
  /*position: relative;*/
}

/* ============================================================================
 * PHOTOSWIPE - Hide thumbnail placeholder during image loading
 * ============================================================================ */

/* Hide the thumbnail placeholder that Photoswipe displays while loading full image */
.pswp__img--placeholder,
.pswp__img--with-bg {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* ============================================================================
 * IMAGELIGHTBOX AUTOPLAY BUTTON
 * ============================================================================ */

/* Style for autoplay stop/start button */
.imagelightbox-autoplay-button {
  position: fixed !important;
  top: 20px !important;
  right: 80px !important; /* Position to the left of close button */
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  border: 0 !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  transition: background 0.2s ease !important;
  z-index: 10004 !important; /* Higher than imagelightbox-close (10002) and imagelightbox-loading (10003) */
  pointer-events: auto !important;
  touch-action: manipulation !important; /* Prevent double-tap zoom and improve touch responsiveness */
  -webkit-tap-highlight-color: transparent !important; /* Remove tap highlight on mobile */
  user-select: none !important; /* Prevent text selection on touch */
}

.imagelightbox-autoplay-button:hover {
  background: rgba(0, 0, 0, 0.7) !important;
}

.imagelightbox-autoplay-button:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5) !important;
  outline-offset: 2px !important;
}

.imagelightbox-autoplay-button svg {
  width: 20px !important;
  height: 20px !important;
  fill: currentColor !important;
}


#block-ptasiewyprawy-primary-local-tasks ul li {
  display: inline-grid;
  background: #fff;
  padding: 10px;
}

.pw-node .views-field-title a {
  color: #0a0a0a;
}

.views-element-container.contextual-region.settings-tray-editable a {
  padding: 0;
  /*background: #0a0a0a;*/
  color: var(--text-primary);
  /*float: left;*/
}

.pw-bread {
  width: 30%;
  padding: 10px 30px 10px 10px;
  /*display: inline-block;*/
}

.pw-bread a {
  color: var(--bg-accent);
}

.pw-breadcrumb {
  border-bottom: 1px solid #ccc;
  margin-bottom: 10px;
}

.pager {
  text-align: center;
}

.pager li {
  display: inline-grid;
  padding: 0 10px;
}

.pw-search a {
  color: var(--text-primary) !important;
  /*padding-left: 10px;*/
}

.pw-search .views-view-responsive-grid__item {
  border: 1px solid var(--bg-accent);
}

.pw-search .pw-link {
  padding-left: 10px;
}

#block-ptasiewyprawy-mainnavigation {
  position: relative;
  left: 440px;
  background: var(--bg-title-in);
  width: 425px;
  max-width: 50%;
  transition: all 500ms ease-in-out;
  display: block;
}

#block-ptasiewyprawy-mainnavigation li {
  list-style: none;
  text-align: center;
}

#block-ptasiewyprawy-mainnavigation:hover {
  background: var(--bg-accent);
}


#block-ptasiewyprawy-mainnavigation li a {
  color: var(--text-inverse);
  padding: 10px 10px;
  display: block;
  position: relative;
  left: -20px;
}

#block-ptasiewyprawy-site-branding {
  width: auto;
  position: absolute;
  top: 0;
}

@media (max-width: 1120px) {
  .pw-list .views-field {
    height: auto;
  }
  .pw-list .views-field.views-field-title {
    /*top:400px;*/
    top: calc(100% - 5.7em);
    font-size: 1.5em;
  }

  .pw-list .views-field.views-field.views-field-field-nazwa-angielska {
    /*background: #0a0a0a;*/
    position: absolute;
    top: calc(100% - 3em);
    font-size: 1.5em;
    /*bottom: 0;*/
  }

  #block-ptasiewyprawy-mainnavigation {
    position: relative;
    left: .7em;
    top:35px;
    margin-top: 20px;
    width: 90%;
    background: var(--bg-title-in);
    max-width: 90%;
    transition: all 500ms ease-in-out;
    display: block;
    margin-bottom: 50px;
  }

  #block-ptasiewyprawy-content {
    margin-left: .7em;
  }
}
