/*
Theme Name: Peak Photography
Theme URI: https://example.com/peak-photography
Author: Peak Theme
Description: Minimalistyczny motyw portfolio fotograficznego wzorowany na szablonie Peak. Boczna nawigacja, siatkowa galeria kafelkowa z pop-out lightboxem.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: peak-photography
Tags: photography, portfolio, grid, minimal, responsive
*/

/* ============================
   RESET & BASE
   ============================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-light: #999999;
  --color-border: #ebebeb;
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-display: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sidebar-width: 280px;
  --grid-gap: 6px;
  --grid-cols: 3;
  --transition: 0.25s ease;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ============================
   LAYOUT — SIDEBAR + CONTENT
   ============================ */
.site-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================
   SIDEBAR / HEADER
   ============================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  z-index: 100;
  background: #fff;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  padding: 120px 28px 32px 56px !important;
  overflow-y: auto;
}

.site-branding {
  margin-bottom: 48px;
}

.site-branding .site-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.3;
  font-family: var(--font-display);
}

.site-branding .site-title a {
  color: var(--color-text);
}

.site-branding .site-tagline {
  display: block;
  margin-top: 4px;
  font-size: 0.6875rem;
  color: var(--color-text-light);
  letter-spacing: 0.04em;
}

/* Nawigacja pionowa */
.main-navigation {
  flex: 1;
}

.main-navigation ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.main-navigation a {
  display: block;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
  padding: 5px 0;
  transition: color var(--transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a,
.main-navigation .current-menu-ancestor > a {
  color: var(--color-text);
}

/* Stopka sidebar */
.sidebar-footer {
  margin-top: auto;
  padding-top: 24px;
}

.sidebar-footer .footer-copy {
  font-size: 0.6875rem;
  color: var(--color-text-light);
  line-height: 1.5;
}

.footer-social {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.footer-social a {
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-light);
  transition: color var(--transition);
}

.footer-social a:hover { color: var(--color-text); }

/* Hamburger — ukryty na desktopie */
.menu-toggle { display: none; }

/* ============================
   MAIN CONTENT
   ============================ */
.site-header {
  border-right: none !important;
}

.site-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  border-left: none !important;
  outline: none;
}

/* ============================
   PHOTO GRID — MASONRY (pozycjonowanie przez JS)
   ============================ */
.photo-grid {
  position: relative;
  width: 100%;
  padding-top: 20px;
  padding-right: 120px;
}

.photo-grid-item {
  position: absolute;
  cursor: pointer;
  background: #f2f2f2;
  overflow: hidden;
  display: block;
}

.photo-grid-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease, opacity var(--transition);
}

.photo-grid-item:hover img {
  transform: scale(1.03);
  opacity: 0.9;
}

.item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding: 16px;
  opacity: 0;
  transition: opacity var(--transition);
  background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 60%);
}

.photo-grid-item:hover .item-overlay { opacity: 1; }

.item-title {
  font-size: 1rem;
  font-weight: 300;
  font-family: var(--font-display);
  color: #fff;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  font-style: italic;
}

/* ============================
   LIGHTBOX
   ============================ */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.93);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox-overlay.active { display: flex; }

.lightbox-content {
  position: relative;
  max-width: calc(100vw - 200px);
  max-height: calc(100vh - 100px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: calc(100vh - 100px);
  object-fit: contain;
  border-radius: 1px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  transition: opacity 0.2s ease;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 1.25rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
  z-index: 1001;
}

.lightbox-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 2rem;
  cursor: pointer;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
  line-height: 1;
}

.lightbox-nav:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

.lightbox-prev { left: -64px; }
.lightbox-next { right: -64px; }

.lightbox-caption {
  margin-top: 14px;
  color: rgba(255,255,255,0.5);
  font-size: 1rem;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-align: center;
}

.lightbox-counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.3);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
}

/* ============================
   PAGE HEADER
   ============================ */
.page-header {
  padding: 48px 32px 32px;
}

.page-header .page-title {
  font-size: 1.5rem;
  font-weight: 300;
  letter-spacing: 0.04em;
  text-transform: none;
  font-family: var(--font-display);
}

.page-header .page-description {
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--color-text-light);
}

/* ============================
   ABOUT / STATIC PAGES
   ============================ */
.about-page {
  max-width: 680px;
  padding: 64px 40px;
}

.about-page h1 {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 24px;
  letter-spacing: 0.01em;
  font-family: var(--font-display);
  line-height: 1.2;
}

.about-page p,
.about-page .entry-content p {
  font-size: 0.9375rem;
  line-height: 1.8;
  color: #444;
  margin-bottom: 16px;
}

.about-page .entry-content img {
  max-width: 480px;
  margin-bottom: 32px;
}

/* ============================
   CONTACT PAGE
   ============================ */
.contact-page {
  max-width: 520px;
  padding: 64px 40px;
}

.contact-page h1 {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 8px;
  font-family: var(--font-display);
  line-height: 1.2;
}

.contact-page .contact-intro {
  color: var(--color-text-light);
  font-size: 0.875rem;
  margin-bottom: 36px;
  line-height: 1.7;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form label {
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-light);
  display: block;
  margin-bottom: 5px;
}

