/* =====================================================================
   TRZY KSIĘŻYCE JOGI — Redesign CSS
   Paleta: midnight navy + moon cream + golden accent
   Typografia: Cormorant Garamond (display) + DM Sans (body)
   ===================================================================== */

/* ── 1. DESIGN TOKENS ────────────────────────────────────────────── */
:root {
  /* Colours */
  --c-night:      #0f1320;
  --c-dusk:       #1c2a45;
  --c-moon:       #f8f5ee;
  --c-parchment:  #ece7da;
  --c-gold:       #c6a253;
  --c-gold-light: #ddb96d;
  --c-ink:        #1e1e2e;
  --c-body:       #3b3b50;
  --c-muted:      #808096;
  --c-lilac:      #9888b8;
  --c-rule:       rgba(30, 30, 46, 0.09);

  /* Typography */
  --f-menu: Glory, Georgia, serif;
  --f-display: 'Cormorant Garamond', Georgia, serif;
  --f-body:    Piazzolla, system-ui, -apple-system, sans-serif;

  /* Fluid type scale */
  --ts-xs:   clamp(0.75rem,  1.4vw, 0.8125rem);
  --ts-sm:   clamp(0.875rem, 1.8vw, 1rem);
  --ts-base: clamp(1rem,     2vw,   1.125rem);
  --ts-lg:   clamp(1.15rem,  2.5vw, 1.375rem);
  --ts-xl:   clamp(1.5rem,   3.5vw, 2rem);
  --ts-2xl:  clamp(2rem,     5vw,   3rem);
  --ts-3xl:  clamp(2.5rem,   7vw,   4.25rem);

  /* Spacing */
  --sp-xs:  0.5rem;
  --sp-sm:  1rem;
  --sp-md:  1.5rem;
  --sp-lg:  2.5rem;
  --sp-xl:  4rem;
  --sp-2xl: 6rem;

  /* Layout */
  --max-w:      740px;
  --max-w-wide: 1160px;
  --header-h:   80px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur:  0.25s;
}

/* ── 2. RESET ────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--f-body);
  font-size: var(--ts-base);
  line-height: 1.75;
  color: var(--c-body);
  background-color: var(--c-moon);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--c-lilac);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--dur) var(--ease);
}

a:hover {
  color: var(--c-gold);
  text-decoration-color: var(--c-gold);
}

ul, ol {
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.4rem;
}

/* ── 3. TYPOGRAPHY ───────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--f-display);
  font-weight: 600;
  line-height: 1.2;
  color: var(--c-ink);
  margin-bottom: 0.75em;
}

h1 { font-size: var(--ts-2xl); }
h2 { font-size: var(--ts-xl);  margin-top: 2rem; }
h3 { font-size: var(--ts-lg);  margin-top: 1.5rem; }

p {
  margin-bottom: 1.1rem;
}

p:last-child {
  margin-bottom: 0;
}

strong {
  font-weight: 700;
  color: var(--c-ink);
}

/* ── 4. SITE HEADER ──────────────────────────────────────────────── */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--header-h);
  transition:
    background-color 0.35s var(--ease),
    border-bottom-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}

/* Pages with no hero: solid from the start */
.site-header--solid,
.site-header.is-scrolled {
  background-color: var(--c-night);
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.header-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 var(--sp-md);
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-md);
  font-family: var(--f-menu);
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-symbol img {
  height: 64px;
  border-radius: 50%;
  border: solid 1px --var(--c-gold-light);
}

.logo-name {
  font-family: var(--f-menu);
  font-size: var(--ts-sm);
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #fff;
  text-transform: uppercase;
}

/* Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  margin-left: auto;
}

.nav-link {
  font-size: var(--ts-sm);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
  position: relative;
  padding-bottom: 2px;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0;
  height: 1px;
  background: var(--c-gold);
  transition: width var(--dur) var(--ease);
}

.nav-link:hover {
  color: #fff;
}

.nav-link:hover::after {
  width: 100%;
}

/* Social icons in header */
.header-social {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.social-link {
  display: flex;
  align-items: center;
  opacity: 0.65;
  transition: opacity var(--dur) var(--ease);
  text-decoration: none;
}

.social-link:hover {
  opacity: 1;
}

.header-social img,
.social-link img {
  filter: brightness(0) invert(1);
  width: 20px;
  height: 20px;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  transform-origin: center;
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── 5. HERO SECTION ─────────────────────────────────────────────── */
.page-hero {
  position: relative;
  min-height: 58vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.page-hero--full {
  min-height: 88vh;
}

.page-hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
}

.page-hero__img-top {
  object-position: center top;
}

.page-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 19, 32, 1) 0%,
    rgba(15, 19, 32, 0.15) 60%,
    rgba(15, 19, 32, 0.55) 100%
  );
}

