/* ─── Template B — Gallery / Exploratory Work ─────────── */
/* Used for: 007, Posters, Ukraine, and similar             */

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

:root {
  --white:       #ffffff;
  --light:       #f5f5f5;
  --border:      #e2e2e2;
  --text:        #1c1c1c;
  --muted:       #666666;
  --accent:      #0057D9;
  --accent-dark: #004ab8;
  --navy:        #111111;
  --radius:      10px;
  --max-w:       1440px;
  --ease:        0.22s ease;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--white);
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, h5 { font-family: 'Montserrat', sans-serif; line-height: 1.25; font-weight: 700; }

/* ── FOCUS RING ─────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* ── PAGE LOAD FADE-IN ──────────────────────────────────── */
body { opacity: 0; transition: opacity 0.4s ease; }
body.tb-loaded { opacity: 1; }

/* ── CONTAINER ──────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 80px;
}

/* ════════════════════════════════════════════════════════
   CTA BUTTON SYSTEM (mirrors Template A)
   Primary   → .tb-btn.tb-btn--primary
   Secondary → .tb-btn.tb-btn--secondary
   Tertiary  → .tb-btn.tb-btn--tertiary
   ════════════════════════════════════════════════════════ */
.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 6px;
  padding: 10px 24px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  user-select: none;
  transition: background var(--ease), color var(--ease), border-color var(--ease), box-shadow var(--ease), transform 0.12s ease;
}
.tb-btn:active { transform: scale(0.97); }

.tb-btn--primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}
.tb-btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 4px 16px rgba(0,87,217,0.28);
}
.tb-btn--primary:active { background: var(--accent-dark); box-shadow: none; }

.tb-btn--secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.tb-btn--secondary:hover {
  background: var(--accent);
  color: var(--white);
  box-shadow: 0 4px 16px rgba(0,87,217,0.2);
}
.tb-btn--secondary:active {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--white);
  box-shadow: none;
}

.tb-btn--tertiary {
  background: none;
  border-color: transparent;
  color: var(--accent);
  padding: 0;
  gap: 4px;
}
.tb-btn--tertiary::after { content: '→'; display: inline-block; transition: transform var(--ease); }
.tb-btn--tertiary:hover { color: var(--accent-dark); }
.tb-btn--tertiary:hover::after { transform: translateX(4px); }
.tb-btn--tertiary:active { color: var(--accent-dark); transform: scale(0.98); }

/* ── NAV ───────────────────────────────────────────────── */
.tb-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.3s ease;
}
.tb-nav--scrolled {
  box-shadow: 0 2px 24px rgba(0,0,0,0.07);
  border-bottom-color: transparent;
}
.tb-nav .container {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tb-nav-home {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: color var(--ease);
}
.tb-nav-home:hover { color: var(--accent); }
.tb-nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}
.tb-nav-links a {
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: color var(--ease);
}
.tb-nav-links a:hover { color: var(--accent); }

/* ── HERO ──────────────────────────────────────────────── */
/* Background colour set inline per project                */
.tb-hero {
  padding: 72px 0 64px;
  background: var(--navy);
}
.tb-eyebrow-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}
.tb-eyebrow {
  display: inline-flex;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  border-radius: 20px;
  padding: 4px 14px;
}
.tb-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 800;
  color: var(--white);
  line-height: 1.08;
  max-width: 820px;
  margin-bottom: 24px;
}
.tb-hero-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.tb-hero-meta span {
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
}

/* ── INTRO ─────────────────────────────────────────────── */
.tb-intro {
  padding: 64px 0 48px;
}
.tb-intro-text {
  max-width: 720px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text);
}
.tb-intro-text p + p { margin-top: 16px; }

/* ── CALLOUT ───────────────────────────────────────────── */
/* Optional highlight block — same as Template A           */
.tb-callout {
  background: var(--light);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 28px 32px;
  margin-top: 32px;
  max-width: 720px;
}
.tb-callout-label {
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 10px;
}
.tb-callout p {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
}

