/* ============================================
   Rémi Vallat Portfolio — Static Site
   Dark theme, sidebar layout
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #ccc;
  background: #111;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Jost", "Futura PT", "Futura", sans-serif;
}

/* ==========================================
   SIDEBAR — fixed left navigation
   ========================================== */

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 220px;
  background: #111;
  border-right: 1px solid #222;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-inner {
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Logo */
.site-logo {
  display: block;
  margin-bottom: 28px;
}

.site-logo img {
  width: 100%;
  max-width: 160px;
  height: auto;
}

.site-title-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

/* Navigation */
.main-nav {
  display: flex;
  flex-direction: column;
}

.nav-home {
  display: block;
  padding: 4px 0;
  margin-bottom: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #777;
  transition: color 0.2s;
}

.nav-home:hover,
.nav-home.active {
  color: #fff;
}

/* Nav sections */
.nav-section {
  margin-bottom: 20px;
}

.nav-section-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 8px;
}

.nav-section ul {
  display: flex;
  flex-direction: column;
}

.nav-link {
  display: block;
  padding: 3px 0;
  font-size: 0.8rem;
  font-weight: 400;
  color: #999;
  transition: color 0.2s;
  letter-spacing: 0.01em;
}

.nav-link:hover {
  color: #fff;
}

.nav-link.active {
  color: #fff;
  font-weight: 600;
}

/* Pages section (About, Publication, Contact) at bottom */
.nav-pages {
  margin-top: auto;
  padding-top: 20px;
}

.nav-pages .nav-link {
  font-size: 0.75rem;
  color: #666;
}

.nav-pages .nav-link:hover,
.nav-pages .nav-link.active {
  color: #fff;
}

/* ==========================================
   MAIN CONTENT — right of sidebar
   ========================================== */

.site-wrapper {
  margin-left: 220px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-main {
  flex: 1;
}

/* ==========================================
   GALLERY — 3-column grid
   ========================================== */

.gallery-page {
  padding: 0;
}

.gallery-title {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: uppercase;
  text-align: center;
  padding: 32px 20px 15px;
  color: #eee;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 4px 4px;
}

.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
}

.gallery-item.portrait {
  grid-row: span 2;
}

.img-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #1a1a1a;
}

.gallery-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gallery-img.loaded {
  opacity: 1;
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px 12px 8px;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.gallery-item:hover .gallery-caption {
  opacity: 1;
}

/* ==========================================
   HOMEPAGE
   ========================================== */

.home-page {
  padding: 0;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 4px 4px;
}

.home-grid .gallery-item.portrait {
  grid-row: span 2;
}

/* ==========================================
   ABOUT PAGE
   ========================================== */

.about-page {
  max-width: 600px;
  padding: 60px 40px;
}

.about-page h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 28px;
  color: #eee;
}

.about-photo img {
  max-width: 280px;
  margin-bottom: 28px;
}

.about-page p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: #aaa;
  margin-bottom: 16px;
}

.about-page .social-links {
  margin-top: 24px;
  display: flex;
  gap: 16px;
}

.about-page .social-links a {
  font-size: 0.8rem;
  color: #777;
  transition: color 0.2s;
}

.about-page .social-links a:hover {
  color: #fff;
}

/* ==========================================
   CONTACT PAGE
   ========================================== */

.contact-page {
  max-width: 500px;
  padding: 60px 40px;
}

.contact-page h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 28px;
  color: #eee;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  color: #888;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.85rem;
  border: 1px solid #333;
  border-radius: 2px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #1a1a1a;
  color: #ccc;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #888;
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form button[type="submit"] {
  align-self: flex-start;
  padding: 8px 28px;
  background: #fff;
  color: #111;
  border: none;
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s;
}

.contact-form button[type="submit"]:hover {
  opacity: 0.85;
}

.contact-info {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid #222;
}

.contact-info p {
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #888;
}

.contact-info a {
  color: #ccc;
  transition: color 0.2s;
}

.contact-info a:hover {
  color: #fff;
}

.social-links {
  display: flex;
  gap: 16px;
  margin-top: 12px;
}

.social-links a {
  font-size: 0.8rem;
  color: #777;
  transition: color 0.2s;
}

.social-links a:hover {
  color: #fff;
}

/* ==========================================
   PUBLICATION PAGE
   ========================================== */

.publication-page {
  max-width: 600px;
  padding: 60px 40px;
}

.publication-page h1 {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 28px;
  color: #eee;
}

/* ==========================================
   FOOTER
   ========================================== */

.site-footer {
  text-align: center;
  padding: 40px 20px 24px;
  font-size: 0.7rem;
}

.footer-instagram {
  display: inline-block;
  color: #555;
  margin-bottom: 16px;
  transition: color 0.2s;
}

.footer-instagram:hover {
  color: #fff;
}

.footer-instagram svg {
  display: block;
}

.back-to-top {
  display: block;
  margin-bottom: 8px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #444;
  transition: color 0.2s;
}

.back-to-top:hover {
  color: #fff;
}

.copyright {
  color: #444;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
}

/* ==========================================
   HAMBURGER (mobile only)
   ========================================== */

.menu-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  background: rgba(17, 17, 17, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid #333;
  border-radius: 4px;
  cursor: pointer;
  padding: 10px 9px;
}

.menu-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #ccc;
  margin: 4px 0;
  transition: transform 0.3s, opacity 0.3s;
  border-radius: 1px;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4px);
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4px);
}

/* ==========================================
   PHOTOSWIPE OVERRIDES
   ========================================== */

.pswp__custom-caption {
  text-align: center;
  font-size: 0.8rem;
  color: #999;
  padding: 12px 16px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1200px) {
  .gallery-grid,
  .home-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 190px;
  }

  .site-wrapper {
    margin-left: 190px;
  }
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  }

  .site-wrapper {
    margin-left: 0;
  }

  .gallery-grid,
  .home-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    padding: 0 3px 3px;
  }

  .gallery-item.portrait {
    grid-row: span 1;
  }

  .gallery-title {
    font-size: 24px;
    padding: 20px 16px 12px;
  }

  .about-page,
  .contact-page,
  .publication-page {
    padding: 40px 20px;
  }
}

@media (max-width: 480px) {
  .gallery-grid,
  .home-grid {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 0 2px 2px;
  }
}

/* Sidebar overlay backdrop on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99;
}

.sidebar-overlay.visible {
  display: block;
}