.page-hero__content {
  position: relative;
  z-index: 1;
  padding: var(--sp-2xl) var(--sp-md) var(--sp-xl);
  max-width: var(--max-w-wide);
  width: 100%;
  margin: 0 auto;
}

.hero-eyebrow {
  font-family: var(--f-body);
  font-size: var(--ts-xs);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--c-gold-light);
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: var(--f-display);
  font-size: var(--ts-3xl);
  font-weight: 400;
  font-style: italic;
  color: #fff;
  line-height: 1.1;
  max-width: 22ch;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
  margin-bottom: 0;
}

/* ── 6. PAGE BODY ────────────────────────────────────────────────── */
.page-body {
  padding-top: var(--header-h);
  flex: 1;
}

.page-content {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: var(--sp-2xl) var(--sp-sm);
}

/* When a hero is present, less top padding on the content */
body:not(.no-hero) .page-body {
  padding-top: 0;
}

body:not(.no-hero) .page-content {
  padding-top: var(--sp-xl);
}

/* ── 7. FIRST IMAGE AS HERO FALLBACK ─────────────────────────────── */
/* If hero_image is not set in front matter but the page still starts with
   an image (legacy structure), style it as a wide banner. */
.no-hero .page-content > p:first-of-type img:not([class^="floated"]) {
  width: 100%;
  max-width: 100%;
  height: 52vh;
  object-fit: cover;
  object-position: center top;
  margin: 0 auto var(--sp-xl);
  border-radius: 4px;
}

/* ── 8. CONTENT ELEMENTS ─────────────────────────────────────────── */
/* Separator image — replace with a gold moon ornament via CSS */
img[alt="separator"] {
  display: block;
  margin: var(--sp-md) auto;
  /* Gold-tinted filter — works regardless of the original image colour */
  filter: sepia(1) saturate(1.5) hue-rotate(10deg) brightness(1.1);
  opacity: 0.55;
}

/* Page images (non-hero, non-separator) */
.page-content img:not([alt="separator"]) {
  border-radius: 2px;
  /* margin: var(--sp-lg) auto; */
}

/* Image beside text: kramdown `![alt](src){:.floated-right}` */
.page-content { display: flow-root; }
.floated-left, .floated-right {
  width: 40%;
  max-width: 22rem;
  margin-bottom: var(--sp-md);
}
.floated-left  { float: left;  margin-right: var(--sp-lg); }
.floated-right { float: right; margin-left: var(--sp-lg); }

@media (max-width: 640px) {
  .floated-left, .floated-right {
    float: none;
    display: block;
    width: 100%;
    margin: 0 auto var(--sp-md);
  }
}

/* Inline links in content */
.page-content a {
  color: var(--c-lilac);
}

.page-content a:hover {
  color: var(--c-gold);
}

/* Content heading rhythm */
.page-content h1 {
  font-size: var(--ts-2xl);
  font-style: italic;
  font-weight: 400;
  margin-bottom: 1.25rem;
  color: var(--c-ink);
}

.page-content h2 {
  font-size: var(--ts-xl);
  font-weight: 600;
  margin-top: var(--sp-xl);
  margin-bottom: 1rem;
}

/* Drop cap for lead paragraph after h1 */
.page-content h1 + p::first-letter {
  float: left;
  font-family: var(--f-display);
  font-size: 3.5rem;
  line-height: 0.8;
  margin-right: 0.1em;
  color: var(--c-gold);
  padding-top: 0.05em;
}

.page-content blockquote {
  position: relative;
  margin: var(--sp-sm) 0 var(--sp-lg);
  padding: var(--sp-md) var(--sp-md) var(--sp-md) var(--sp-lg);
  background: linear-gradient(135deg, var(--c-parchment), var(--c-moon));
  border-left: 3px solid var(--c-gold);
  border-radius: 0 6px 6px 0;
  font-style: italic;
  color: var(--c-ink);
}

.page-content blockquote::before {
  content: "\201C";
  position: absolute;
  top: -0.15em;
  left: 0.1em;
  font-family: var(--f-display);
  font-size: 5rem;
  line-height: 1;
  color: var(--c-gold);
  opacity: 0.4;
}

