/*
 * Sigma Gallery — front-end + editor styles.
 *
 * Plain CSS (no Tailwind): this loads on the public front end and inside every
 * page builder, none of which carry the plugin's `.smm-wrap` scope.
 */

.smm-gallery {
  display: grid;
  grid-template-columns: repeat(var(--smm-gallery-cols, 3), minmax(0, 1fr));
  gap: var(--smm-gallery-gap, 12px);
  margin: 0 0 1.5em;
  padding: 0;
  list-style: none;
}

.smm-gallery__item {
  margin: 0;
  padding: 0;
  position: relative;
  overflow: hidden;
}

.smm-gallery__link {
  display: block;
  line-height: 0;
  text-decoration: none;
}

.smm-gallery__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* Cropped: uniform squares regardless of source ratio. */
.smm-gallery--crop .smm-gallery__img {
  aspect-ratio: 1 / 1;
  height: 100%;
  -o-object-fit: cover;
     object-fit: cover;
}

/* Older browsers without aspect-ratio support fall back to a padded box. */
@supports not (aspect-ratio: 1 / 1) {
  .smm-gallery--crop .smm-gallery__item {
    padding-top: 100%;
  }
  .smm-gallery--crop .smm-gallery__link,
  .smm-gallery--crop .smm-gallery__img {
    position: absolute;
    inset: 0;
    height: 100%;
  }
}

.smm-gallery__caption {
  margin: 0;
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.3;
  color: #555;
  text-align: center;
}

.smm-gallery__link:hover .smm-gallery__img {
  opacity: 0.92;
  transition: opacity 0.15s ease;
}

.smm-gallery--empty {
  display: block;
  border: 1px dashed #c3c4c7;
  border-radius: 4px;
  padding: 24px;
  text-align: center;
  color: #757575;
  background: #f6f7f7;
}

/* Responsive column drop-down. */
@media (max-width: 782px) {
  .smm-gallery {
    grid-template-columns: repeat(
      min(var(--smm-gallery-cols, 3), 3),
      minmax(0, 1fr)
    );
  }
}

@media (max-width: 480px) {
  .smm-gallery {
    grid-template-columns: repeat(
      min(var(--smm-gallery-cols, 3), 2),
      minmax(0, 1fr)
    );
  }
}

/* ---- Lightbox ---- */

body.smm-lightbox-open {
  overflow: hidden;
}

