/*
Theme Name: JW Custom Tile & Glass
Theme URI: https://jwcustomtileandglass.com
Author: JW Custom Tile & Glass
Description: Custom business-card theme for JW Custom Tile & Glass — tile installation and custom glasswork. Warm stone tones, deep pine green, brass accents, and a tile-seam signature motif.
Version: 1.0.7
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: jwctg
*/

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* Colors */
  --color-bg: #F5F1E8;          /* warm limestone */
  --color-bg-soft: #ECE5D4;     /* sand, section alt */
  --color-card: #FFFFFF;
  --color-ink: #23241E;         /* grout charcoal */
  --color-ink-soft: #56594E;
  --color-pine: #1E3B33;        /* glazed tile green — primary brand */
  --color-pine-deep: #12211D;   /* footer / darkest */
  --color-pine-mid: #2C5348;
  --color-glass: #C7DBD4;       /* pale seafoam glass tint */
  --color-glass-line: #A9C6BC;
  --color-brass: #A87C3F;       /* fixture brass — accent / CTA */
  --color-brass-light: #C9A06A;
  --color-border: rgba(35, 36, 30, 0.12);

  /* Type */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* Scale */
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.75rem, 1.5rem + 1vw, 2.25rem);
  --step-3: clamp(2.25rem, 1.9rem + 1.6vw, 3.25rem);
  --step-4: clamp(2.75rem, 2.1rem + 2.8vw, 4.5rem);

  --container: 1220px;
  --radius: 2px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 0.5em;
  color: var(--color-pine);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-ink); }
p { margin: 0 0 1.1em; color: var(--color-ink-soft); }
:focus-visible { outline: 2px solid var(--color-brass); outline-offset: 3px; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-brass);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--color-brass); display: inline-block; }

/* ==========================================================================
   3. SIGNATURE ELEMENT — Tile Seam divider
   ========================================================================== */
.tile-seam {
  height: 10px;
  width: 100%;
  background-image: repeating-linear-gradient(
    90deg,
    var(--color-brass) 0px, var(--color-brass) 8px,
    transparent 8px, transparent 12px,
    var(--color-pine-mid) 12px, var(--color-pine-mid) 20px,
    transparent 20px, transparent 24px
  );
  background-repeat: repeat-x;
  background-position: center;
  background-size: auto 3px;
  opacity: 0.9;
}
.tile-seam--soft {
  background-image: repeating-linear-gradient(
    90deg,
    var(--color-glass-line) 0px, var(--color-glass-line) 8px,
    transparent 8px, transparent 12px,
    var(--color-border) 12px, var(--color-border) 20px,
    transparent 20px, transparent 24px
  );
}

