/*
Theme Name: Tomislav Čorak — Chris Bleier Edition
Theme URI: https://www.tomislavcorak.com
Author: Tomislav Čorak
Author URI: https://www.tomislavcorak.com
Description: Pixel-for-pixel Chris Bleier inspired Minimal Square Grid portfolio theme for Tomislav Čorak — 3D Artist & Photographer. Includes front-page.php to override WordPress static front page settings, 4-column 1px-gutter 1:1 square grid with 65% white hover overlay, interactive Before/After drone sliders, Full Stack / Grid / Lightbox switcher, and automatic WPBakery/HyperX style isolation.
Version: 4.0.0
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: tc-gallery
*/

:root {
  --font-display: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  background-color: #ffffff !important;
  color: #000000 !important;
}

body.tc-cb-body {
  background-color: #ffffff !important;
  color: #000000 !important;
  font-family: var(--font-sans) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.tc-cb-body a {
  color: inherit;
  text-decoration: none;
}

/* Header (Centered max-width container matching grid width) */
.tc-cb-header {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  background: #ffffff;
  padding: 32px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

@media (max-width: 768px) {
  .tc-cb-header {
    padding: 20px 24px;
    flex-wrap: wrap;
  }
}

.tc-cb-brand {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #000000;
  cursor: pointer;
  transition: opacity 150ms ease;
}

.tc-cb-brand:hover {
  opacity: 0.8;
}

.tc-cb-header-right {
  display: flex;
  align-items: center;
  gap: 32px;
}

.tc-cb-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.tc-cb-nav-link {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 400;
  color: #000000;
  padding: 4px 0;
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  transition: all 150ms ease;
}

.tc-cb-nav-link:hover {
  opacity: 0.65;
}

.tc-cb-nav-link.active {
  border-bottom: 1px solid #000000;
  font-weight: 500;
  opacity: 1;
}

.tc-cb-socials {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #000000;
}

@media (max-width: 1024px) {
  .tc-cb-socials {
    display: none;
  }
}

.tc-cb-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  transition: opacity 150ms ease;
}

.tc-cb-socials a:hover {
  opacity: 0.6;
}

/* Centered Portfolio Container (Not 100% edge-to-edge) */
.tc-cb-portfolio-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 48px 64px;
}

@media (max-width: 768px) {
  .tc-cb-portfolio-wrap {
    padding: 0 24px 48px;
  }
}

/* Filter Bar above Grid */
.tc-cb-filter-bar {
  padding: 0 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.tc-cb-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

.tc-cb-filter-btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.025em;
  color: rgba(0, 0, 0, 0.6);
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  cursor: pointer;
  transition: all 150ms ease;
}

.tc-cb-filter-btn:hover {
  color: #000000;
}

.tc-cb-filter-btn.active {
  color: #000000;
  font-weight: 700;
  border-bottom: 1px solid #000000;
}

.tc-cb-filter-hint {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0, 0, 0, 0.45);
}

/* 4-Column 1px-Gutter 1:1 Square Grid (#gridThumbs — 2 cols mobile, 4 cols desktop like chrisbleier.com) */
#gridThumbs.tc-cb-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background-color: #ffffff;
}

@media (min-width: 1024px) {
  #gridThumbs.tc-cb-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tc-cb-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background-color: #f5f5f5;
  cursor: pointer;
  user-select: none;
}

/* Fallback for older browsers without aspect-ratio */
@supports not (aspect-ratio: 1 / 1) {
  .tc-cb-tile::before {
    content: "";
    display: block;
    padding-top: 100%;
  }
  .tc-cb-tile > img {
    position: absolute;
    inset: 0;
  }
}

.tc-cb-tile img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  transition: transform 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.tc-cb-tile:hover img {
  transform: scale(1.04);
}

.tc-cb-tile-overlay {
  position: absolute;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.65);
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.tc-cb-tile:hover .tc-cb-tile-overlay {
  opacity: 1;
}

.tc-cb-tile-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  opacity: 0;
  transition: all 200ms ease;
  pointer-events: none;
}

.tc-cb-tile:hover .tc-cb-tile-text {
  opacity: 1;
}

.tc-cb-tile-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.02em;
  line-height: 1.25;
  transform: translateY(4px);
  transition: transform 200ms ease;
}

.tc-cb-tile:hover .tc-cb-tile-title {
  transform: translateY(0);
}

.tc-cb-tile-subtitle {
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.8);
  letter-spacing: 0.02em;
}

/* Single Project / Post View (Exact Chris Bleier Project Layout) */
.tc-cb-utility-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 48px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

@media (max-width: 768px) {
  .tc-cb-utility-bar {
    padding: 8px 24px 20px;
  }
}

.tc-cb-back-btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(0, 0, 0, 0.6);
  background: none;
  border: none;
  cursor: pointer;
}

.tc-cb-back-btn:hover {
  color: #000000;
}

.tc-cb-mode-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f5f5f5;
  padding: 4px;
}

.tc-cb-mode-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.tc-cb-mode-btn.active {
  background: #000000;
  color: #ffffff;
}

.tc-cb-project-header {
  max-width: 896px;
  margin: 0 auto;
  padding: 48px 24px 40px;
  text-align: center;
}

.tc-cb-project-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 700;
  color: #000000;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.tc-cb-project-subtitle {
  margin-top: 12px;
  font-size: 0.95rem;
  color: rgba(0, 0, 0, 0.75);
  letter-spacing: 0.02em;
}

.tc-cb-media-column {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

@media (max-width: 640px) {
  .tc-cb-media-column {
    padding: 0 16px;
    gap: 28px;
  }
}

.tc-cb-video-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
}

.tc-cb-interactive-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000000;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.tc-cb-video-wrap iframe,
.tc-cb-interactive-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Interactive Before / After Comparison Slider */
.tc-ba-slider {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  user-select: none;
  cursor: ew-resize;
  background: #f5f5f5;
}

.tc-ba-slider img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
  pointer-events: none;
}

.tc-ba-before-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  clip-path: inset(0 48% 0 0);
}

.tc-ba-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 52%;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.tc-ba-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 36px;
  height: 36px;
  border-radius: 9999px;
  background: #ffffff;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tc-ba-badge {
  position: absolute;
  bottom: 12px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(20, 20, 19, 0.78);
  color: #ffffff;
  border-radius: 4px;
  pointer-events: none;
}

.tc-ba-badge-left {
  left: 12px;
}

.tc-ba-badge-right {
  right: 12px;
}

/* Credits Two-Column Table */
.tc-cb-credits {
  max-width: 448px;
  margin: 24px auto 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 24px;
  font-size: 0.875rem;
  line-height: 1.95;
}

.tc-cb-credits-left {
  text-align: right;
  color: rgba(0, 0, 0, 0.6);
  user-select: none;
}

.tc-cb-credits-right {
  text-align: left;
  color: #000000;
}

/* Prev / Next Pagination (#itemPagination) */
.tc-cb-pagination {
  max-width: 1440px;
  margin: 32px auto 0;
  padding: 56px 48px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

@media (max-width: 768px) {
  .tc-cb-pagination {
    padding: 36px 24px;
  }
}

.tc-cb-page-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  background: none;
  border: none;
  cursor: pointer;
  color: #000000;
}

.tc-cb-page-label {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.55);
}

.tc-cb-page-title {
  font-family: var(--font-display);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 700;
  color: #000000;
}

/* Footer */
.tc-cb-footer {
  padding: 40px 24px;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.6);
  margin-top: auto;
}
