/*
Theme Name: Bec Hamilton
Author: Ben S Wallace
Author URI: https://github.com/sinclairbenj
Theme URI: 
Tags: full-site-editing, block-patterns
Text Domain: bec-hamilton
Requires at least: 6.4
Requires PHP: 7.4
Tested up to: 6.4
Version: 100.0

License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

/***** Styles intended only for the front. *****/
html {
	scroll-behavior: smooth;
}

@media screen and (prefers-reduced-motion: reduce) {

	html {
		scroll-behavior: auto;
	}
}

body {
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

.bec-inner-wide {
  max-width: var(--wp--style--global--wide-size, 1712px);
  margin-left: auto;
  margin-right: auto;
  width: 100%;
}

div,
a,
button,
.wp-block-button__link,
.bec-header-navigation a span,
.bec-footer-navigation a span {
  transition: all 0.2s ease;
}

/***** REFINED STYLING *****/

/*** Global ***/


/*** Header ***/

@media screen and (max-width: 600px) {
  .site-header nav {
      align-self: start;
  }

  .wp-block-navigation__responsive-container.is-menu-open {
      padding-top: 1.875rem;
      padding-right: var(--wp--preset--spacing--m);
      padding-bottom: 1.63rem;
      padding-left: var(--wp--preset--spacing--m);
  }

  .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation__container, .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-page-list {
    width: 100%;
    align-items: center;
  }
}

@media screen and (max-width: 1000px) {
    .rotating-tag {
    display: block;
    margin-top: -1px;
    }

    .rotating-tag-prefix {
        display: none;
    }
}

.bec-header {
    line-height: 1;
}

h1.bec-header {
    font-size: var(--wp--preset--font-size--super) !important;
    line-height: 1;
    margin-bottom: -2px;
}


.bec-header-tagline {
    padding-left: 1px;
}

.rotating-tag,
.rotating-tag-prefix {
  color: var(--wp--preset--color--primary);
  transition: opacity 0.4s ease;
}

.rotating-tag {
  opacity: 1;
}

.rotating-tag.fade-in {
  opacity: 1;
}

.rotating-tag:not(.fade-in) {
  opacity: 0;
}

.wp-block-navigation a {
  text-decoration: none;
}

/* Override inherited color on hover/focus */
.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation-item__content:focus {
  color: var(--wp--preset--color--primary) !important;
}

/* Base link style */
.wp-block-navigation a {
    text-decoration: none;
    color: var(--wp--preset--color--contrast);
    font-weight: 400;
    transition: color 0.2s ease;
    position: relative;
    z-index: 0;
}

/* Hover and focus state */
.bec-header-navigation a:hover,
.bec-header-navigation a:focus {
  color: var(--wp--preset--color--primary); /* your theme’s blue */
}

.bec-search-button span.wp-block-navigation-item__label {
    font-size: 0px;
}

.bec-search-button a {
    height: 1em;
    width: 1em;
    background-image: url(../bec-hamilton/assets/search.svg);
    background-repeat: no-repeat;
    background-position-x: center;
}

@media screen and (min-width: 600px) {

  .bec-header-navigation a::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3em;
    height: 3em;
    border-radius: 50%;
    background-color: var(--wp--preset--color--subtle);
    transform: translate(-50%, 50%) scale(0);
    opacity: 0;
    transition:
      transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
      opacity 0.3s ease;
    z-index: -1;
  }

  .bec-header-navigation a:hover::before,
  .bec-header-navigation a:focus::before {
    transform: translate(-50%, 35%) scale(1);
    opacity: 1;
  }

  .bec-header-navigation .current-menu-item:not(:first-of-type) {
    color: var(--wp--preset--color--primary); 
  }

  .bec-header-navigation .current-menu-item:not(:first-of-type) a:before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3em;
    height: 3em;
    border-radius: 50%;
    background-color: var(--wp--preset--color--subtle);
    transform: translate(-50%, 35%) scale(1);
    z-index: -1;
    opacity: 1;
  }

  .bec-header-navigation:has(a:hover):not(:has(.current-menu-item:hover)) .current-menu-item a::before {
    opacity: 0;
    transform: translate(-50%, 50%) scale(0);
  }

}

.site-header > div {
    overflow: hidden;
}

/** Topper **/

.bec-topper p {
    font-size: clamp(0.875rem, 0.25rem + 3.75vw, 3.75rem);
    line-height: 1.3;
    padding-top: var(--wp--preset--spacing--xl) !important;
    padding-bottom: 2em !important;
    max-width: 100%;
}

