/* =========================================================
   Atelier Zdzisława — redesign
   Mobile-first, semantic, WordPress-friendly
   ========================================================= */

:root {
  /* Palette (preserved from original site) */
  --color-bg: #e9d7c9;
  --color-surface: #f3e7dc;
  --color-primary: #062b23;
  --color-secondary: #2b453c;
  --color-tertiary: #7a7e5f;
  --color-on-dark: #e9d7c9;

  /* Type */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Rhythm */
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(3.5rem, 9vw, 7rem);
  --radius: 4px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; margin: 0; }

.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;
}
.skip-link {
  position: absolute; left: 0.5rem; top: -3rem; z-index: 1000;
  background: var(--color-primary); color: var(--color-on-dark);
  padding: 0.6rem 1rem; border-radius: var(--radius); text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus { top: 0.5rem; }

/* ---------- Layout helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section__title {
  font-size: clamp(1.6rem, 4.5vw, 2.6rem);
  letter-spacing: -0.01em;
  max-width: 24ch;
}
.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-tertiary);
  margin: 0 0 0.9rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.7rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  border: 1px solid var(--color-primary);
  transition: background-color 0.25s, color 0.25s, transform 0.25s;
}
.btn--solid { background: var(--color-primary); color: var(--color-on-dark); }
.btn--solid:hover { background: var(--color-secondary); border-color: var(--color-secondary); }
.btn--ghost { background: transparent; color: var(--color-primary); }
.btn--ghost:hover { background: var(--color-primary); color: var(--color-on-dark); }
.btn:active { transform: translateY(1px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 12%, transparent);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
}
.brand { text-decoration: none; display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.brand__tag {
  font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.2em;
  color: var(--color-tertiary); margin-top: 0.15rem;
}

/* Nav — mobile first (off-canvas dropdown) */
.nav__toggle {
  width: 44px; height: 44px; border: 0; background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  position: relative;
}
.nav__toggle-bar,
.nav__toggle-bar::before,
.nav__toggle-bar::after {
  content: ""; display: block; width: 24px; height: 2px;
  background: var(--color-primary); transition: transform 0.25s, opacity 0.2s;
}
.nav__toggle-bar::before { position: absolute; transform: translateY(-7px); }
.nav__toggle-bar::after { position: absolute; transform: translateY(7px); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar { background: transparent; }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar::before { transform: rotate(45deg); }
.nav__toggle[aria-expanded="true"] .nav__toggle-bar::after { transform: rotate(-45deg); }

.nav__menu {
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--color-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--color-primary) 14%, transparent);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.32s ease;
}
.nav__menu.is-open {
  max-height: 60vh;
  border-bottom-width: 1px;
}
.nav__menu li { border-top: 1px solid color-mix(in srgb, var(--color-primary) 10%, transparent); }
.nav__menu a {
  display: block;
  padding: 1rem var(--gutter);
  text-decoration: none;
  font-weight: 500;
}
.nav__menu a:hover { background: color-mix(in srgb, var(--color-primary) 6%, transparent); }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem); }
.hero__inner { display: grid; gap: clamp(2rem, 6vw, 3.5rem); }
.hero__title {
  font-size: clamp(2.6rem, 11vw, 5.5rem);
  letter-spacing: -0.02em;
  margin-block: 0.4rem 1.2rem;
}
.hero__lead { font-size: clamp(1.05rem, 2.5vw, 1.2rem); max-width: 46ch; color: var(--color-secondary); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 1.8rem; }
.hero__media {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px -28px rgba(6, 43, 35, 0.55);
}
.hero__media img { width: 100%; aspect-ratio: 16 / 11; object-fit: cover; }

/* ---------- About ---------- */
.about__inner { display: grid; gap: clamp(1.5rem, 5vw, 3.5rem); }
.about__body > p { margin: 0 0 1.2rem; max-width: 68ch; }
.about__body > p:last-child { margin-bottom: 0; }

/* ---------- Quote ---------- */
.quote { background: var(--color-primary); color: var(--color-on-dark); padding-block: clamp(3rem, 8vw, 5.5rem); }
.quote__text {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.8rem, 6vw, 3.4rem);
  line-height: 1.2;
  text-align: center;
  letter-spacing: -0.01em;
}

/* ---------- Gallery ---------- */
.gallery__head { margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
.gallery__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}
.gallery__item { margin: 0; }
.gallery__btn {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  border-radius: var(--radius); overflow: hidden; position: relative;
}
.gallery__btn img {
  width: 100%; height: 100%; object-fit: cover;
  aspect-ratio: 3 / 2;
  transition: transform 0.5s ease;
}
.gallery__item--tall .gallery__btn img { aspect-ratio: 3 / 4; }
.gallery__btn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(6, 43, 35, 0.35));
  opacity: 0; transition: opacity 0.3s;
}
.gallery__btn:hover img { transform: scale(1.04); }
.gallery__btn:hover::after { opacity: 1; }
.gallery__btn:focus-visible { outline: 3px solid var(--color-secondary); outline-offset: 3px; }

