/*
Theme Name: Consumer Friend
Theme URI: 
Author: Pedl Digitl Limited
Author URI: https://pedldigitl.com
Description: Bespoke Multipurpose WordPress Theme.
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 8.0
Version: 1.1.1
License: Proprietary
License URI: 
Text Domain: consumer-friend
Tags: full-site-editing, block-patterns, block-styles, custom-colors, custom-logo, custom-menu, editor-style, featured-images, one-column, wide-blocks
*/

/*
Consumer Friend WordPress Theme, Copyright (C) 2026 Pedl Digitl Limited.
All rights reserved.

This theme is proprietary software, licensed and not sold. Unauthorised
copying, modification, distribution or use, via any medium, is prohibited.
See the LICENSE file in the theme root for the full terms.

For licensing enquiries: alen@pedldigitl.com
*/

/* CSS Reset
---------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: inherit;
}

html {
  box-sizing: border-box;
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  /* Anchor targets (table of contents, in-page links, URL hashes) land below
     the fixed site header rather than underneath it. */
  --cf-header-height: 80px;
  scroll-padding-top: calc(var(--cf-header-height) + var(--wp--preset--spacing--md));
}

b,
strong {
  font-weight: var(--wp--custom--font-weight--semibold);
}

ol,
ul {
  padding: 0;
}

ol:where(:not([class*="wp-block"])),
ol:where(.wp-block-list),
ul:where(:not([class*="wp-block"])),
ul:where(.wp-block-list) {
  padding-inline-start: var(--wp--preset--spacing--medium);
}

div[class*="wp-block-"] figcaption {
  color: var(--wp--preset--color--foreground-muted);
  font-size: var(--wp--preset--font-size--x-small);
  margin-bottom: 0;
  margin-top: 20px;
  text-align: left;
}

img,
figure {
  max-width: 100%;
  height: auto;
}

/* Temporary fix for text-decoration-thickness in Firefox */
@-moz-document url-prefix() {
  a {
    text-decoration-thickness: 0.1rem !important;
  }
}

/* Standardize form styling
--------------------------------------------- */

input,
button,
textarea,
select {
  font: inherit;
}

input[type="button"],
input[type="email"],
input[type="search"],
input[type="submit"],
input[type="text"],
textarea {
  -webkit-appearance: none;
  appearance: none;
}

input:not([type="submit"]),
select,
textarea,
.wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]),
.wp-block-post-comments-form textarea {
  color: var(--wp--preset--color--foreground);
  border-radius: 5px;
  border: solid 1px var(--wp--preset--color--border);
  padding: 0.5em 1em;
  font-size: var(--wp--preset--font-size--small);
  background-color: #fff;
}

input:focus-visible,
textarea:focus-visible {
  outline-color: var(--wp--preset--color--primary);
}

input[type="checkbox"],
input[type="image"],
input[type="radio"] {
  width: auto;
}

label {
  width: 100%;
  display: block;
}

::placeholder {
  color: var(--wp--preset--color--foreground-muted);
  font-size: var(--wp--preset--font-size--small);
  opacity: 0.75;
}

/* Helper styles
---------------------------------------------------------------------------- */

a.more-link {
  display: block;
}

/* Inline code */
*:not(.wp-block-code) > code {
  background-color: var(--wp--preset--color--background-alt);
  padding: 3px 5px;
  position: relative;
  border-radius: 3px;
}

.wp-block-categories {
  position: relative;
}

/* Adjust terms at bottom of posts */
.single .wp-block-group .wp-block-post-terms,
.blog .wp-block-group .wp-block-post-terms {
  margin-bottom: -8px !important;
}

/* Remove margin on term description on archive pages */
.wp-block-term-description p:last-child {
  margin-bottom: 0;
}

/* Remove last separator on post list */
.remove-border-and-padding
  .wp-block-post-template
  li:last-child
  .wp-block-separator {
  display: none;
}

/* Hide post meta div if no tags assigned */
.single .wp-block-group:has(> .post-meta:empty) {
  display: none;
}

.wp-block-group:empty:has(+ .comment-respond) {
  display: none;
}

.row-logos > figure {
  flex-shrink: 1 !important;
}

/* Sticky header */

body:not(.wp-admin) header:has(> .is-position-sticky) {
  position: sticky;
  top: calc(0px + var(--wp-admin--admin-bar--height, 0px));
  z-index: 100;
}

/* Account for admin bar on mobile */

@media (max-width: 600px) {
  header:has(> .is-position-sticky) {
    top: 0;
  }
}

/* Mobile helper classes */

@media (max-width: 781px) {
  .cf-hide-on-mobile {
    display: none;
  }

  .cf-unstick-mobile {
    position: static;
  }

  header:has(> .cf-unstick-mobile) {
    position: static;
  }
}

a {
  transition: var(--wp--custom--transition--base);
}

/* Image lazy loading animation */
img[data-src] {
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.4s ease-out,
    transform 0.4s ease-out;
}

img[data-src].lazyloaded {
  opacity: 1;
  transform: translateY(0);
}
