/* ==========================================================================
   CSS Variables & Reset
   ========================================================================== */

:root {
  --sidebar-w: 230px;
  --pad: 24px;
  --text: #111;
  --muted: #666;
  --border: #e6e6e6;
  --maxw: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

* {
  box-sizing: border-box;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */

body {
  margin: 0;
  color: var(--text);
  font-family: "Libertinus Serif Display", system-ui;
  font-weight: 400;
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
}

p,
li {
  font-weight: 300;
}

/* ==========================================================================
   Layout Components
   ========================================================================== */

.container {
  min-height: 100vh;
}

.content {
  padding: var(--pad);
  margin-left: calc(var(--sidebar-w) + 24px);
  width: calc(100vw - var(--sidebar-w) - 24px);
  max-width: none;
}

.lead {
  max-width: 640px;
  margin: 0 auto 24px auto;
  text-align: left;
}

.lead-wrap {
  max-width: 720px;
  margin: 0 auto 32px auto;
  text-align: center;
}

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.sidebar {
  width: var(--sidebar-w);
  padding: 28px 18px;
  border-right: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background: #fff;
  z-index: 100;
}

.brand {
  font-size: 22px;
  text-decoration: none;
  color: var(--text);
  display: inline-block;
  margin-bottom: 18px;
}

.nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: block;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--text);
}

.sub-label {
  display: block;
  padding: 6px 4px;
  color: var(--text);
  opacity: 0.9;
  cursor: pointer;
}

.has-sub {
  margin: 6px 0;
  position: relative;
}

.has-sub .submenu {
  display: none;
  margin: 4px 0 10px 8px;
  border-left: 2px solid var(--border);
  padding-left: 10px;
}

.has-sub:hover .submenu {
  display: block;
}

/* ==========================================================================
   Gallery Components
   ========================================================================== */

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  width: 100%;
  margin: 0 auto 32px auto;
}

.gallery img {
  width: 100%;
  height: auto;
  display: block;
}

/* Gallery Hero Image */
.gallery-hero {
  max-width: 600px;
  margin: 0 auto 20px;
  text-align: center;
}

.gallery-hero img {
  width: 100%;
  height: auto;
  display: block;
}

.gallery-hero figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}

/* Masonry Layout */
.gallery.masonry {
  display: block !important;
  column-count: 4;
  column-gap: 22px;
  width: 100%;
}

.gallery.masonry .card {
  display: inline-block;
  width: 100%;
  margin: 0 0 22px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  position: relative;
}

.gallery.masonry img {
  width: 100%;
  height: auto !important;
}

/* ==========================================================================
   Card Components
   ========================================================================== */

.card {
  position: relative;
  overflow: hidden;
}

.card img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.25s ease;
}

.card:hover img {
  transform: scale(1.03);
}

.card .overlay {
  position: absolute;
  inset: 0;
  padding: 14px;
  display: flex;
  align-items: flex-start;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.55),
    rgba(0, 0, 0, 0) 65%
  );
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.card:hover .overlay,
.card:focus-within .overlay {
  opacity: 1;
}

.card .overlay h3,
.card .overlay p {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.card .overlay h3 {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 6px;
}

.card .overlay p {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 14px;
  opacity: 0.95;
  margin: 0;
}

/* ==========================================================================
   Lightbox Component
   ========================================================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  color: #111;
}

.lightbox.open {
  display: block;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 1;
}

.lb-inner {
  position: absolute;
  inset: 48px 32px;
  display: flex;
  gap: 48px;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.lb-media {
  flex: 1 1 62%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

#lb-img {
  max-height: 86vh;
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  pointer-events: auto;
}

#lb-img.zoom {
  max-height: none;
  max-width: none;
}

.lb-meta {
  flex: 0 1 32%;
  pointer-events: auto;
}

.lb-meta h2 {
  margin: 0 0 10px 0;
  font-size: 36px;
  line-height: 1.2;
}

.lb-meta p {
  margin: 0;
  opacity: 0.8;
}

/* Lightbox Controls */
.lb-close,
.lb-prev,
.lb-next,
.lb-full {
  position: absolute;
  background: none;
  border: 0;
  cursor: pointer;
  color: #111;
  font-size: 28px;
  line-height: 1;
}

.lb-close {
  top: 14px;
  right: 18px;
}

.lb-full {
  top: 14px;
  left: 18px;
  font-size: 20px;
}

.lb-prev,
.lb-next {
  top: 50%;
  transform: translateY(-50%);
  font-size: 38px;
}

.lb-prev {
  left: 22px;
}

.lb-next {
  right: 22px;
}

.lightbox [data-close] {
  position: absolute;
  inset: 0;
}

.gallery button.zoom {
  all: unset;
  display: block;
  width: 100%;
  cursor: pointer;
}

/* ==========================================================================
   Page Templates
   ========================================================================== */

/* Hero Component */
.hero {
  max-width: 1000px;
  margin: 0 auto;    /* centers the whole hero block */
  text-align: center;
}
.hero img {
  width: 100%;
  height: auto;
  display: block;
}

/* About Page */
.about-hero img {
  display: block;
  width: 100%;
  max-width: 780px;
  margin: 0 auto 24px;
}

.about-prose {
  max-width: 780px;
  margin: 0 auto 48px;
}

.about-prose h2 {
  font-weight: 700;
  font-size: 18px;
  margin: 22px 0 10px;
}

.about-prose hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 18px 0 10px;
}