/* ── GALLERY ───────────────────────────────────────────── */
.tb-gallery {
  padding: 0 0 80px;
}
.tb-gallery-heading {
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 24px;
}

/* Grid variants — set on .tb-gallery-grid */
.tb-gallery-grid {
  display: grid;
  gap: 8px;
}

/* Square: icons, illustrations, social graphics           */
.tb-gallery-grid--square {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.tb-gallery-grid--square .tb-gallery-item img {
  aspect-ratio: 1;
}

/* Portrait: posters, editorial, A-series print           */
.tb-gallery-grid--portrait {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.tb-gallery-grid--portrait .tb-gallery-item img {
  aspect-ratio: 2 / 3;
}

/* Wide: landscapes, screenshots, horizontal compositions */
.tb-gallery-grid--wide {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.tb-gallery-grid--wide .tb-gallery-item img {
  aspect-ratio: 4 / 3;
}

/* ── Gallery item ──────────────────────────────────────── */
.tb-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--light);
  cursor: zoom-in;
}
.tb-gallery-item img {
  width: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s cubic-bezier(0, 0, 0.2, 1);
}
.tb-gallery-item:hover img { transform: scale(1.05); }

/* Caption overlay — fades in on hover */
.tb-gallery-item figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 14px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.72));
  color: rgba(255,255,255,0.95);
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.tb-gallery-item:hover figcaption {
  opacity: 1;
  transform: none;
}

/* Placeholder for during build */
.tb-img-placeholder {
  background: var(--light);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  aspect-ratio: 1;
}

/* ── READING PROGRESS BAR ──────────────────────────────── */
.tb-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ── BACK TO TOP ────────────────────────────────────────── */
.tb-back-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--ease), transform var(--ease), background var(--ease);
  z-index: 90;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.tb-back-top.visible { opacity: 1; transform: none; }
.tb-back-top:hover { background: var(--accent); }

/* ── LIGHTBOX ───────────────────────────────────────────── */
.tb-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.94);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.tb-lightbox.active { opacity: 1; pointer-events: all; }
.tb-lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 6px;
}
.tb-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 22px;
  cursor: pointer;
  padding: 8px;
  transition: color var(--ease);
}
.tb-lightbox-close:hover { color: var(--white); }
.tb-lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
}

/* ── SCROLL REVEAL ──────────────────────────────────────── */
.tb-reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}
.tb-reveal.tb-reveal--visible {
  opacity: 1;
  transform: none;
}

/* ── FOOTER ────────────────────────────────────────────── */
.tb-footer {
  background: #000000;
  padding: 32px 0;
}
.tb-footer .container {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.tb-footer-contact {
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  text-align: right;
}
.tb-footer-contact a { color: rgba(255,255,255,0.55); }
.tb-footer-contact a:hover { color: white; }

/* ── REDUCED MOTION ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  body { opacity: 1 !important; transition: none !important; }
  .tb-reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .tb-gallery-item img,
  .tb-gallery-item figcaption,
  .tb-progress,
  .tb-lightbox,
  .tb-back-top { transition: none !important; }
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1280px) {
  .container { padding: 0 48px; }
}
@media (max-width: 960px) {
  .container { padding: 0 32px; }
  .tb-gallery-grid--square { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .tb-gallery-grid--portrait { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .tb-gallery-grid--wide { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
}
@media (max-width: 640px) {
  .container { padding: 0 24px; }
  .tb-hero { padding: 48px 0 40px; }
  .tb-gallery-grid--square { grid-template-columns: repeat(3, 1fr); }
  .tb-gallery-grid--portrait { grid-template-columns: repeat(2, 1fr); }
  .tb-gallery-grid--wide { grid-template-columns: repeat(2, 1fr); }
  .tb-nav-links { display: none; }
}