/* ==========================================================================
   4. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 30px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.35s var(--ease), background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.btn-primary { background: var(--color-brass); color: #fff; }
.btn-primary:hover { background: var(--color-brass-light); transform: translateY(-2px); }
.btn-outline { border-color: currentColor; color: inherit; background: transparent; }
.btn-outline:hover { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); transform: translateY(-2px); }
.btn-outline.on-dark:hover { background: #fff; color: var(--color-pine-deep); border-color: #fff; }

/* ==========================================================================
   5. HEADER / NAV
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 0;
  transition: background 0.4s var(--ease), padding 0.4s var(--ease), box-shadow .4s var(--ease);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-header.is-scrolled { background: var(--color-pine); padding: 14px 0; box-shadow: 0 6px 24px rgba(0,0,0,0.15); }
.home:not(.is-scrolled) .site-header,
body:not(.has-solid-header) .site-header:not(.is-scrolled) { background: transparent; }
.site-branding { display: flex; align-items: center; gap: 12px; }
.site-logo-mark { width: 38px; height: 38px; flex-shrink: 0; }
.site-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: #fff;
  line-height: 1.1;
  margin: 0;
}
.site-title span { display: block; font-family: var(--font-body); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--color-glass); font-weight: 500; margin-top: 3px; }

.main-navigation { display: flex; align-items: center; gap: 26px; }
.main-navigation ul { display: flex; gap: 20px; }
.main-navigation a {
  color: #fff;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  position: relative;
  padding-bottom: 4px;
}
.main-navigation a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--color-brass-light);
  transition: width 0.3s var(--ease);
}
.main-navigation a:hover::after, .main-navigation .current-menu-item a::after { width: 100%; }

.header-cta { display: flex; align-items: center; gap: 10px; }
.header-phone {
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.header-phone svg { width: 15px; height: 15px; stroke: var(--color-brass-light); flex-shrink: 0; }
.header-cta .btn { flex-shrink: 0; white-space: nowrap; }

.badge-veteran-header {
  display: inline-flex;
  align-items: center;
  align-self: center;
  flex-shrink: 0;
  gap: 7px;
  padding: 9px 14px 8px;
  border: 1.5px solid #fff;
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.badge-veteran-header svg { width: 13px; height: 13px; fill: #C9A06A; flex-shrink: 0; display: block; }
.badge-veteran-header span { display: block; line-height: 1; }

.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 30px; height: 22px; position: relative;
}
.menu-toggle span { position: absolute; left: 0; right: 0; height: 2px; background: #fff; transition: all .3s var(--ease); }
.menu-toggle span:nth-child(1) { top: 0; }
.menu-toggle span:nth-child(2) { top: 10px; }
.menu-toggle span:nth-child(3) { top: 20px; }
.menu-toggle.is-open span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* ==========================================================================
   6. HERO
   ========================================================================== */
.hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: flex-end;
  color: #fff;
  background: var(--color-pine-deep);
  overflow: hidden;
}
.hero-media { position: absolute; inset: 0; }
.hero-media img, .hero-media video { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18,33,29,0.35) 0%, rgba(18,33,29,0.55) 55%, rgba(18,33,29,0.92) 100%);
}
.hero-inner { position: relative; z-index: 2; padding-bottom: 88px; padding-top: 200px; width: 100%; }
.hero-inner h1 { color: #fff; max-width: 15ch; }
.hero-inner .lede { color: var(--color-glass); font-size: 1.1rem; max-width: 46ch; margin-bottom: 34px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero--page { min-height: 46vh; align-items: center; }
.hero--page .hero-inner { padding-top: 130px; padding-bottom: 40px; }
.hero--page h1 { font-size: var(--step-3); }

/* ==========================================================================
   7. SECTIONS — shared rhythm
   ========================================================================== */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-soft { background: var(--color-bg-soft); }
.section-pine { background: var(--color-pine); color: #fff; }
.section-pine h2, .section-pine h3 { color: #fff; }
.section-pine p { color: var(--color-glass); }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 90px); align-items: center; }
.split img { border-radius: var(--radius); width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.split-copy .eyebrow { margin-bottom: 14px; }

.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--color-border); border: 1px solid var(--color-border); }
.service-card {
  background: var(--color-bg);
  padding: 40px 30px;
  transition: background 0.35s var(--ease);
  position: relative;
}
.service-card:hover { background: var(--color-card); }
.service-icon { width: 40px; height: 40px; margin-bottom: 22px; stroke: var(--color-brass); fill: none; stroke-width: 1.4; }
.service-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.service-card p { font-size: 0.92rem; margin-bottom: 0; }
.service-card .num { position: absolute; top: 24px; right: 28px; font-family: var(--font-display); color: var(--color-border); font-size: 1.4rem; }

.reasons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; margin-top: 20px; }
.reason h4 { color: var(--color-pine); margin-bottom: 10px; }
.reason .tile-seam { width: 44px; margin-bottom: 18px; }

