/*
 * WordPress-only rules, on top of css/site.css (the Next.js design, generated).
 */

/* Fonts come from Google Fonts here instead of next/font. */
:root {
  --font-montserrat: "Montserrat";
  --font-inter: "Inter";
}

/* Later pages in the same visit skip the intro screen (see inc/setup.php). */
html[data-intro] .intro {
  display: none;
}

/* Photo wall tiles: next/image "fill" positioned these inline. */
.xh-tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Logged-in visitors: keep the fixed header below the WordPress admin bar. */
.admin-bar .site-header {
  top: 32px;
}

.admin-bar .mobile-menu {
  inset: calc(var(--header-h) + 32px) 0 0;
}

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

  .admin-bar .mobile-menu {
    inset: calc(var(--header-h) + 46px) 0 0;
  }

  /* The admin bar scrolls away on phones */
  #wpadminbar {
    position: fixed;
  }
}

/* ================= Header menu ================= */

/* The WordPress menu has more and longer items than the design's, so labels stay on one
   line and the header switches to the menu button sooner (the design does it at 1023px). */
.site-nav__link {
  white-space: nowrap;
}

@media (max-width: 1239px) {
  .site-nav {
    display: none;
  }

  .site-header__toggle {
    display: block;
  }
}

/* Dropdowns (menu items with children) */

.site-nav__has-sub {
  position: relative;
}

.site-nav__has-sub > .site-nav__link {
  padding-right: 0.9rem;
}

.site-nav__has-sub > .site-nav__link::before {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  width: 0.36rem;
  height: 0.36rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-70%) rotate(45deg);
}

.site-nav__sub {
  position: absolute;
  top: 100%;
  left: -1rem;
  z-index: 5;
  min-width: 13rem;
  padding: 0.5rem 0;
  border: 1px solid var(--rule-dark);
  border-radius: 0.5rem;
  background: rgba(11, 11, 11, 0.97);
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  translate: 0 0.4rem;
  transition:
    opacity var(--dur-ui) ease,
    translate var(--dur-ui) var(--ease-out),
    visibility var(--dur-ui);
}

.site-nav__has-sub:hover > .site-nav__sub,
.site-nav__has-sub:focus-within > .site-nav__sub {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
}

.site-nav__sublink {
  display: block;
  padding: 0.5rem 1rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--fs-small);
  text-transform: capitalize;
  transition: color var(--dur-ui) ease;
}

.site-nav__sublink:hover,
.site-nav__sublink:focus-visible,
.site-nav__sublink[aria-current="page"] {
  color: var(--white);
}

.mobile-menu__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin: 0.25rem 0 0.75rem;
}

.mobile-menu__sublink {
  color: rgba(255, 255, 255, 0.7);
}

.mobile-menu__sublink[aria-current="page"] {
  color: var(--white);
}

/* ================= Pages not built from XOXO blocks yet ================= */

.xoxo-page-hero {
  padding-top: calc(var(--header-h) + var(--section-y) * 0.6);
}

.xoxo-page-hero__lead {
  max-width: 40rem;
  margin-top: 1.25rem;
}

.xoxo-content {
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.7;
}

.xoxo-content > * + * {
  margin-top: 1.25rem;
}

.xoxo-content h2,
.xoxo-content h3,
.xoxo-content h4 {
  font-family: var(--font-display);
  letter-spacing: var(--ls-display);
  line-height: 1.15;
  margin-top: 2.5rem;
}

.xoxo-content ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.xoxo-content ol {
  list-style: decimal;
  padding-left: 1.25rem;
}

.xoxo-content a {
  color: var(--red);
  text-decoration: underline;
}

.xoxo-content__image {
  width: 100%;
  height: auto;
  border-radius: 1rem;
}

/* ================= Text with photo (blocks/text-photo.php) ================= */

.xoxo-text-photo__body + .xoxo-text-photo__body {
  margin-top: 1rem;
}

.xoxo-text-photo .display + .xoxo-text-photo__body {
  margin-top: 1.25rem;
}

.xoxo-text-photo__actions {
  margin-top: 2rem;
}

.xoxo-text-photo__figure img {
  aspect-ratio: 6 / 5;
  object-fit: cover;
}

@media (min-width: 861px) {
  .xoxo-text-photo--flip .xoxo-text-photo__figure {
    order: -1;
  }
}

/* ================= SureForms form in the design's style (blocks/enquiry.php) ================= */

/* The form's colours point at Astra's colour settings; give them the design's red and ink. */
.xoxo-srfm {
  --ast-global-color-0: #cc2b3e;
  --ast-global-color-2: #111111;
}

.xoxo-srfm .srfm-form-container {
  --srfm-bg-color: transparent;
  --srfm-row-gap-between-blocks: 1.75rem;
  --srfm-input-field-padding: 0.75rem 0;
  --srfm-input-field-font-size: var(--fs-body);
  --srfm-color-input-placeholder: var(--muted);
  --srfm-color-input-background: transparent;
  --srfm-color-input-background-hover: transparent;
  --srfm-color-input-border: var(--rule);
  --srfm-color-input-border-hover: var(--red);
  --srfm-color-input-border-focus-glow: transparent;
  --srfm-btn-color-hover: var(--red-dark);
  font-family: var(--font-body);
}

