/* Blog Page Styles */

.blog-main {
  padding: 100px 24px 80px;
  max-width: 800px;
  margin: 0 auto;
  background: #fafafa;
  min-height: 100vh;
}

/* Ensure blog header is first visible element */
.blog-main > .blog-header {
  margin-top: 0;
  padding-top: 0;
}

/* Blog Header with Title, Search, and Archives */
/* Override any global header styles - ensure blog header is visible */
.blog-main header.blog-header {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  margin-bottom: 60px;
  padding-bottom: 32px;
  padding-top: 40px; /* Extra space from site header */
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
  width: 100%;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: transparent;
  backdrop-filter: none;
  z-index: auto;
}

.blog-header {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  margin: 0 0 60px 0 !important;
  padding: 0 0 32px 0 !important;
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
  width: 100% !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  z-index: auto !important;
  box-sizing: border-box !important;
}

.blog-header h1.blog-title,
.blog-header .blog-title,
.blog-title {
  font-size: 48px !important;
  font-weight: 700 !important;
  letter-spacing: 3px !important;
  text-transform: uppercase !important;
  color: #000000 !important;
  margin: 0 0 32px 0 !important;
  padding: 0 !important;
  text-align: center !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  line-height: 1.2 !important;
  font-family: inherit !important;
  width: 100% !important;
  text-shadow: none !important;
}

