/*
Theme Name: The Brand Guy
Theme URI: https://thebrandguy.site
Author: Pat
Author URI: https://thebrandguy.site
Description: Full studio portfolio — Websites, Photography, Brand Identity
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Private
Text Domain: thebrandguy
*/

/* =============================================
   TOKENS
   ============================================= */
:root {
  --cream:   #F2EEE6;
  --dark:    #161513;
  --orange:  #FF3B00;

  --font-display: 'Bricolage Grotesque', sans-serif;
  --font-body:    'Space Grotesk', sans-serif;

  --pad-x: clamp(20px, 4vw, 64px);
  --pad-y: clamp(56px, 11vh, 140px);

  --radius: 6px;
  --border: 1.5px solid var(--dark);
  --ease-out: cubic-bezier(.22, 1, .36, 1);

  /* tbg-prefixed aliases */
  --tbg-bg:           #F2EEE6;
  --tbg-dark:         #161513;
  --tbg-accent:       #FF3B00;
  --tbg-font-heading: 'Bricolage Grotesque', sans-serif;
  --tbg-font-body:    'Space Grotesk', sans-serif;
  --tbg-radius:       6px;
}

/* =============================================
   RESET
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--cream);
  color: var(--dark);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Lock scroll when overlays are open */
body.tbg-locked {
  overflow: hidden;
}

img, video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

::selection {
  background: var(--orange);
  color: var(--cream);
}

/* =============================================
   SITE WRAPPER
   ============================================= */
.tbg-site-wrapper {
  position: relative;
  overflow-x: hidden;
}

/* =============================================
   TYPOGRAPHY HELPERS
   ============================================= */
.tbg-eyebrow {
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
}

.tbg-display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 0.9;
}

/* =============================================
   MEDIA FILL
   ============================================= */
.tbg-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* placeholder shown when no image is set */
.tbg-img-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #e0dbd2;
}

.tbg-img-wrap::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(22,21,19,.4);
  text-align: center;
  padding: 16px;
  pointer-events: none;
}

.tbg-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
   HEADER
   ============================================= */
#tbg-header {
  background: transparent;
  border-bottom: 1.5px solid transparent;
  mix-blend-mode: difference;
}

/* Scrolled state (JS: .is-scrolled added at scrollY > 24) */
#tbg-header.is-scrolled {
  background: var(--cream);
  border-bottom: 1.5px solid var(--dark);
  mix-blend-mode: normal;
  padding-top: 13px !important;
  padding-bottom: 13px !important;
}

#tbg-header.is-scrolled #tbg-logo,
#tbg-header.is-scrolled #tbg-menu-btn {
  color: var(--dark);
}

/* =============================================
   MENU OVERLAY
   ============================================= */
#tbg-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: var(--dark);
  color: var(--cream);
  overflow-y: auto;
  /* hidden: clipped upward so it wipes down on open */
  clip-path: inset(0 0 100% 0);
  transition: clip-path .6s cubic-bezier(.77, 0, .18, 1);
  pointer-events: none;
}

#tbg-menu-overlay.is-open {
  clip-path: inset(0 0 0% 0);
  pointer-events: auto;
}

/* Nav link hover inside overlay */
#tbg-menu-overlay .tbg-nav-link:hover .tbg-navtext {
  color: var(--orange);
  transform: translateX(10px);
}

#tbg-menu-overlay .tbg-nav-link:hover span:last-child {
  opacity: 1 !important;
}

/* =============================================
   MARQUEE
   ============================================= */
@keyframes tbg-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.tbg-marquee-track {
  display: flex;
  width: max-content;
  animation: tbg-marquee 26s linear infinite;
  white-space: nowrap;
}

/* =============================================
   CARD HOVER
   ============================================= */
.tbg-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform .4s var(--ease-out);
}

.tbg-card:hover {
  transform: translateY(-6px);
}

.tbg-card .tbg-card-ov,
.tbg-card .tbg-ov {
  opacity: 0;
  transition: opacity .4s ease;
  pointer-events: none;
}

.tbg-card:hover .tbg-card-ov,
.tbg-card:hover .tbg-ov {
  opacity: 1;
}

.tbg-card .tbg-img-wrap,
.tbg-card img {
  transition: transform .6s var(--ease-out);
}

.tbg-card:hover .tbg-img-wrap,
.tbg-card:hover img {
  transform: scale(1.05);
}

/* =============================================
   NAV LINK HOVER
   ============================================= */
.tbg-nav-link:hover .tbg-navtext {
  color: var(--orange);
  transform: translateX(10px);
}

.tbg-nav-link:hover span:last-child {
  opacity: 1 !important;
}

.tbg-nav-link:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 4px;
  border-radius: 2px;
}

/* =============================================
   OVERLAYS (base — JS toggles .tbg-open)
   ============================================= */
.tbg-overlay,
.tbg-detail {
  position: fixed;
  inset: 0;
  z-index: 100;
  visibility: hidden;
  opacity: 0;
  transition: opacity .45s var(--ease-out), visibility 0s .45s;
}

.tbg-overlay.tbg-open,
.tbg-detail.tbg-open {
  visibility: visible;
  opacity: 1;
  transition: opacity .45s var(--ease-out), visibility 0s 0s;
}

/* Menu overlay */
.tbg-overlay {
  background: var(--dark);
  color: var(--cream);
  overflow-y: auto;
}

/* Case study detail */
.tbg-detail {
  background: var(--cream);
  overflow-y: auto;
}

/* =============================================
   CTA BUTTON
   ============================================= */
.tbg-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: var(--dark);
  color: var(--cream);
  font-weight: 600;
  font-size: clamp(15px, 1.3vw, 18px);
  letter-spacing: 0.04em;
  padding: 18px 30px;
  border-radius: 100px;
  text-decoration: none;
  border: 1.5px solid var(--dark);
  cursor: pointer;
  transition: background .3s ease, color .3s ease, transform .3s ease;
}

.tbg-btn:hover {
  background: var(--orange);
  border-color: var(--orange);
  transform: translateY(-2px);
}

.tbg-btn--outline {
  background: transparent;
  color: var(--dark);
}

.tbg-btn--outline:hover {
  background: var(--dark);
  color: var(--cream);
  border-color: var(--dark);
}

/* =============================================
   RESPONSIVE GRID HELPERS
   ============================================= */
@media (max-width: 768px) {
  .tbg-services-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .tbg-work-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .tbg-about-grid {
    grid-template-columns: 1fr !important;
  }

  .tbg-cs-meta {
    flex-direction: column;
    gap: 20px !important;
  }

  .tbg-cs-body {
    grid-template-columns: 1fr !important;
  }

  .tbg-cs-gallery {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .tbg-work-grid {
    grid-template-columns: 1fr !important;
  }

  .tbg-footer-bottom {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px !important;
  }
}