/* Fields: a single underline, as in the design's enquiry form */
.xoxo-srfm .srfm-input-common {
  border: 0 !important;
  border-bottom: 1px solid var(--rule) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0.75rem 0 !important;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--ink);
  transition: border-color var(--dur-ui) ease;
}

.xoxo-srfm .srfm-input-common::placeholder {
  color: var(--muted);
  opacity: 1;
}

.xoxo-srfm .srfm-input-common:focus {
  outline: none;
  border-bottom-color: var(--red) !important;
}

.xoxo-srfm textarea.srfm-input-common {
  min-height: 8.75rem;
  resize: vertical;
}

.xoxo-srfm .srfm-error-message {
  font-size: var(--fs-small);
}

/* Submit: the design's red pill button */
.xoxo-srfm .srfm-submit-container {
  margin-top: 0.75rem;
}

.xoxo-srfm #srfm-submit-btn.srfm-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 3.25rem;
  padding: 0 1.75rem !important;
  border: 1px solid var(--red) !important;
  border-radius: 0 !important;
  line-height: 1.6;
  background: var(--red) !important;
  color: var(--white) !important;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color var(--dur-ui) ease,
    border-color var(--dur-ui) ease;
}

.xoxo-srfm #srfm-submit-btn.srfm-button:hover,
.xoxo-srfm #srfm-submit-btn.srfm-button:focus-visible {
  background: var(--red-dark) !important;
  border-color: var(--red-dark) !important;
}

.xoxo-srfm .srfm-submit-wrap::after {
  content: "→";
  margin-left: 0.5em;
}

/* ================= FAQ (blocks/faq.php) ================= */

.faq-list {
  border-top: 1px solid var(--rule);
}

.faq {
  border-bottom: 1px solid var(--rule);
}

.faq__q {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) 1.5rem;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0;
  cursor: pointer;
  list-style: none;
}

.faq__q::-webkit-details-marker {
  display: none;
}

.faq__q .index {
  color: var(--red);
}

.faq__title {
  transition: color var(--dur-ui) ease;
}

.faq__q:hover .faq__title,
.faq__q:focus-visible .faq__title {
  color: var(--red);
}

.faq__q:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 4px;
}

/* Plus that turns into a minus */
.faq__icon {
  position: relative;
  width: 1.25rem;
  height: 1.25rem;
  justify-self: end;
}

.faq__icon::before,
.faq__icon::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--red);
  transition: transform var(--dur-ui) var(--ease-out);
}

.faq__icon::after {
  transform: rotate(90deg);
}

.faq[open] .faq__icon::after {
  transform: rotate(0deg);
}

.faq__a {
  max-width: 46rem;
  padding: 0 2.5rem 1.75rem 4.5rem;
}

.faq__a p + p {
  margin-top: 0.75rem;
}

@media (max-width: 599px) {
  .faq__q {
    grid-template-columns: 2.25rem minmax(0, 1fr) 1.25rem;
    gap: 0.75rem;
  }

  .faq__a {
    padding: 0 0 1.5rem 3rem;
  }
}

/* ================= Topic cards (blocks/topic-grid.php) ================= */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--col-gap);
}

.topic {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
}

.topic__media img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.topic__body {
  padding: clamp(1.25rem, 2vw, 1.75rem);
}

.topic__name {
  margin-top: 0.5rem;
}

.topic__list {
  margin-top: 1rem;
  font-size: var(--fs-small);
  line-height: 1.55;
}

.topic__list li {
  padding: 0.7rem 0;
  border-top: 1px solid var(--rule);
  color: var(--muted);
}

.topic__list a {
  color: inherit;
}

@media (max-width: 1023px) {
  .topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 639px) {
  .topic-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= Social icon links (helpers.php xoxo_social_links) ================= */

.social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.social-links__link {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: var(--white);
  transition:
    background-color var(--dur-ui) ease,
    border-color var(--dur-ui) ease,
    color var(--dur-ui) ease;
}

.social-links__link svg {
  width: 1.125rem;
  height: 1.125rem;
}

.social-links .social-links__link:hover,
.social-links .social-links__link:focus-visible {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

/* Under each client's name in the Reels row (blocks/reels.php). Tiles in the row share one
   height, so pinning the icons to the bottom keeps them level when a name wraps to two lines. */
.reel {
  display: flex;
  flex-direction: column;
}

/* Sized so all four (Instagram, Facebook, LinkedIn, X) fit one row in the narrowest 150px tile. */
.reel__social {
  gap: 0.375rem;
  margin-top: auto;
  padding-top: 0.875rem;
}

.reel__social .social-links__link {
  width: 2rem;
  height: 2rem;
}

.reel__social .social-links__link svg {
  width: 0.9375rem;
  height: 0.9375rem;
}

/* Privacy Policy link beside the copyright line */
.footer-bottom__link {
  color: inherit;
  transition: color var(--dur-ui) ease;
}

.footer-bottom__link:hover,
.footer-bottom__link:focus-visible {
  color: var(--red);
}

/* Reel tiles that link to the reel */
a.reel__tile {
  color: inherit;
}