.contact-form input,
.contact-form textarea,
.contact-page input[type="text"],
.contact-page input[type="email"],
.contact-page textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 2px;
  font-family: var(--font-main);
  font-size: 0.875rem;
  color: var(--color-text);
  background: #fff;
  transition: border-color var(--transition);
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus,
.contact-page input:focus,
.contact-page textarea:focus {
  border-color: #aaa;
}

.contact-form textarea,
.contact-page textarea {
  min-height: 140px;
  resize: vertical;
}

.contact-form button,
.contact-page input[type="submit"] {
  background: var(--color-text);
  color: #fff;
  border: none;
  padding: 12px 28px;
  font-family: var(--font-main);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  transition: opacity var(--transition);
  align-self: flex-start;
}

.contact-form button:hover,
.contact-page input[type="submit"]:hover {
  opacity: 0.7;
}

/* ============================
   GRID COLUMN VARIANTS
   ============================ */
.grid-cols-2 { --grid-cols: 2; }
.grid-cols-3 { --grid-cols: 3; }
.grid-cols-4 { --grid-cols: 4; }

/* ============================
   ANIMACJE WEJŚCIA
   ============================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.photo-grid-item {
  animation: fadeIn 0.4s ease both;
}

.photo-grid-item:nth-child(1)  { animation-delay: 0.04s; }
.photo-grid-item:nth-child(2)  { animation-delay: 0.08s; }
.photo-grid-item:nth-child(3)  { animation-delay: 0.12s; }
.photo-grid-item:nth-child(4)  { animation-delay: 0.16s; }
.photo-grid-item:nth-child(5)  { animation-delay: 0.20s; }
.photo-grid-item:nth-child(6)  { animation-delay: 0.24s; }
.photo-grid-item:nth-child(n+7){ animation-delay: 0.28s; }

/* ============================
   RESPONSIVE — MOBILE
   ============================ */
@media (max-width: 768px) {
  :root { --sidebar-width: 0px; }

  .site-header {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: auto;
    width: 100%;
    height: 52px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
  }

  .site-branding { margin-bottom: 0; }

  .sidebar-footer { display: none; }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
  }

  .menu-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background: var(--color-text);
    transition: var(--transition);
  }

  .main-navigation {
    display: none;
    position: fixed;
    top: 52px;
    left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    padding: 20px 20px 24px;
    z-index: 99;
  }

  .main-navigation.is-open { display: block; }

  .main-navigation ul {
    flex-direction: column;
    gap: 16px;
  }

  .main-navigation a {
    font-size: 0.9375rem;
    padding: 0;
  }

  .site-content {
    margin-left: 0;
    padding-top: 52px;
  }

  .photo-grid {
    --grid-cols: 2;
    gap: 4px;
    padding: 4px;
  }

  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }

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

  .about-page,
  .contact-page {
    padding: 40px 20px;
  }
}

@media (max-width: 420px) {
  .photo-grid { --grid-cols: 1; }
}

/* ============================
   UTILS
   ============================ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}

/* ============================
   CUSTOM LOGO
   ============================ */
.custom-logo-link {
  display: block;
}

.custom-logo {
  max-width: 160px;
  max-height: 80px;
  width: auto;
  height: auto;
  display: block;
}

/* ============================
   IKONKI SOCIAL MEDIA
   ============================ */
.footer-social {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  color: var(--color-text-light);
  transition: color var(--transition);
  flex-shrink: 0;
}

.footer-social a:hover {
  color: var(--color-text);
}

.footer-social a svg {
  width: 10px;
  height: 10px;
  display: block;
}

/* ============================
   BLOG
   ============================ */
.blog-post {
    padding: 64px 80px 80px 80px;
    border-bottom: 1px solid var(--color-border);
}

.blog-post:last-of-type {
    border-bottom: none;
}

.blog-post-header {
    margin-bottom: 32px;
}

.blog-post-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.3;
    margin-bottom: 6px;
}

.blog-post-title a {
    color: var(--color-text);
    text-decoration: none;
}

.blog-post-title a:hover {
    opacity: 0.7;
}

.blog-post-date {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-light);
    letter-spacing: 0.04em;
}

.blog-post-content {
    font-size: 0.9375rem;
    line-height: 1.85;
    color: var(--color-text);
    text-align: justify;
}

.blog-post-content p {
    margin-bottom: 1.5em;
}

.blog-post-content img {
    max-width: 800px;
    max-height: 800px;
    width: auto;
    height: auto;
    display: block;
    margin: 2em 0;
}

.blog-post-content figure {
    margin: 2em 0;
}

.blog-post-content figcaption {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin-top: 8px;
    font-style: italic;
}

.blog-post-content h2,
.blog-post-content h3 {
    font-family: var(--font-display);
    font-weight: 400;
    margin: 2em 0 0.75em;
}

.blog-post-content h2 { font-size: 1.375rem; }
.blog-post-content h3 { font-size: 1.125rem; }

.blog-pagination {
    padding: 40px 80px;
    text-align: center;
}

@media (max-width: 768px) {
    .blog-post {
        padding: 40px 20px;
    }
    .blog-pagination {
        padding: 32px 20px;
    }
}

/* ============================
   SCROLL TO TOP
   ============================ */
#scroll-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 40px;
  height: 40px;
  background: var(--color-text);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.125rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, background 0.2s ease;
  z-index: 500;
}

#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
}

#scroll-top:hover {
  background: #444;
}

@media (max-width: 768px) {
  #scroll-top {
    bottom: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
  }
}
