/* =============================================
   Stories by Ariel — Dark Grid Portfolio
   ============================================= */

:root {
  --bg: #0f0f0f;
  --bg-surface: #1a1a1a;
  --text: #d4d0c8;
  --text-muted: #8a8578;
  --text-heading: #c8c2b4;
  --accent: #a89f91;
  --gap: 6px;
}

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

body {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Navigation ---- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1.2rem 2rem;
}

.nav-wrap {
  display: flex;
  gap: 1.5rem;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--text);
}

/* ---- Hero / Title ---- */
.hero-title {
  text-align: center;
  padding: 6rem 1rem 3rem;
}

.site-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
  font-size: clamp(2.4rem, 5vw, 4rem);
  color: var(--text-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.8rem;
}

.scroll-arrow {
  color: var(--text-muted);
  font-size: 1.6rem;
  margin-top: 1rem;
  animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ---- Category Grid (Home) ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
  padding: 0 var(--gap) var(--gap);
}

.category-tile {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4 / 3;
  background: var(--bg-surface);
}

.category-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: brightness(0.7);
}

.category-tile:hover img {
  transform: scale(1.05);
  filter: brightness(0.9);
}

.category-tile .tile-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 1.2rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
  opacity: 1;
  transition: opacity 0.3s ease;
}

@media (hover: hover) {
  .category-tile .tile-overlay {
    align-items: center;
    padding-bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
  }

  .category-tile:hover .tile-overlay {
    opacity: 1;
  }
}

.tile-overlay span {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.2rem, 2.5vw, 2rem);
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Placeholder tile (no image yet) */
.category-tile.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a2a2a;
}

.category-tile.placeholder .tile-label {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1rem, 2vw, 1.6rem);
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 1rem;
}

/* ---- Gallery View (shared) ---- */
.gallery-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 5rem 2rem 2rem;
}

.back-btn {
  background: none;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.back-btn:hover {
  color: var(--text);
  border-color: var(--text);
}

.gallery-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: 1.6rem;
  color: var(--text-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-body {
  padding: 0 var(--gap) var(--gap);
  overflow-x: hidden;
}

/* ---- Layout: Grid (Portraits, Headshots, Personal) ---- */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.gallery-item {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-surface);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
}

.gallery-item.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #2a2a2a;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---- Layout: Scatter (Moments) ---- */
.layout-scatter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  padding: 1rem 0 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.scatter-item {
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.scatter-item:hover {
  transform: scale(1.01);
}

.scatter-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Sizes */
.scatter-large {
  width: 70%;
}

.scatter-medium {
  width: 50%;
}

.scatter-small {
  width: 35%;
}

/* Horizontal offsets */
.nudge-left {
  align-self: flex-start;
  margin-left: 5%;
}

.nudge-left-far {
  align-self: flex-start;
  margin-left: 2%;
}

.nudge-right {
  align-self: flex-end;
  margin-right: 5%;
}

.nudge-right-far {
  align-self: flex-end;
  margin-right: 2%;
}

/* Theme headings */
.scatter-theme-heading {
  width: 100%;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--text-heading);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 3rem 0 1rem;
}

.scatter-theme-heading:first-child {
  padding-top: 0.5rem;
}

/* Featured full-bleed images */
.scatter-full-desktop {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  align-self: center;
}

.scatter-full-mobile {
  width: 50%;
}

@media (max-width: 520px) {
  .scatter-full-desktop {
    width: 85%;
    margin-left: 0;
  }

  .scatter-full-mobile {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
  }
}

@media (min-width: 521px) and (max-width: 900px) {
  .scatter-full-mobile {
    width: 45%;
  }
}

/* Add slight rotation for organic feel */
.scatter-item:nth-child(3n+1) {
  transform: rotate(-0.8deg);
}

.scatter-item:nth-child(3n+2) {
  transform: rotate(0.5deg);
}

.scatter-item:nth-child(3n) {
  transform: rotate(-0.3deg);
}

.scatter-item:hover {
  transform: rotate(0deg) scale(1.01);
}

@media (max-width: 520px) {
  .scatter-large {
    width: 90%;
  }

  .scatter-medium {
    width: 75%;
  }

  .scatter-small {
    width: 60%;
  }

  .nudge-left,
  .nudge-left-far {
    margin-left: 2%;
  }

  .nudge-right,
  .nudge-right-far {
    margin-right: 2%;
  }
}

/* ---- Layout: Sidebar (Events) ---- */
.layout-sidebar {
  display: flex;
  gap: 0;
  min-height: 60vh;
}

.sidebar-nav {
  position: sticky;
  top: 4rem;
  align-self: flex-start;
  width: 220px;
  flex-shrink: 0;
  padding: 1rem 0;
  border-right: 1px solid #2a2a2a;
}

.sidebar-nav-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 0.7rem 1.2rem;
  color: var(--text-muted);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  border-left: 2px solid transparent;
}

