/* ═══════════════════════════════════════════════════════════
   Berwick Glass — Theme Stylesheet
   ═══════════════════════════════════════════════════════════ */

/* ── CSS Variables ─────────────────────────────────────── */
:root {
  --bg-dark:    #0d1219;
  --bg-surface: #141c25;
  --bg-light:   #f3f2ee;
  --bg-text:    #edecea;
  --bg-muted:   #8a9199;
  --bg-accent:  #d4782a;
  --bg-border:  rgba(255, 255, 255, 0.07);
  --bg-serif:   'Cormorant Garamond', Georgia, serif;
  --bg-sans:    'DM Sans', system-ui, sans-serif;
}
@supports (color: oklch(0 0 0)) {
  :root { --bg-accent: oklch(0.70 0.185 47); }
}

/* ── Base reset ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--bg-sans);
  background: var(--bg-light);
  color: #1a1f27;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

/* Remove default WP block margins */
.wp-block-group,
.wp-block-columns,
.wp-block-column,
.wp-block-cover {
  margin-top: 0;
  margin-bottom: 0;
}

/* ── Header ────────────────────────────────────────────── */
.berwick-header {
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--bg-border);
  transition: background 0.3s;
}

/* Logo in header */
.berwick-nav-logo .wp-block-site-logo,
.berwick-nav-logo img {
  display: block;
  height: 44px;
  width: auto;
  object-fit: contain;
}

/* Logo in footer */
.berwick-footer-logo .wp-block-site-logo,
.berwick-footer-logo img {
  display: block;
  height: 56px;
  width: auto;
  object-fit: contain;
  margin-bottom: 0;
}

.berwick-header .wp-block-site-title a {
  font-family: var(--bg-serif);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg-text) !important;
  text-decoration: none;
}

/* Navigation — enforce gap between items */
.berwick-header .wp-block-navigation .wp-block-navigation__container,
.berwick-header .wp-block-navigation > ul,
.berwick-header nav > ul {
  display: flex !important;
  gap: 36px !important;
  column-gap: 36px !important;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.berwick-header .wp-block-navigation .wp-block-navigation-item {
  margin: 0 !important;
  padding: 0 !important;
}

.berwick-header .wp-block-navigation a {
  font-family: var(--bg-sans);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--bg-muted) !important;
  text-decoration: none;
  transition: color 0.2s;
  white-space: nowrap;
}

.berwick-header .wp-block-navigation a:hover {
  color: var(--bg-text) !important;
}

.berwick-header .nav-cta > a,
.berwick-header .wp-block-navigation-item.nav-cta > a {
  background: var(--bg-accent) !important;
  color: #fff !important;
  padding: 9px 22px;
  border-radius: 2px;
  font-weight: 500 !important;
  transition: opacity 0.2s !important;
}

.berwick-header .nav-cta > a:hover,
.berwick-header .wp-block-navigation-item.nav-cta > a:hover {
  opacity: 0.85;
}

/* Mobile hamburger */
.berwick-header .wp-block-navigation__responsive-container-open,
.berwick-header .wp-block-navigation__responsive-container-close {
  color: var(--bg-muted);
}

/* ── Hero ──────────────────────────────────────────────── */
.bg-hero-cover .wp-block-cover__inner-container {
  max-width: 860px;
}

/* ── Eyebrow label ─────────────────────────────────────── */
.bg-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bg-accent);
  margin-bottom: 28px;
  font-family: var(--bg-sans);
}
.bg-eyebrow::before {
  content: '';
  width: 30px;
  height: 1px;
  background: currentColor;
}

/* ── Section label ─────────────────────────────────────── */
.bg-section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--bg-accent);
  margin-bottom: 18px;
  font-family: var(--bg-sans);
}
.bg-section-label::before {
  content: '';
  width: 22px;
  height: 1px;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Trust bar ─────────────────────────────────────────── */
.bg-trust-bar .wp-block-columns {
  gap: 0 !important;
  align-items: stretch;
}
.bg-trust-bar .wp-block-column {
  border-right: 1px solid var(--bg-border);
  padding: 28px 36px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.bg-trust-bar .wp-block-column:last-child { border-right: none; }

.bg-trust-big {
  font-family: var(--bg-serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--bg-accent);
  line-height: 1;
}
.bg-trust-small {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bg-muted);
  margin-top: 4px;
  font-family: var(--bg-sans);
}

/* ── About section image column ────────────────────────── */
.bg-about-section { align-items: stretch !important; }
.bg-about-section > .wp-block-column:last-child { padding: 0 !important; }
.bg-about-section > .wp-block-column:last-child .wp-block-cover {
  height: 100%;
  min-height: 540px;
  margin: 0;
}

/* ── Service cards ─────────────────────────────────────── */
.bg-services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.bg-svc-card {
  position: relative;
  overflow: hidden;
  transition: background 0.3s;
  padding: 48px 40px;
  background: #fff;
}
.bg-svc-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--bg-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s ease;
}
.bg-svc-card:hover { background: #f9f9f7; }
.bg-svc-card:hover::after { transform: scaleX(1); }

.bg-svc-num {
  font-family: var(--bg-serif);
  font-size: 3.2rem;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.055);
  line-height: 1;
  margin-bottom: 22px;
}
.bg-svc-name {
  font-family: var(--bg-serif);
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--bg-dark);
  line-height: 1.2;
  margin-bottom: 12px;
}
.bg-svc-desc {
  font-size: 0.87rem;
  color: #586070;
  line-height: 1.72;
  font-weight: 300;
  margin: 0;
}
.bg-svc-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 26px;
  font-size: 0.73rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg-accent);
  font-weight: 500;
  text-decoration: none;
}