.page-content blockquote p {
  text-align: left;
}

/* ── 9. CLASSES (ZAJĘCIA) PAGE ───────────────────────────────────── */
/* Style the schedule list as clean cards */
.page-content > p + p a[href*="ochotanajoge"],
.page-content > p + p a[href*="anyayoga"],
.page-content > p + p a[href*="centrumjoga"] {
  font-weight: 500;
  text-decoration-style: dotted;
}

/* Schedule entries — wrap each venue block as a visual card */
/* The schedule paragraphs start with day names */
/* We target paragraphs containing schedule info */
.schedule-card {
  background: var(--c-parchment);
  border-left: 3px solid var(--c-gold);
  border-radius: 0 6px 6px 0;
  padding: var(--sp-sm) var(--sp-md);
  margin-bottom: var(--sp-sm);
}

/* ── 10. FAQ PAGE ────────────────────────────────────────────────── */
/* FAQ sections separated by the moon ornament above */
.page-content h2 {
  font-size: var(--ts-xl);
  font-style: italic;
  font-weight: 400;
  color: var(--c-ink);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-rule);
  &:first-child {
    margin-top: 0;
  }
}

/* ── 11. BLOG LIST ───────────────────────────────────────────────── */
.blog-intro,
.blog-year {
  max-width: 960px;
  margin: 0 auto;
}

.blog-intro {
  text-align: center;
  margin-bottom: var(--sp-xl);
}

.page-content .blog-intro h1 {
  font-size: var(--ts-3xl);
  margin-bottom: 0.25rem;
}

.blog-intro p {
  font-family: var(--f-display);
  font-size: var(--ts-lg);
  font-style: italic;
  color: var(--c-muted);
}

.page-content .blog-intro h1 + p::first-letter {
  float: none;
  font: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

.page-content h2.blog-year__label {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  font-size: var(--ts-lg);
  font-weight: 400;
  letter-spacing: 0.2em;
  font-variant-numeric: lining-nums;
  color: var(--c-gold);
  border: 0;
  margin: var(--sp-lg) 0 0;
  padding: 0;
}

.blog-year__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-rule);
}

/* Okładka jest opcjonalna: bez niej trzecia kolumna (auto) po prostu znika */
.blog-entry {
  display: grid;
  grid-template-columns: 7.5rem 1fr auto;
  gap: var(--sp-lg);
  align-items: start;
  padding: var(--sp-md) 0;
  position: relative;
}

.blog-entry + .blog-entry {
  border-top: 1px solid var(--c-rule);
}

.blog-entry__date {
  font-size: var(--ts-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-muted);
  line-height: 1.3;
}

.blog-entry__day {
  display: block;
  font-family: var(--f-display);
  font-size: var(--ts-2xl);
  line-height: 1;
  color: var(--c-ink);
  letter-spacing: 0;
  font-variant-numeric: lining-nums;
  margin-bottom: 0.3rem;
}

.page-content h3.blog-entry__title {
  font-size: var(--ts-xl);
  font-style: italic;
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.6rem;
}

.page-content .blog-entry__title a {
  color: var(--c-ink);
  text-decoration: none;
}

/* Cały wiersz klikalny, bez zagnieżdżania bloków w <a> */
.blog-entry__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.blog-entry:hover .blog-entry__title a {
  color: var(--c-lilac);
}

.blog-entry__excerpt {
  font-size: var(--ts-sm);
  line-height: 1.65;
  margin-bottom: 0.6rem;
  max-width: 34em;
}

.blog-entry__meta {
  font-size: var(--ts-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-gold);
}

.blog-entry__cover {
  display: block;
  width: 260px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 2px;
}

.blog-entry__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.6s var(--ease);
}

.blog-entry:hover .blog-entry__cover img {
  transform: scale(1.04);
}

/* ── 12. BLOG POST ───────────────────────────────────────────────── */
.post-article {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-sm);
}

/* Naturalne proporcje: okładki bywają panoramiczne albo prawie kwadratowe (dyplom) */
.post-cover {
  margin: 0 0 var(--sp-lg);
}

.post-cover img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  object-position: top;
  border-radius: 2px;
}

.post-header {
  padding: 0 0 var(--sp-lg);
  border-bottom: 1px solid var(--c-rule);
  margin-bottom: var(--sp-lg);
}

.post-date {
  display: block;
  font-size: var(--ts-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--c-gold);
  margin-bottom: 0.75rem;
}