.sidebar-nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-nav-item.active {
  color: var(--text-heading);
  border-left-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-content {
  flex: 1;
  padding-left: var(--gap);
}

.group-section {
  margin-bottom: 3rem;
}

.group-heading {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: 1.3rem;
  color: var(--text-heading);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1rem 0;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: var(--gap);
}

.group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

.subgroup-heading {
  font-family: "Inter", sans-serif;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1.5rem 0 0.5rem;
}

.subgroup-heading:first-of-type {
  padding-top: 0.5rem;
}

/* ---- Layout: Cities (Street, Travel) ---- */
.cities-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0 1.5rem;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 1.5rem;
}

.city-btn {
  background: none;
  border: 1px solid #333;
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.city-btn:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.city-btn.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

.cities-content .group-section {
  margin-bottom: 3rem;
}

.cities-content .group-heading {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--text-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 0 1rem;
}

.cities-content .group-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap);
}

/* ---- Layout: Blog (Personal) ---- */
.layout-blog {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1rem;
}

.blog-post {
  margin-bottom: 4rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid #2a2a2a;
}

.blog-post:last-child {
  border-bottom: none;
}

.blog-post-header {
  margin-bottom: 1.5rem;
}

.blog-post-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  font-size: 1.8rem;
  color: var(--text-heading);
  letter-spacing: 0.04em;
  line-height: 1.3;
}

.blog-post-date {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.blog-post-body {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 2rem;
}

.blog-images {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.blog-figure {
  margin: 0;
}

.blog-figure .gallery-item {
  aspect-ratio: auto;
}

.blog-figure .gallery-item img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.blog-caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0;
  gap: 1rem;
}

.blog-caption-text {
  color: var(--text);
  font-size: 0.85rem;
  font-style: italic;
}

.blog-caption-meta {
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* ---- Contact Page ---- */
.contact-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 6rem 2rem 4rem;
  text-align: center;
}

.contact-heading {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 300;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--text-heading);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-subtext {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.8rem;
  max-width: 400px;
}

.contact-links {
  display: flex;
  gap: 1.5rem;
  margin-top: 3rem;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2rem 2.5rem;
  border: 1px solid #2a2a2a;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, background 0.2s;
}

.contact-card:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.03);
}

.contact-icon {
  width: 32px;
  height: 32px;
  color: var(--accent);
}

.contact-label {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
  color: var(--text-heading);
}

.contact-handle {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

@media (max-width: 520px) {
  .contact-links {
    flex-direction: column;
    width: 100%;
  }

  .contact-card {
    padding: 1.5rem;
  }
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  padding: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  z-index: 1001;
}

.lb-close:hover,
.lb-prev:hover,
.lb-next:hover {
  opacity: 1;
}

.lb-close {
  top: 1rem;
  right: 1.5rem;
  font-size: 2.4rem;
}

.lb-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lb-info {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  max-width: 500px;
}

.lb-counter {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}

.lb-meta-title {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.1rem;
  color: #e0e0e0;
  letter-spacing: 0.04em;
}

.lb-meta-desc {
  color: #999;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.lb-meta-tech {
  color: #666;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
}

/* ---- Footer ---- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

/* ---- Utility ---- */
.hidden {
  display: none !important;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .category-grid,
  .layout-grid,
  .group-grid,
  .cities-content .group-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar-nav {
    width: 180px;
  }
}

@media (max-width: 520px) {
  .category-grid,
  .layout-grid,
  .group-grid,
  .cities-content .group-grid {
    grid-template-columns: 1fr;
  }

  .hero-title {
    padding: 5rem 1rem 2rem;
  }

  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 4.5rem 1rem 1.5rem;
  }

  /* Sidebar collapses to horizontal scroll on mobile */
  .layout-sidebar {
    flex-direction: column;
  }

  .sidebar-nav {
    position: static;
    width: 100%;
    display: flex;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid #2a2a2a;
    padding: 0;
    gap: 0;
  }

  .sidebar-nav-item {
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }

  .sidebar-nav-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }

  .sidebar-content {
    padding-left: 0;
  }
}