/* ── Gallery ───────────────────────────────────────────── */
.bg-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: 260px 260px;
  gap: 4px;
}
.bg-g-item { overflow: hidden; background: #dddbd6; }
.bg-g-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.4s;
  filter: saturate(0.88);
  display: block;
}
.bg-g-item:hover img { transform: scale(1.06); filter: saturate(1.1); }
.bg-g-wide { grid-column: span 2; }
.bg-g-tall  { grid-row: span 2; }

/* ── Markets ───────────────────────────────────────────── */
.bg-markets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--bg-border);
}
.bg-mkt-item {
  padding: 64px 52px;
  border-right: 1px solid var(--bg-border);
  transition: background 0.3s;
}
.bg-mkt-item:last-child { border-right: none; }
.bg-mkt-item:hover { background: rgba(255, 255, 255, 0.02); }

.bg-mkt-num {
  font-family: var(--bg-serif);
  font-size: 1rem;
  color: var(--bg-accent);
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}
.bg-mkt-name {
  font-family: var(--bg-serif);
  font-size: 2.4rem;
  font-weight: 300;
  color: var(--bg-text);
  line-height: 1.1;
  margin-bottom: 16px;
}
.bg-mkt-desc {
  font-size: 0.88rem;
  color: var(--bg-muted);
  line-height: 1.75;
  font-weight: 300;
  margin: 0;
}

/* ── Contact ───────────────────────────────────────────── */
.bg-contact-cols.wp-block-columns {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 0 !important;
}
.bg-ci-item { margin-bottom: 32px; }
.bg-ci-label {
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--bg-muted);
  margin-bottom: 6px;
  font-family: var(--bg-sans);
}
.bg-ci-value {
  font-size: 0.95rem;
  color: var(--bg-text);
  font-weight: 300;
  line-height: 1.6;
  font-family: var(--bg-sans);
}
.bg-ci-value a { color: var(--bg-accent); text-decoration: none; }
.bg-social-link {
  width: 36px; height: 36px;
  border: 1px solid var(--bg-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  transition: border-color 0.2s;
  text-decoration: none;
}
.bg-social-link:hover { border-color: var(--bg-accent); }

/* ── Contact form ──────────────────────────────────────── */
.bg-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.bg-form-field label {
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6a7280;
  font-weight: 400;
  font-family: var(--bg-sans);
}
.bg-form-field input,
.bg-form-field select,
.bg-form-field textarea {
  background: var(--bg-light);
  border: 1px solid #dddbd6;
  border-radius: 2px;
  padding: 12px 16px;
  font-family: var(--bg-sans);
  font-size: 0.9rem;
  color: var(--bg-dark);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}
.bg-form-field input:focus,
.bg-form-field select:focus,
.bg-form-field textarea:focus { border-color: var(--bg-accent); }
.bg-form-field textarea { resize: vertical; min-height: 120px; }
.bg-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bg-form-submit button {
  background: var(--bg-dark);
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 14px 40px;
  border-radius: 2px;
  font-family: var(--bg-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.2s;
  margin-top: 8px;
}
.bg-form-submit button:hover {
  background: var(--bg-accent);
  transform: translateY(-1px);
}

/* ── Footer ────────────────────────────────────────────── */
.berwick-footer .wp-block-site-title a {
  font-family: var(--bg-serif);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bg-text) !important;
  text-decoration: none;
}
.berwick-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.berwick-footer-links a {
  color: var(--bg-muted);
  font-size: 0.84rem;
  font-weight: 300;
  text-decoration: none;
  transition: color 0.2s;
}
.berwick-footer-links a:hover { color: var(--bg-text); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 1100px) {
  .bg-markets-grid { gap: 0; }
  .bg-mkt-item { padding: 48px 36px; }
}

@media (max-width: 900px) {
  .bg-services-grid  { grid-template-columns: 1fr 1fr; }
  .bg-gallery-grid   { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 220px); }
  .bg-g-wide { grid-column: span 2; }
  .bg-g-tall { grid-row: span 1; }
  .bg-markets-grid   { grid-template-columns: 1fr; }
  .bg-mkt-item       { border-right: none; border-bottom: 1px solid var(--bg-border); padding: 48px 32px; }
  .bg-mkt-item:last-child { border-bottom: none; }
  .bg-about-section > .wp-block-column:last-child .wp-block-cover { min-height: 380px; }
  .bg-contact-cols.wp-block-columns { flex-wrap: wrap !important; }
  .bg-contact-cols .wp-block-column { flex-basis: 100% !important; }
  .berwick-header .wp-block-group { padding-left: 32px !important; padding-right: 32px !important; }
}

@media (max-width: 640px) {
  .bg-services-grid  { grid-template-columns: 1fr; }
  .bg-gallery-grid   { grid-template-columns: 1fr 1fr; grid-template-rows: repeat(4, 180px); }
  .bg-trust-bar .wp-block-column {
    border-right: none;
    border-bottom: 1px solid var(--bg-border);
  }
  .bg-mkt-item { padding: 40px 24px; }
  .bg-form-row { grid-template-columns: 1fr; }
  .bg-about-section > .wp-block-column:last-child .wp-block-cover { min-height: 300px; }
  .berwick-header .wp-block-group { padding-left: 20px !important; padding-right: 20px !important; }
}
