/* ==========================================================================
   imago creative — the content panel a menu button opens.
   Shared by the public site and the admin's live preview, so what the admin
   sees while editing is exactly what visitors get.
   ========================================================================== */

.ic-panel {
  --ink: #042433;
  --terra: #be6640;
  --terra-dk: #a8542f;
  --sage: #85917b;
  --sage-dk: #6d7a63;
  --cream: #faf8f5;
  --accent: var(--terra);
  --accent-dk: var(--terra-dk);

  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  padding: 16px 26px 24px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 30px;
  box-shadow: 0 32px 60px -34px rgba(4, 36, 51, .45);
  font-family: 'Quicksand', system-ui, sans-serif;
  overflow: hidden;
  outline: none;
}
.ic-panel[hidden] { display: none; }
.ic-panel *, .ic-panel *::before, .ic-panel *::after { box-sizing: border-box; }
.ic-panel--right { --accent: var(--sage); --accent-dk: var(--sage-dk); }

/* ── Header ─────────────────────────────────────────────────────────────── */
.ic-panel__head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.ic-panel__title {
  margin: 4px 0 0;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.2px;
  overflow-wrap: anywhere;
}
.ic-panel__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 2px -10px 0 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background .2s ease, color .2s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.ic-panel__close svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ic-panel__close:hover { background: var(--accent); color: #fff; transform: rotate(90deg); }
.ic-panel__close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Scrolling text area ────────────────────────────────────────────────── */
.ic-panel__scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-right: -14px;
  padding-right: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(4, 36, 51, .25) transparent;
}
/* A soft fade tells people there is more text below. */
.ic-panel__scroll.has-more {
  -webkit-mask-image: linear-gradient(#000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 36px), transparent);
}

.ic-panel__body {
  font-size: 17px;
  line-height: 1.5;
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
  text-wrap: pretty;
  overflow-wrap: break-word;
}
.ic-panel__body:empty { display: none; }
.ic-panel__body p { margin: 0 0 .65em; }
.ic-panel__body > :last-child { margin-bottom: 0; }
.ic-panel__body ul,
.ic-panel__body ol { margin: 0 0 .65em; padding-left: 1.35em; text-align: left; }
.ic-panel__body li { margin: .15em 0; }
.ic-panel__body li::marker { color: var(--accent); }
.ic-panel__body strong { font-weight: 700; }
.ic-panel__body a {
  color: var(--terra);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.ic-panel__body a:hover { color: var(--terra-dk); text-decoration-thickness: 2px; }

/* ── Image ──────────────────────────────────────────────────────────────── */
.ic-panel__media {
  flex: none;
  margin: 14px 0 0;
  padding: 4px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: #fff;
}
.ic-panel__media[hidden] { display: none; }
.ic-panel--contact .ic-panel__media { display: none; }

/* ── Image slider ───────────────────────────────────────────────────────── */
.ic-slider {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: var(--cream);
  isolation: isolate;
}
.ic-slider__track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  outline: none;
}
.ic-slider__track::-webkit-scrollbar { display: none; }
.ic-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; scroll-snap-stop: always; overflow: hidden; }
.ic-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  transform: scale(1.08);
  transition: transform .9s cubic-bezier(.22, 1, .36, 1), opacity .5s ease;
  opacity: .75;
}
/* The slide in view settles into place — a gentle zoom as each one arrives. */
.ic-slide.is-active img { transform: none; opacity: 1; }