.smm-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.9);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.smm-lightbox[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.smm-lightbox__figure {
  margin: 0;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.smm-lightbox__img {
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  -o-object-fit: contain;
     object-fit: contain;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.smm-lightbox__caption {
  margin-top: 12px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  max-width: 80vw;
}

.smm-lightbox__close,
.smm-lightbox__nav {
  position: absolute;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s ease;
  padding: 8px;
}

.smm-lightbox__close:hover,
.smm-lightbox__nav:hover {
  opacity: 1;
}

.smm-lightbox__close {
  top: 16px;
  right: 20px;
  font-size: 40px;
}

.smm-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 56px;
}

.smm-lightbox__prev {
  left: 12px;
}

.smm-lightbox__next {
  right: 12px;
}

.smm-lightbox__counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  letter-spacing: 0.03em;
}

@media (max-width: 600px) {
  .smm-lightbox__nav {
    font-size: 40px;
  }
  .smm-lightbox__close {
    font-size: 32px;
  }
}

/* ---- Block editor: Image Source inspector ---- */

.smm-gi {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.smm-gi__label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #1e1e1e;
}

.smm-gi__count {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #757575;
}

.smm-gi__folders {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
}

.smm-gi__folder {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
  text-align: left;
  color: #1e1e1e;
  transition: background-color 0.1s ease;
}

.smm-gi__folder:hover {
  background: #f0f0f0;
}

.smm-gi__folder.is-selected {
  background: #f0f6fc;
  color: #043959;
}

.smm-gi__check {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  border: 1.5px solid #949494;
  border-radius: 3px;
  box-sizing: border-box;
  position: relative;
}

.smm-gi__check.is-on {
  background: #3858e9;
  border-color: #3858e9;
}

.smm-gi__check.is-on::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.smm-gi__folder-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.smm-gi__field .components-base-control {
  margin-bottom: 0;
}

.smm-gi__field--divider {
  border-top: 1px solid #e0e0e0;
  padding-top: 16px;
}

.smm-gi__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.smm-gi__btn.smm-gi__btn {
  width: 100%;
  justify-content: center;
}


/*
*	ITEM FEATURED IMAGE: Citadela Block CSS styles for both frontend and editor screen
*/

.ctdl-item-featured-image .ft-image							{ position: relative; }
.ctdl-item-featured-image .ft-image a						{ display: inline-block; vertical-align: top; }

.ctdl-item-featured-image.loading 							{ display: none; }
.ctdl-item-featured-image .ft-image-thumb					{ text-align: center; position: relative; }
.ctdl-item-featured-image.align-center .ft-image-thumb		{ text-align: center; }
.ctdl-item-featured-image.align-left .ft-image-thumb		{ text-align: left; }
.ctdl-item-featured-image.align-right .ft-image-thumb		{ text-align: right; }

.ctdl-item-featured-image.custom-height img					{ object-fit: cover; }
.ctdl-item-featured-image.position-top-right img			{ object-position: top right; }
.ctdl-item-featured-image.position-top-center img			{ object-position: top center; }
.ctdl-item-featured-image.position-top-left img				{ object-position: top left; }
.ctdl-item-featured-image.position-center-right img			{ object-position: center right; }
.ctdl-item-featured-image.position-center-center img		{ object-position: center center; }
.ctdl-item-featured-image.position-center-left img			{ object-position: center left; }
.ctdl-item-featured-image.position-bottom-right img			{ object-position: bottom right; }
.ctdl-item-featured-image.position-bottom-center img		{ object-position: bottom center; }
.ctdl-item-featured-image.position-bottom-left img			{ object-position: bottom left; }

.ctdl-item-featured-image.cover-height								{ width: 100%; }
.ctdl-item-featured-image.cover-height img							{ object-fit: cover; }
.ctdl-item-featured-image.cover-height:first-child:last-child		{ height: 100%; }
.ctdl-item-featured-image.cover-height:first-child:last-child img	{ display: block; position: absolute; top: 0; left: 0; }
.ctdl-item-featured-image.cover-height .ft-image-thumb,
.ctdl-item-featured-image.cover-height .ft-image,
.ctdl-item-featured-image.cover-height .ft-image a,
.ctdl-item-featured-image.cover-height .ft-image img				{ width: 100%; height: 100%; }

.ctdl-item-featured-image.cover-height .ft-image-caption			{ position: absolute; background: rgba(0,0,0,0.3); color: #ffffff; bottom: 0; left: 0; right: 0; }

/*
*	ITEM OPENING HOURS: Citadela Block CSS styles for both frontend and editor screen
*/

.ctdl-item-opening-hours .oh-day 				{ display: flex; flex-flow: wrap; margin-bottom: 1em; }
.ctdl-item-opening-hours .oh-day p				{ margin: 0 0 0.3em 0; }
.ctdl-item-opening-hours .oh-day .oh-label,
.ctdl-item-opening-hours .oh-day .oh-data		{ flex: auto; width: 150px; max-width: 100%; }
.ctdl-item-opening-hours .oh-day .oh-label		{ font-weight: 700; }

/*
*	ITEM CONTACT DETAILS: Citadela Block CSS styles for both frontend and editor screen
*/


.ctdl-item-contact-details {}

.ctdl-item-contact-details .cd-info 					{ margin-bottom: 0.5em; }
.ctdl-item-contact-details .cd-info p					{ margin: 0 0 0.3em 0; }
.ctdl-item-contact-details .cd-info .cd-label,
.ctdl-item-contact-details .cd-info .cd-data			{ display: inline-block; max-width: 100%; vertical-align: top; }
.ctdl-item-contact-details .cd-info .cd-label			{ font-weight: 700; }
.ctdl-item-contact-details .cd-info .cd-label p:after	{ content: ":"; }
/*
*	ITEM CONTACT FORM: Citadela Block CSS styles for both frontend and editor screen
*/


.ctdl-item-contact-form {}

.ctdl-item-contact-form .input-container							{ margin-bottom: 0.5em; }
.ctdl-item-contact-form .input-container:not(.sf-button) label		{ display: none; }
.ctdl-item-contact-form .input-container:not(.sf-button) input,
.ctdl-item-contact-form .input-container:not(.sf-button) textarea	{ width: 100%; box-sizing: border-box; padding: 5px 10px; }
.ctdl-item-contact-form .input-container:not(.sf-button) textarea	{ height: 200px; max-width: 100%; min-width: 100%; }

/*
*	ITEM GPX DOWNLOAD: Citadela Block CSS styles for both frontend and editor screen
*/

.ctdl-item-gpx-download { margin-bottom: 1.5rem; }

.ctdl-item-gpx-download.align-left 		{ text-align: left; }
.ctdl-item-gpx-download.align-center 	{ text-align: center; }
.ctdl-item-gpx-download.align-right 	{ text-align: right; }

.ctdl-item-gpx-download .download-button > a					{ display: inline-block; max-width: 100%; height: auto; text-align: center; white-space: normal; box-sizing: border-box; vertical-align: top; }
.ctdl-item-gpx-download:not(.text-style) .download-button > a 	{ background: #000000; color: #ffffff; border-radius: 4px; line-height: 1.3; }
.ctdl-item-gpx-download.small-button-style .download-button > a { padding: 6px 20px; font-size: 14px; }
.ctdl-item-gpx-download.large-button-style .download-button > a { padding: 12px 30px; font-size: 18px; }

/*
*	ITEM GET DIRECTIONS: Citadela Block CSS styles for both frontend and editor screen
*/

.ctdl-item-get-directions { margin-bottom: 1.5rem; }

.ctdl-item-get-directions.align-left 		{ text-align: left; }
.ctdl-item-get-directions.align-center 	{ text-align: center; }
.ctdl-item-get-directions.align-right 	{ text-align: right; }

.ctdl-item-get-directions .button-wrapper > a					{ display: inline-block; max-width: 100%; height: auto; text-align: center; white-space: normal; box-sizing: border-box; vertical-align: top; }
.ctdl-item-get-directions:not(.text-style) .button-wrapper > a 	{ background: #000000; color: #ffffff; border-radius: 4px; line-height: 1.3; }
.ctdl-item-get-directions.small-button-style .button-wrapper > a { padding: 6px 20px; font-size: 14px; }
.ctdl-item-get-directions.large-button-style .button-wrapper > a { padding: 12px 30px; font-size: 18px; }