.cta-band { text-align: center; }
.cta-band h2 { max-width: 20ch; margin-left: auto; margin-right: auto; }
.cta-band .btn { margin-top: 10px; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.gallery-grid img { width: 100%; height: 260px; object-fit: cover; border-radius: var(--radius); transition: transform .6s var(--ease); }
.gallery-grid a { overflow: hidden; display: block; border-radius: var(--radius); }
.gallery-grid a:hover img { transform: scale(1.06); }

.page-content { max-width: 760px; }
.page-content h2 { margin-top: 1.6em; }
.page-content ul { list-style: disc; padding-left: 1.4em; margin-bottom: 1.2em; }
.page-content ul li { color: var(--color-ink-soft); margin-bottom: 0.4em; }
.page-content a { color: var(--color-brass); text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   8. CONTACT PAGE
   ========================================================================== */
.contact-wrap { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 60px; align-items: start; }
.contact-form { background: var(--color-card); border: 1px solid var(--color-border); padding: clamp(28px, 4vw, 46px); border-radius: var(--radius); }
.form-row { margin-bottom: 20px; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
label { display: block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--color-pine); margin-bottom: 8px; }
input[type=text], input[type=email], input[type=tel], select, textarea {
  width: 100%;
  padding: 13px 14px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-ink);
  transition: border-color .25s var(--ease);
}
input:focus, select:focus, textarea:focus { border-color: var(--color-brass); }
textarea { resize: vertical; min-height: 130px; }
.form-hpot { position: absolute; left: -9999px; }
.form-status { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 0.9rem; }
.form-status.success { background: #E3EEE8; color: var(--color-pine); border: 1px solid var(--color-glass-line); }
.form-status.error { background: #F6E6DE; color: #8A3E1B; border: 1px solid #E3B79B; }

.contact-info-card { background: var(--color-pine); color: #fff; padding: clamp(28px, 4vw, 46px); border-radius: var(--radius); }
.contact-info-card h3 { color: #fff; font-size: 1.4rem; }
.contact-info-row { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.14); }
.contact-info-row:first-of-type { border-top: none; margin-top: 6px; }
.contact-info-row svg { width: 20px; height: 20px; stroke: var(--color-brass-light); flex-shrink: 0; margin-top: 2px; }
.contact-info-row a, .contact-info-row span { color: var(--color-glass); font-size: 0.92rem; line-height: 1.5; }
.contact-info-row strong { display: block; color: #fff; font-size: 0.95rem; margin-bottom: 2px; }
.map-frame { margin-top: 24px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--color-border); }
.map-frame iframe { width: 100%; height: 220px; border: 0; display: block; }
.social-row { display: flex; gap: 14px; margin-top: 22px; }
.social-row a { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.25); border-radius: 50%; transition: background .3s var(--ease); }
.social-row a:hover { background: rgba(255,255,255,0.14); }
.social-row svg { width: 15px; height: 15px; stroke: #fff; fill: none; }

/* ==========================================================================
   8b. GALLERY PAGE
   ========================================================================== */
.gallery-content { max-width: none; margin-bottom: 20px; }
.gallery-content > p:first-child { max-width: 70ch; }
.gallery-content .wp-block-gallery,
.gallery-content .blocks-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  list-style: none;
  padding: 0;
  margin: 30px 0;
}
.gallery-content .wp-block-gallery figure,
.gallery-content .blocks-gallery-item { margin: 0; }
.gallery-content .wp-block-gallery img,
.gallery-content .blocks-gallery-item img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: zoom-in;
  transition: transform 0.6s var(--ease);
}
.gallery-content .wp-block-gallery figure:hover img { transform: scale(1.05); }
.gallery-content figcaption {
  font-size: 0.82rem;
  color: var(--color-ink-soft);
  margin-top: 8px;
  text-align: left;
}

.gallery-placeholder { margin-top: 10px; }
.gallery-grid--placeholder .gallery-placeholder-tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1/1;
  border: 1px solid var(--color-border);
}
.gallery-grid--placeholder .gallery-placeholder-tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0.96; transition: transform 0.6s var(--ease); }
.gallery-grid--placeholder .gallery-placeholder-tile:hover img { transform: scale(1.04); }
.gallery-placeholder-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  background: linear-gradient(0deg, rgba(18,33,29,0.82) 0%, rgba(18,33,29,0) 100%);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  pointer-events: none;
}

/* ==========================================================================
   8c. LIGHTBOX
   ========================================================================== */
