/*
 * Styles for the components this theme adds on top of the reference design.
 *
 * The reference templates were static markup with no form handling, no search
 * and no related-posts block, so those pieces have no styles of their own.
 * Everything here is written against the design's existing variables and
 * spacing so the additions read as part of the same system.
 *
 * Loaded after assets/style.css and assets/css/blog.css.
 */

/* =======================================================================
   Form validation and status messaging
   ==================================================================== */

.dm-error {
  display: none;
  margin-top: 6px;
  color: #e43d5c;
  font-size: 13px;
  line-height: 1.4;
}

.dm-error[data-has-error] {
  display: block;
}

/* Red ring on the field itself, not just the message below it. */
.iapp-form [aria-invalid="true"] {
  border-color: #e43d5c !important;
  box-shadow: 0 0 0 3px rgba(228, 61, 92, 0.12) !important;
}

.iapp-form-status {
  margin: 14px 0 0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.iapp-form-status.is-success {
  background: #e3f5e9;
  border: 1px solid #b7e4c7;
  color: #12703a;
}

.iapp-form-status.is-error {
  background: #fdecef;
  border: 1px solid #f5c2cc;
  color: #a4262c;
}

/* The footer subscribe form is a flex row; its status sits underneath. */
.ft-subscribe-status {
  margin-top: 10px;
  font-size: 13px;
  padding: 8px 12px;
}

.iapp-form button[disabled] {
  opacity: 0.6;
  cursor: progress;
}

/* Inline [iapp_contact_form] inside post content. */
.iapp-inline-form {
  margin: 40px 0;
}

/* =======================================================================
   Blog search
   ==================================================================== */

.tw-blogsearch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  margin: 28px auto 0;
  padding: 6px 6px 6px 44px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.tw-blogsearch__icon {
  position: absolute;
  left: 16px;
  display: flex;
  color: #5c6e8c;
  pointer-events: none;
}

.tw-blogsearch__icon .tw-icon {
  width: 18px;
  height: 18px;
}

.tw-blogsearch__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: inherit;
  outline: none;
}

.tw-blogsearch__input::placeholder {
  color: #8a97ab;
}

/* Brand tokens, not hand-picked hexes: this pill sits directly under the
   "Insights & Ideas" heading and beside the header's "Book a Demo" button, so
   an off-brand blue reads as a mismatch. */
.tw-blogsearch__submit {
  flex: 0 0 auto;
  padding: 10px 22px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.tw-blogsearch__submit:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.tw-blogsearch:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 104, 255, 0.16);
}

@media (max-width: 600px) {
  .tw-blogsearch {
    padding-left: 40px;
  }

  .tw-blogsearch__submit {
    padding: 10px 16px;
  }
}

/* =======================================================================
   Related posts
   ==================================================================== */

.tw-related {
  padding-top: 8px;
}

.tw-related .tw-rows {
  display: grid;
  gap: 28px;
}

/* =======================================================================
   Copy-link button fix

   blog.css normalises form controls inside the article with
   `.tw-main button, .tw-main input, .tw-main select { font: inherit; color: inherit }`.
   That selector is more specific than `.tw-share__btn`, so the button's own
   white text and 13px size lose the cascade and the label renders dark-on-dark
   — invisible. The same happens in the original static templates.

   Restoring the intended values here (components.css loads last) rather than
   editing blog.css keeps the vendored design file byte-identical to source.
   ==================================================================== */

