/*
Theme Name:  Cargo Portfolio
Theme URI:   
Author:      
Description: Minimal editorial portfolio. Projects listed as large italic text, detail panel slides in from the right. Inspired by Cargo.site aesthetics.
Version:     1.0
License:     GNU General Public License v2 or later
Text Domain: cargo-portfolio
*/

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

/* ── TOKENS ─────────────────────────────────────────────────── */
:root {
  --bg:       #f2efe9;
  --text:     #1a1919;
  --muted:    #888;
  --border:   #ccc8c0;
  --panel-w:  50%;
  --footer-h: 44px;
}

/* ── BASE ───────────────────────────────────────────────────── */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Cormorant Garamond', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

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

/* ── LAYOUT ─────────────────────────────────────────────────── */
.site {
  display: flex;
  height: 100vh;
  position: relative;
  overflow: hidden;
}

/* ── LEFT PANEL ─────────────────────────────────────────────── */
.left-panel {
  width: var(--panel-w);
  height: 100vh;
  padding: 26px 28px calc(var(--footer-h) + 20px);
  overflow-y: auto;
  scrollbar-width: none;
}
.left-panel::-webkit-scrollbar { display: none; }

.project-item {
  display: block;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(24px, 3.3vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 0;
  user-select: none;
  transition: opacity 0.2s ease;
}
.project-item:hover  { opacity: 0.45; }
.project-item.active { opacity: 0.4; }

/* ── RIGHT PANEL ────────────────────────────────────────────── */
.right-panel {
  position: fixed;
  top: 0; right: 0;
  width: var(--panel-w);
  height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--border);
  transform: translateX(100%);
  transition: transform 0.48s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 50;
  display: flex;
  flex-direction: column;
}
.right-panel.open { transform: translateX(0); }

.panel-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 30px;
}

.close-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.close-btn:hover { background: var(--text); color: var(--bg); }

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.panel-scroll::-webkit-scrollbar { display: none; }

/* ── PROJECT DETAIL ─────────────────────────────────────────── */
.project-detail {
  padding: 14px 22px calc(var(--footer-h) + 16px);
}

/* ── PROJECT TITLE TOP (inside right panel) ─────────────────── */
.project-title-top {
  font-size: 12px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  padding: 10px 0 12px;
  color: var(--text);
}

/* ── SLIDESHOW ──────────────────────────────────────────────── */
.slideshow {
  margin-bottom: 20px;
  background: var(--border);
}

.slide-stage {
  display: flex;
  align-items: center;
  background: #e4e0d8;
}

.slide-img-wrap {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  max-height: 380px;
}

.slide-img-wrap img {
  width: 100%;
  height: 100%;
  max-height: 380px;
  object-fit: contain;
  display: block;
  transition: opacity 0.22s ease;
}

.slide-nav {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 14px 10px;
  color: var(--text);
  opacity: 0.4;
  transition: opacity 0.15s;
  flex-shrink: 0;
  font-family: inherit;
  line-height: 1;
}
.slide-nav:hover { opacity: 1; }

.slide-counter {
  text-align: center;
  font-size: 9px;
  font-style: normal;
  color: var(--muted);
  padding: 5px 0;
  letter-spacing: 0.06em;
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.slide-placeholder {
  width: 100%;
  min-height: 160px;
  background: #e4e0d8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  font-style: normal;
  margin-bottom: 20px;
}

/* ── DETAIL COLUMNS ─────────────────────────────────────────── */
.detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  font-size: 11px;
  line-height: 1.45;
  font-style: normal;
  margin-top: 16px;
}
.detail-meta p { margin-bottom: 2px; }

/* Body text: natural paragraph flow, no justify, no bloated spacing */
.detail-body {
  line-height: 1.45;
  font-size: 11px;
}
.detail-body p {
  margin-bottom: 0;
  text-align: left;
}
.detail-body p + p {
  margin-top: 0;
}

/* ── EDITOR CONTENT IMAGES ──────────────────────────────────── */
/* Images inserted via the WP editor in project descriptions     */
.detail-body img,
.detail-body figure img,
.detail-body .wp-block-image img,
.detail-body .wp-block-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 0 6px 0;
}

/* Remove default WP figure margins */
.detail-body figure,
.detail-body .wp-block-image {
  margin: 0 0 6px 0;
  width: 100% !important;
}

/* Gallery blocks */
.detail-body .wp-block-gallery {
  margin: 0 0 6px 0;
}
.detail-body .wp-block-gallery img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* ── ABOUT PANEL ────────────────────────────────────────────── */
.about-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  line-height: 1.6;
  font-style: normal;
}

.about-section { border-bottom: 1px solid var(--border); }
.about-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  padding: 12px 22px;
  font-size: 11px;
  line-height: 1.55;
  font-style: normal;
}
.about-section-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  padding-top: 1px;
  font-weight: 400;
}
.about-entry { margin-bottom: 9px; }
.about-entry:last-child { margin-bottom: 0; }

/* ── DIMMER ─────────────────────────────────────────────────── */
.dimmer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  cursor: pointer;
}
.dimmer.on { display: block; }

/* ── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--footer-h);
  display: flex;
  align-items: center;
  padding: 0 14px;
  z-index: 100;
}

.footer-pills {
  display: flex;
  gap: 5px;
}

.pill-btn {
  background: none;
  border: 1px solid var(--text);
  border-radius: 20px;
  font-family: inherit;
  font-size: 11px;
  color: var(--text);
  padding: 3px 11px 4px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
}
.pill-btn:hover,
.pill-btn.active { background: var(--text); color: var(--bg); }

.footer-caption {
  flex: 1;
  text-align: center;
  font-size: 9px;
  line-height: 1.45;
  font-style: normal;
  color: #999;
  pointer-events: none;
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-notice {
  padding: 30px 22px;
  font-size: 12px;
  font-style: normal;
  color: var(--muted);
  line-height: 1.6;
}

/* ── MOBILE RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --panel-w: 100%; }

  body, html { overflow: hidden; }

  .left-panel {
    width: 100%;
    padding: 20px 18px calc(var(--footer-h) + 24px);
  }

  .project-item {
    font-size: clamp(26px, 8vw, 42px);
    margin-bottom: 0;
    line-height: 1.08;
  }

  /* Panel slides up from bottom on mobile */
  .right-panel {
    width: 100%;
    height: 88vh;
    top: auto;
    bottom: 0;
    right: 0;
    transform: translateY(100%);
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
  }
  .right-panel.open { transform: translateY(0); }

  .detail-cols {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  /* On mobile: images fill nearly full width with small margin */
  .detail-body img,
  .detail-body figure img,
  .detail-body .wp-block-image img,
  .detail-body .wp-block-image {
    width: calc(100% + 30px);
    max-width: calc(100% + 30px);
    margin-left: -15px;
    margin-right: -15px;
    margin-bottom: 5px;
  }
  .detail-body figure,
  .detail-body .wp-block-image {
    width: calc(100% + 30px) !important;
    margin-left: -15px;
  }

  .about-head {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .about-row {
    grid-template-columns: 100px 1fr;
  }

  .slide-img-wrap { min-height: 180px; max-height: 260px; }

  .footer-caption { font-size: 8px; }
}

@media (max-width: 480px) {
  .about-row { grid-template-columns: 1fr; gap: 4px; }
  .about-section-label { margin-bottom: 4px; }
}