/* ---------- Contact ---------- */
.contact { background: var(--color-surface); text-align: center; }
.contact__inner { display: grid; justify-items: center; }
.contact__title { max-width: 18ch; }
.contact__sub { max-width: 48ch; margin: 1rem 0 2rem; color: var(--color-secondary); }
.contact__phone {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  border-bottom: 2px solid transparent;
  transition: border-color 0.25s;
}
.contact__phone:hover { border-color: var(--color-primary); }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-primary); color: var(--color-on-dark); padding-block: 2.5rem; }
.site-footer__inner { display: grid; gap: 1rem; text-align: center; }
.brand--footer { margin: 0; }
.brand--footer .brand__name { font-size: 1.3rem; }
.site-footer__social { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.site-footer__social a { text-decoration: none; opacity: 0.85; transition: opacity 0.2s; }
.site-footer__social a:hover { opacity: 1; text-decoration: underline; }
.site-footer__credit { font-size: 0.8rem; opacity: 0.6; margin: 0; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(6, 43, 35, 0.94);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
}
.lightbox[hidden] { display: none; }
.lightbox__img {
  max-width: 100%; max-height: 90vh; width: auto;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.lightbox__close, .lightbox__nav {
  position: absolute; background: rgba(233, 215, 201, 0.12);
  color: var(--color-on-dark); border: 0; border-radius: 999px;
  width: 48px; height: 48px; font-size: 1.6rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.2s;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(233, 215, 201, 0.25); }
.lightbox__close { top: 1rem; right: 1rem; }
.lightbox__nav--prev { left: 1rem; }
.lightbox__nav--next { right: 1rem; }
.lightbox__nav { top: 50%; transform: translateY(-50%); }

/* =========================================================
   Tablet  (>= 600px)
   ========================================================= */
@media (min-width: 600px) {
  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.1rem;
  }
  .gallery__item--wide { grid-column: span 2; }
  .gallery__item--wide .gallery__btn img { aspect-ratio: 16 / 7; }
  .gallery__item--tall { grid-row: span 2; }
  .gallery__item--tall .gallery__btn img { height: 100%; aspect-ratio: auto; }
}

/* =========================================================
   Desktop  (>= 900px)
   ========================================================= */
@media (min-width: 900px) {
  .nav__toggle { display: none; }
  .nav__menu {
    position: static; display: flex; gap: 0.5rem;
    background: none; border: 0;
    max-height: none; overflow: visible;
  }
  .nav__menu li { border: 0; }
  .nav__menu a { padding: 0.5rem 0.9rem; border-radius: 999px; }

  .hero__inner {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }
  .hero__media img { aspect-ratio: 4 / 5; }

  .about__inner { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
  .about__head { position: sticky; top: 100px; }

  .gallery__grid { grid-template-columns: repeat(3, 1fr); }
  .gallery__item--wide { grid-column: span 2; }

  .site-footer__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
    text-align: left;
  }
  .site-footer__credit { justify-self: end; }
}

/* =========================================================
   Motion preferences
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================
   Ustawienia bloków ACF — marginesy (Margines górny / dolny)
   ========================================================= */
.margin-top { margin-top: var(--section-y); }
.margin-bottom { margin-bottom: var(--section-y); }

/* =========================================================
   Submenu (wp_nav_menu — poziom 2 i 3)
   Zgodność ze standardem: hover na desktop, toggle na mobile.
   W obecnym projekcie menu jest płaskie — style gotowe na przyszłe submenu.
   ========================================================= */
.nav__menu .sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.nav__menu .sub-menu.is-open { max-height: 60vh; }
.nav__submenu-toggle {
  border: 0;
  background: transparent;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
}
.nav__submenu-toggle::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s;
}
.nav__submenu-toggle[aria-expanded="true"]::before { transform: rotate(-135deg); }

@media (min-width: 900px) {
  .nav__menu .menu-item-has-children { position: relative; }
  .nav__menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    max-height: none;
    overflow: visible;
    background: var(--color-bg);
    border: 1px solid color-mix(in srgb, var(--color-primary) 14%, transparent);
    border-radius: var(--radius);
    padding: 0.4rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 50;
  }
  .nav__menu .menu-item-has-children:hover > .sub-menu,
  .nav__menu .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .nav__menu .sub-menu .sub-menu { top: 0; left: 100%; }
  .nav__submenu-toggle { display: none; }
}