.tw-main .tw-share__btn {
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.tw-main .tw-share__btn .tw-icon {
  color: currentColor;
}

/* =======================================================================
   Comments

   WordPress' comment_form() emits its own markup, which the reference design
   never had to style. These rules bring it in line with the article column.
   ==================================================================== */

.tw-comments {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
}

.tw-comments__title,
.tw-comments .comment-reply-title {
  margin: 0 0 20px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
}

.tw-comments__list {
  margin: 0 0 32px;
  padding: 0;
  list-style: none;
}

.tw-comments__list ol,
.tw-comments__list ul {
  list-style: none;
  padding-left: 24px;
}

.tw-comments__list .comment-body {
  padding: 16px 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.tw-comments__list .comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.tw-comments__list .comment-author img {
  border-radius: 50%;
}

.tw-comments__list .comment-metadata {
  margin-bottom: 8px;
  font-size: 13px;
  color: #5c6e8c;
}

.tw-comments__closed {
  color: #5c6e8c;
  font-style: italic;
}

/* ---- the form itself ---- */

.tw-comments .comment-respond {
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  background: #fff;
}

.tw-comments .comment-form p {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 18px;
}

.tw-comments .comment-form label {
  order: -1; /* WordPress prints the label after the field on some rows. */
  font-size: 14px;
  font-weight: 600;
  color: #1d2327;
}

.tw-comments .comment-form input[type="text"],
.tw-comments .comment-form input[type="email"],
.tw-comments .comment-form input[type="url"],
.tw-comments .comment-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 10px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tw-comments .comment-form textarea {
  min-height: 150px;
  resize: vertical;
}

.tw-comments .comment-form input:focus,
.tw-comments .comment-form textarea:focus {
  outline: none;
  border-color: #1431cf;
  box-shadow: 0 0 0 3px rgba(20, 49, 207, 0.12);
}

/*
 * The "remember me" row is a checkbox followed by its label, so it stays a
 * row. The selector repeats the `p` from the rule above — without it the
 * column direction set there would win on specificity.
 */
.tw-comments .comment-form p.comment-form-cookies-consent {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.tw-comments .comment-form p.comment-form-cookies-consent input {
  flex: 0 0 auto;
  width: auto;
  margin: 0;
}

.tw-comments .comment-form p.comment-form-cookies-consent label {
  order: 0;
  font-weight: 400;
  font-size: 14px;
}

.tw-comments .comment-notes,
.tw-comments .logged-in-as {
  margin-bottom: 18px;
  font-size: 14px;
  color: #5c6e8c;
}

/* The rows are flex columns, whose default `stretch` would make the button
   span the full width. Pin it to its own size instead. */
.tw-comments .comment-form p.form-submit {
  align-items: flex-start;
  margin-bottom: 0;
}

.tw-comments .form-submit input[type="submit"] {
  width: auto;
  padding: 12px 32px;
  border: 0;
  border-radius: 9999px;
  background: #1431cf;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.tw-comments .form-submit input[type="submit"]:hover {
  background: #2563eb;
  transform: translateY(-1px);
}

@media (max-width: 600px) {
  .tw-comments .comment-respond {
    padding: 20px;
  }

  .tw-comments .form-submit input[type="submit"] {
    width: 100%;
  }
}

/* =======================================================================
   Inline CTA banner ([cta_banner])
   ==================================================================== */

.custom-cta-banner {
  margin: 40px 0;
  padding: 50px 30px;
  border-radius: 16px;
  background-color: #000;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.custom-cta-banner .cta-title {
  margin: 0 0 25px;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.4;
}

.custom-cta-banner .cta-btn {
  display: inline-block;
  padding: 12px 40px;
  border: 0;
  border-radius: 30px;
  background-color: #1431cf;
  color: #fff !important;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(20, 49, 207, 0.3);
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-cta-banner .cta-btn:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.custom-cta-banner .cta-btn:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .custom-cta-banner {
    padding: 35px 20px;
  }

  .custom-cta-banner .cta-title {
    margin-bottom: 20px;
    font-size: 20px;
  }

  .custom-cta-banner .cta-btn {
    padding: 10px 30px;
    font-size: 15px;
  }
}

/* =======================================================================
   WordPress core output inside article content
   ==================================================================== */

.blog-content .alignleft {
  float: left;
  margin: 0 24px 16px 0;
}

.blog-content .alignright {
  float: right;
  margin: 0 0 16px 24px;
}

.blog-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.blog-content img,
.blog-content iframe {
  max-width: 100%;
  height: auto;
}

.blog-content .wp-caption-text {
  color: #5c6e8c;
  font-size: 13px;
  text-align: center;
}

/* Wide content must scroll inside itself, never widen the page. */
.blog-content table,
.tw-table-scroll {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

/* =======================================================================
   Accessibility helpers
   ==================================================================== */

.screen-reader-text,
.dm-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100000;
  width: auto;
  height: auto;
  padding: 12px 20px;
  clip: auto;
  clip-path: none;
  border-radius: 8px;
  background: #1431cf;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

/* Respect a reduced-motion preference across the animated sections. */
@media (prefers-reduced-motion: reduce) {
  .marquee-track,
  .ft-ticker-track,
  .slider-track,
  .hero-float,
  .seal-text {
    animation: none !important;
    transition: none !important;
  }
}