/* Contact Page */
/* Contact: tighter, centered, two columns touching */
.contact-wrap{
  display: grid;
  grid-template-columns: 1.1fr 1fr;   /* image | form */
  gap: 0;                              /* ← no space between them */
  align-items: stretch;
  max-width: 980px;                    /* overall width (make smaller/larger as needed) */
  margin: 0 auto 32px;                 /* center on page */
}

/* ensure children don’t add gaps */
.contact-wrap > * { margin: 0; }

/* Image pane */
.contact-hero { overflow: hidden; min-height: 520px; }
.contact-hero img{
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* Form pane */
.contact-form{
  background: #e9e9e9;
  padding: 24px;                       /* smaller internal padding */
}
.contact-form h2{ margin: 0 0 12px; font-size: 28px; }

.contact-form label{ display:block; margin:12px 0; }
.contact-form label span{ display:block; font-size:14px; margin-bottom:6px; }
.contact-form input, .contact-form textarea{
  width: 100%; border:0; border-bottom:2px solid #222;
  background:transparent; padding:8px 6px; font:inherit; outline:none;
  resize: none;
}
.contact-form .two{ display:grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.contact-form .btn{ margin-top:12px; background:#444; color:#fff; border:0; padding:10px 22px; cursor:pointer; }

/* Responsive */
@media (max-width: 900px){
  .contact-wrap{ grid-template-columns: 1fr; max-width: 680px; }
  .contact-hero{ min-height: 260px; }
  .contact-form h2{ font-size: 24px; }
  .contact-form .two{ grid-template-columns: 1fr; }
}


/* CV Page */
.cv {
  max-width: 780px;
  margin: 0 auto 48px;
  line-height: 1.5;
}

.cv h2 {
  margin: 28px 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.cv ul {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
}

.cv li {
  margin-bottom: 6px;
}

.cv li strong {
  display: inline-block;
  width: 60px;
  font-weight: 600;
}

.cv a {
  color: var(--text);
  text-decoration: underline;
}

/* ==========================================================================
   Footer Component
   ========================================================================== */

.footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer-row {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Media Queries
   ========================================================================== */

/* Large screens */
@media (max-width: 1400px) {
  .gallery.masonry {
    column-count: 3;
  }
}

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

/* Medium screens */
@media (max-width: 900px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery.masonry {
    column-count: 2;
  }
  
  .contact-wrap {
    grid-template-columns: 1fr;
  }
  
  .contact-form {
    padding: 24px 18px;
  }
  
  .contact-form h2 {
    font-size: 26px;
  }
  
  .contact-form .two {
    flex-direction: column;
  }
}

/* Small screens */
@media (max-width: 820px) {
  .content {
    margin-left: 0;
    width: 100vw;
  }
  
  .sidebar {
    position: static;
    height: auto;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  
  .has-sub .submenu {
    position: static;
    border: 0;
    box-shadow: none;
    padding-left: 12px;
    display: block;
  }
}

/* Extra small screens */
@media (max-width: 560px) {
  .gallery {
    grid-template-columns: 1fr;
  }
  
  .gallery.masonry {
    column-count: 1;
  }
}