.jwctg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(11, 22, 20, 0.94);
  padding: 40px;
}
.jwctg-lightbox.is-open { display: flex; }
.jwctg-lightbox-img {
  max-width: min(90vw, 1100px);
  max-height: 84vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.jwctg-lightbox-close, .jwctg-lightbox-prev, .jwctg-lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s var(--ease);
}
.jwctg-lightbox-close:hover, .jwctg-lightbox-prev:hover, .jwctg-lightbox-next:hover { background: rgba(255,255,255,0.2); }
.jwctg-lightbox-close { top: 24px; right: 24px; width: 44px; height: 44px; font-size: 1.6rem; line-height: 1; }
.jwctg-lightbox-prev, .jwctg-lightbox-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2rem; }
.jwctg-lightbox-prev { left: 24px; }
.jwctg-lightbox-next { right: 24px; }

/* ==========================================================================
   9. FOOTER
   ========================================================================== */
.site-footer { background: var(--color-pine-deep); color: var(--color-glass); }
.footer-top { padding: clamp(56px, 8vw, 90px) 0 40px; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand .site-title { color: #fff; }
.footer-brand p { color: var(--color-glass); max-width: 32ch; margin-top: 16px; font-size: 0.9rem; }
.footer-col h4 { color: #fff; font-size: 0.78rem; margin-bottom: 18px; }
.footer-col ul li { margin-bottom: 11px; }
.footer-col a { color: var(--color-glass); font-size: 0.9rem; transition: color .25s var(--ease); }
.footer-col a:hover { color: var(--color-brass-light); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 22px 0; display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: rgba(199,219,212,0.6); }
.footer-bottom a { color: rgba(199,219,212,0.75); }

/* ==========================================================================
   10. EDITOR STYLES
   ========================================================================== */
.editor-styles-wrapper { font-family: var(--font-body); color: var(--color-ink); }
.editor-styles-wrapper h1, .editor-styles-wrapper h2, .editor-styles-wrapper h3 { font-family: var(--font-display); color: var(--color-pine); }

/* ==========================================================================
   11. RESPONSIVE
   ========================================================================== */
@media (max-width: 1400px) and (min-width: 861px) {
  .badge-veteran-header { display: none; }
}
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .reasons { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .main-navigation, .header-phone-wrap { display: none; }
  .menu-toggle { display: block; }
  .main-navigation.is-open {
    display: flex; position: fixed; inset: 0; top: 0;
    background: var(--color-pine-deep);
    flex-direction: column; justify-content: center; align-items: center;
    gap: 30px;
  }
  .main-navigation.is-open ul { flex-direction: column; align-items: center; gap: 26px; }
  .main-navigation.is-open a { font-size: 1.3rem; }
  .split { grid-template-columns: 1fr; }
  .split img { aspect-ratio: 16/10; }
  .contact-wrap { grid-template-columns: 1fr; }
  .form-row-split { grid-template-columns: 1fr; }

  .header-cta { flex-wrap: wrap; justify-content: flex-end; gap: 8px; row-gap: 8px; }
  .header-cta .btn-primary { display: none; }
  .badge-veteran-header {
    display: inline-flex;
    order: 1;
    padding: 7px 11px 6px;
    font-size: 0.64rem;
    gap: 5px;
  }
  .badge-veteran-header svg { width: 11px; height: 11px; }
  .menu-toggle { order: 2; }
}
@media (max-width: 640px) {
  .services-grid, .gallery-grid, .reasons { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 10px; text-align: center; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { justify-content: center; }
  .jwctg-lightbox-prev, .jwctg-lightbox-next { width: 42px; height: 42px; font-size: 1.6rem; }
  .jwctg-lightbox-prev { left: 10px; }
  .jwctg-lightbox-next { right: 10px; }
  .gallery-content .wp-block-gallery,
  .gallery-content .blocks-gallery-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 400px) {
  .badge-veteran-header span { display: none; }
  .badge-veteran-header { padding: 8px; border-radius: 50%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}