/* ============================================================
   Rodrigo Brandão — main.css  v1.1
   ============================================================ */

/* ── HARD RESET — override any lingering plugin/Uncode CSS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Force correct display on single project pages */
body #rb-project .sp-video-frame { width: 100% !important; max-width: 100% !important; }
body #rb-project .sp-video-frame iframe { width: 100% !important; max-width: 100% !important; height: 100% !important; }
body #rb-project .sp-videos { width: 100% !important; max-width: 100% !important; }
body #rb-project .sp-hero { width: 100% !important; max-width: 100% !important; }
/* Kill Uncode container constraints */
body #rb-project .container,body #rb-project .wrapper,body #rb-project .row { max-width:none !important; width:100% !important; padding:0 !important; margin:0 !important; }

:root {
  --bg:     #f7f6f2;
  --ink:    #0f0f0e;
  --mid:    #6b6b67;
  --muted:  #b5b4ae;
  --rule:   #e2e0d8;
  --serif:  'Playfair Display', Georgia, serif;
  --sans:   'DM Sans', sans-serif;
  --mono:   'DM Mono', monospace;
  --pad:    48px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── NAV ── */
#rb-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--pad);
  background: transparent;
  transition: background 0.4s ease;
}

#rb-nav.scrolled {
  background: rgba(247,246,242,0.93);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-logo {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(242,240,234,0.9);
  transition: color 0.3s;
}

#rb-nav.scrolled .nav-logo { color: var(--ink); }

/* WordPress outputs a <ul> inside the nav */
.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0; padding: 0;
}

.nav-links li { margin: 0; }

.nav-links a {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(220,218,212,0.65);
  transition: color 0.2s;
}
.nav-links a:hover                  { color: rgba(242,240,234,0.95); }
#rb-nav.scrolled .nav-links a       { color: var(--mid); }
#rb-nav.scrolled .nav-links a:hover { color: var(--ink); }

/* ── HERO ── */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0c0c0b;
}

.hero-photos {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr 1.3fr 0.9fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  opacity: 0;
  animation: rbFadeIn 1.2s ease forwards 0.1s;
}

.hero-photos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.72) brightness(0.62);
}

.hero-photos img:first-child { grid-row: 1 / 3; }

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10,10,9,0.28) 0%,
    rgba(10,10,9,0.04) 40%,
    rgba(10,10,9,0.55) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--pad) 52px;
}

.hero-location {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(240,238,232,0.55);
  margin-bottom: 20px;
  opacity: 0;
  animation: rbUp 0.7s ease forwards 0.6s;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(68px, 11vw, 160px);
  line-height: 0.88;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: #f2f0ea;
  opacity: 0;
  animation: rbUp 0.9s ease forwards 0.75s;
}

.hero-title em {
  font-style: italic;
  color: rgba(242,240,234,0.62);
}

.hero-bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 40px;
  opacity: 0;
  animation: rbUp 0.7s ease forwards 1.1s;
}

.hero-role {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 400;
  color: rgba(220,218,212,0.65);
  max-width: 380px;
  line-height: 1.65;
}

.hero-role strong {
  display: block;
  font-weight: 500;
  color: rgba(240,238,232,0.92);
  font-size: 14px;
  margin-bottom: 5px;
}

.hero-scroll {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(220,218,212,0.45);
}

.hero-scroll-line {
  width: 36px;
  height: 1px;
  background: rgba(220,218,212,0.45);
  animation: rbPulseLine 2s ease-in-out infinite;
}

/* ── DIVIDERS ── */
.rb-rule, hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 0 var(--pad);
}

/* ── SECTIONS ── */
.section { padding: 100px var(--pad); }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 64px;
}

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
}

/* ── ABOUT ── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 0 80px;
  align-items: start;
}

.about-name {
  font-family: var(--serif);
  font-size: 48px;
  font-weight: 400;
  line-height: 1.0;
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}
.about-name em { font-style: italic; }

.about-chips { display: flex; flex-direction: column; gap: 0; margin-top: 40px; }

.chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--mid);
}
.chip:last-child { border-bottom: 1px solid var(--rule); }

.chip-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.about-bio {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  color: #3a3a38;
  font-weight: 300;
}
.about-bio p { margin: 0 0 1.4em; }
.about-bio p:last-child { margin-bottom: 0; }
.about-bio strong { font-weight: 500; color: var(--ink); }

/* ── WORK ── */
.work-section { padding: 0 var(--pad) 100px; }