@media screen and (max-width: 1200px) {
  .bec-topper p {
    padding-top: 0 !important;
  }
}

/** topper animation **/

.home .bec-topper {
  padding-top: 3em;
  cursor: default;
  position: relative;
  overflow: clip; /* fallback: overflow: hidden; */
  --nav-dot-size: 3rem; /* keep in sync with menu dot */
  --edge-buffer: 4rem;    /* hide dot early near right/bottom edges */
}

/* the follower dot (matches your menu dot styling) */
.bec-cursor-dot {
  position: absolute;
  width: var(--nav-dot-size);
  height: var(--nav-dot-size);
  border-radius: 50%;
  background-color: var(--wp--preset--color--subtle);
  pointer-events: none;
  z-index: -1; /* behind topper content; bump if needed */
  transform: translate(0px, 0px) scale(0); /* start hidden + centered */
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  will-change: transform, opacity;
}

/* visible state (scale up on enter, scale down on leave) */
.bec-topper.is-dot-active .bec-cursor-dot {
  transform: translate(0px, -10px) scale(1);
  opacity: 1;
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .bec-cursor-dot { transition: none; }
}



/*** Footer ***/

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

.wp-site-blocks {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  box-sizing: border-box;
}

footer h2 {
    line-height: 1;
    padding-top: 0.375em;
}

.bec-footer-navigation {
    margin-top: 0;
    row-gap: 0.125em;
    column-gap: 1em;
}

.bec-footer-navigation ul.wp-block-navigation__container > li > a > span {
  color: var(--wp--preset--color--white);
  transition: color 0.2s ease;
}

.bec-footer-navigation ul.wp-block-navigation__container > li > a:hover > span,
.bec-footer-navigation ul.wp-block-navigation__container > li > a:focus > span {
  color: var(--wp--preset--color--soft-blue);
}


/*** Main layout adjustments ***/

/* This is the main content area */
.wp-site-blocks > *:not(header):not(footer) {
  flex: 1;
}

.wp-block-group {
  margin-top: 0;
  padding-top: 0;
}

.wp-block-group.has-background {
  border-radius: 0.375em;
}

.wp-block-group.alignfull,
footer .wp-block-group.has-background {
  border-radius: 0;
}

body.admin-bar .wp-site-blocks {
  margin-top: -32px; /* Adjust as needed, WP admin bar height */
  padding-top: 32px;
}

/*** REFINED page layouting ***/

.bec-inner {
  max-width: 1480px;
  margin-left: auto;
  margin-right: auto;
  margin-block-start: 3.5em;
  padding-left: var(--wp--preset--spacing--xl);
  padding-right: var(--wp--preset--spacing--xl);
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 782px) {
.bec-inner {
  padding-left: var(--wp--preset--spacing--m);
  padding-right: var(--wp--preset--spacing--m);
}
}


.bec-page-top {
    margin-bottom: var(--wp--preset--spacing--xl);
}


.bec-page-top .title-column {
    max-width: 40%;
    align-self: flex-start;
}

.bec-page-top .excerpt-column {
    margin-bottom: 6px;
}

