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

body {
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #000;
  background: #fff;
  font-size: 15px;
}

/* Sidebar layout */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 200px;
  height: 100vh;
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
}

.sidebar .site-name {
  font-size: 1.1rem;
  font-weight: 400;
  text-decoration: none;
  color: #000;
  margin-bottom: 2rem;
  display: block;
}

.sidebar .nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.sidebar .nav-links a {
  text-decoration: none;
  color: #000;
  font-size: 0.95rem;
  font-weight: 400;
}

.sidebar .nav-links a:hover {
  text-decoration: underline;
}

.nav-footer {
  margin-top: auto;
  font-size: 0.8rem;
  color: #666;
}

.nav-footer a {
  color: #000;
  text-decoration: none;
  font-size: 0.8rem;
}

.nav-footer a:hover {
  text-decoration: underline;
}

.nav-footer p {
  margin-top: 0.25rem;
  color: #666;
}

/* Main content */
.content {
  margin-left: 200px;
  flex: 1;
  padding: 2.5rem 3rem;
  max-width: 900px;
}

/* Home hero */
.hero {
  padding: 4rem 0 2rem;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: #000;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1rem;
  color: #000;
  max-width: 500px;
}

/* Page content */
h1 {
  font-size: 1.75rem;
  font-weight: 400;
  color: #000;
  margin-bottom: 1.5rem;
  letter-spacing: 0.01em;
}

h2 {
  font-size: 1.3rem;
  font-weight: 400;
  color: #000;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: #000;
}

/* About */
.about-photo {
  max-width: 50%;
  margin: 2rem auto;
  display: block;
}

/* Blog listing */
.post-list {
  list-style: none;
}

.post-list li {
  padding: 1rem 0;
  border-bottom: 1px solid #e0e0e0;
}

.post-list li:first-child {
  border-top: 1px solid #e0e0e0;
}

.post-list a {
  text-decoration: none;
  font-weight: 400;
  font-size: 1.05rem;
  color: #000;
}

.post-list a:hover {
  text-decoration: underline;
}

.post-list .date {
  display: block;
  font-size: 0.85rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Blog post */
.post-meta {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-content {
  font-size: 1rem;
  line-height: 1.75;
}

.post-content p {
  margin-bottom: 1.25rem;
}

/* --- Desktop Publishing Styles --- */

.post-content .drop-cap::first-letter {
  float: left;
  font-size: 4.2em;
  line-height: 0.8;
  padding-right: 0.08em;
  margin-top: 0.05em;
  font-weight: 400;
  color: #000;
}

.pull-quote {
  float: right;
  width: 40%;
  margin: 0.5rem 0 1rem 2rem;
  padding: 1rem 0 1rem 1.5rem;
  border-left: 2px solid #000;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.5;
  color: #000;
}

.pull-quote-left {
  float: left;
  width: 40%;
  margin: 0.5rem 2rem 1rem 0;
  padding: 1rem 1.5rem 1rem 0;
  border-left: none;
  border-right: 2px solid #000;
  text-align: right;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.5;
  color: #000;
}

.two-col {
  column-count: 2;
  column-gap: 2.5rem;
  column-rule: 1px solid #e0e0e0;
}

.three-col {
  column-count: 3;
  column-gap: 2rem;
  column-rule: 1px solid #e0e0e0;
}

.img-right {
  float: right;
  max-width: 45%;
  margin: 0.25rem 0 1rem 1.5rem;
}

.img-left {
  float: left;
  max-width: 45%;
  margin: 0.25rem 1.5rem 1rem 0;
}

.img-full {
  width: 100%;
  margin: 1.5rem 0;
}

.fig {
  margin: 1.5rem 0;
}

.fig img {
  width: 100%;
}

.fig figcaption {
  font-size: 0.8rem;
  color: #666;
  margin-top: 0.5rem;
  font-style: italic;
}

.fig-right {
  float: right;
  max-width: 45%;
  margin: 0.25rem 0 1rem 1.5rem;
}

.fig-left {
  float: left;
  max-width: 45%;
  margin: 0.25rem 1.5rem 1rem 0;
}

.fig-right img,
.fig-left img {
  width: 100%;
}

.divider {
  border: none;
  text-align: center;
  margin: 2.5rem 0;
}

.divider::before {
  content: '* * *';
  color: #999;
  font-size: 1rem;
  letter-spacing: 0.5em;
}

.rule {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 2rem 0;
}

.deck {
  font-size: 1.1rem;
  color: #333;
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 2rem;
}

.small-caps {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
}

.epigraph {
  font-style: italic;
  color: #333;
  border: none;
  padding: 0;
  margin: 0 0 2.5rem 0;
  text-align: center;
  font-size: 1rem;
}

.epigraph cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.85rem;
  color: #666;
}

.back-link {
  display: inline-block;
  margin-top: 2rem;
  color: #000;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* Paintings gallery grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
}

.gallery-grid .painting {
  aspect-ratio: 1;
  cursor: pointer;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: #fff;
  font-weight: 600;
}

.gallery-grid .painting:hover {
  opacity: 0.85;
}

.gallery-grid .painting img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
}

