/*
Theme Name: CEO Access - Devjoy
Theme URI: https://ceoaccess.co.uk
Author: Devjoy
Author URI: https://devjoy.co.uk
Description: WordPress theme for CEÒ Access — technical access, inspection and rescue specialists. Pixel-faithful port of the React design with ACF blocks for content editing.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ceo-access-devjoy
Tags: custom-logo, custom-menu, editor-style, block-styles, wide-blocks
*/

/* Front-end styles are enqueued from assets/css/main.css */

/*
 * WordPress global styles output unlayered `a { text-decoration: underline }`
 * which beats Tailwind utilities inside @layer. Reset here (also unlayered).
 */
a:where(:not(.wp-element-button)) {
  text-decoration: inherit;
}

/* WordPress nav menus output <li> items — strip default list bullets. */
#site-header nav ul,
#mobile-nav-panel ul,
footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#site-header nav li,
#mobile-nav-panel li,
footer ul li {
  list-style: none;
}

/*
 * Admin bar: the site header is position:fixed at top:0, so the logged-in
 * toolbar would sit on top of the nav. Offset the fixed header below the
 * toolbar so the admin bar stays above the header, and account for the
 * height difference in the full-height mobile nav panel.
 */
body.admin-bar #site-header {
  top: 32px;
}

body.admin-bar #mobile-nav-panel > div {
  min-height: calc(100dvh - 4rem - 32px);
}

@media (min-width: 768px) {
  body.admin-bar #mobile-nav-panel > div {
    min-height: calc(100dvh - 5rem - 32px);
  }
}

@media screen and (max-width: 782px) {
  body.admin-bar #site-header {
    top: 46px;
  }

  body.admin-bar #mobile-nav-panel > div {
    min-height: calc(100dvh - 4rem - 46px);
  }
}

/*
 * Contact Form 7 — mirror the theme enquiry form (EnquiryForm.tsx).
 * Self-contained CSS: CF7 markup is stored in the database and is outside the
 * Tailwind compile source, so the form is styled here with plain CSS.
 */
.ceo-access-cf7-wrap .wpcf7-form,
.ceo-access-enquiry-form {
  display: grid;
  gap: 2rem;
}

.ceo-access-cf7-wrap .ceo-access-cf7-grid {
  display: grid;
  gap: 2rem;
}

@media (min-width: 768px) {
  .ceo-access-cf7-wrap .ceo-access-cf7-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ceo-access-cf7-wrap .ceo-access-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ceo-access-cf7-wrap .ceo-access-field--full {
  width: 100%;
}

/* Defensive: keep any residual CF7 control wrapper full-width in the flex column */
.ceo-access-cf7-wrap .wpcf7-form-control-wrap {
  display: block;
  width: 100%;
}

.ceo-access-cf7-wrap .ceo-access-label,
.ceo-access-enquiry-form .ceo-access-label {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.ceo-access-cf7-wrap .ceo-access-input,
.ceo-access-cf7-wrap .ceo-access-select,
.ceo-access-cf7-wrap .ceo-access-textarea,
.ceo-access-enquiry-form .ceo-access-input,
.ceo-access-enquiry-form .ceo-access-select,
.ceo-access-enquiry-form .ceo-access-textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  background: transparent;
  padding: 1rem 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--foreground);
  transition: border-color 0.2s ease;
}

.ceo-access-cf7-wrap .ceo-access-input::placeholder,
.ceo-access-cf7-wrap .ceo-access-textarea::placeholder,
.ceo-access-enquiry-form .ceo-access-input::placeholder,
.ceo-access-enquiry-form .ceo-access-textarea::placeholder {
  color: color-mix(in srgb, var(--muted-foreground) 60%, transparent);
}

.ceo-access-cf7-wrap .ceo-access-select,
.ceo-access-enquiry-form .ceo-access-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 1.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}

.ceo-access-cf7-wrap .ceo-access-select option {
  background: var(--background);
  color: var(--foreground);
}

