/*
 Theme Name:   GeneratePress Child
 Theme URI:    https://generatepress.com
 Description:  Default GeneratePress child theme
 Author:       Tom Usborne
 Author URI:   https://tomusborne.com
 Template:     generatepress
 Version:      0.1
*/

/* WP Button */
.wp-block-button__link {
  border-radius: 0;
  display: inline-block;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.4px;
  text-decoration: none;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.wp-block-button__link::after {
  content: " →";
  font-weight: 700;
  margin-left: 6px;
}

/* Separator */
.wp-block-separator,
.wp-block-separator::before,
hr {
  border: none;
  border-top: 1px solid var(--base-2);
  margin: 2rem 0;
  opacity: 1;
}

/* =====================================================
   CONTACT FORM 7 — LAYOUT + FIELDS
===================================================== */

/* Base */
.wpcf7,
.wpcf7 * {
  box-sizing: border-box;
}

/* Grid */
.wpcf7 .cf7-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(1.25rem, 2vw, 2rem);
}

.wpcf7 .cf7-grid p {
  margin: 0;
  grid-column: span 12;
}

.wpcf7 .cf7-grid .half {
  grid-column: span 6;
}

@media (max-width: 768px) {
  .wpcf7 .cf7-grid .half {
    grid-column: span 12;
  }
}

.wpcf7 .cf7-grid .third {
  grid-column: span 4;
}

@media (max-width: 768px) {

  .wpcf7 .cf7-grid .half,
  .wpcf7 .cf7-grid .third {
    grid-column: span 12;
  }
}

/* Labels */
.wpcf7 label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--contrast-2);
  margin-bottom: 0.35rem;
}

/* Inputs / Selects / Textarea */
.wpcf7 input:not([type="submit"]),
.wpcf7 select,
.wpcf7 textarea {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  border-radius: 0;
  border: 1px solid var(--contrast-3);
  background: var(--base-3);
  color: var(--contrast);
  letter-spacing: 0.3px;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.wpcf7 input:hover,
.wpcf7 select:hover,
.wpcf7 textarea:hover {
  border-color: color-mix(in srgb, var(--contrast) 35%, transparent);
}

.wpcf7 input:focus,
.wpcf7 select:focus,
.wpcf7 textarea:focus {
  background: #fff;
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, white);
}

.wpcf7 textarea {
  min-height: 160px;
  resize: vertical;
}

/* Placeholder */
.wpcf7 ::placeholder {
  color: var(--contrast-3);
}

/* Select Chevron */
.wpcf7 select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--contrast-3) 50%),
    linear-gradient(135deg, var(--contrast-3) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-size: 10px 10px;
  background-position: right 1rem top 50%, right 0.8rem top 50%;
}

/* =====================================================
   CF7 SUBMIT BUTTON — EXACT MATCH TO WP BLOCK BUTTONS
===================================================== */

body .wpcf7 input.wpcf7-submit {
  border: none !important;
  border-radius: 0 !important;
  padding: 14px 28px !important;
  padding-right: 48px !important;

  font-size: 16px !important;
  font-weight: 600 !important;
  letter-spacing: 0.4px !important;
  text-transform: uppercase !important;

  background-color: #1E45A8 !important;
  color: #fff !important;

  cursor: pointer !important;
  display: inline-block !important;

  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
  transition: all .2s ease !important;

  /* Arrow */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' fill='white' width='14' height='14' viewBox='0 0 20 20'><path d='M7 4l6 6-6 6'/></svg>");
  background-repeat: no-repeat;
  background-position: calc(100% - 16px) center;
  background-size: 14px;
}

/* Hover */
body .wpcf7 input.wpcf7-submit:hover {
  background-color: #173A8C !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18) !important;
}

/* Mobile Full Width */
@media (max-width: 768px) {
  .wpcf7 input.wpcf7-submit {
    width: 100%;
  }
}

/* =====================================================
   VALIDATION + RESPONSES
===================================================== */

.wpcf7-not-valid-tip {
  display: none;
}

