/**
 * "Contact" page (template: archery-contact-template.php).
 *
 * Loaded only on pages using that template (see inc/enqueue.php). Holds the
 * contact card (.dark) + form styles, including the custom "Sujet" dropdown.
 * The shared design system (buttons, banner, top bar, footer, mobile menu)
 * lives in styles.css / tablet.css / mobile.css and is reused as-is.
 */

/* ============================================================
   Shared bits this page leans on
   ============================================================ */
.serif {
  font-family: Castoro, Georgia, serif;
  font-weight: 400;
  margin: 0;
}

.arr {
  display: inline-block;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e9511c;
  background: #e9511c;
  color: #f8feff;
  border-radius: 15px;
  padding: 7px 16px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 34px;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f8feff;
  animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* Reveal-on-load, staggered by delay class. */
.rise {
  animation: rise 0.85s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rise.d1 { animation-delay: 0.1s; }
.rise.d2 { animation-delay: 0.2s; }
.rise.d3 { animation-delay: 0.32s; }
.rise.d4 { animation-delay: 0.44s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

/* ============================================================
   Contact card
   ============================================================ */
.dark {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 70px;
  align-items: stretch;
  margin: 15px;
  padding: 28px 32px 32px;
  border-radius: 15px;
  background: #d0eff2;
  color: #000;
}

.dark a { color: #000; }
.dark a:hover { color: #e9511c; }

.dark .eyebrow {
  align-self: flex-start;
  font-size: 14px;
  border-radius: 8px;
}

/* Left column — heading + intro + addresses */
.dk-info {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.dk-title {
  font-size: clamp(72px, 9vw, 150px);
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: #000;
  margin-top: 0;
}

.dk-l1 { display: block; }
.dk-l2 { display: block; text-align: right; }
.dk-l2 i { color: #e9511c; }

/* Intro — a WYSIWYG field, hence the .rich-text container (a <div>, not a <p>).
   Paragraph/list/link spacing comes from .rich-text in css/styles.css; only the
   type and colour of the block are page business. */
.dk-note {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(0, 0, 0, 0.65);
}

.dk-note b,
.dk-note strong { color: #000; }

.dk-addrs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  text-align: left;
  margin-top: 14px;
}

.dk-addrs .dk-addr:last-child { text-align: right; }

.dk-ah {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin: 0 0 10px;
  font-family: Montserrat, system-ui, sans-serif;
  color: #000;
}

.dk-addr p {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(0, 0, 0, 0.6);
  white-space: nowrap;
}

/* ============================================================
   Contact form
   ============================================================ */
.dk-formcol {
  display: flex;
  flex-direction: column;
}

.dk-form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.dk-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dk-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 22px;
}

.dk-field-grow { flex: 1; }

/* Message textarea stretches to fill the remaining form height, so the form
   column matches the (tall) left column — as in the prototype (f1). */
.dk-field-grow .dkf { flex: 1; }

.dkl {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #000;
  transition: color 0.25s;
}

/* Required marker. Sits right after the label text; aria-hidden in the markup
   because CF7 already exposes aria-required on the control itself. */
.dk-req { color: #e9511c; font-size: 16px; line-height: 1; }
.dk-field:focus-within .dkl { color: #e9511c; }

.dkf {
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 15px;
  background: transparent;
  color: #000;
  padding: 14px 18px;
  font-size: 14px;
  font-family: Montserrat, system-ui, sans-serif;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  appearance: none;
  -webkit-appearance: none;
}

.dkf:hover { border-color: rgba(0, 0, 0, 0.55); }
.dkf:focus { border-color: #e9511c; box-shadow: 0 0 0 3px rgba(233, 81, 28, 0.18); }
.dkf::placeholder { color: rgba(0, 0, 0, 0.35); }

.dkta { min-height: 120px; resize: vertical; line-height: 1.6; }

.dk-submit {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Custom "Sujet" dropdown ---- */
.dd { position: relative; }

.dd-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 15px;
  background: transparent;
  color: #000;
  padding: 14px 18px;
  font-size: 14px;
  font-family: Montserrat, system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.dd-btn:hover { border-color: rgba(0, 0, 0, 0.55); }
.dd.open .dd-btn { border-color: #e9511c; box-shadow: 0 0 0 3px rgba(233, 81, 28, 0.18); }
.dd-btn.placeholder { color: rgba(0, 0, 0, 0.35); }

.dd-caret {
  flex: none;
  width: 14px;
  height: 9px;
  margin-left: 12px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.dd.open .dd-caret { transform: rotate(180deg); }

.dd-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #f8feff;
  border: 1px solid #70cbd3;
  border-radius: 15px;
  padding: 6px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.16);
  transform-origin: top;
  animation: ddin 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ddin {
  from { opacity: 0; transform: translateY(-8px) scaleY(0.96); }
  to { opacity: 1; transform: none; }
}

.dd-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: none;
  background: none;
  border-radius: 11px;
  font-family: Montserrat, system-ui, sans-serif;
  font-size: 14px;
  color: #000;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.dd-opt:hover { background: #d0eff2; }
.dd-opt.sel { background: #e9511c; color: #f8feff; }
.dd-opt.sel:hover { background: #e9511c; }

.dd-check { opacity: 0; font-size: 13px; flex: none; }
.dd-opt.sel .dd-check { opacity: 1; }

/* ---- Conditional "Précisez le sujet" field ---- */
/* Hidden until the "Autre" option is picked (js/contact.js toggles [hidden]);
   slides in so the form does not jump. */
.dk-subject-other:not([hidden]) {
  animation: dkin 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

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

/* ---- Sent confirmation ---- */
/* Theme-namespaced (dk-sent) so it never collides with CF7's reserved "sent"
   form-status class, which CF7 stamps on the <form> element on success. */
.dk-sent {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: 1;
  background: #f8feff;
  border-radius: 15px;
  padding: 60px 40px;
  text-align: center;
}

.dk-sent h3 { font-size: 40px; }
.dk-sent p { max-width: 380px; color: rgba(0, 0, 0, 0.65); line-height: 1.6; }

[hidden] { display: none !important; }

/* ============================================================
   Contact Form 7 integration
   ------------------------------------------------------------
   The form is a CF7 form (html_class="dk-form") whose markup reuses the
   classes above (see tools/cf7-contact-form.txt). CF7 wraps every control
   in <span class="wpcf7-form-control-wrap">; these rules keep that wrapper
   from breaking the block layout, hide the subject input behind the custom
   dropdown, and style CF7's validation feedback in the theme's palette.
   ============================================================ */
.dk-form .wpcf7-form-control-wrap { display: block; }

/* The visible dropdown drives a hidden CF7 subject field (still submitted and
   still required). Only the INPUT is hidden — its wrapper stays in the flow so
   CF7's "field is required" tip appears under the dropdown button, and the
   button itself picks up the error border. CF7 never emits the native `required`
   attribute (only aria-required), so a display:none control cannot deadlock the
   browser's own form validation. */
.dd input[name="subject"].dk-subject-input { display: none; }
.dd:has(.wpcf7-not-valid) .dd-btn { border-color: #e9511c; }

/* CF7 messages + per-field validation, in the theme's palette. */
.dk-form .wpcf7-response-output {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-family: Montserrat, system-ui, sans-serif;
  line-height: 1.5;
}

.dk-form .wpcf7-not-valid-tip {
  color: #e9511c;
  font-size: 12px;
  margin-top: 6px;
  font-family: Montserrat, system-ui, sans-serif;
}

.dkf.wpcf7-not-valid,
.dd-btn.wpcf7-not-valid { border-color: #e9511c; }

.dkf.archery-invalid,
.dd-btn.archery-invalid { border-color: #e9511c; }

.archery-field-error {
  display: block;
  color: #e9511c;
  font-size: 12px;
  margin-top: 6px;
  font-family: Montserrat, system-ui, sans-serif;
}

.dk-form .wpcf7-spinner { margin: 0 0 0 12px; }

/* ============================================================
   Responsive
   ============================================================ */
/* Tablet (<=1280px) — single column; margin-top clears the fixed
   .ui-menu-mobile bar (shown on tablet + mobile). */
@media (max-width: 1280px) {
  .dark { grid-template-columns: 1fr; padding: 44px 24px; gap: 44px; margin-top: 115px; }
  .dk-row2 { grid-template-columns: 1fr; gap: 0; }
  .dk-addrs { grid-template-columns: 1fr; gap: 28px; }
  .dk-addrs .dk-addr:last-child { text-align: left; }
  .dk-addr p { white-space: normal; }
  .dk-l2 { text-align: left; }
}

/* Mobile (<=580px) */
@media (max-width: 580px) {
  .dark { margin-left: 10px; margin-right: 10px; margin-bottom: 10px; padding: 34px 20px; gap: 36px; }
  .dk-title { font-size: clamp(56px, 17vw, 90px); }
  .dk-note { margin-top: 4px; padding-top: 0; }
}

/* ==========================================================================
   Big screens (>=1700px) — mirrors css/big-screen.css for this page.

   Every fixed px length above is re-expressed in vw so the 1440px-reference
   design scales up proportionally instead of leaving the content marooned in
   whitespace. Conversion: 1px = 0.0694486429vw (100 / 1440). Percentages, fr
   units and ratio line-heights are left untouched.

   The clamp() display headings drop their px ceiling here: the cap started
   binding at ~1700px, which would freeze them while the rest of the page
   grew. @keyframes offsets stay in px — a media query cannot override an
   individual keyframe step.
   ========================================================================== */

@media (min-width: 1700px) {
  .eyebrow {
    gap: 0.55559vw;
    border: 0.06945vw solid #e9511c;
    border-radius: 1.04173vw;
    padding: 0.48614vw 1.11118vw;
    font-size: 0.76394vw;
    letter-spacing: 0.09723vw;
    margin-bottom: 2.36125vw;
  }

  .eyebrow::before {
    width: 0.48614vw;
    height: 0.48614vw;
  }

  .dark {
    gap: 4.86141vw;
    margin: 1.04173vw;
    padding: 1.94456vw 2.22236vw 2.22236vw;
    border-radius: 1.04173vw;
  }

  .dark .eyebrow {
    font-size: 0.97228vw;
    border-radius: 0.55559vw;
  }

  .dk-info {
    gap: 2.08346vw;
  }

  .dk-title {
    font-size: 9vw;
  }

  .dk-note {
    font-size: 0.97228vw;
  }

  /* .rich-text spacing is em-based, so it scales with the font-size above. */

  .dk-addrs {
    gap: 3.47243vw;
    margin-top: 0.97228vw;
  }

  .dk-ah {
    font-size: 0.97228vw;
    letter-spacing: 0.09723vw;
    margin: 0 0 0.69449vw;
  }

  .dk-addr p {
    font-size: 0.97228vw;
  }

  .dk-row2 {
    gap: 1.38897vw;
  }

  .dk-field {
    gap: 0.55559vw;
    margin-bottom: 1.52787vw;
  }

  .dkl {
    gap: 0.34724vw;
    font-size: 0.97228vw;
    letter-spacing: 0.08334vw;
  }

  .dk-req {
    font-size: 1.11118vw;
  }

  .dkf {
    border: 0.06945vw solid rgba(0, 0, 0, 0.28);
    border-radius: 1.04173vw;
    padding: 0.97228vw 1.25008vw;
    font-size: 0.97228vw;
  }

  .dkf:focus {
    box-shadow: 0 0 0 0.20835vw rgba(233, 81, 28, 0.18);
  }

  .dkta {
    min-height: 8.33384vw;
  }

  .dk-submit {
    gap: 0.55559vw;
    padding: 0.97228vw 1.94456vw;
  }

  .dd-btn {
    border: 0.06945vw solid rgba(0, 0, 0, 0.28);
    border-radius: 1.04173vw;
    padding: 0.97228vw 1.25008vw;
    font-size: 0.97228vw;
  }

  .dd.open .dd-btn {
    box-shadow: 0 0 0 0.20835vw rgba(233, 81, 28, 0.18);
  }

  .dd-caret {
    width: 0.97228vw;
    height: 0.62504vw;
    margin-left: 0.83338vw;
  }

  .dd-panel {
    top: calc(100% + 0.55559vw);
    border: 0.06945vw solid #70cbd3;
    border-radius: 1.04173vw;
    padding: 0.41669vw;
    box-shadow: 0 1.38897vw 3.05574vw rgba(0, 0, 0, 0.16);
  }

  .dd-opt {
    gap: 0.83338vw;
    padding: 0.76394vw 0.97228vw;
    border-radius: 0.76394vw;
    font-size: 0.97228vw;
  }

  .dd-check {
    font-size: 0.90283vw;
  }

  .dk-sent {
    gap: 0.97228vw;
    border-radius: 1.04173vw;
    padding: 4.16692vw 2.77795vw;
  }

  .dk-sent h3 {
    font-size: 2.77795vw;
  }

  .dk-sent p {
    max-width: 26.39048vw;
  }

  .dk-form .wpcf7-response-output {
    margin: 1.11118vw 0 0;
    padding: 0.83338vw 1.11118vw;
    border-radius: 0.83338vw;
    font-size: 0.90283vw;
  }

  .dk-form .wpcf7-not-valid-tip {
    font-size: 0.83338vw;
    margin-top: 0.41669vw;
  }

  .archery-field-error {
    font-size: 0.83338vw;
    margin-top: 0.41669vw;
  }

  .dk-form .wpcf7-spinner {
    margin: 0 0 0 0.83338vw;
  }
}