.work-list { list-style: none; }

.work-item {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.work-item.vis { opacity: 1; transform: none; }

.work-link {
  display: grid;
  grid-template-columns: 48px 1fr 32px;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink);
  transition: padding-left 0.25s;
}
.work-item:last-child .work-link { border-bottom: 1px solid var(--rule); }
.work-link:hover { padding-left: 12px; }

.work-n {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.work-link:hover .work-n { color: var(--ink); }

.work-title {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.work-arrow {
  font-size: 18px;
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity 0.2s, transform 0.2s;
  color: var(--mid);
  text-align: right;
}
.work-link:hover .work-arrow { opacity: 1; transform: none; }

/* ── CONTACT ── */
.contact-section {
  padding: 100px var(--pad) 80px;
  border-top: 1px solid var(--rule);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 80px;
  align-items: end;
}

.contact-heading {
  font-family: var(--serif);
  font-size: clamp(56px, 8vw, 110px);
  font-weight: 400;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.contact-links { list-style: none; }

.contact-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mid);
  transition: color 0.2s, padding-left 0.2s;
}
.contact-links li:last-child .contact-link { border-bottom: 1px solid var(--rule); }
.contact-link:hover { color: var(--ink); padding-left: 8px; }

.contact-link-arrow { opacity: 0.3; transition: opacity 0.2s; }
.contact-link:hover .contact-link-arrow { opacity: 1; }

/* ── FOOTER ── */
#rb-footer {
  padding: 24px var(--pad);
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-text {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── KEYFRAMES ── */
@keyframes rbFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes rbUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes rbPulseLine {
  0%, 100% { width: 36px; opacity: 0.45; }
  50%       { width: 52px; opacity: 0.75; }
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  :root { --pad: 24px; }

  #rb-nav { padding: 18px var(--pad); }

  .hero-photos {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
  }
  .hero-photos img:first-child { grid-row: 1 / 3; }

  .about-grid    { grid-template-columns: 1fr; gap: 48px; }
  .contact-grid  { grid-template-columns: 1fr; gap: 48px; }
  .contact-heading { font-size: clamp(48px, 12vw, 80px); }

  #rb-footer { flex-direction: column; gap: 8px; text-align: center; }
}

@media (max-width: 520px) {
  .hero-title { font-size: clamp(52px, 14vw, 90px); }
  .hero-photos { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
  .hero-photos img:nth-child(n+4) { display: none; }
  .hero-photos img:first-child { grid-row: 1 / 3; }
}

/* ══════════════════════════════════════════════
   SINGLE PROJECT PAGE  — sp-* namespace
   ══════════════════════════════════════════════ */

/* ══════════════════════════════════════════════
   SINGLE PROJECT PAGE
   ══════════════════════════════════════════════ */

#rb-project { padding-top: 0; min-height: 100vh; }

/* ── BACK BUTTON — always visible at top ── */
.sp-topbar {
  position: sticky;
  top: 0;
  z-index: 150;
  background: rgba(247,246,242,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
  padding: 0 var(--pad);
}

.sp-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mid);
  transition: color 0.2s;
}
.sp-back-btn:hover { color: var(--ink); }

.sp-back-arrow {
  font-size: 16px;
  line-height: 1;
  transition: transform 0.2s;
}
.sp-back-btn:hover .sp-back-arrow { transform: translateX(-3px); }

.sp-back-label { font-weight: 400; }

/* ── HERO — with background image ── */
.sp-hero {
  position: relative;
  overflow: hidden;
}

.sp-hero.has-bg {
  min-height: 80vh;
  background: #0d0d0c;
  display: flex;
  flex-direction: column;
}

.sp-hero.no-bg {
  background: var(--bg);
  padding-bottom: 0;
}

.sp-hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.sp-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(8,8,7,0.15) 0%,
    rgba(8,8,7,0.0) 30%,
    rgba(8,8,7,0.72) 100%
  );
}

