/* Photostream CMS — shared public styles
 * Edit this file to change site-wide look & layout.
 */

* { margin: 0; padding: 0; box-sizing: border-box; }
    body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f6f6f6; color: #111; line-height: 1.5; -webkit-text-size-adjust: 100%; }
    /* Fixed-height sticky header avoids layout wobble on scroll */
    header {
      background: white;
      padding: 0 4%;
      height: 72px;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 1px 0 rgba(0,0,0,0.06);
      transition: box-shadow 0.2s ease, height 0.2s ease;
    }
    header.small {
      height: 56px;
      box-shadow: 0 2px 12px rgba(0,0,0,0.1);
    }
    .container { max-width: 1800px; margin: 0 auto; padding: 0 4%; }
    header .container {
      display: flex; justify-content: space-between; align-items: center;
      flex-wrap: nowrap; gap: 10px; padding: 0; height: 100%;
    }
    h1 {
      font-size: 1.75rem; font-weight: 700; margin: 0; line-height: 1.2;
      transition: font-size 0.2s ease;
    }
    header.small h1 { font-size: 1.35rem; }
    h1 a { color: inherit; text-decoration: none; }
    .menu-btn {
      width: 44px; height: 44px; border: 1px solid #ddd; border-radius: 8px;
      background: white; cursor: pointer; display: flex; flex-direction: column;
      align-items: center; justify-content: center; gap: 5px; padding: 0;
      -webkit-tap-highlight-color: transparent;
    }
    .menu-btn span {
      display: block; width: 18px; height: 2px; background: #222; border-radius: 1px;
      transition: transform 0.2s, opacity 0.2s;
    }
    .menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .menu-btn.open span:nth-child(2) { opacity: 0; }
    .menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
    .nav-drawer {
      position: fixed; top: 0; right: 0; width: min(300px, 85vw); height: 100%;
      background: white; z-index: 300; box-shadow: -8px 0 30px rgba(0,0,0,0.12);
      transform: translateX(100%); transition: transform 0.25s ease;
      padding: 80px 24px 40px; display: flex; flex-direction: column; gap: 4px;
    }
    .nav-drawer.open { transform: translateX(0); }
    .nav-drawer a {
      display: block; padding: 14px 16px; color: #111; text-decoration: none;
      font-size: 1.05rem; border-radius: 8px; font-weight: 500;
    }
    .nav-drawer a:hover { background: #f3f3f3; }
    .nav-backdrop {
      position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 250;
      opacity: 0; pointer-events: none; transition: opacity 0.25s;
    }
    .nav-backdrop.open { opacity: 1; pointer-events: auto; }

    footer.site-footer {
      background: #111; color: #ccc; margin-top: 40px; padding: 40px 4% 28px;
    }
    footer.site-footer .footer-inner {
      max-width: 1100px; margin: 0 auto; display: flex; flex-wrap: wrap;
      gap: 28px; justify-content: space-between; align-items: flex-start;
    }
    footer.site-footer h3 { color: #fff; font-size: 1.1rem; margin-bottom: 10px; }
    footer.site-footer p { font-size: 0.9rem; line-height: 1.5; max-width: 360px; }
    footer.site-footer a { color: #ddd; text-decoration: none; font-size: 0.9rem; }
    footer.site-footer a:hover { color: #fff; }
    footer.site-footer ul { list-style: none; }
    footer.site-footer li { margin-bottom: 8px; }
    footer.site-footer .copy {
      width: 100%; border-top: 1px solid #333; margin-top: 24px; padding-top: 18px;
      font-size: 0.8rem; color: #888; text-align: center;
    }

    .lightbox-tags a {
      display: inline-block; background: rgba(255,255,255,0.18); padding: 4px 12px;
      border-radius: 20px; margin: 2px 3px; color: #fff; text-decoration: none;
      font-size: 0.8rem;
    }
    .lightbox-tags a:hover { background: rgba(255,255,255,0.35); }

    .filters {
      background: white; border-bottom: 1px solid #eee; padding: 12px 4%;
      position: sticky; top: 56px; z-index: 90;
    }
    header:not(.small) ~ .filters { top: 72px; }
    header.small ~ .filters, .filters.stuck { /* handled by JS if needed */ }
    .filters-inner { max-width: 1800px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
    .filters input[type="search"] {
      flex: 1; min-width: 140px; max-width: 280px; padding: 9px 14px;
      border: 1px solid #ddd; border-radius: 8px; font-size: 0.95rem;
    }
    .filters select {
      padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.9rem; background: white;
    }
    .chip {
      display: inline-block; padding: 6px 12px; border-radius: 20px; font-size: 0.85rem;
      background: #eee; color: #333; text-decoration: none; border: none; cursor: pointer;
    }
    .chip.active, .chip:hover { background: #111; color: white; }
    .chip-clear { background: #fee; color: #c00; }
    .results-info { font-size: 0.9rem; color: #666; padding: 12px 4% 0; max-width: 1800px; margin: 0 auto; }

    /* Uniform 1:1 square grid — predictable & responsive */
    .photostream {
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 14px;
      padding: 20px 0 40px;
    }
    .photo-item {
      position: relative;
      overflow: hidden;
      border-radius: 10px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      background: #1a1a1a;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
      width: 100%;
      aspect-ratio: 1 / 1;
    }
    .photo-item img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center;
      display: block;
      border-radius: 10px;
    }
    .overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.35) 45%, transparent 70%);
      opacity: 0;
      transition: opacity 0.2s ease;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      padding: 14px;
      color: #fff;
      pointer-events: none;
      border-radius: 10px;
      line-height: 1.35;
      text-align: left;
    }
    .photo-item:hover .overlay,
    .photo-item:focus-within .overlay,
    .photo-item:active .overlay {
      opacity: 1;
    }
    .title {
      font-size: 0.95rem;
      font-weight: 600;
      margin-bottom: 4px;
      text-shadow: 0 1px 3px rgba(0,0,0,0.6);
      line-height: 1.3;
    }
    .meta {
      font-size: 0.8rem;
      opacity: 0.95;
      text-shadow: 0 1px 2px rgba(0,0,0,0.5);
      line-height: 1.3;
    }

    .loader { text-align: center; padding: 20px; color: #888; font-size: 0.9rem; display: none; }
    .loader.visible { display: block; }
    .loader.end { color: #bbb; font-size: 0.85rem; padding: 16px; }
    .empty { text-align: center; padding: 60px 20px; color: #666; font-size: 1.1rem; }

    /* Lightbox */
    #lightbox {
      position: fixed; inset: 0; background: rgba(0,0,0,0.95); display: none;
      flex-direction: column; align-items: center; justify-content: center; z-index: 2000;
      padding: 12px; touch-action: none;
    }
    #lightbox.active { display: flex; }
    .lightbox-content { width: 100%; max-width: 96vw; display: flex; flex-direction: column; align-items: center; }
    #lightbox img { max-width: 100%; max-height: 70vh; border-radius: 6px; object-fit: contain; user-select: none; -webkit-user-drag: none; }
    .info-bar { width: 100%; max-width: 900px; color: white; padding: 12px 8px 4px; text-align: center; }
    .lightbox-title { font-size: 1.25rem; font-weight: 600; margin-bottom: 4px; }
    .lightbox-title a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.35); }
    .lightbox-title a:hover { border-bottom-color: #fff; }
    .lightbox-desc { font-size: 0.95rem; opacity: 0.9; max-width: 95%; margin: 0 auto 6px; white-space: pre-wrap; }
    .lightbox-meta { font-size: 0.85rem; opacity: 0.75; margin-bottom: 4px; }
    .lightbox-exif { font-size: 0.8rem; opacity: 0.65; }
    .lightbox-tags { font-size: 0.8rem; opacity: 0.85; margin-top: 6px; }
    .lightbox-tags span { display: inline-block; background: rgba(255,255,255,0.15); padding: 3px 10px; border-radius: 20px; margin: 2px 3px; }
    .close-btn {
      position: fixed; top: 12px; right: 16px; color: white; font-size: 2.4rem; cursor: pointer;
      width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
      background: rgba(0,0,0,0.35); border-radius: 50%; z-index: 20;
    }
    .nav-arrow {
      position: fixed; top: 50%; transform: translateY(-50%); color: white; font-size: 2.8rem;
      cursor: pointer; opacity: 0.7; padding: 16px 12px; z-index: 15;
      background: rgba(0,0,0,0.25); border-radius: 8px;
    }
    .prev { left: 8px; } .next { right: 8px; }
    .nav-arrow.hidden { opacity: 0; pointer-events: none; }

    @media (max-width: 1400px) { .photostream { grid-template-columns: repeat(4, 1fr); } }
    @media (max-width: 1000px) { .photostream { grid-template-columns: repeat(3, 1fr); } }
    @media (max-width: 700px)  {
      .photostream { grid-template-columns: repeat(2, 1fr); gap: 10px; }
      h1 { font-size: 1.45rem; }
      header.small h1 { font-size: 1.2rem; }
    }
    @media (max-width: 600px)  {
      #lightbox { padding-top: 56px; justify-content: flex-start; }
      #lightbox img { max-height: 55vh; }
      .nav-arrow { font-size: 2.2rem; top: 40%; }
      .filters-inner { gap: 8px; }
      .filters input[type="search"] { max-width: none; width: 100%; }
    }
    @media (max-width: 420px) {
      .photostream { grid-template-columns: 1fr; }
    }
    @media (hover: none) {
      .photo-item .overlay {
        opacity: 1;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 55%);
      }
    }

/* Album detail page */
.back { color: #555; text-decoration: none; font-size: 0.9rem; }
.back:hover { color: #111; }
.album-desc { max-width: 800px; margin: 6px 0 0; color: #555; font-size: 0.95rem; }


/* Albums listing */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 32px 0 60px;
}
.album-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.album-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.14);
}
.album-card .cover {
  height: 180px;
  background: #e4e4e4;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.9rem;
  overflow: hidden;
}
.album-card .cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.album-card .body { padding: 16px 18px 20px; }
.album-card .body h2 { font-size: 1.15rem; font-weight: 600; margin-bottom: 4px; }
.album-card .body p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.album-card .count { font-size: 0.85rem; color: #888; }
@media (max-width: 600px) {
  .albums-grid { grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px 0 40px; }
  .album-card .cover { height: 130px; }
  .album-card .body { padding: 12px; }
  .album-card .body h2 { font-size: 1rem; }
}
@media (max-width: 380px) {
  .albums-grid { grid-template-columns: 1fr; }
}


/* Single photo page */
body.photo-page { background: #0f0f0f; color: #eee; }
.photo-page header {
  background: rgba(20,20,20,0.95);
  border-bottom: 1px solid #222;
  box-shadow: none;
}
.photo-page header a.logo { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.25rem; }
.photo-page header .links a { color: #aaa; text-decoration: none; margin-left: 16px; font-size: 0.9rem; }
.photo-page header .links a:hover { color: #fff; }
.photo-wrap, .photo-page .wrap { max-width: 1100px; margin: 0 auto; padding: 24px 4% 60px; }
.photo-stage {
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
  margin-bottom: 28px;
}
.photo-stage img {
  max-width: 100%;
  max-height: 82vh;
  height: auto;
  display: block;
  margin: 0 auto;
}
.meta-block h1 { font-size: clamp(1.4rem, 3vw, 2rem); color: #fff; margin-bottom: 8px; }
.meta-block .sub { color: #999; font-size: 0.95rem; margin-bottom: 12px; }
.meta-block .desc { color: #ccc; font-size: 1rem; white-space: pre-wrap; margin-bottom: 16px; max-width: 720px; }
.meta-block .exif { color: #777; font-size: 0.85rem; margin-bottom: 14px; }
.meta-block .tags a {
  display: inline-block;
  background: #222;
  color: #ddd;
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  margin: 0 6px 6px 0;
}
.meta-block .tags a:hover { background: #333; color: #fff; }
.nav-photos {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #222;
}
.nav-photos a { color: #ccc; text-decoration: none; font-size: 0.95rem; max-width: 45%; }
.nav-photos a:hover { color: #fff; }
.nav-photos .next { text-align: right; margin-left: auto; }
.draft-badge {
  display: inline-block;
  background: #a60;
  color: #fff;
  font-size: 0.75rem;
  padding: 3px 8px;
  border-radius: 4px;
  margin-left: 8px;
  vertical-align: middle;
}
.not-found { text-align: center; padding: 80px 20px; color: #888; }
.not-found a { color: #ccc; }
.photo-page footer.site-footer {
  background: #0a0a0a;
  color: #666;
  border-top: 1px solid #1a1a1a;
  text-align: center;
  padding: 28px 4%;
  font-size: 0.85rem;
}
.photo-page footer.site-footer a { color: #888; }