/* Force all content-width blocks (800px) to left-align */
.is-layout-constrained > *:not(.alignleft):not(.alignright):not(.alignwide):not(.alignfull):not(form) {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* Image blocks defaulting to content width should align left too */
.wp-block-image:not(.alignleft):not(.alignright):not(.alignwide):not(.alignfull) {
  display: block;
  margin-left: 0 !important;
  margin-right: auto !important;
}

.wp-block-image.alignright {
  float: right;
  margin-left: var(--wp--preset--spacing--m);
  margin-right: 0;
}

.is-layout-constrained > * {
  margin-block-start: var(--wp--preset--spacing--s);
  margin-block-end: var(--wp--preset--spacing--s);
}

/* Remove default constrained padding from post content */
.wp-block-post-content.is-layout-constrained {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Center the wide container */
.wp-block-group.alignwide {
  margin-left: auto;
  margin-right: auto;
  max-width: 1480px;
}

/* Content-aligned images should sit right */
.wp-block-image.alignright {
  float: right;
  max-width: 800px;
}

/* Wide layout columns span full width */
.wp-block-columns.alignwide {
  max-width: 1480px;
  margin-left: auto;
  margin-right: auto;
  gap: var(--wp--preset--spacing--l);
}

/* Prevent box squish */
.wp-block-group.alignfull {
  box-sizing: border-box;
}


/* Column shrinkage and growage */

@media (min-width: 782px) {
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column.shrinking {
    flex-basis: clamp(20%, 40vw, 50%);
    flex-grow: 0;
  }

  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column.growing {
    flex-basis: clamp(50%, 60vw, 80%);
    flex-grow: 0;
  }
}

@media (min-width: 1200px) {
  /* Cap both to exactly 50% when there's enough room */
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column.shrinking,
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column.growing {
    flex-basis: 50%;
  }
}

@media (max-width: 781px) {
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column.shrinking,
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column.growing {
    flex-basis: 100% !important;
    flex-grow: 0;
  }
}



/* REFINED STYLING */

/* images */

img, video, embed {
    border-radius: 0.75em;
}

.wp-block-image figcaption {
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--contrast);
    margin-top: 0.5em;
    margin-right: 0.5em;
    line-height: 1.4;
    text-align: right;
}

/* featured image logo treatment */

.wp-block-post-featured-image {
  border-radius: 0.75em;
}

@media screen and (max-width: 500px) {
  .single-details {
      flex-direction: column;
      align-items: flex-start;
      gap: var(--wp--preset--spacing--xs);
  }
}

.single .single-header {
    width: 100%;
    padding: 0;
}


.has-logo .wp-block-post-featured-image {
    border-radius: var(--wp--custom--radius--default, 15px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.has-logo .wp-block-post-featured-image a {
    height: auto;
	padding: 5em 1.5em;
}

.search-results .has-logo .wp-block-post-featured-image a,
.archive .has-logo .wp-block-post-featured-image a {
    height: auto;
    padding: 3em;
}

.has-logo .wp-block-post-featured-image .wp-post-image {
  max-height: 120px;
	width: 100%;
}

.single .has-logo .wp-block-post-featured-image .wp-post-image {
    max-height: 100px;
    width: auto;
    margin: 3em;
}

/* featured image video type tag */

.wp-block-query li.post-type-video .post-image figure:after {
    content: "\25B6\FE0E  Video";
    font-size: var(--wp--preset--font-size--small);
    position: absolute;
    padding: 8px 16px;
    left: 14px;
    bottom: 14px;
    color: var(--wp--preset--color--base);
    background-color: var(--wp--preset--color--primary);
    border-radius: 50px;
}

/* highlight color */

::selection {
  background-color: var(--wp--preset--color--subtle);
  color: inherit;
}

::-moz-selection {
  background-color: var(--wp--preset--color--subtle);
  color: inherit;
}

/* query loops */

/* Make post titles smaller in query loop */

.wp-block-query {
    margin-bottom: var(--wp--preset--spacing--l);
}

.wp-block-query .wp-block-post-title {
  font-size: var(--wp--preset--font-size--x-large);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 0;
}

.wp-block-query .wp-block-post-excerpt {
    margin-block-start: var(--wp--preset--spacing--xxs);
}

.wp-block-query .wp-block-post-excerpt p {
    margin-block-start: var(--wp--preset--spacing--xxs);
}

.post-item-grid {
  display: grid;
  grid-template-columns: 40% 1fr;
  gap: var(--wp--preset--spacing--l);
  align-items: start;
  outline: 0px solid transparent;
}

.wp-block-post-template {
	margin-top: var(--wp--preset--spacing--m);
	margin-bottom: var(--wp--preset--spacing--m);
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

.post-item-grid:hover, .wp-block-post:hover > .post-item-grid {
    cursor: pointer;
    background-color: var(--wp--preset--color--subtle);
    outline: 1em solid var(--wp--preset--color--subtle);
    border-radius: 0.75em;
}

.wp-block-post:hover > .post-item-grid .post-image {
    background-color: var(--wp--preset--color--soft-blue) !important;
}


.post-item-grid .post-image {
  min-height: 0;
}

.post-item-grid .post-image {
  border-radius: var(--wp--custom--radius--default, 15px);
}

.post-item-grid .post-image:empty.has-subtle-background-color {
  background-color: var(--wp--preset--color--subtle);
  aspect-ratio: 3 / 2;
  width: 100%;
  border-radius: var(--wp--custom--radius--default, 15px);
  position: relative;
}


.wp-block-post-title,
.wp-block-post-title a {
    line-height: 1.2;
    margin-left: -2px;
}

.wp-block-post-terms {
    margin-bottom: var(--wp--preset--spacing--s);
    margin-top: 0;
}

.wp-block-post-terms a {
    text-decoration: none;
	padding: 6px 12px 7px 12px;
    color: var(--wp--preset--color--primary);
    background-color: var(--wp--preset--color--subtle);
    border-radius: 50px;
}

.single .wp-block-post-terms a:hover {
    background-color: var(--wp--preset--color--soft-blue);
}

.wp-block-query .wp-block-post:hover .wp-block-post-terms a {
    background-color: var(--wp--preset--color--soft-blue);
}

.search .wp-block-query .wp-block-post:hover .wp-block-post-terms a,
.archive .wp-block-query .wp-block-post:hover .wp-block-post-terms a {
    background-color: var(--wp--preset--color--subtle);
}

.search .type-page .details {
    display: none;
}


.wp-block-query .wp-block-post-title a {
    color: var(--wp--preset--color--contrast);
}

.wp-block-query .wp-block-post:hover .wp-block-post-title a {
    color: var(--wp--preset--color--primary);
}

.post-details {
  display: grid;
  grid-template-rows: 1fr auto;
  height: 100%;
  margin-bottom: -5px;
}

.post-details .wp-block-post-title {
  margin-top: 0;
}

.post-details .post-content {
    align-self: start;
    margin-bottom: 0;
    margin-top: var(--wp--preset--spacing--s);
}

.post-details .wp-block-post-date {
  justify-self: end;
  align-self: end;
  width:100%;
  line-height: 1;
  margin-top: var(--wp--preset--spacing--s);
}

@media (max-width: 782px) {
  .post-item-grid {
    grid-template-columns: 1fr;
  }

  .post-details .post-content {
        margin-top: 0;
        display: flex;
        flex-direction: column;
        order: 2;
  }

  .wp-block-post-terms {
    margin-block-start: var(--wp--preset--spacing--s) !important;
    margin-bottom: 0;
    order: 3;
  } 
  
  .wp-block-post-terms a {
    display: inline-block;
    margin-block-end: var(--wp--preset--spacing--xs);
  } 
  .post-details .wp-block-post-date {
    text-align: left !important;
    margin-top: 0;
    margin-bottom: var(--wp--preset--spacing--s);
  }


  .post-item-grid:hover, .wp-block-post:hover > .post-item-grid {
      cursor: pointer;
      background-color: var(--wp--preset--color--subtle);
      outline: 0.625em solid var(--wp--preset--color--subtle);
      border-radius: 0.75em;
  }

}



/* tables */

.wp-block-table table {
    background: var(--wp--preset--color--base);
}

.wp-block-table thead {
    border-bottom: 1px solid;
    background: var(--wp--preset--color--soft-blue);
}

/* CUSTOM BLOCK / PATTERN STYLES */

/*** Separator ***/

.wp-block-separator {
  border: none;
  border-bottom: 0.375em dotted var(--wp--preset--color--subtle);
  margin-block: var(--wp--preset--spacing--s);
}

/*** Paragraph + Headings ***/

.has-x-large-font-size {
    font-size: var(--wp--preset--font-size--x-large) !important;
    line-height: 1.3;
}

/* Intro Paragraph */
.is-style-intro {
  font-size: var(--wp--preset--font-size--large);

}

/* Super Paragraph */
.is-style-super {
  font-size: var(--wp--preset--font-size--super);
  font-family: "neue-kabel", sans-serif;
  font-weight: 600;
}

/*** Links ***/

.entry-content a[target="_blank"]::after,
.wp-block-post-content a[target="_blank"]::after {
    content: "";
    background-image: url(../bec-hamilton/assets/arrow.svg);
    background-repeat: no-repeat;
    background-position: 2px 3px;
    background-size: 11px;
    display: inline-block;
    margin-left: 0.25em;
    margin-bottom: -0.225em;
    font-size: 0.6em;
    background-color: var(--wp--preset--color--primary);
    width: 1rem;
    height: 1rem;
    border-radius: 4rem;
    overflow: hidden;
    transition: all 0.2s ease;
}


.entry-content a[target="_blank"]:hover::after,
.wp-block-post-content a[target="_blank"]:hover::after,
.entry-content a[target="_blank"]:focus::after,
.wp-block-post-content a[target="_blank"]:focus::after {
    background-color: var(--wp--preset--color--contrast);
}

.redirect-arrow {
    background-image: url(../bec-hamilton/assets/arrow.svg);
    background-repeat: no-repeat;
    background-position: 3px 5px;
    background-size: 16px;
    display: inline-block;
    margin-left: 0.35em;
    margin-bottom: -2px;
    font-size: 0.6em;
    background-color: var(--wp--preset--color--primary);
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 4rem;
    overflow: hidden;
}

/** Forms and buttons **/

input, textarea {
    border-radius: 0.75rem;
    background-color: var(--wp--preset--color--subtle) !important; 
    border: none !important;
}

.is-style-light.wp-block-button .wp-block-button__link {
    background-color: var(--wp--preset--color--subtle);
    color: var(--wp--preset--color--contrast);
    border: none;
}

.is-style-light.wp-block-button .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--contrast);
    color: var(--wp--preset--color--subtle);
}


.wpforms-container input.wpforms-field-medium, .wpforms-container select.wpforms-field-medium, .wpforms-container .wpforms-field-row.wpforms-field-medium, .wp-core-ui div.wpforms-container input.wpforms-field-medium, .wp-core-ui div.wpforms-container select.wpforms-field-medium, .wp-core-ui div.wpforms-container .wpforms-field-row.wpforms-field-medium {
    max-width: 100% !important;
}

div.wpforms-container-full input[type=submit]:not(:hover):not(:active), div.wpforms-container-full button[type=submit]:not(:hover):not(:active), div.wpforms-container-full .wpforms-page-button:not(:hover):not(:active), .wp-core-ui div.wpforms-container-full input[type=submit]:not(:hover):not(:active), .wp-core-ui div.wpforms-container-full button[type=submit]:not(:hover):not(:active), .wp-core-ui div.wpforms-container-full .wpforms-page-button:not(:hover):not(:active) {
    border-radius: 0.75rem;
    border-color: transparent;
    border-width: 0px;
    border-style: none;
    color: var(--wp--preset--color--subtle);
    font-family: inherit;
    font-weight: 400;
    font-size: var(--wp--preset--font-size--small);
    line-height: inherit;
    padding-top: var(--wp--preset--spacing--xs);
    padding-right: var(--wp--preset--spacing--s);
    padding-bottom: var(--wp--preset--spacing--xs);
    padding-left: var(--wp--preset--spacing--s);
    text-decoration: none;
    box-shadow: none;
}

div.wpforms-container-full input[type=submit]:hover, div.wpforms-container-full input[type=submit]:active, div.wpforms-container-full button[type=submit]:hover, div.wpforms-container-full button[type=submit]:active, div.wpforms-container-full .wpforms-page-button:hover, div.wpforms-container-full .wpforms-page-button:active, .wp-core-ui div.wpforms-container-full input[type=submit]:hover, .wp-core-ui div.wpforms-container-full input[type=submit]:active, .wp-core-ui div.wpforms-container-full button[type=submit]:hover, .wp-core-ui div.wpforms-container-full button[type=submit]:active, .wp-core-ui div.wpforms-container-full .wpforms-page-button:hover, .wp-core-ui div.wpforms-container-full .wpforms-page-button:active {
    border-radius: 0.75rem;
    border-color: transparent;
    border-width: 0px;
    border-style: none;
    color: white;
    background-color: var(--wp--preset--color--contrast);
    font-family: inherit;
    font-weight: 400;
    font-size: var(
    --wp--preset--font-size--small);
    line-height: inherit;
    padding-top: var(
    --wp--preset--spacing--xs);
    padding-right: var(
    --wp--preset--spacing--s);
    padding-bottom: var(
    --wp--preset--spacing--xs);
    padding-left: var(
    --wp--preset--spacing--s);
    text-decoration: none;
    box-shadow: none;
}

div.wpforms-container-full .wpforms-confirmation-container-full, div[submit-success]>.wpforms-confirmation-container-full:not(.wpforms-redirection-message) {
    background-color: var(--wp--preset--color--secondary) !important;
    border: none !important;
    border-radius: 0.75em !important;
    padding: 1.5em var(--wp--preset--spacing--s) !important;
}

div.wpforms-container-full .wpforms-confirmation-container-full p, div[submit-success]>.wpforms-confirmation-container-full:not(.wpforms-redirection-message) p {
    color: var(--wp--preset--color--subtle) !important;
    text-align: center !important;
}