/*
Theme Name: Rockin T Electric
Theme URI: https://rockintelectric.com
Author: Hawkes Design
Author URI: https://hawkes.design
Description: Child theme of Ollie for Rockin T Electric. Design tokens live in theme.json (from design/design-system/tokens.json). BEM classes are prefixed rt-.
Template: ollie
Version: 0.2.0
Requires at least: 6.7
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rockin-t
*/

/* ------------------------------------------------------------------
   Foundations
   ------------------------------------------------------------------ */

/* Focus ring: the Orange anchor, 2px outside the element (design system, States). theme.json has no outline property. */
:where(a, button, .wp-element-button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--wp--custom--focus-ring);
  outline-offset: 2px;
}

/* Links keep their underline; the colour comes from theme.json. */
.entry-content a:not(.wp-element-button):not(.wp-block-button__link) {
  text-underline-offset: 0.15em;
}

/* Radius tokens as plain custom properties, so cards and the Live Wire agree on the corner. */
:root {
  --rt-radius-sm: 0.5rem;
  --rt-radius-md: 0.75rem;
  --rt-radius-lg: 1rem;
  --rt-radius-xl: 1.5rem;
  --rt-shadow-raised: 0 1px 2px rgba(7, 20, 25, 0.06), 0 6px 18px rgba(7, 20, 25, 0.08);
  --rt-shadow-overlay: 0 2px 6px rgba(7, 20, 25, 0.10), 0 18px 48px rgba(7, 20, 25, 0.16);
  --rt-motion-fast: 150ms ease-out;
  --rt-motion-layout: 200ms ease-in-out;
}

/* ------------------------------------------------------------------
   Header
   ------------------------------------------------------------------ */

.rt-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
}

.rt-lockup__name a,
.rt-lockup__name {
  text-decoration: none;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .rt-header .rt-lockup__name {
    font-size: 0.8rem;
  }
}

.rt-lockup__mark img {
  display: block;
  height: 44px;
  width: auto;
}

.rt-header__actions {
  min-width: 0;
}

.rt-nav .wp-block-navigation-item__content {
  padding-block: 0.25rem;
}

/* The call button stays reachable at every width; the menu collapses to the hamburger below 900px. */
@media (max-width: 899px) {
  .rt-header__call .wp-block-button__link {
    padding: 0.55rem 0.9rem;
  }
}

/* Below 480px the call button is icon only (the preset font-size class uses !important, so this does too). */
@media (max-width: 480px) {
  .rt-header__call .wp-block-button__link {
    font-size: 0 !important;
    letter-spacing: 0;
    padding: 0.6rem;
    line-height: 0;
    min-width: 44px;
    min-height: 44px;
  }
  .rt-header__call .wp-block-button__link::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}

/* ------------------------------------------------------------------
   Cards (design system: bg-raised, radius-lg, hairline border, shadow-raised; never a coloured left border)
   ------------------------------------------------------------------ */

.rt-card {
  border-radius: var(--rt-radius-lg);
  border: 1px solid var(--wp--preset--color--border-light);
  box-shadow: var(--rt-shadow-raised);
  overflow: hidden;
  transition: transform var(--rt-motion-layout), box-shadow var(--rt-motion-fast);
}

.rt-card:hover,
.rt-card:focus-within {
  box-shadow: var(--rt-shadow-overlay);
}

.rt-card--project .rt-card__media {
  margin: 0;
}

.rt-card--project .rt-card__media img {
  display: block;
  width: 100%;
  transition: transform 600ms ease-out;
}

.rt-card--project:hover .rt-card__media img {
  transform: scale(1.02);
}

.rt-card__body {
  width: 100%;
}

.rt-card--project .wp-block-post-title a {
  text-decoration: none;
  color: inherit;
}

.rt-card--project .wp-block-post-title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.rt-card--row {
  width: 100%;
}

.rt-card--row .wp-block-post-title a {
  text-decoration: none;
  color: inherit;
}

@media (min-width: 782px) {
  .rt-card--details {
    position: sticky;
    top: calc(var(--wp--preset--spacing--medium) + 84px);
  }
}

.rt-media img {
  border-radius: var(--rt-radius-xl);
}

.rt-meta {
  text-transform: none;
}

.rt-meta .wp-block-post-terms {
  margin: 0;
}

.rt-link-arrow {
  text-decoration: none;
  white-space: nowrap;
}

.rt-link-arrow::after {
  content: " \2192";
  display: inline-block;
  transition: transform var(--rt-motion-fast);
}

.rt-link-arrow:hover::after {
  transform: translateX(3px);
}

/* Project details list (rendered by the rt/project-details block). */
.rt-details {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--wp--preset--spacing--small) var(--wp--preset--spacing--medium);
  font-size: var(--wp--preset--font-size--small);
}

.rt-details__term {
  color: var(--wp--preset--color--secondary);
  font-weight: 600;
}

.rt-details__value {
  margin: 0;
}

/* Project highlights (rt/project-highlights). */
.rt-highlights {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--wp--preset--spacing--medium);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rt-highlights__item {
  padding: var(--wp--preset--spacing--medium);
  border-radius: var(--rt-radius-md);
  background: var(--wp--preset--color--tertiary);
  border-top: 2px solid var(--wp--preset--color--primary-alt);
}

.rt-highlights__title {
  margin: 0 0 0.25rem;
  font-family: var(--wp--preset--font-family--primary);
  font-weight: 700;
}