.wpcf7 form.invalid .wpcf7-not-valid-tip {
  display: block;
  margin-top: .35rem;
  font-size: .85rem;
  color: #dc2626;
}

.wpcf7 form.invalid .wpcf7-not-valid {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 2px color-mix(in oklab, #dc2626 25%, white);
}

/* Response Message */
.wpcf7-response-output {
  margin-top: 3rem;
  padding: 1.25rem 1.75rem;
  border-left: 6px solid var(--accent);
  background: var(--base-3);
  border-radius: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.wpcf7 form.sent .wpcf7-response-output {
  border-left-color: #10b981;
}

/* =====================================================
   HAMBURGER MENU CSS
===================================================== */

/* Hide default GeneratePress mobile menu icon + label */
.menu-toggle .gp-icon,
.menu-toggle .screen-reader-text {
  display: none !important;
}

body .hamburger {
  transform: scale(.5);
  padding: 0;
  line-height: 0;
  vertical-align: middle;
}

body .hamburger.is-active .hamburger-inner::after,
body .hamburger-inner,
body .hamburger-inner::before,
body .hamburger-inner::after,
body .hamburger.is-active .hamburger-inner,
body .hamburger.is-active .hamburger-inner::before,
body .hamburger.is-active .hamburger-inner::after {
  background-color: currentColor;
}

.slideout-toggle a:before,
.slide-opened .slideout-exit:not(.has-svg-icon):before,
.slideout-navigation button.slideout-exit:not(.has-svg-icon):before {
  display: none !important;
}

/* Two-line submenu style */
.main-navigation .sub-menu a {
  display: block;
  line-height: 1.3;
}

.main-navigation .sub-menu a::after {
  /* content: "(" attr(title) ")"; */
  content: attr(title);
  display: block;
  font-size: 0.85em;
  font-style: none;
  font-family: 'Figtree', sans-serif;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 2px;
}

.main-navigation .sub-menu li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  /* faint white line */
}

.main-navigation .sub-menu li:last-child {
  border-bottom: none;
}

/* MOBILE HEADER LAYOUT: logo left, hamburger right, nicely aligned */
@media (max-width: 768px) {

  /* Make the header use flex to distribute logo + hamburger */
  .site-header .inside-header.grid-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Stop logo from being auto-centered */
  .site-header .site-logo {
    margin: 0;
  }

  /* Keep the mobile nav (hamburger) on the right, not full-width */
  .site-header .mobile-menu-control-wrapper {
    margin-left: auto;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
  }

  /* Tidy up the button itself */
  .site-header .mobile-menu-control-wrapper .menu-toggle {
    padding: 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Size the hamburger so it visually matches the logo */
  .site-header .mobile-menu-control-wrapper .hamburger {
    transform: scale(0.6);
    /* tweak 0.6–0.9 to taste */
  }

  /* Keep the logo from towering on small screens */
  .site-header .site-logo img {
    max-height: 36px;
    width: auto;
  }
}

/* =====================================================
   SECONDARY BUTTON — outline variant using WP's outline style
   Hooks: core Button block "Outline" style, no manual class needed
===================================================== */

.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-outline .wp-block-button__link.wp-element-button {
  background: transparent;
  color: var(--accent, #28509f);
  border: 2px solid var(--accent, #28509f);
  box-shadow: none;
}

/* Hover converts outline to solid for clear action state */
.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link.wp-element-button:hover {
  background: var(--accent, #28509f);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* =====================================================
   RESPONSIVE BUTTON STACKING — full-width CTAs on mobile
   Hooks: any Buttons block inside normal content (no extra classes)
===================================================== */

@media (max-width: 768px) {

  /* Stack buttons in post/page content for better mobile CTAs */
  .entry-content .wp-block-buttons,
  .page-content .wp-block-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    width: 100%;
  }

  .entry-content .wp-block-buttons .wp-block-button,
  .page-content .wp-block-buttons .wp-block-button {
    flex: 1 1 100%;
  }

  .entry-content .wp-block-buttons .wp-block-button__link,
  .page-content .wp-block-buttons .wp-block-button__link {
    display: block;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}

/* =====================================================
   kenburns — Background slow-zoom motion effect
   Usage: Add class "kenburns" to any container that
   has a background image set in the block editor.
===================================================== */

.kenburns {
  position: relative;
  overflow: hidden;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Animated background overlay */
.kenburns::before {
  content: "";
  position: absolute;
  inset: 0;
  background: inherit;
  background-size: inherit;
  background-position: inherit;
  background-repeat: inherit;
  transform-origin: center;
  animation: kenburns-zoom 60s ease-in-out infinite;
  z-index: 0;
}

/* Gradient overlay so text stays readable */
.kenburns::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: linear-gradient(to bottom,
      rgba(0, 0, 0, 0.15),
      rgba(0, 0, 0, 0.30));
}

/* Ensure inner content stays above animation */
.kenburns>* {
  position: relative;
  z-index: 2;
}

/* Keyframes */
@keyframes kenburns-zoom {
  0% {
    transform: scale(1) translate(0, 0);
  }

  50% {
    transform: scale(1.22) translate(18px, 12px);
  }

  100% {
    transform: scale(1) translate(0, 0);
  }
}

/* Accessibility: stop animation if user prefers no motion */
@media (prefers-reduced-motion: reduce) {
  .kenburns::before {
    animation: none;
    transform: none;
  }
}

/* =====================================================
   FAQ — FLAT MODE (Matches Current Site Design)
===================================================== */

details {
  margin-bottom: 1.25rem !important;             /* tighter vertical rhythm */
  border-radius: 8px !important;                 /* match your other rounded elements */
  background: var(--base-3, #fff);
  border: 1px solid rgba(0,0,0,0.08) !important; /* soft, neutral border */
  box-shadow: none !important;
  padding: 0 !important;
  transition: background-color .15s ease, border-color .15s ease;
}

/* Hover — subtle, same style as your site hover states */
details:hover {
  background-color: rgba(0,0,0,0.02) !important;
  border-color: rgba(0,0,0,0.14) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Summary (Question) */
details > summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.25rem !important;              /* matches global content padding */
  padding-right: 3rem !important;

  font-weight: 600;
  line-height: 1.35 !important;
  font-size: 1.05rem !important;
  color: var(--contrast, #2a2a2a);

  border-bottom: 1px solid rgba(0,0,0,0.06) !important;
  user-select: none;
  position: relative;
}

/* Remove Chrome default marker */
details > summary::-webkit-details-marker {
  display: none;
}

/* Plus/Minus icon — matches your accent color & thickness */
details > summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent, #28509f);

  position: absolute;
  top: 50%;
  right: 1.25rem;
  transform: translateY(-50%);
  transition: transform .2s ease;
}

details[open] > summary::after {
  content: "–";
  transform: translateY(-50%);
}

/* Inner content */
details > *:not(summary) {
  padding: 0.75rem 1.25rem 1.15rem !important;
  font-size: 1rem !important;
  line-height: 1.6 !important;
  color: var(--contrast-2, #555);
}

/* Paragraph spacing */
details p {
  margin: 0.5rem 0 !important;
}

details p:first-of-type {
  margin-top: 0.35rem !important;
}

details p:last-of-type {
  margin-bottom: 0 !important;
}

/* List spacing matches your theme’s typography rhythm */
details ul,
details ol {
  margin: 0.4rem 0 0.9rem 1.2rem !important;
}

details li {
  margin-bottom: 0.3rem !important;
}

/* Remove diagonal texture (flat mode) */
details::before {
  display: none !important;
}

/* =====================================================
   JARVIS LAW — Left-Aligned Short Faint Separator
   Applies ONLY to: <hr class="wp-block-separator ... is-style-default">
===================================================== */

hr.wp-block-separator {
  border: none;
  height: 1px;
  width: 120px;                 /* short horizontal length */
  background-color: var(--contrast);
  opacity: 0.18;                /* faint, subtle */
  margin: 2.5rem 0;             /* space above & below, left aligned */
  padding: 0;
}
