.wpcf7 {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 40px);
  background: #fff;
  border: 1px solid rgba(166, 122, 82, 0.2);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
  position: relative;
}

.wpcf7 *,
.wpcf7 *::before,
.wpcf7 *::after {
  box-sizing: border-box;
}

.wpcf7 form {
  margin: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  width: 100%;
}

.wpcf7 p {
  margin: 0 0 16px;
  width: 100%;
}

.wpcf7 label {
  display: block;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a67a52;
}

.wpcf7 .wpcf7-form-control {
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(166, 122, 82, 0.35);
  border-radius: 12px;
  font-size: 16px;
  color: #5b3d26;
  background: #fffdfa;
  font-family: 'Playfair Display', serif;
  font-weight: 300;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wpcf7 textarea.wpcf7-form-control {
  height: 100px;
  max-height: 100px;
  resize: vertical;
}

.wpcf7 .wpcf7-form-control:focus {
  outline: none;
  border-color: #a67a52;
  box-shadow: 0 0 0 3px rgba(166, 122, 82, 0.18);
}

.wpcf7 input::placeholder,
.wpcf7 select::placeholder,
.wpcf7 textarea::placeholder {
  color: rgba(91, 61, 38, 0.5);
  font-family: 'Playfair Display', serif;
  font-weight: 300;
}

.wpcf7 select.wpcf7-form-control {
  appearance: none;
  padding-right: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, #a67a52 50%),
    linear-gradient(135deg, #a67a52 50%, transparent 50%);
  background-position:
    calc(100% - 22px) 52%,
    calc(100% - 16px) 52%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.wpcf7 select.wpcf7-form-control option {
  color: #5b3d26;
  font-family: 'Playfair Display', serif;
}

.wpcf7 .wpcf7-submit {
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-radius: 999px;
  background: #a67a52;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wpcf7 .wpcf7-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(166, 122, 82, 0.25);
}

.wpcf7 .wpcf7-submit:active {
  transform: translateY(0);
  box-shadow: none;
}

.wpcf7 .wpcf7-not-valid-tip {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: #b93434;
  background: transparent;
}

.wpcf7 .wpcf7-not-valid {
  border-color: #b93434;
  box-shadow: 0 0 0 3px rgba(185, 52, 52, 0.16);
}

.wpcf7 .wpcf7-response-output {
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a67a52;
  text-align: center;
}

.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output {
  border-color: transparent !important;
  color: #b93434 !important;
  background: transparent !important;
}

.wpcf7 form.sent {
  transform: translateY(0);
  pointer-events: none;
}

.wpcf7 form.sent p,
.wpcf7 form.sent .wpcf7-form-control-wrap,
.wpcf7 form.sent .wpcf7-submit,
.wpcf7 form.sent .ajax-loader {
  display: none;
}

.wpcf7 form.sent .wpcf7-response-output {
  margin: 0;
  padding: 18px 0 6px;
  font-size: 18px;
  letter-spacing: 0.12em;
  color: var(--main-text-dark-color, #5b3d26);
  border: 0 !important;
  background: transparent !important;
  text-transform: none;
  animation: formSentFade 0.35s ease forwards;
}

@keyframes formSentFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}


.wpcf7 .ajax-loader {
  display: inline-block;
  margin-left: 8px;
}

.wpcf7 .screen-reader-response {
  position: static;
  width: auto;
  height: auto;
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #fff4f4;
  border: 1px solid rgba(139, 47, 47, 0.25);
  border-radius: 10px;
  color: #8b2f2f;
}

@media (max-width: 640px) {
  .wpcf7 {
    padding: 18px;
    border-radius: 16px;
  }

  .wpcf7 label {
    font-size: 12px;
  }

  .wpcf7 .wpcf7-form-control {
    font-size: 15px;
  }
}

@media (min-width: 900px) {
  .wpcf7 {
    max-width: 760px;
  }
}

.gallery-contact-slot {
  display: flex;
  justify-content: center;
  padding: 32px 16px;
}

.gallery-contact-slot .wpcf7 {
  width: min(92vw, 760px);
  margin: 0;
}

.gallery-contact-card {
  position: relative;
  background: #f7f2ec;
}

.gallery-contact-card__bg {
  opacity: 0.55;
  filter: saturate(0.9);
}

.gallery-contact-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  text-align: center;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.85));
  z-index: 3;
}

.gallery-contact-card__title {
  width: min(70%, 200px);
  height: auto;
  margin-bottom: 10px;
}

.gallery-contact-card__overlay p {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--main-text-dark-color, #5b3d26);
}

.gallery-contact-ribbon {
  display: flex;
  justify-content: center;
  padding: 24px 12px;
}

.gallery-contact-ribbon__inner {
  width: min(92vw, 760px);
  border-radius: 18px;
  border: 1px solid rgba(166, 122, 82, 0.25);
  background: rgba(255, 255, 255, 0.9);
  padding: 20px 18px;
  text-align: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
}

.gallery-contact-ribbon__inner img {
  width: min(70vw, 240px);
  height: auto;
  margin-bottom: 8px;
}

.gallery-contact-ribbon__inner p {
  margin: 0 0 14px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--main-text-dark-color, #5b3d26);
}

.contact-inline-trigger {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--main-text-dark-color, #5b3d26);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(166, 122, 82, 0.25);
}

.contact-fab {
  position: fixed;
  right: 0;
  top: 45%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(255, 255, 255, 0.75);
  color: var(--main-text-dark-color, #5b3d26);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 14px 10px 14px 18px;
  border-radius: 999px 0 0 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
  z-index: 1002;
  -webkit-tap-highlight-color: transparent;
}

.contact-fab span {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-weight: 300;
}

@supports (-webkit-touch-callout: none) {
  .contact-fab {
    right: 12px;
    padding-right: 16px;
  }
}

.contact-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1001;
  isolation: isolate;
}

.contact-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.contact-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(3px);
  z-index: 0;
}

.contact-modal__panel {
  position: relative;
  width: min(92vw, 760px);
  max-height: 90vh;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 24px;
  padding: 32px 28px 28px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.contact-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  font-size: 22px;
  color: var(--main-text-dark-color, #5b3d26);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.contact-modal__title {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.contact-modal__title img {
  width: min(70vw, 320px);
  height: auto;
}

.contact-modal__social {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 0 0 24px;
}

.contact-modal__social .footer-social-link svg {
  width: 22px;
  height: 22px;
  fill: var(--main-text-dark-color, #5b3d26);
}

html.contact-modal-open,
body.contact-modal-open {
  overflow: hidden;
}

body.contact-modal-open .contact-fab {
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 640px) {
  .contact-modal__panel {
    padding: 24px 18px;
  }
}