.blog-header-controls {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Search Box */
.blog-search-container {
  flex: 1;
  max-width: 300px;
  min-width: 200px;
}

.blog-search-input {
  width: 100%;
  padding: 10px 16px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.blog-search-input:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.blog-search-input::placeholder {
  color: #999;
}

/* Archives Dropdown */
.blog-archives-dropdown {
  position: relative;
  display: inline-block;
}

.blog-archives-toggle {
  padding: 10px 20px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: lowercase;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.blog-archives-toggle:hover,
.blog-archives-toggle:focus {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
  outline: none;
}

.blog-archives-toggle:active {
  background: rgba(0, 0, 0, 0.1);
}

.blog-archives-toggle[aria-expanded="true"] {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
}

.blog-archives-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  min-width: 280px;
  max-height: 400px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  padding: 8px 0;
}

.blog-archives-menu.active {
  display: block;
}

.blog-archives-item {
  display: block;
  padding: 12px 16px;
  font-size: 14px;
  color: #1a1a1a;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.2s ease;
  cursor: pointer;
  touch-action: manipulation;
}

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

.blog-archives-item:hover,
.blog-archives-item:focus {
  background: rgba(0, 0, 0, 0.05);
  outline: none;
}

.blog-archives-item-title {
  font-weight: 500;
  margin-bottom: 4px;
  display: block;
}

.blog-archives-item-date {
  font-size: 12px;
  color: #666;
  display: block;
}

/* Hide posts when searching */
.blog-post.hidden {
  display: none;
}

.blog-container {
  width: 100%;
}

/* Blog Post */
.blog-post {
  margin-bottom: 120px;
  scroll-margin-top: 150px; /* Account for fixed header + blog header */
}

.blog-post:last-child {
  margin-bottom: 60px;
}

/* Post Header */
.post-header {
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.post-title {
  font-size: 32px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.5px;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.post-date {
  display: block;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #666;
  font-weight: 400;
}

/* Post Content */
.post-content {
  font-size: 18px;
  line-height: 1.8;
  color: #2a2a2a;
  max-width: 100%;
}

.post-content p {
  margin-bottom: 24px;
}

.post-content p:last-child {
  margin-bottom: 0;
}

/* Blog Photos - 35mm Aesthetic */
.blog-photo {
  margin: 40px 0;
  width: 100%;
  position: relative;
  overflow: hidden;
}

.blog-photo img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  filter: contrast(1.05) brightness(0.98) saturate(1.1);
  /* Film grain effect */
  background-image: 
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.03) 0px,
      transparent 1px,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 3px
    );
  image-rendering: -webkit-optimize-contrast;
  object-fit: contain;
}

.photo-caption {
  font-size: 13px;
  color: #666;
  font-style: italic;
  margin-top: 12px;
  text-align: center;
  line-height: 1.5;
}

/* EXIF Data for Blog Photos */
.blog-photo .exif-data {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  width: 100%;
  overflow: hidden;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.blog-photo:hover .exif-data {
  opacity: 1;
  transform: translateY(0);
}

/* Show EXIF on touch devices */
@media (hover: none) {
  .blog-photo .exif-data {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Media Embeds */
.media-embed {
  margin: 40px 0;
  width: 100%;
  position: relative;
}

.media-embed iframe {
  width: 100%;
  display: block;
  border: none;
}

/* YouTube Embed */
.youtube-embed {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Spotify Embed */
.spotify-embed {
  margin: 40px 0;
}

.spotify-embed iframe {
  width: 100%;
  min-height: 352px;
  border-radius: 12px;
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin: 40px 0;
}

.photo-grid .blog-photo {
  margin: 0;
}

/* Links in Content */
.post-content a {
  color: #1a1a1a;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.3);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.post-content a:hover {
  text-decoration-color: rgba(0, 0, 0, 0.6);
}

/* Typography Enhancements */
.post-content strong {
  font-weight: 500;
  color: #1a1a1a;
}

.post-content em {
  font-style: italic;
}

.post-content blockquote {
  margin: 32px 0;
  padding-left: 24px;
  border-left: 3px solid rgba(0, 0, 0, 0.2);
  font-style: italic;
  color: #555;
  line-height: 1.7;
}

.post-content ul,
.post-content ol {
  margin: 24px 0;
  padding-left: 32px;
}

.post-content li {
  margin-bottom: 12px;
  line-height: 1.7;
}

.post-content h3 {
  font-size: 24px;
  font-weight: 400;
  margin: 40px 0 20px;
  line-height: 1.4;
  color: #1a1a1a;
}

.post-content h4 {
  font-size: 20px;
  font-weight: 400;
  margin: 32px 0 16px;
  line-height: 1.4;
  color: #1a1a1a;
}

/* Header Link */
header h1 a {
  color: #1a1a1a;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

header h1 a:hover {
  opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .blog-main {
    padding: 90px 20px 60px;
  }

  /* Blog Header - Mobile */
  .blog-header {
    margin-bottom: 40px;
    padding-bottom: 24px;
    padding-top: 30px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .blog-title {
    font-size: 32px;
    margin-bottom: 20px;
    letter-spacing: 2px;
    font-weight: 600;
    color: #000000;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .blog-header-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .blog-search-container {
    max-width: 100%;
    min-width: 100%;
  }

  .blog-search-input {
    padding: 12px 16px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .blog-archives-toggle {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .blog-archives-menu {
    min-width: 100%;
    max-height: 300px;
    left: 0;
    right: 0;
  }

  .blog-archives-item {
    padding: 14px 16px;
    font-size: 15px;
  }

  .blog-archives-item-title {
    font-size: 15px;
  }

  .blog-archives-item-date {
    font-size: 13px;
    margin-top: 2px;
  }

  /* Post Title and Date - Mobile Visibility Fix */
  .blog-post {
    margin-bottom: 80px;
  }

  .post-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  }

  .post-title {
    font-size: 26px;
    line-height: 1.3;
    margin-bottom: 12px;
    color: #1a1a1a; /* Ensure visibility */
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Ensure title is always visible on mobile */
    display: block;
    visibility: visible;
    opacity: 1;
  }

  .post-date {
    display: block !important; /* Force visibility */
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #666;
    font-weight: 400;
    visibility: visible !important; /* Ensure visible */
    opacity: 1 !important; /* Ensure visible */
    margin-top: 8px;
  }

  .post-content {
    font-size: 16px;
    line-height: 1.7;
  }

  .post-content p {
    margin-bottom: 20px;
  }

  .blog-photo {
    margin: 32px 0;
  }

  .media-embed {
    margin: 32px 0;
  }

  .photo-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 32px 0;
  }

  .post-content h3 {
    font-size: 22px;
    margin: 32px 0 16px;
  }

  .post-content h4 {
    font-size: 18px;
    margin: 24px 0 12px;
  }

  .post-content blockquote {
    margin: 24px 0;
    padding-left: 20px;
  }

  .spotify-embed iframe {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .blog-main {
    padding: 80px 16px 50px;
  }

  /* Blog Header - Small Mobile */
  .blog-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    padding-top: 24px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .blog-title {
    font-size: 28px;
    margin-bottom: 16px;
    letter-spacing: 1.5px;
    font-weight: 600;
    color: #000000;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .blog-header-controls {
    gap: 10px;
  }

  .blog-search-input {
    padding: 12px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .blog-archives-toggle {
    padding: 12px 18px;
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .blog-archives-menu {
    max-height: 250px;
  }

  .blog-archives-item {
    padding: 12px 14px;
    font-size: 14px;
  }

  .blog-archives-item-title {
    font-size: 14px;
  }

  .blog-archives-item-date {
    font-size: 12px;
  }

  /* Post Title and Date - Small Mobile Visibility Fix */
  .blog-post {
    margin-bottom: 60px;
  }

  .post-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  }

  .post-title {
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 10px;
    color: #1a1a1a; /* Ensure visibility */
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    /* Ensure title is always visible on small mobile */
    display: block;
    visibility: visible;
    opacity: 1;
  }

  .post-date {
    display: block !important; /* Force visibility */
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #666;
    font-weight: 400;
    visibility: visible !important; /* Ensure visible */
    opacity: 1 !important; /* Ensure visible */
    margin-top: 6px;
  }

  .post-content {
    font-size: 15px;
    line-height: 1.6;
  }

  .post-content p {
    margin-bottom: 18px;
  }

  .blog-photo {
    margin: 24px 0;
  }

  .photo-caption {
    font-size: 12px;
    margin-top: 10px;
  }

  .media-embed {
    margin: 24px 0;
  }

  .spotify-embed iframe {
    min-height: 280px;
  }

  .post-content h3 {
    font-size: 20px;
    margin: 28px 0 14px;
  }

  .post-content h4 {
    font-size: 17px;
    margin: 20px 0 10px;
  }

  .post-content blockquote {
    margin: 20px 0;
    padding-left: 16px;
    font-size: 14px;
  }

  .post-content ul,
  .post-content ol {
    padding-left: 24px;
  }
}

