/*
Theme Name: UK Business Blog
Theme URI: https://uk-business.blog/
Author: UK Business Blog
Description: WordPress conversion of the supplied UK Business. Blog React/Vite magazine design. Includes WordPress-native posts, categories, menus, author profiles, search, policy pages and demo content.
Version: 2.0.5
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Text Domain: uk-business-blog
*/


/* Single-post published/updated metadata */
.ubb-post-date-meta {
  display: none;
}

@media (min-width: 640px) {
  .ubb-post-date-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
}


/* Larger single-post article headings. Font weights are controlled in
   Appearance > Customize > Single Post Typography. */
.single-post .ubb-entry-content h2 {
  font-size: 32px;
  line-height: 1.3;
}

.single-post .ubb-entry-content h3 {
  font-size: 26px;
  line-height: 1.35;
}

.single-post .ubb-entry-content h4 {
  font-size: 22px;
  line-height: 1.4;
  color: #0F172A;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .single-post .ubb-entry-content h2 {
    font-size: 28px;
  }

  .single-post .ubb-entry-content h3 {
    font-size: 24px;
  }

  .single-post .ubb-entry-content h4 {
    font-size: 20px;
  }
}

/* Single-post lists: plain editorial bullets only.
   These !important resets override Gutenberg block borders/backgrounds as well. */
body.single-post .ubb-entry-content ul,
body.single-post .ubb-entry-content ul.wp-block-list,
body.single-post .ubb-entry-content ul.has-background,
body.single-post .ubb-entry-content ul.has-border-color {
  display: block !important;
  list-style: disc outside !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-top: 0 !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: 0 !important;
  margin: 1.5rem 0 !important;
  padding: 0 0 0 1.5rem !important;
}

body.single-post .ubb-entry-content ul > li,
body.single-post .ubb-entry-content ul.wp-block-list > li {
  display: list-item !important;
  position: static !important;
  background: transparent !important;
  background-color: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 0 0 .15rem !important;
  color: #334155;
}

body.single-post .ubb-entry-content ul > li::before,
body.single-post .ubb-entry-content ul.wp-block-list > li::before {
  content: none !important;
  display: none !important;
}

body.single-post .ubb-entry-content ul > li::marker,
body.single-post .ubb-entry-content ul.wp-block-list > li::marker {
  color: #DA0033 !important;
}

/* Every post table is server-wrapped in .ubb-table-scroll. On phones the
   article cannot grow wider than the viewport; only this wrapper may scroll. */
