/* ----------------------------------------------------------------
	Custom CSS

	Add all your Custom Styled CSS here for New Styles or
	Overwriting Default Theme Styles for Better Handling Updates
-----------------------------------------------------------------*/

/* The actual accent color values are set per-request from SiteSetting
   (see app/views/shared/_accent_color.html.erb), editable at
   /admin/site_setting/edit. These rules just consume the CSS variables
   so they always track whatever color is chosen. */

::selection {
  background: rgba(var(--cnvs-themecolor-rgb), 0.35);
}

a:not(.button):not(.btn):not(.social-icon):hover {
  color: var(--cnvs-accent-color);
}

/* Smoother, slightly slower scroll-reveal easing for a more editorial feel. */
:root {
  --animate-duration: 0.9s;
}

[data-animate] {
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* Inline editor (admin-only): click-to-edit affordance rendered by the
   `inline_setting` / `inline_title` helpers on the public pages. See
   app/javascript/inline_edit.js. */
.inline-editable {
  position: relative;
  display: inline-block;
  border-radius: 0.25rem;
  outline: 1px dashed transparent;
  outline-offset: 4px;
  transition: outline-color 0.2s ease, background-color 0.2s ease;
}

.inline-editable:hover {
  outline-color: rgba(var(--cnvs-themecolor-rgb), 0.6);
}

.inline-editable .inline-edit-pencil {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  margin-left: 0.4em;
  border: 0;
  border-radius: 50%;
  background: rgba(var(--cnvs-themecolor-rgb), 0.92);
  color: #000;
  font-size: 0.55em;
  opacity: 0.85;
  transform: scale(1);
  transition: opacity 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  vertical-align: middle;
}

/* On devices with real hover (mouse/trackpad) the pencil stays hidden until
   hovered, to keep the public-looking text uncluttered. Touch devices have no
   hover, so it stays visible at low opacity there — see .media-btn below for
   the same reasoning applied to the photo/video controls. */
@media (hover: hover) {
  .inline-editable .inline-edit-pencil {
    opacity: 0;
    transform: scale(0.85);
  }

  .inline-editable:hover .inline-edit-pencil {
    opacity: 1;
    transform: scale(1);
  }
}

.inline-editable [data-inline-edit-target="field"] {
  width: 100%;
  min-width: 12ch;
  color: inherit;
  font: inherit;
  background: rgba(0, 0, 0, 0.3);
}

.inline-editable.inline-edit-saved {
  outline-color: #3a9b7a;
}

.inline-editable.inline-edit-error {
  outline-color: #a8555f;
}

/* Inline media editor (admin-only): add/replace/delete/reorder controls
   rendered by ApplicationHelper#media_overlay / #media_add_tile on top of
   photos, videos and slides. See app/javascript/inline_media.js. */
.media-overlay {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  z-index: 15;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

/* Buttons/labels get a real 44px tap target regardless of the icon's own
   size — the touch-target minimum recommended by iOS/Android/WCAG, so
   nobody has to zoom in to hit the right spot on a phone. */
.media-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.media-btn-camera {
  background: rgba(var(--cnvs-themecolor-rgb), 0.92);
  color: #000;
}

.media-btn-delete:hover {
  background: #a8555f;
}

@media (hover: hover) {
  .media-overlay {
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  /* Matches whichever element directly wraps the overlay (a portfolio card, a
     swiper slide, or the small position-relative wrapper put around a single
     site image) without needing to enumerate every one of those classes. */
  *:hover > .media-overlay {
    opacity: 1;
  }

  .media-btn:hover {
    opacity: 1;
    transform: scale(1.08);
  }
}

.media-error {
  display: block;
  color: #f0b4ba;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

.portfolio-image {
  position: relative;
}

/* "+" tile that uploads straight into a photo/slide collection (see
   ApplicationHelper#media_add_tile). */
.media-add-tile {
  height: 100%;
  min-height: 160px;
  border: 2px dashed rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.media-add-tile:hover {
  border-color: var(--cnvs-accent-color, #c9a961);
  color: #fff;
}

/* "+" mini-form used to add a new portfolio item (video/image/audio) in
   place, see _portfolio_artistic.html.erb. */
.media-add-item-toggle {
  min-height: 2.75rem;
}

.media-add-item-form .btn,
.media-add-item-form .button {
  min-height: 2.75rem;
}

/* Floating "add slide" control for the Swiper hero slider — kept outside
   .swiper-wrapper on purpose so it never becomes a rotating slide itself. */
#slider {
  position: relative;
}

.media-add-slide-wrap {
  bottom: 5.5rem;
  right: 1.25rem;
  z-index: 20;
  width: 260px;
}

.media-add-slide-wrap .media-add-item-toggle {
  width: 2.75rem;
  height: 2.75rem;
}

.media-add-slide-wrap .media-add-item-form {
  margin-top: 0.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.85);
}