/* --- Responsive Images --- */
img {
  max-width: 100%;
  height: auto;
}

.responsive-img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Lazy loading placeholder */
img[loading="lazy"] {
  background: #f0f0f0;
}

/* Picture element styling */
picture {
  display: block;
}

picture img {
  width: 100%;
  height: auto;
}

/* Responsive video/embed container */
.video-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-container iframe,
.video-container video,
.video-container embed,
.video-container object {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-container.aspect-4-3 {
  padding-bottom: 75%; /* 4:3 aspect ratio */
}

.video-container.aspect-1-1 {
  padding-bottom: 100%; /* 1:1 aspect ratio */
}

/* --- Responsive Breakpoints --- */

/* Large desktop (1200px+) */
@media (min-width: 1200px) {
  .content {
    max-width: 1000px;
    padding: 3rem 4rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .three-col {
    column-count: 3;
  }
}

/* Tablet landscape (992px - 1199px) */
@media (max-width: 1199px) and (min-width: 992px) {
  .content {
    max-width: 800px;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .three-col {
    column-count: 2;
  }
}

/* Tablet portrait (768px - 991px) */
@media (max-width: 991px) and (min-width: 769px) {
  .sidebar {
    width: 180px;
    padding: 2rem 1.5rem;
  }

  .content {
    margin-left: 180px;
    padding: 2rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .two-col {
    column-count: 2;
  }

  .three-col {
    column-count: 2;
  }

  .pull-quote,
  .pull-quote-left {
    width: 45%;
    font-size: 1.1rem;
  }
}

/* Mobile (max 768px) */
@media (max-width: 768px) {
  .site-wrapper {
    flex-direction: column;
  }

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 1.5rem;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
  }

  .sidebar .site-name {
    margin-bottom: 0;
  }

  .sidebar .nav-links {
    flex-direction: row;
    gap: 1rem;
  }

  .nav-footer {
    display: none;
  }

  .content {
    margin-left: 0;
    padding: 1.5rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .two-col,
  .three-col {
    column-count: 1;
  }

  .pull-quote,
  .pull-quote-left {
    float: none;
    width: 100%;
    margin: 1.5rem 0;
    border-left: 2px solid #000;
    border-right: none;
    text-align: left;
    padding: 0.75rem 0 0.75rem 1rem;
  }

  .img-right,
  .img-left,
  .fig-right,
  .fig-left {
    float: none;
    max-width: 100%;
    margin: 1.25rem 0;
  }

  /* Responsive typography for mobile */
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .post-content {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .post-content .drop-cap::first-letter {
    font-size: 3.5em;
  }
}

/* Small mobile (max 480px) */
@media (max-width: 480px) {
  .sidebar {
    padding: 1rem;
    gap: 0.75rem;
  }

  .sidebar .site-name {
    font-size: 1rem;
  }

  .sidebar .nav-links {
    gap: 0.75rem;
  }

  .sidebar .nav-links a {
    font-size: 0.85rem;
  }

  .content {
    padding: 1rem;
  }

  .hero {
    padding: 2rem 0 1rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .about-photo {
    max-width: 80%;
  }

  .post-list a {
    font-size: 0.95rem;
  }

  .post-list .date {
    font-size: 0.8rem;
  }

  .deck {
    font-size: 1rem;
  }

  .epigraph {
    font-size: 0.9rem;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .gallery-grid .painting {
    -webkit-tap-highlight-color: transparent;
  }

  .gallery-grid .painting:active {
    opacity: 0.85;
  }
}

/* High-resolution displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Ensure crisp images on retina displays */
  img {
    image-rendering: -webkit-optimize-contrast;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Uncomment to enable dark mode:
  body {
    background: #1a1a1a;
    color: #e0e0e0;
  }

  .sidebar .site-name,
  .sidebar .nav-links a,
  a {
    color: #e0e0e0;
  }

  h1, h2 {
    color: #fff;
  }

  .post-list li {
    border-color: #333;
  }
  */
}