.sp-hero-inner {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 64px var(--pad) 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.has-bg .sp-hero-inner { margin-top: auto; }
.no-bg  .sp-hero-inner { padding: 56px var(--pad) 48px; }

.sp-num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: rgba(220,218,212,0.45);
}
.no-bg .sp-num { color: var(--muted); }

.sp-title {
  font-family: var(--serif);
  font-size: clamp(40px, 7vw, 100px);
  font-weight: 400;
  font-style: italic;
  line-height: 0.9;
  letter-spacing: -0.02em;
  color: #f2f0ea;
}
.no-bg .sp-title { color: var(--ink); }

.sp-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sp-pill {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(220,218,212,0.5);
  border: 1px solid rgba(220,218,212,0.2);
  padding: 4px 12px;
}
.no-bg .sp-pill { color: var(--mid); border-color: var(--rule); }

.sp-pill-link { cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.sp-pill-link:hover { color: rgba(242,240,234,0.9); border-color: rgba(220,218,212,0.5); }
.no-bg .sp-pill-link:hover { color: var(--ink); border-color: var(--mid); }

/* ── SINGLE VIDEO + TEXT SIDE BY SIDE ── */
.sp-split {
  display: grid;
  grid-template-columns: 55% 45%;
  border-top: 1px solid var(--rule);
}

.sp-split-video {
  background: #0d0d0c;
  position: relative;
  /* Force a 16:9 height based on the column width */
  aspect-ratio: 16 / 9;
  min-height: 300px;
}

.sp-split-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 16/9) {
  .sp-split-video::before {
    content: '';
    display: block;
    padding-top: 56.25%;
  }
  .sp-split-video iframe {
    position: absolute;
    top: 0; left: 0;
  }
}

.sp-split-text {
  padding: 56px var(--pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  border-left: 1px solid var(--rule);
}

/* ── FULL-WIDTH SINGLE VIDEO ── */
.sp-videos {
  background: #0d0d0c;
  border-top: 1px solid var(--rule);
}

.sp-vframe-full {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  width: 100%;
}

.sp-vframe-full iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
  display: block;
}

/* ── MULTIPLE VIDEOS STACKED ── */
.sp-videos-stack {
  background: #0d0d0c;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid var(--rule);
}

.sp-video-row {
  position: relative;
}

.sp-vnum {
  position: absolute;
  top: 16px;
  left: var(--pad);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(180,178,172,0.35);
  z-index: 1;
}

/* ── TEXT / BODY ── */
.sp-body {
  padding: 80px var(--pad) 80px;
  max-width: calc(660px + var(--pad) * 2);
  border-top: 1px solid var(--rule);
}

.sp-body-top {
  border-top: none;
  padding-bottom: 0;
}

.sp-excerpt {
  font-family: var(--serif);
  font-size: clamp(19px, 2vw, 26px);
  font-style: italic;
  line-height: 1.5;
  color: var(--mid);
  margin-bottom: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}

.sp-content {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.88;
  color: #3d3d3b;
  font-weight: 300;
}
.sp-content p            { margin-bottom: 1.4em; }
.sp-content p:last-child { margin-bottom: 0; }
.sp-content strong       { font-weight: 500; color: var(--ink); }

/* Links — only underline text links, not image links */
.sp-content a:not(:has(img)) {
  border-bottom: 1px solid var(--rule);
  transition: border-color 0.2s;
}
.sp-content a:not(:has(img)):hover { border-color: var(--ink); }

/* Kill link styling on image wrappers */
.sp-content a img,
.sp-content a:has(img) { border: none; display: block; }

/* Single images */
.sp-content img          { max-width: 100%; height: auto; display: block; margin: 36px 0; }
.sp-content figure       { max-width: 100%; margin: 36px 0; }
.sp-content figcaption   { font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; color: var(--muted); text-transform: uppercase; margin-top: 8px; }