.post-title {
  font-size: var(--ts-2xl);
  font-style: italic;
  font-weight: 400;
  color: var(--c-ink);
  line-height: 1.15;
  margin-bottom: 0;
}

/* Hide the date + cover image that's baked into post markdown */
/* (since we render them separately via post.html layout) */
.post-body > p:first-of-type img,
.post-body > p:first-child img {
  display: none;
}

/* First paragraph after date in post body */
.post-body p:first-of-type {
  font-size: var(--ts-lg);
  font-style: italic;
  color: var(--c-ink);
  border-left: 2px solid var(--c-gold);
  padding-left: var(--sp-sm);
  margin-bottom: var(--sp-md);
}

.post-body img[alt="separator"] {
  margin: var(--sp-xl) auto;
}

.post-footer {
  margin-top: var(--sp-xl);
  padding-top: var(--sp-md);
  border-top: 1px solid var(--c-rule);
}

.back-link {
  font-size: var(--ts-sm);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--c-muted);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.back-link:hover {
  color: var(--c-ink);
}

/* ── 13. CONTACT PAGE ────────────────────────────────────────────── */
.page-content a[href^="mailto"] {
  display: inline-block;
  margin-top: 0.5rem;
  font-family: var(--f-display);
  font-size: var(--ts-xl);
  font-style: italic;
  font-weight: 400;
  color: var(--c-ink);
  text-decoration: none;
  border-bottom: 1.5px solid var(--c-gold);
  padding-bottom: 2px;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.page-content a[href^="mailto"]:hover {
  color: var(--c-gold);
  border-color: var(--c-gold-light);
}

/* ── 14. FOOTER ──────────────────────────────────────────────────── */
.site-footer {
  background-color: var(--c-night);
  padding: var(--sp-xl) var(--sp-sm);
  margin-top: var(--sp-md);
  font-family: var(--f-menu);
}

.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: var(--sp-sm) var(--sp-lg);
  align-items: center;
}

.site-logo--footer {
  grid-column: 1;
  grid-row: 1;
}

.site-logo--footer .logo-name {
  color: rgba(255,255,255,0.7);
}

.footer-nav {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  gap: var(--sp-md);
  flex-wrap: wrap;
}

.footer-nav a {
  font-size: var(--ts-sm);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.footer-nav a:hover {
  color: rgba(255,255,255,0.9);
}

.footer-social {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  gap: var(--sp-sm);
}

.footer-social a {
  display: flex;
  align-items: center;
  opacity: 0.45;
  transition: opacity var(--dur) var(--ease);
  text-decoration: none;
}

.footer-social a:hover {
  opacity: 0.85;
}

.footer-social img {
  filter: brightness(0) invert(1);
  width: 20px;
  height: 20px;
}

.footer-copy {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: var(--ts-xs);
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.04em;
  margin-bottom: 0;
}

/* ── 15. RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .blog-entry {
    grid-template-columns: 6rem 1fr auto;
    gap: var(--sp-md);
  }

  .blog-entry__cover {
    width: 180px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 60px;
  }

  /* Mobile nav */
  .main-nav {
    display: none;
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--c-night);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: var(--sp-sm) 0 var(--sp-md);
    border-top: 1px solid rgba(255,255,255,0.07);
    z-index: 199;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 0.85rem var(--sp-md);
    font-size: var(--ts-sm);
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .nav-link::after {
    display: none;
  }

  .header-social {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .blog-entry {
    grid-template-columns: 1fr;
    gap: var(--sp-sm);
  }

  .blog-entry__cover {
    order: -1;
    width: 100%;
    aspect-ratio: 16 / 9;
  }

  .blog-entry__date {
    display: flex;
    align-items: baseline;
    gap: 0.4em;
  }

  .blog-entry__day {
    display: inline;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    margin: 0;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    text-align: center;
    gap: var(--sp-sm);
  }

  .site-logo--footer {
    grid-column: 1;
    grid-row: 1;
    justify-content: center;
  }

  .footer-nav {
    grid-column: 1;
    grid-row: 2;
    justify-content: center;
  }

  .footer-social {
    grid-column: 1;
    grid-row: 3;
    justify-content: center;
  }

  .footer-copy {
    grid-row: 4;
  }

  .page-hero {
    min-height: 45vh;
  }

  .page-content h1 + p::first-letter {
    font-size: 2.8rem;
  }
}

/* Prevent body scroll when mobile menu is open */
body.nav-open {
  overflow: hidden;
}

/* ── 16. REDUCED MOTION ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
