/*
Theme Name: Quiet Confidence
Theme URI: https://www.quietconfidence.co.uk
Author: Quiet Confidence
Description: A custom block theme for the Quiet Confidence Recalibration Programme. All content is editable via the WordPress Site Editor.
Version: 1.0.2
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: quietconfidence
*/

/* Newsletter form layout (Contact Form 7) */
.qc-newsletter-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr auto;
  gap: 0;
  align-items: stretch;
  max-width: 760px;
  margin: 1.25rem auto 0;
  border: 1px solid #ddd;
  position: relative;
}
.qc-newsletter-form .wpcf7-form-control-wrap { display: contents; }
.qc-newsletter-form input,
.qc-newsletter-form input[type="text"],
.qc-newsletter-form input[type="email"],
.qc-newsletter-form input[type="submit"] {
  box-sizing: border-box;
}
.qc-newsletter-form input[type="text"],
.qc-newsletter-form input[type="email"] {
  width: 100%;
  min-width: 0;
  padding: 1rem 1.1rem;
  border: 0;
  border-right: 1px solid #ddd;
  background: transparent;
  font: inherit;
  color: #222;
  outline: none;
}
.qc-newsletter-form input::placeholder { color: #9f9d9d; }
.qc-newsletter-form input:focus { background: #fafafa; }
.qc-newsletter-form input[type="submit"] {
  padding: 1rem 1.5rem;
  border: 0;
  background: transparent;
  font: 700 0.85rem/1 'Source Sans 3','Proxima Nova','Helvetica Neue',Arial,sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111;
  cursor: pointer;
  white-space: nowrap;
}
.qc-newsletter-form input[type="submit"]:hover { color: #facf33; background: #111; }
/* Pull spinner out of the grid so it can't create an empty second row */
.qc-newsletter-form .wpcf7-spinner {
  position: absolute;
  right: -2rem;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
}
@media (max-width: 720px) {
  .qc-newsletter-form { grid-template-columns: 1fr; }
  .qc-newsletter-form input[type="text"],
  .qc-newsletter-form input[type="email"] { border-right: 0; border-bottom: 1px solid #ddd; }
  .qc-newsletter-form input[type="submit"] { background: #facf33; }
}

/* CF7 response & validation messages should sit below the form, not break layout */
.wpcf7 form .wpcf7-response-output { max-width: 760px; margin: 1rem auto 0; text-align: center; }
.wpcf7-not-valid-tip { display: block; padding: 0.4rem 1rem; font-size: 0.8rem; }

/* Apply / Application form — single column, generous spacing, restrained inputs */
.qc-apply-form { display: block; max-width: 100%; }
.qc-apply-form p { margin: 0 0 1.25rem; }
.qc-apply-form label {
  display: block;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #1a1a1a;
}
.qc-apply-form .wpcf7-form-control-wrap { display: block; margin-top: 0.5rem; }
.qc-apply-form input[type="text"],
.qc-apply-form input[type="email"],
.qc-apply-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.9rem;
  font: inherit;
  font-size: 1rem;
  color: #111;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 0;
  outline: none;
}
.qc-apply-form textarea {
  min-height: 7rem;
  line-height: 1.55;
  resize: vertical;
}
.qc-apply-form input[type="text"]:focus,
.qc-apply-form input[type="email"]:focus,
.qc-apply-form textarea:focus {
  border-color: #111;
  background: #fafafa;
}
.qc-apply-form .wpcf7-radio { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 0.5rem; }
.qc-apply-form .wpcf7-radio .wpcf7-list-item { margin: 0; }
.qc-apply-form .wpcf7-radio label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  color: #2a2a2a;
}
.qc-apply-form input[type="submit"] {
  margin-top: 0.5rem;
  padding: 0.85rem 1.6rem;
  font: inherit;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  background: #111;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.qc-apply-form input[type="submit"]:hover { color: #facf33; background: #000; }
.qc-apply-form .wpcf7-spinner { display: none; }

/* Arrow links used on Insights page */
.qc-arrow-link { color: #2c5d9a; text-decoration: none; }
.qc-arrow-link:hover { text-decoration: underline; }
.qc-arrow-link strong { font-weight: 600; }

/* Results page testimonial grid */
.qc-testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.qc-testimonial-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.35rem 1.25rem;
  border: 1px solid #e2e2e2;
  border-radius: 18px;
  background: #fff;
}
.qc-testimonial-body {
  display: grid;
  grid-template-columns: 76px 1fr;
  column-gap: 0.9rem;
  align-items: start;
}
.qc-testimonial-photo {
  width: 76px;
  height: 76px;
  border-radius: 14px;
  object-fit: cover;
  display: block;
}
.qc-testimonial-quote {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #1a1a1a;
}
.qc-testimonial-name {
  margin: 0.85rem 0 0;
  text-align: right;
  font-size: 0.82rem;
  color: #6b6b6b;
}
@media (max-width: 900px) {
  .qc-testimonial-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .qc-testimonial-grid { grid-template-columns: 1fr; }
}

/* Articles archive grid */
.wp-block-query .qc-articles-grid {
  list-style: none;
  margin: 0;
  padding: 0;
}
.qc-article-card {
  background: transparent;
}
.qc-article-card .wp-block-post-featured-image {
  margin: 0 0 0.85rem;
  display: block;
}
.qc-article-card .wp-block-post-featured-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}
.qc-article-card .wp-block-post-title {
  margin: 0;
  font-family: "Libre Franklin", "Source Sans 3", system-ui, sans-serif;
}
.qc-article-card .wp-block-post-title a {
  color: #111;
  text-decoration: none;
}
.qc-article-card .wp-block-post-title a:hover {
  color: #555;
}
.qc-article-card .wp-block-post-excerpt {
  margin: 0;
  color: #2a2a2a;
}
.qc-article-card .wp-block-post-excerpt__more-link {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 600;
  color: #111;
  text-decoration: none;
}
.qc-article-card .wp-block-post-excerpt__more-link:hover {
  text-decoration: underline;
}
.qc-article-card .qc-article-meta {
  gap: 0.4rem;
  align-items: baseline;
}
.qc-article-card .qc-article-meta p,
.qc-article-card .qc-article-meta time,
.qc-article-card .qc-article-meta a {
  margin: 0;
  font-size: 0.78rem !important;
  color: #6b6b6b;
  text-decoration: none;
}

/* Single article styling */
.qc-article-meta { gap: 0.5rem; align-items: baseline; }
.qc-article-meta p,
.qc-article-meta time,
.qc-article-meta a {
  margin: 0;
  color: #6b6b6b;
  text-decoration: none;
}

/* Section dividers — full bleed thin grey line, matching the original's quiet rhythm */
.wp-block-separator.is-style-wide {
  border: 0;
  border-top: 1px solid var(--wp--preset--color--rule);
  opacity: 1;
  max-width: none;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

/* Quote styling: italic body, em-dash attribution beneath, grey */
.wp-block-quote {
  border-left: 0;
  padding: 0;
  margin: 1.25rem 0;
}
.wp-block-quote p { font-style: italic; font-size: 0.95rem; line-height: 1.65; color: #2a2a2a; }
.wp-block-quote cite {
  display: block;
  margin-top: 0.6rem;
  font-style: normal;
  font-size: 0.85rem;
  color: #6b6b6b;
  letter-spacing: 0.01em;
}

/* Header polish */
header.wp-block-group .wp-block-site-logo img { display: block; }
header.wp-block-group .wp-block-navigation .wp-block-navigation-item__content {
  font-weight: 400;
  color: #555;
  font-size: 0.9rem;
}
header.wp-block-group .wp-block-navigation .wp-block-navigation-item__content:hover {
  color: #111;
}

/* Social icons — black squares like the original */
header .wp-block-social-links.is-style-default .wp-block-social-link {
  background: #111;
  border-radius: 0;
}
header .wp-block-social-links.is-style-default .wp-block-social-link a { color: #fff; }

/* Keep social icons on a single line (not a 2x2 grid) on mobile */
header .wp-block-social-links {
  flex-wrap: nowrap;
}

/* Sticky top menu */
header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--wp--preset--color--base);
}

/* Offset the sticky header below the WP admin bar when logged in,
   so it isn't clipped (appearing to "shrink") on scroll. */
.admin-bar header.wp-block-template-part {
  top: 32px;
}
@media screen and (max-width: 782px) {
  .admin-bar header.wp-block-template-part {
    top: 46px;
  }
}
/* At <=600px the WP admin bar becomes position:absolute (scrolls away with
   the page) instead of fixed, so any offset here leaves a gap above the
   sticky header. Stick it flush to the top. */
@media screen and (max-width: 600px) {
  .admin-bar header.wp-block-template-part {
    top: 0;
  }
}

/* Mobile overlay (dropdown) menu — match the live site: inset from the
   screen edges with yellow pill links, so nothing is clipped at the margins. */
header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
  padding: 2.25rem;             /* 36px inset all round, matching the live site */
  align-items: flex-start;
}
header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
  gap: 0.5rem;                  /* tight vertical spacing like the live site */
  align-items: flex-start;
}
header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item__content {
  background-color: var(--wp--preset--color--accent);
  color: #000;
  font-size: 1rem;              /* 16px */
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  /* higher specificity than core so the pill padding actually applies */
  padding: 0.75rem 1.125rem;    /* 12px 18px pill, matching the live site */
  border-radius: 3px;
}
header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
  color: #000;
  text-decoration: none;
}
/* Close (X): pull it in from the corner and give it a larger tap target. */
header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
  top: 1.25rem;
  right: 1.25rem;
  width: 44px;
  height: 44px;
  padding: 10px;
}

/* Hero pair — thin grey border around each square as in the original */
.wp-block-image.has-custom-border img {
  display: block;
  width: 100%;
  height: auto;
}

/* Headings inside the body sections — slightly tighter line-height like Squarespace original */
main h2 { letter-spacing: -0.005em; }
main h2 + h2 { margin-top: 0.1rem; }

/* Buttons: match the small uppercase yellow CTA pill from the original */
.wp-block-button .wp-block-button__link {
  border-radius: 2px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.85rem 1.4rem;
}

/* Body paragraphs — original uses tight tracking and 1.5 leading */
main p { color: #222; }
main ul li { margin-bottom: 0.25rem; }

/* Body copy sized to match the live site (18px). The theme's root font is
   fluid, which shrank body text to ~14px on mobile; this pins it back to
   1.125rem. Paragraphs inside blockquotes are excluded so the testimonial
   quotes stay smaller than the main body copy. */
main :not(blockquote) > p,
main li {
  font-size: 1.125rem;
}

/* The Method "> ..." lines should look like neat list items, not a wrapped paragraph */
main .wp-block-paragraph,
main p { line-height: 1.6; }
