/* ============================================
   Thomas Kleinert Fotografie — Hugo Theme CSS
   Matching live site thomaskleinertfotografie.de
   ============================================ */

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

html {
  font-size: 62.5%; /* 1rem = 10px */
}

body {
  font-family: "Open Sans", Helvetica, Arial, sans-serif;
  font-size: 1.7rem;
  line-height: 1.6;
  color: #171717;
  background-color: #ffffff;
  padding-top: 12rem; /* space for fixed header */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Dark Mode --- */
[data-theme="dark"] body { color: #e8e8e8; background-color: #1a1a1a; }
[data-theme="dark"] .site-header { background-color: #222222; }
[data-theme="dark"] .card-title { color: #e8e8e8; }
[data-theme="dark"] .breadcrumb,
[data-theme="dark"] .breadcrumb a { color: #888; }
[data-theme="dark"] .breadcrumb a:hover { color: #fff; }
[data-theme="dark"] .section-description { color: #aaa; }
[data-theme="dark"] .site-name { color: #ff9900; }
[data-theme="dark"] .site-tagline { color: #888; }
[data-theme="dark"] .nav-list li a { color: #ccc; border-bottom-color: #444; }
[data-theme="dark"] .theme-toggle { color: #ccc; }

/* Theme toggle icons */
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: #ffffff;
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

[data-theme="dark"] .site-header.scrolled {
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.header-inner {
  width: 100%;
  padding: 3rem 1rem 0.5rem 1rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  transition: padding 0.3s ease;
}

.site-header.scrolled .header-inner {
  padding: 1.5rem 1rem 0.5rem 1rem;
}

.site-header.scrolled .nav-list li a {
  padding-bottom: 0;
}

.site-branding {
  max-width: 45%;
  margin-left: 1rem;
}

.site-title {
  display: flex;
  flex-direction: column;
  color: inherit;
}

.site-title:hover .site-name { color: #ff9900; }

h1.site-name { margin: 0; }

.site-name {
  font-family: "Julius Sans One", sans-serif;
  font-size: 3.6rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 2px;
  color: #ff9900;
  transition: color 0.2s, font-size 0.3s ease;
}

.site-header.scrolled .site-name {
  font-size: 2.4rem;
}

.site-tagline {
  display: block;
  margin: 0 0 0.5rem 0.5rem;
  font-family: "Julius Sans One", sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.6;
  color: #606060;
  overflow: hidden;
  max-height: 3rem;
  opacity: 1;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin 0.3s ease;
}

.site-header.scrolled .site-tagline {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

/* --- Header Right (nav + icons in one row) --- */
.header-right {
  display: flex;
  align-items: center;
  margin-right: 4rem;
  padding-bottom: 0.5rem;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-left: 1.2rem;
  padding-left: 1.2rem;
  border-left: 1px solid #ddd;
}

[data-theme="dark"] .header-icons {
  border-left-color: #444;
}

.icon-link {
  display: flex;
  align-items: center;
  padding: 0.4rem;
  color: #515151;
  transition: color 0.2s;
}

.icon-link:hover { color: #ff8800; }

[data-theme="dark"] .icon-link { color: #ccc; }
[data-theme="dark"] .icon-link:hover { color: #ff8800; }

.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: #515151;
  padding: 0.4rem;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.theme-toggle:hover,
[data-theme="dark"] .theme-toggle:hover { color: #ff8800; }

/* --- Navigation --- */
.site-nav {
  display: flex;
  align-items: flex-end;
}

.nav-list {
  display: flex;
  list-style: none;
  align-items: center;
}

.nav-list li a {
  display: block;
  padding: 0.5rem 1.6rem;
  font-family: "Julius Sans One", sans-serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #515151;
  transition: color 0.2s;
}

.nav-list li a:hover,
.nav-list li a.active { color: #ff8800; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  margin: 0;
  padding: 1rem 1.4rem;
  border: 0;
  border-radius: 3px;
  color: #fff;
  background-color: #171717;
  font-family: "Julius Sans One", sans-serif;
  font-size: 1.3rem;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

.nav-toggle span {
  display: inline-block;
  width: 1.8rem;
  height: 2px;
  background: #fff;
  position: relative;
  vertical-align: middle;
}

.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  display: block;
  width: 100%;
  height: 2px;
  background: #fff;
  position: absolute;
  left: 0;
  transition: transform 0.3s;
}

.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* --- Page Sections --- */
.page-section {
  width: 100%;
  max-width: 80rem;
  padding: 2rem 2rem 4.4rem;
  margin: 0 auto;
}

.page-section h2 {
  font-family: "Julius Sans One", sans-serif;
  font-size: 2rem;
  font-weight: 400;
  margin: 2.5rem 0 1rem;
}

.page-section h3 {
  font-size: 1.7rem;
  font-weight: 600;
  margin: 2rem 0 0.8rem;
}

.page-section p {
  margin-bottom: 1.2rem;
}

.page-section ul, .page-section ol {
  margin: 0 0 1.2rem 2rem;
}

.page-section li {
  margin-bottom: 0.4rem;
}

.section-title {
  font-family: "Julius Sans One", sans-serif;
  font-size: 2.4rem;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 1.1rem;
  padding: 0 0.5rem;
}

.section-description {
  font-size: 1.4rem;
  line-height: 1.6;
  max-width: 80rem;
  margin-bottom: 2.2rem;
  color: #606060;
  padding: 0 0.5rem;
}

.breadcrumb {
  font-size: 1.3rem;
  margin-bottom: 2.2rem;
  color: #606060;
  padding: 0 0.5rem;
}

.breadcrumb a {
  color: #515151;
  font-weight: 700;
  transition: color 0.2s;
}

.breadcrumb a:hover { color: #ff8800; }

/* ============================================
   Tiles Grid — CSS columns masonry layout
   for gallery pages (homepage, collection/travel singles)
   ============================================ */
.tiles-grid {
  column-count: 3;
  column-gap: 4px;
  line-height: 0;
}

.tiles-grid .gallery-item {
  break-inside: avoid;
  margin-bottom: 4px;
  overflow: hidden;
  line-height: 0;
  cursor: pointer;
}

.tiles-grid .gallery-item a {
  display: block;
  overflow: hidden;
  position: relative;
}

.tiles-grid .gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Hover: vignette + plus icon + subtle scale (pointer devices only) */
@media screen and (pointer: fine) {
  .tiles-grid .gallery-item a::after {
    content: "+";
    font-size: 4rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(254,254,254,0) 20%, rgba(0,0,0,0.9) 120%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
  }

  .tiles-grid .gallery-item a:hover::after {
    opacity: 0.9;
  }

  .tiles-grid .gallery-item a:hover img {
    transform: scale(1.02);
  }
}

/* --- Scroll Reveal Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
}

.reveal.visible {
  animation: fadeInUp 0.6s ease-out forwards;
}

/* --- Page Load Fade-in --- */
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main {
  opacity: 0;
}

body.page-loaded main {
  animation: pageFadeIn 0.4s ease-out forwards;
}

/* ============================================
   Cover Grid — justified flexbox layout
   for collections & travel list pages
   ============================================ */
.cover-grid-section {
  max-width: 95%;
  margin: 0 auto;
  padding: 0 0 4.4rem;
}

.cover-grid {
  display: flex;
  flex-wrap: wrap;
  --row-height: 350px;
}

.cover-grid .collection-card {
  flex: 1 1 auto;
  margin: 2.5rem;
  display: block;
  position: relative;
  overflow: visible;
  cursor: pointer;
}

.cover-grid .card-image {
  height: var(--row-height);
  line-height: 0;
  overflow: hidden;
  position: relative;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  transition: box-shadow 0.4s ease;
}

.cover-grid .collection-card:hover .card-image {
  box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}

[data-theme="dark"] .cover-grid .card-image {
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
}

[data-theme="dark"] .cover-grid .collection-card:hover .card-image {
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.cover-grid .card-image img {
  height: 100%;
  width: auto;
  min-width: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.cover-grid .collection-card:hover .card-image img {
  transform: scale(1.03);
}

.cover-grid .card-title {
  padding: 0 0 0.5rem;
}

.card-title h2 {
  font-family: "Julius Sans One", sans-serif;
  font-size: 1.8rem;
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.5;
}

/* Card vignette hover */
@media screen and (pointer: fine) {
  .cover-grid .card-image::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: radial-gradient(ellipse, rgba(254,254,254,0) 20%, rgba(0,0,0,0.4) 100%);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
  }

  .cover-grid .collection-card:hover .card-image::after {
    opacity: 1;
  }
}

/* --- Travel Hover Overlay ---
   Gradient from bottom, reveals description on hover.
   Only used on travel cards (has-overlay class).
*/
.card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 6px;
  background: linear-gradient(0deg, rgba(0,0,0,0.9), rgba(0,0,0,0.3) 50%, transparent);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 3.2rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

[data-theme="dark"] .card-overlay {
  background: linear-gradient(0deg, rgba(0,0,0,0.95), rgba(0,0,0,0.4) 50%, transparent);
}

.collection-card.has-overlay:hover .card-overlay {
  opacity: 1;
}

.card-overlay-inner {
  text-align: center;
  color: #fff;
}

.card-overlay-inner h2 {
  font-family: "Julius Sans One", sans-serif;
  font-size: 1.8rem;
  font-weight: 400;
  text-transform: uppercase;
  margin-bottom: 0.8rem;
  line-height: 1.5;
}

.card-overlay-inner p {
  font-size: 1.4rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}

/* --- Homepage gallery --- */
.homepage-gallery {
  width: 100%;
  padding: 0 0.5rem 4.4rem;
}

/* --- Footer --- */
.site-footer {
  width: 100%;
  padding: 2rem 0 1.5rem;
  background-color: transparent;
  color: #515151;
}

.footer-inner {
  width: 100%;
  padding: 0 1rem;
  font-size: 1.2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
}

.footer-inner a {
  color: #515151;
  transition: color 0.2s;
}

.footer-inner a:hover { color: #ff8800; }

.footer-sep {
  color: #999;
}

[data-theme="dark"] .footer-inner { color: #888; }
[data-theme="dark"] .footer-inner a { color: #888; }
[data-theme="dark"] .footer-sep { color: #555; }

/* --- Responsive --- */

@media (max-width: 1000px) {
  .cover-grid { --row-height: 300px; }
}

@media (max-width: 800px) {
  body { padding-top: 10rem; }

  .tiles-grid { column-count: 2; }

  .cover-grid { --row-height: 250px; }
  .cover-grid .collection-card {
    margin: 1.5rem;
  }

  .header-inner {
    padding: 2rem 1rem 0.5rem;
    flex-wrap: wrap;
  }

  .site-branding { max-width: 100%; }

  .header-right {
    width: 100%;
    margin-right: 0;
    margin-top: 1rem;
    flex-wrap: wrap;
  }

  .nav-toggle { display: block; width: 100%; }

  .site-nav {
    width: 100%;
    order: 2;
  }

  .header-icons {
    order: 3;
    width: 100%;
    justify-content: center;
    margin-left: 0;
    padding-left: 0;
    padding-top: 0.8rem;
    border-left: none;
    border-top: 1px solid #ddd;
  }

  [data-theme="dark"] .header-icons {
    border-top-color: #444;
  }

  .nav-list {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .nav-list.open { display: flex; }

  .nav-list li a {
    display: block;
    padding: 1.1rem 0;
    border-bottom: 1px solid #ddd;
    font-size: 1.4rem;
    line-height: 1.8;
  }
}

@media (max-width: 600px) {
  .tiles-grid { column-count: 1; }

  .cover-grid { --row-height: 200px; }
  .cover-grid .collection-card {
    flex: 1 1 100%;
    margin: 1rem 0;
  }

  .site-name { font-size: 2.8rem; }
  .site-tagline { font-size: 1.3rem; }
}

/* --- PhotoSwipe EXIF Caption --- */
.pswp__exif-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  padding: 1.6rem 2rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.3rem;
  line-height: 1.6;
  pointer-events: none;
  z-index: 10;
}

.exif-gear { font-weight: 600; }
.exif-settings { font-weight: 300; opacity: 0.8; }

/* --- Print --- */
@media print {
  .site-header, .site-footer, .pswp { display: none; }
}