.rt-highlights__text {
  margin: 0;
  color: var(--wp--preset--color--secondary);
  font-size: var(--wp--preset--font-size--small);
}

/* Project gallery (rt/project-gallery). */
.rt-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: var(--wp--preset--spacing--medium);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rt-gallery__item {
  margin: 0;
}

.rt-gallery__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
  border-radius: var(--rt-radius-lg);
}

.rt-gallery__caption {
  font-size: var(--wp--preset--font-size--small);
  color: var(--wp--preset--color--secondary);
  margin-top: 0.4rem;
}

/* Partner logos (rt/partner-logo). */
.rt-partners .wp-block-post-template {
  align-items: center;
}

.rt-partner {
  display: grid;
  place-items: center;
  padding: var(--wp--preset--spacing--medium);
  min-height: 7rem;
  border-radius: var(--rt-radius-lg);
  background: var(--wp--preset--color--base);
  border: 1px solid var(--wp--preset--color--border-light);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--rt-motion-fast);
}

.rt-partner:hover {
  box-shadow: var(--rt-shadow-raised);
}

.rt-partner img {
  display: block;
  max-height: 3.5rem;
  width: auto;
  max-width: 100%;
  filter: grayscale(1);
  opacity: 0.8;
  transition: filter var(--rt-motion-fast), opacity var(--rt-motion-fast);
}

.rt-partner:hover img {
  filter: none;
  opacity: 1;
}

.rt-partner__name {
  font-family: var(--wp--preset--font-family--primary);
  font-weight: 700;
  text-align: center;
}

/* ------------------------------------------------------------------
   Page building blocks
   ------------------------------------------------------------------ */

/* Image placeholders until the photography lands: centred note on a tinted panel. */
.rt-media--placeholder {
  display: grid;
  place-items: center;
  border: 1px dashed var(--wp--preset--color--border-dark);
}

.rt-media--placeholder > * {
  max-width: 36ch;
}

.rt-card--service .wp-block-heading,
.rt-card--person .wp-block-heading {
  margin-top: 0;
}

.rt-card--service > :last-child {
  margin-top: auto;
}

/* Secondary button on a light surface: hairline border, raised shadow (design system, Button secondary). */
.rt-button--ghost .wp-block-button__link {
  border: 1px solid var(--wp--preset--color--border-dark);
  box-shadow: var(--rt-shadow-raised);
}

.rt-list {
  padding-left: 1.2em;
}

.rt-list li + li {
  margin-top: 0.4em;
}

/* Numbered flow: circles on a thin rail (Jake's proposal style). The full timeline arrives in task 1.7. */
.rt-timeline {
  list-style: none;
  counter-reset: rt-step;
  padding: 0;
  margin: 0;
  position: relative;
}

.rt-timeline > li {
  counter-increment: rt-step;
  position: relative;
  padding-left: 4rem;
  min-height: 3rem;
}

.rt-timeline > li::before {
  content: counter(rt-step);
  position: absolute;
  left: 0;
  top: -0.25rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--wp--preset--color--primary);
  color: var(--wp--preset--color--base);
  font-family: var(--wp--preset--font-family--primary);
  font-weight: 700;
  font-size: var(--wp--preset--font-size--medium);
}

.rt-timeline > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(1.375rem - 1px);
  top: 2.6rem;
  bottom: calc(-1 * var(--wp--preset--spacing--large) + 0.25rem);
  width: 2px;
  background: var(--wp--preset--color--border-dark);
}

/* ------------------------------------------------------------------
   Live Wire borders (assets/js/live-wire.js)
   ------------------------------------------------------------------ */

.rt-live-wire {
  position: relative;
  isolation: isolate;
}

.rt-live-wire__svg {
  position: absolute;
  pointer-events: none;
  overflow: visible;
  z-index: 1;
}

.rt-live-wire__live {
  transition: opacity 200ms ease-out;
}

.rt-live-wire--hover:not(.is-live) .rt-live-wire__live,
.rt-live-wire-static .rt-live-wire__live {
  opacity: 0;
}

h1.is-style-rt-live-wire,
h2.is-style-rt-live-wire,
h3.is-style-rt-live-wire {
  display: inline-block;
  width: fit-content;
  max-width: 100%;
  padding: 0.35em 0.6em;
  margin-left: -0.6em;
  border-radius: var(--rt-radius-sm);
  text-wrap: balance;
}

/* ------------------------------------------------------------------
   Footer with the Current Stream background (assets/js/current-stream.js)
   ------------------------------------------------------------------ */

.rt-stream {
  position: relative;
  overflow: hidden;
}

.rt-stream__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.rt-stream > :not(.rt-stream__canvas) {
  position: relative;
  z-index: 1;
}

.rt-footer__title {
  max-width: 20ch;
  text-wrap: balance;
}

.rt-footer__cta {
  padding: clamp(1.25rem, 3vw, 2.5rem);
  border-radius: var(--rt-radius-xl);
  background: linear-gradient(to top, rgba(7, 20, 25, 0.85), rgba(7, 20, 25, 0.35));
}

.rt-footer__nav .wp-block-navigation-item__content,
.rt-footer__policies .wp-block-navigation-item__content {
  text-decoration: none;
}

.rt-footer__nav .wp-block-navigation-item__content:hover,
.rt-footer__policies .wp-block-navigation-item__content:hover {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.rt-footer__legal {
  font-size: var(--wp--preset--font-size--small);
}

.rt-copyright {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .rt-card,
  .rt-card--project .rt-card__media img,
  .rt-link-arrow::after {
    transition: none;
  }
}