.ubb-entry-content .ubb-table-scroll {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

@media (max-width: 767px) {
  html,
  body.single-post {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  body.single-post main,
  body.single-post main > div,
  body.single-post article,
  body.single-post .ubb-entry-content {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  body.single-post main,
  body.single-post main > div,
  body.single-post article,
  body.single-post .ubb-entry-content {
    overflow-x: hidden !important;
  }

  /* Gutenberg's figure wrapper must never use the table's intrinsic width. */
  body.single-post .ubb-entry-content .wp-block-table,
  body.single-post .ubb-entry-content .wp-block-table.alignwide,
  body.single-post .ubb-entry-content .wp-block-table.alignfull {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    float: none !important;
    overflow: hidden !important;
  }

  body.single-post .ubb-entry-content .ubb-table-scroll {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x pan-y;
    scrollbar-width: thin;
    contain: inline-size;
    padding-bottom: 5px;
  }

  body.single-post .ubb-entry-content .ubb-table-scroll::-webkit-scrollbar {
    height: 7px;
  }

  body.single-post .ubb-entry-content .ubb-table-scroll::-webkit-scrollbar-thumb {
    background: #94A3B8;
    border-radius: 999px;
  }

  body.single-post .ubb-entry-content .ubb-table-scroll table {
    display: table !important;
    table-layout: auto !important;
    width: max-content !important;
    min-width: 620px !important;
    max-width: none !important;
    margin: 0 !important;
  }

  /* The plain bullet treatment is also forced on mobile against block styles. */
  body.single-post .ubb-entry-content ul,
  body.single-post .ubb-entry-content ul.wp-block-list {
    width: auto !important;
    max-width: 100% !important;
  }
}

/* If Gutenberg has placed a background/border on a wrapper whose purpose is
   only to contain a bullet list, keep that wrapper visually plain too. */
body.single-post .ubb-entry-content .wp-block-group.has-background:has(> ul),
body.single-post .ubb-entry-content .wp-block-group.has-border-color:has(> ul),
body.single-post .ubb-entry-content .wp-block-group[style*="border"]:has(> ul) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* =====================================================
   UK Business Contact Form
   Contact Form 7
   ===================================================== */

.ubb-contact-form-box {
    width: 100%;
    padding: 28px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
}


/* Form heading */

.ubb-contact-form-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #E2E8F0;
}

.ubb-contact-form-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #DA0033;
    color: #FFFFFF;
    border-radius: 50%;
}

.ubb-contact-form-heading {
    flex: 1;
}

.ubb-contact-form-heading > span {
    display: block;
    margin-bottom: 4px;
    color: #DA0033;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.ubb-contact-form-heading h2 {
    margin: 0 0 6px;
    padding: 0;
    color: #0F172A;
    font-size: 22px;
    line-height: 1.3;
    font-weight: 800;
}

.ubb-contact-form-heading p {
    margin: 0;
    padding: 0;
    color: #64748B;
    font-size: 14px;
    line-height: 1.6;
}


/* Remove default CF7 spacing */

.ubb-contact-form .wpcf7 {
    width: 100%;
}

.ubb-contact-form .wpcf7-form {
    width: 100%;
    margin: 0;
}

.ubb-contact-form .wpcf7-form > p {
    margin: 0;
}


/* Your existing CF7 labels */

.ubb-contact-form .wpcf7-form label {
    display: block;
    width: 100%;
    margin: 0 0 18px;
    color: #0F172A;
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
}


/* CF7 wraps each input inside this */

.ubb-contact-form .wpcf7-form-control-wrap {
    display: block;
    width: 100%;
    margin-top: 7px;
}


/* Inputs */

.ubb-contact-form input[type="text"],
.ubb-contact-form input[type="email"] {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 48px;
    box-sizing: border-box;
    padding: 0 14px;
    margin: 0;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    color: #0F172A;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    outline: none;
    box-shadow: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


/* Message */

.ubb-contact-form textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 160px;
    box-sizing: border-box;
    padding: 13px 14px;
    margin: 0;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 4px;
    color: #0F172A;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    box-shadow: none;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}


/* Input focus */

.ubb-contact-form input[type="text"]:focus,
.ubb-contact-form input[type="email"]:focus,
.ubb-contact-form textarea:focus {
    border-color: #DA0033;
    box-shadow: 0 0 0 3px rgba(218, 0, 51, 0.08);
}


/* Submit */

.ubb-contact-form input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 160px;
    min-height: 46px;
    margin: 2px 0 0;
    padding: 12px 24px;
    background: #DA0033;
    border: 1px solid #DA0033;
    border-radius: 4px;
    color: #FFFFFF;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
    cursor: pointer;
    box-shadow: none;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.ubb-contact-form input[type="submit"]:hover {
    background: #B8002B;
    border-color: #B8002B;
}

.ubb-contact-form input[type="submit"]:active {
    transform: translateY(1px);
}


/* CF7 validation */

.ubb-contact-form .wpcf7-not-valid {
    border-color: #DC2626 !important;
}

.ubb-contact-form .wpcf7-not-valid-tip {
    display: block;
    margin-top: 6px;
    color: #DC2626;
    font-size: 12px;
    line-height: 1.4;
    font-weight: 600;
}


/* CF7 result messages */

.ubb-contact-form .wpcf7-response-output {
    margin: 20px 0 0 !important;
    padding: 13px 15px !important;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.6;
}


/* Success */

.ubb-contact-form form.sent .wpcf7-response-output {
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    color: #166534;
}


/* Error */

.ubb-contact-form form.invalid .wpcf7-response-output,
.ubb-contact-form form.failed .wpcf7-response-output,
.ubb-contact-form form.unaccepted .wpcf7-response-output {
    background: #FEF2F2;
    border: 1px solid #FCA5A5;
    color: #991B1B;
}


/* CF7 spinner */

.ubb-contact-form .wpcf7-spinner {
    margin: 0 0 0 12px;
    vertical-align: middle;
}


/* Prevent unwanted paragraph gaps */

.ubb-contact-form br {
    display: none;
}


/* =====================================================
   Mobile
   ===================================================== */

@media (max-width: 640px) {

    .ubb-contact-form-box {
        padding: 20px;
    }

    .ubb-contact-form-header {
        gap: 12px;
        margin-bottom: 22px;
        padding-bottom: 20px;
    }

    .ubb-contact-form-icon {
        width: 42px;
        height: 42px;
        min-width: 42px;
    }

    .ubb-contact-form-heading h2 {
        font-size: 19px;
    }

    .ubb-contact-form-heading p {
        font-size: 13px;
    }

    .ubb-contact-form .wpcf7-form label {
        margin-bottom: 16px;
    }

    .ubb-contact-form input[type="text"],
    .ubb-contact-form input[type="email"] {
        height: 46px;
        font-size: 16px;
    }

    .ubb-contact-form textarea {
        min-height: 145px;
        font-size: 16px;
    }

    .ubb-contact-form input[type="submit"] {
        width: 100%;
        min-height: 47px;
    }
}