/* WP gallery shortcode output */
.sp-content .gallery,
.sp-content .wp-block-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 40px 0;
}
.sp-content .gallery img,
.sp-content .wp-block-gallery img {
  width: 100%; height: 220px;
  object-fit: cover; margin: 0; display: block;
}

/* Old Uncode: images wrapped in <a> tags, in <p> tags — detect and grid them */
/* When multiple consecutive <p><a><img></a></p> groups appear, display as grid */
.sp-content p a img { width: 100%; height: auto; display: block; }

/* Photo grid for posts with multiple inline images (Fernando de Noronha style) */
.sp-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin: 40px 0;
}
.sp-photo-grid a { display: block; overflow: hidden; aspect-ratio: 4/3; }
.sp-photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.sp-photo-grid a:hover img { transform: scale(1.03); }

/* Photo grid for attached images (Fernando de Noronha, B&W, NY Color etc.) */
.sp-photo-section {
  padding: 0 var(--pad) 80px;
}

.sp-photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.sp-photo-item {
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1; /* uniform square — crops all images consistently */
  background: #e8e6e0;
}

.sp-photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s ease;
  margin: 0;
}

.sp-photo-item:hover img { transform: scale(1.04); }

/* ── FEATURED HEADLINE ── */
.sp-headline-block {
  padding: 72px var(--pad) 64px;
  border-bottom: 1px solid var(--rule);
  max-width: calc(900px + var(--pad) * 2);
}

.sp-headline {
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}

/* ── MORE DETAILS ── */
.sp-details-block {
  padding: 56px var(--pad) 56px;
  border-top: 1px solid var(--rule);
  max-width: calc(680px + var(--pad) * 2);
}

.sp-details {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.85;
  color: var(--mid);
  font-weight: 300;
}

.sp-details br { display: block; margin-bottom: 0.5em; content: ""; }

/* ── PREV / NEXT NAV ── */
.sp-nav {
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
}

.sp-nav-link {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 44px var(--pad);
  transition: background 0.2s;
}
.sp-nav-link:hover { background: rgba(15,15,14,0.03); }

.sp-nav-prev { border-right: 1px solid var(--rule); }
.sp-nav-next { align-items: flex-end; border-left: 1px solid var(--rule); }
.sp-nav-next .sp-nav-title { text-align: right; }

.sp-nav-dir {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.2s;
}
.sp-nav-link:hover .sp-nav-dir { color: var(--ink); }

.sp-nav-title {
  font-family: var(--serif);
  font-size: clamp(15px, 1.8vw, 22px);
  font-weight: 400;
  font-style: italic;
  color: var(--ink);
  max-width: 300px;
  line-height: 1.2;
  transition: opacity 0.2s;
}
.sp-nav-link:hover .sp-nav-title { opacity: 0.5; }

.sp-nav-index {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  transition: color 0.2s;
  white-space: nowrap;
}
.sp-nav-index:hover { color: var(--ink); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .sp-split { grid-template-columns: 1fr; }
  .sp-split-video { aspect-ratio: 16/9; min-height: 0; }
  .sp-split-text { border-left: none; border-top: 1px solid var(--rule); }
  .sp-nav { grid-template-columns: 1fr 1fr; }
  .sp-nav-index { display: none; }
  .sp-nav-next { grid-column: 2; }
  .sp-photo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .sp-topbar { padding: 0 var(--pad); }
  .sp-body { padding: 48px var(--pad) 56px; }
  .sp-photo-section { padding: 0 var(--pad) 48px; }
  .sp-photo-grid { grid-template-columns: 1fr 1fr; }
  .sp-nav { grid-template-columns: 1fr; }
  .sp-nav-prev { border-right: none; border-bottom: 1px solid var(--rule); }
  .sp-nav-next { border-left: none; align-items: flex-start; grid-column: 1; }
  .sp-nav-next .sp-nav-title { text-align: left; }
  .sp-nav-link { padding: 28px var(--pad); }
  .sp-content .gallery,
  .sp-content .wp-block-gallery { grid-template-columns: 1fr; }
}
