/*
Theme Name: ZHUPANICH
Theme URI: https://zhupanich.com
Author: Matija Zhupanich
Author URI: https://zhupanich.com
Description: Standalone, modern custom WordPress spatial theme for visual archives, design systems, photography, and essays.
Version: 1.6.0
Text Domain: zhupanich
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/

:root {
  --bg: #0c0c0d;
  --card-bg: #141416;
  --card-dim: rgba(0, 0, 0, 0.55);
  --text: #f0f0f2;
  --subtext: #8e8e93;
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.25);
  --radius: 0px;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'Xanh Mono', monospace;
  font-weight: 400;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding: 140px 0 120px 0;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.article-date {
  font-size: 10px;
  font-family: monospace;
  color: var(--subtext);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* --- UNIFIED CONTAINER ALIGNMENT --- */
.container-aligned {
  width: 90%;
  max-width: 1800px;
  margin: 0 auto;
}

/* --- TOP HEADER NAV (NO BACKGROUND) --- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: none !important;
  padding: 36px 0;
  pointer-events: none;
}

.top-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.top-nav-inner > * {
  pointer-events: auto;
}

.brand-mark {
  font-size: 16px;
  font-weight: 600;
  font-family: monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.brand-mark:hover {
  opacity: 0.8;
}

.menu-filters {
  display: flex;
  gap: 8px;
}

.menu-filters button {
  background: none;
  border: none;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  color: var(--subtext);
  transition: all 0.2s ease;
}

.menu-filters button.active,
.menu-filters button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

/* Mobile Hamburger Menu Button */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 12px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  align-items: center;
}

.mobile-menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--text);
  transition: all 0.3s ease;
}

/* --- FLAT CURSOR (ICON SVG: ARROW-UP-RIGHT FROM ICONSVG.XYZ) --- */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.2s ease;
  will-change: transform;
}

.cursor-arrow {
  width: 64px !important;
  height: 64px !important;
  stroke: #ffffff !important;
  color: #ffffff !important;
  stroke-width: 2.2 !important;
  stroke-linecap: square !important;
  stroke-linejoin: arcs !important;
  fill: none !important;
  filter: none !important;
  will-change: transform, opacity;
}

.cursor-label {
  font-size: 11px;
  font-weight: 500;
  font-family: monospace;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #0c0c0d;
  background: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius);
  white-space: nowrap;
  box-shadow: none !important;
}

.artifact.interactive {
  cursor: none !important;
}

/* --- CANVAS GRID ENGINE --- */
.canvas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: auto;
  gap: 56px;
  align-items: start;
}

.artifact {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.3s ease, transform 0.3s ease;
  transform: translateY(var(--shift, 0px));
  will-change: transform;
}

.artifact .dim-overlay {
  position: absolute;
  inset: 0;
  background: #000000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.artifact.interactive:hover .dim-overlay {
  opacity: 0.55;
}

.artifact.interactive:hover {
  border-color: var(--border-hover);
}

/* Pinned Sticky Post Styling */
.artifact.is-sticky {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.05);
}

.pinned-badge-above {
  background: #ffffff;
  color: #0c0c0d;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-bottom: 16px;
  z-index: 5;
  position: relative;
}

.pinned-badge-above svg {
  width: 13px;
  height: 13px;
  stroke: #0c0c0d;
}

/* --- CLASSIC HERO SECTION --- */
.classic-hero {
  margin-bottom: 72px;
  padding-bottom: 16px;
  border-bottom: none;
}

.hero-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-family: monospace;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 24px;
}