.ceo-access-cf7-wrap .ceo-access-input:focus,
.ceo-access-cf7-wrap .ceo-access-select:focus,
.ceo-access-cf7-wrap .ceo-access-textarea:focus,
.ceo-access-enquiry-form .ceo-access-input:focus,
.ceo-access-enquiry-form .ceo-access-select:focus,
.ceo-access-enquiry-form .ceo-access-textarea:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: none;
}

.ceo-access-cf7-wrap .ceo-access-textarea,
.ceo-access-enquiry-form .ceo-access-textarea {
  resize: none;
}

.ceo-access-cf7-wrap .ceo-access-cf7-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 1rem;
}

.ceo-access-cf7-wrap .ceo-access-cf7-consent {
  max-width: 28rem;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.ceo-access-cf7-wrap .ceo-access-submit,
.ceo-access-enquiry-form .ceo-access-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--primary);
  background: var(--primary);
  padding: 1rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--primary-foreground);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ceo-access-cf7-wrap .ceo-access-submit:hover,
.ceo-access-enquiry-form .ceo-access-submit:hover {
  background: transparent;
  color: var(--primary);
}

.ceo-access-cf7-wrap .ceo-access-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

/* CF7 injects a spinner + AJAX loader after the submit control */
.ceo-access-cf7-wrap .wpcf7-spinner {
  margin: 0 0 0 0.75rem;
}

.ceo-access-cf7-wrap .wpcf7-not-valid-tip {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: var(--primary);
}

.ceo-access-cf7-wrap .ceo-access-input.wpcf7-not-valid,
.ceo-access-cf7-wrap .ceo-access-select.wpcf7-not-valid,
.ceo-access-cf7-wrap .ceo-access-textarea.wpcf7-not-valid {
  border-color: var(--primary);
}

/* Hide the response box until CF7 sets a status class (avoids an empty box). */
.ceo-access-cf7-wrap .wpcf7-response-output {
  display: none;
  margin: 0 0 1.5rem;
  border: 1px solid var(--hairline);
  background: var(--surface);
  padding: 1.5rem;
  font-size: 0.875rem;
  color: var(--foreground);
}

.ceo-access-cf7-wrap .wpcf7-response-output.wpcf7-mail-sent-ok,
.ceo-access-cf7-wrap .wpcf7-response-output.wpcf7-mail-sent-ng,
.ceo-access-cf7-wrap .wpcf7-response-output.wpcf7-validation-errors,
.ceo-access-cf7-wrap .wpcf7-response-output.wpcf7-spam-blocked,
.ceo-access-cf7-wrap .wpcf7-response-output.wpcf7-acceptance-missing,
.ceo-access-cf7-wrap .wpcf7-response-output.wpcf7-aborted {
  display: block;
}

.ceo-access-cf7-wrap .wpcf7-response-output.wpcf7-mail-sent-ok {
  border-color: var(--primary);
}

/* Prose / rich-text content (legal & long-form pages). */
.ceo-access-prose > * + * {
  margin-top: 1.25rem;
}

.ceo-access-prose h2,
.ceo-access-prose h3,
.ceo-access-prose h4 {
  margin-top: 2.5rem;
  color: var(--foreground);
  font-family: var(--font-display, inherit);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.ceo-access-prose h2 {
  font-size: 1.6rem;
}

.ceo-access-prose h3 {
  font-size: 1.25rem;
}

.ceo-access-prose h4 {
  font-size: 1.05rem;
}

.ceo-access-prose p,
.ceo-access-prose li {
  color: var(--muted-foreground);
}

.ceo-access-prose a {
  color: var(--foreground);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ceo-access-prose a:hover {
  color: var(--primary);
}

.ceo-access-prose ul,
.ceo-access-prose ol {
  padding-left: 1.25rem;
}

.ceo-access-prose ul {
  list-style: disc;
}

.ceo-access-prose ol {
  list-style: decimal;
}

.ceo-access-prose li + li {
  margin-top: 0.5rem;
}

.ceo-access-prose strong {
  color: var(--foreground);
  font-weight: 600;
}

.ceo-access-prose blockquote {
  border-left: 2px solid var(--primary);
  padding-left: 1.25rem;
  color: var(--foreground);
}