.ic-slider__nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-top: -20px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 6px 16px -8px rgba(4, 36, 51, .6);
  opacity: 0;
  transition: opacity .25s ease, transform .25s cubic-bezier(.34, 1.56, .64, 1), background .2s ease, color .2s ease;
}
.ic-slider__nav svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ic-slider__nav--prev { left: 10px; transform: translateX(-8px); }
.ic-slider__nav--next { right: 10px; transform: translateX(8px); }
.ic-slider:hover .ic-slider__nav,
.ic-slider:focus-within .ic-slider__nav { opacity: 1; transform: none; }
.ic-slider__nav:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: scale(1.08); }
.ic-slider__nav:focus-visible { opacity: 1; outline: 2px solid #fff; outline-offset: 2px; }
.ic-slider__nav--prev:active { transform: translateX(-3px) scale(.95); }
.ic-slider__nav--next:active { transform: translateX(3px) scale(.95); }
@media (hover: none) {
  .ic-slider__nav { opacity: 1; transform: none; width: 36px; height: 36px; margin-top: -18px; }
}

.ic-slider__dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(4, 36, 51, .45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transform: translateX(-50%);
}
.ic-slider__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .55);
  cursor: pointer;
  transition: width .35s cubic-bezier(.34, 1.56, .64, 1), background .25s ease;
}
.ic-slider__dot:hover { background: #fff; }
.ic-slider__dot.is-on { width: 20px; background: #fff; }
.ic-slider__dot:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ic-slider.is-single .ic-slider__nav,
.ic-slider.is-single .ic-slider__dots { display: none; }
.ic-panel--image .ic-form { display: none; }

/* ── Contact form ───────────────────────────────────────────────────────── */
.ic-form { margin-top: 16px; }
.ic-form__trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.ic-form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.ic-field { display: block; margin-bottom: 10px; }
.ic-field__label {
  display: block;
  margin: 0 0 4px 4px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
}
.ic-field__label small { font-weight: 500; opacity: .6; font-size: 12.5px; }
.ic-field input,
.ic-field textarea {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 2px solid rgba(4, 36, 51, .22);
  border-radius: 14px;
  background: var(--cream);
  color: var(--ink);
  font: 500 16px/1.4 'Quicksand', system-ui, sans-serif;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.ic-field textarea { resize: vertical; min-height: 96px; }
.ic-field input:hover,
.ic-field textarea:hover { border-color: rgba(4, 36, 51, .4); }
.ic-field input:focus,
.ic-field textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: #fff;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent);
}
.ic-field [aria-invalid="true"] { border-color: #b3261e; background: #fff; }
.ic-field__err { display: block; margin: 4px 0 0 4px; font-size: 13px; font-weight: 600; color: #b3261e; }
.ic-field__err:empty { display: none; }

.ic-form__foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.ic-form__status { flex: 1 1 160px; margin: 0; font-size: 14px; font-weight: 600; color: #b3261e; }
.ic-form__status:empty { display: none; }
.ic-form__send {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 600 16px/1 'Quicksand', system-ui, sans-serif;
  cursor: pointer;
  transition: background .2s ease, transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease;
}
.ic-form__send svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }
.ic-form__send:hover:not(:disabled) { background: var(--accent-dk); transform: translateY(-2px); box-shadow: 0 10px 18px -10px rgba(4, 36, 51, .5); }
.ic-form__send:hover:not(:disabled) svg { transform: translateX(3px); }
.ic-form__send:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.ic-form__send:disabled { opacity: .6; cursor: default; }
.ic-form.is-sending .ic-form__send span::after { content: '…'; }

.ic-form__done {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--cream);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.45;
  animation: icDone .45s cubic-bezier(.34, 1.56, .64, 1) both;
}
.ic-form__done[hidden] { display: none; }
.ic-form__done svg {
  flex: none;
  padding: 6px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--accent);
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-form__done p { margin: 0; }
.ic-form.is-done > :not(.ic-form__done) { display: none; }

@keyframes icDone { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }

@media (max-width: 520px) {
  .ic-panel { padding: 12px 18px 18px; border-radius: 24px; }
  .ic-panel__title { font-size: 28px; }
  .ic-panel__body { font-size: 16px; text-align: left; }
  .ic-form__row { grid-template-columns: 1fr; }
  .ic-form__send { width: 100%; justify-content: center; }
}