.classic-hero h1 {
  font-size: clamp(38px, 6vw, 84px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.05;
  color: #ffffff;
  margin-bottom: 24px;
}

.hero-subhead {
  font-size: 17px;
  line-height: 1.6;
  color: var(--subtext);
  max-width: 720px;
  margin-bottom: 32px;
}

/* --- ANIMATED GRADIENT MAP LINE --- */
.gradient-line-container {
  margin-bottom: 100px;
}

.gradient-line {
  max-width: 100%;
  height: 8px;
  border-radius: 0px;
  background: linear-gradient(
    90deg,
    #ff007a,
    #7928ca,
    #0070f3,
    #00dfd8,
    #20e260,
    #ffea00,
    #ff4d4d,
    #7928ca,
    #ff007a
  );
  background-size: 300% 100%;
  animation: gradientShift 8s linear infinite;
  box-shadow: 0 4px 20px rgba(121, 40, 202, 0.3);
  position: relative;
}

.gradient-line::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: inherit;
  background-size: inherit;
  animation: inherit;
  filter: blur(12px);
  opacity: 0.55;
  z-index: -1;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- MODAL TYPES & CARD VARIANTS --- */

/* Photography Modal — ORIGINAL ASPECT RATIO (NO CROPPING) */
.modal-photo {
  background: var(--card-bg);
  height: auto !important;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-photo img {
  width: 100%;
  height: auto !important;
  max-height: none !important;
  object-fit: contain !important;
  display: block;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-photo:hover img {
  transform: scale(1.02);
}

.photo-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(12, 12, 13, 0.85);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 10px;
  font-size: 11px;
  font-family: monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 3;
}

/* Design Case Study Modal */
.modal-design {
  padding: 36px 30px;
  min-height: 380px;
  background: var(--card-bg);
}
.design-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 3;
}
.design-preview {
  margin: 48px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  z-index: 3;
}
.design-preview h3 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.design-footer {
  font-size: 11px;
  color: var(--subtext);
  font-family: monospace;
  z-index: 3;
}

/* Writing / Essay Modal */
.modal-writing {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 24px 8px;
}
.modal-writing .dim-overlay { display: none; }
.modal-writing .essay-tag {
  font-size: 11px;
  font-family: monospace;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.modal-writing h2 {
  font-family: 'Xanh Mono', monospace;
  font-size: 36px;
  line-height: 1.15;
  margin-bottom: 18px;
  font-weight: normal;
  letter-spacing: -0.02em;
  color: #ffffff;
  transition: color 0.2s ease;
}
.modal-writing.interactive:hover h2 { color: #cfcfd4; }
.modal-writing p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--subtext);
}
.modal-writing .design-footer { margin-top: 18px; }

/* Apple Stickies Note Modal */
.modal-note {
  padding: 26px 22px 22px 22px;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  min-height: 180px;
}
.modal-note::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: rgba(0, 0, 0, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.modal-note .dim-overlay {
  background: rgba(0, 0, 0, 0.12);
}

/* Yellow Stickie (Default) */
.modal-note,
.modal-note.sticky-yellow {
  background: #fcf4a7;
  border: 1px solid #f6de59;
  color: #1c1917;
}
.modal-note .note-label,
.modal-note.sticky-yellow .note-label {
  font-size: 10px;
  font-family: monospace;
  color: #713f12;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  z-index: 3;
}
.modal-note p,
.modal-note.sticky-yellow p {
  font-size: 14px;
  line-height: 1.65;
  color: #292524;
  font-weight: 500;
  z-index: 3;
}

/* Pink Stickie */
.modal-note.sticky-pink {
  background: #fbcfe8;
  border: 1px solid #f9a8d4;
  color: #4c0519;
}
.modal-note.sticky-pink .note-label { color: #9f1239; }
.modal-note.sticky-pink p { color: #701a75; }

/* Green Stickie */
.modal-note.sticky-green {
  background: #c3fdaa;
  border: 1px solid #98ed79;
  color: #064e3b;
}
.modal-note.sticky-green .note-label { color: #14532d; }
.modal-note.sticky-green p { color: #14532d; }

/* Blue Stickie */
.modal-note.sticky-blue {
  background: #bcf2fd;
  border: 1px solid #7ee0f9;
  color: #0c4a6e;
}
.modal-note.sticky-blue .note-label { color: #0369a1; }
.modal-note.sticky-blue p { color: #0c4a6e; }

/* Purple Stickie */
.modal-note.sticky-purple {
  background: #bac9fb;
  border: 1px solid #8da3f8;
  color: #1e1b4b;
}
.modal-note.sticky-purple .note-label { color: #3730a3; }
.modal-note.sticky-purple p { color: #1e1b4b; }

/* Telemetry & Stats Modal */
.modal-stats {
  padding: 32px 28px;
  background: #111113;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 240px;
}
.modal-stats .stats-header {
  font-size: 11px;
  font-family: monospace;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.modal-stats .stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 16px 0;
}
.modal-stats .stat-val {
  font-size: 26px;
  font-family: monospace;
  font-weight: 600;
  color: #ffffff;
}
.modal-stats .stat-lbl {
  font-size: 10px;
  font-family: monospace;
  color: var(--subtext);
  text-transform: uppercase;
  margin-top: 4px;
}

/* Code Modal */
.modal-code {
  padding: 24px 22px;
  background: #09090b;
  border: 1px solid var(--border);
  font-family: monospace;
  font-size: 12px;
  line-height: 1.6;
  min-height: 220px;
}
.modal-code .code-header {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--subtext);
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.modal-code pre {
  color: #34d399;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 11px;
}

/* Sticker (Unclickable) */
.modal-sticker {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: monospace;
  font-size: 12px;
  color: var(--subtext);
  pointer-events: none;
}

/* 2-Column Spanning Cards */
.span-2, .artifact.wide, .modal-photo.wide, .modal-writing.wide {
  grid-column: span 2 !important;
}

.modal-writing.wide {
  background: #141416 !important;
  border: 1px solid var(--border) !important;
  padding: 44px 40px !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 360px;
}
.modal-writing.wide .dim-overlay { display: block; }
.modal-writing.wide h2 {
  font-family: 'Xanh Mono', monospace;
  font-size: 40px;
  line-height: 1.15;
  margin-bottom: 20px;
  color: #ffffff;
  transition: color 0.2s ease;
  z-index: 3;
}
.modal-writing.wide.interactive:hover h2 { color: #cfcfd4; }
.modal-writing.wide p {
  font-size: 16px;
  line-height: 1.75;
  color: var(--subtext);
  max-width: 92%;
  z-index: 3;
}
.modal-writing.wide .essay-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-family: monospace;
  font-size: 11px;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  z-index: 3;
}

/* --- DEDICATED SINGLE POST VIEW STYLES (EXACT LEFT ALIGNMENT WITH LOGO) --- */
.single-post-container {
  /* Inherits .container-aligned (width: 90%; max-width: 1800px; margin: 0 auto) */
}

.single-back-nav {
  margin-bottom: 48px;
}

.single-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: monospace;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtext);
  padding: 8px 16px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.single-back-link:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
}

.single-hero-header {
  margin-bottom: 56px;
}

.single-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: monospace;
  font-size: 11px;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.single-meta-tag {
  color: var(--text);
  border: 1px solid var(--border);
  padding: 3px 8px;
}

.single-post-title {
  font-size: clamp(36px, 5vw, 68px);
  line-height: 1.1;
  color: #ffffff;
  margin-bottom: 24px;
}

/* Media Stage - ORIGINAL UNCROPPED ASPECT RATIO (LEFT-ALIGNED) */
.single-media-stage {
  margin-bottom: 64px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  overflow: hidden;
  max-width: 1300px;
  margin-left: 0;
  margin-right: auto;
}

.single-media-stage img {
  width: 100%;
  height: auto !important;
  max-height: 850px !important;
  object-fit: contain !important;
  display: block;
}

.single-content-body {
  font-size: 18px;
  line-height: 1.8;
  color: #d1d1d6;
  max-width: 900px;
  margin-left: 0;
  margin-right: auto;
  margin-bottom: 80px;
}

.single-content-body p {
  margin-bottom: 28px;
}

.single-content-body img {
  max-width: 100%;
  height: auto !important;
  margin: 32px 0;
  border: 1px solid var(--border);
}

.single-content-body h2, 
.single-content-body h3 {
  color: #ffffff;
  margin-top: 48px;
  margin-bottom: 20px;
}

.single-content-body blockquote {
  border-left: 2px solid var(--border-hover);
  padding-left: 24px;
  font-style: italic;
  color: var(--subtext);
  margin: 36px 0;
}

.single-content-body code {
  font-family: monospace;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  font-size: 0.9em;
  color: #34d399;
}

/* Monospace Key-Value Spec Grid */
.single-specs-section {
  border-top: 1px solid var(--border);
  padding-top: 48px;
  margin-top: 64px;
  max-width: 1300px;
  margin-left: 0;
  margin-right: auto;
}

.single-specs-title {
  font-family: monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--subtext);
  margin-bottom: 24px;
}

.single-spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 32px;
}

.single-spec-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: monospace;
}

.single-spec-label {
  font-size: 10px;
  color: var(--subtext);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.single-spec-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* --- RESPONSIVE BREAKPOINTS & MOBILE HAMBURGER --- */
@media (max-width: 1024px) {
  .canvas-grid { grid-template-columns: 1fr; gap: 36px; }
  .span-2, .artifact.wide { grid-column: span 1 !important; }
  .artifact { transform: none !important; }
}

@media (max-width: 768px) {
  .container-aligned { width: 92%; }
  .top-nav { padding: 20px 0; }
  .mobile-menu-toggle { display: flex; }

  .menu-filters {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #141416;
    border: 1px solid var(--border);
    flex-direction: column;
    padding: 12px;
    gap: 8px;
    min-width: 180px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.8);
    z-index: 1001;
  }

  .menu-filters.mobile-open {
    display: flex;
  }

  .classic-hero { margin-bottom: 48px; padding-bottom: 12px; }
  .gradient-line-container { margin-bottom: 64px; }
  .classic-hero h1 { font-size: 36px; }
  .hero-subhead { font-size: 15px; }
  .custom-cursor { display: none !important; }
  .artifact.interactive { cursor: pointer !important; }
}
