/*
Theme Name: Dom nad Krzywym v2
Theme URI: https://example.com/dom-nad-krzywym
Author: Dom nad Krzywym
Description: Motyw v2 (projekt z Claude Design) dla domu wypoczynkowego nad jeziorem -- zawartosc strony jako edytowalne wzorce blokow.
Version: 1.0.0
Requires at least: 6.5
Requires PHP: 7.4
Text Domain: dnk
*/

/* ---------- font ---------- */
@font-face {
  font-family: 'Quicksand';
  src: url('public/quicksand.ttf') format('truetype');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- tokens ----------
   A small, semantic palette: three surface tones (bg/card/surface) plus
   muted/accent, each read against its own foreground. Every other color
   in this file (hover states, shadows, gradients) is derived from these
   eight with CSS relative-color syntax (oklch(from var(...) ...)) rather
   than its own dedicated variable. */
:root {
  --dnk-bg: oklch(30.706% 0.03725 125.512);
  --dnk-card: oklch(30.328% 0.04923 143.309);
  --dnk-surface: oklch(37.261% 0.05082 130.798);
  --dnk-muted: oklch(42% 0.045 135);
  --dnk-accent: oklch(64% 0.1 145);

  --dnk-foreground: oklch(96% 0.012 95);
  --dnk-title: oklch(98% 0.008 95);
  --dnk-muted-foreground: oklch(74% 0.025 110);
}

/* ---------- reset ---------- */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--dnk-card);
  color: var(--dnk-foreground);
  font-family: Quicksand, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
img {
  max-width: 100%;
  display: block;
}
a {
  color: var(--dnk-accent);
  text-decoration: none;
}
a:hover {
  color: oklch(from var(--dnk-accent) calc(l + 0.08) c h);
}
.wp-block-heading {
  margin: 0;
  color: var(--dnk-title);
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* WordPress emits a global, near-zero-specificity "owl selector" rule
   (:root :where(.is-layout-flow) > * { margin-block-start: 1.5rem; ... })
   that auto-spaces block children. Every gap in this design already comes
   from an explicit margin or a flex/grid `gap`, so that automatic spacing
   only fights the layout -- it's what made the first card in a row sit
   higher than its siblings. Neutralize it once, for the whole page,
   instead of overriding it component by component. */
.dnk-content :where(.is-layout-flow) > * {
  margin-block-start: 0;
  margin-block-end: 0;
}

/* ---------- hero-as-header ----------
   No separate site-wide header bar: branding (logo + navigation) lives
   inside the hero's Cover block instead, same as the v1 design. These
   rules give that in-hero content the centered, max-width, readable-on-a-
   dark-photo treatment a header bar would otherwise be responsible for. */
.wp-block-cover .wp-block-cover__inner-container {
  max-width: var(--wp--style--global--wide-size, 1200px);
  margin-left: auto;
  margin-right: auto;
  padding: 1.5rem;
  box-sizing: border-box;
}
.wp-block-cover .wp-block-navigation,
.wp-block-cover .wp-block-navigation a,
.wp-block-cover .wp-block-navigation-item__content {
  color: var(--dnk-foreground);
}
.wp-block-cover
  .wp-block-navigation
  .wp-block-navigation__responsive-container-open
  svg {
  fill: var(--dnk-foreground);
}

/* ---------- shared bits ---------- */
.dnk-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dnk-accent);
  margin: 0 0 10px;
}
.dnk-eyebrow--invert {
  color: oklch(from var(--dnk-foreground) l c h / 0.85);
}
.dnk-photo-tag {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  color: var(--dnk-foreground);
  background: oklch(from var(--dnk-bg) l c h / 0.4);
  backdrop-filter: blur(4px);
  padding: 6px 10px;
  border-radius: 999px;
  margin: 0;
}
.dnk-photo-tag--on-dark {
  background: oklch(from var(--dnk-bg) l c h / 0.55);
}

.dnk-section {
  padding: 40px 1.5rem 8px;
}
.dnk-section--alt {
  background: var(--dnk-muted);
  padding: 40px 0 2rem;
}
/* .dnk-section--alt is alignfull (edge-to-edge background) with its own
   "Inner blocks use content width" (layout: constrained) turned on, so
   WordPress itself centers/caps its children at the theme's wideSize --
   this just adds the horizontal breathing room on top of that. */
.dnk-section--alt > * {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.dnk-section .wp-block-heading {
  font-size: 27px;
  margin-top: 2px;
}
.dnk-section > p:not(.dnk-eyebrow) {
  font-size: 15px;
  line-height: 1.7;
  color: var(--dnk-muted-foreground);
  margin: 12px 0 0;
}

/* ---------- buttons ---------- */
.wp-block-button__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  border-radius: 999px;
  background: var(--dnk-accent);
  color: var(--dnk-bg);
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 10px 1.5rem oklch(from var(--dnk-accent) l c h / 0.3);
  padding: 0 20px;
  text-align: center;
}
.wp-block-button__link:hover {
  background: oklch(from var(--dnk-accent) calc(l + 0.08) c h);
  color: var(--dnk-bg);
}
.wp-block-button.is-style-outline .wp-block-button__link {
  background: var(--dnk-muted);
  color: var(--dnk-foreground);
  box-shadow: none;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: oklch(from var(--dnk-muted) calc(l + 0.06) c h);
}
.wp-block-button.is-style-fill-light .wp-block-button__link {
  background: var(--dnk-foreground);
  color: var(--dnk-bg);
  box-shadow: none;
}
.wp-block-button.is-style-fill-light .wp-block-button__link:hover {
  background: oklch(from var(--dnk-foreground) calc(l - 0.1) c h);
}
.wp-block-button.is-style-outline-light .wp-block-button__link {
  background: transparent;
  color: var(--dnk-foreground);
  border: 1.5px solid oklch(from var(--dnk-foreground) l c h / 0.35);
  box-shadow: none;
}
.wp-block-button.is-style-outline-light .wp-block-button__link:hover {
  background: oklch(from var(--dnk-foreground) l c h / 0.1);
}

/* ---------- reservation widget (roomadmin.pl) ---------- */
/* The widget itself posts its real content height to the parent window on
   an interval (see assets/reservation-widget.js), including extra room for
   its date-picker calendar / guest-count popover -- so the iframe's height
   is set dynamically in JS, not guessed here. This is just its resting
   placeholder before the first message arrives. */
.dnk-reservation-widget {
  width: 100%;
}
.dnk-reservation-iframe {
  display: block;
  width: 100%;
  min-height: 90px;
  transition: height 0.15s ease-out;
  border: none;
  outline: none;
}

/* ---------- rooms ---------- */
.dnk-rooms.wp-block-query {
  margin-top: 4px;
}
.dnk-rooms .wp-block-post-template {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 0;
  padding-top: 12px;
  list-style: none;
  margin: 0;
}
.dnk-room {
  border-radius: 26px;
  overflow: hidden;
  background: var(--dnk-foreground);
  /* box-shadow: 0 0 2rem oklch(from var(--dnk-bg) l c h / 0.3); */
}
.dnk-room__image {
  position: relative;
  height: 230px;
  margin: 10px !important;
  border-radius: 20px;
  overflow: hidden;
  background-image: linear-gradient(
    160deg,
    var(--dnk-surface) 0%,
    var(--dnk-muted) 100%
  );
}

.dnk-room__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dnk-room__image--single {
  height: 50dvh !important;
  margin: 0 0 20px;
}

/* room card carousel (assets/rooms.js): a stack of cross-fading photos
   with prev/next arrows, dots and an autoplay pause toggle it appends
   itself. Server-rendered by the dnk/room-carousel block. */
.room-slides {
  position: relative;
  width: 100%;
  height: 100%;
}
.room-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.room-slide.is-active {
  opacity: 1;
}
.room-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 999px;
  background: oklch(from var(--dnk-bg) l c h / 0.5);
  color: var(--dnk-foreground);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.room-arrow:hover {
  background: oklch(from var(--dnk-bg) l c h / 0.7);
}
.room-arrow--prev {
  left: 10px;
}
.room-arrow--next {
  right: 10px;
}
.room-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.room-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: oklch(from var(--dnk-foreground) l c h / 0.5);
  cursor: pointer;
}
.room-dots button.is-active {
  background: var(--dnk-foreground);
  width: 1rem;
}
.room-pause {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: oklch(from var(--dnk-bg) l c h / 0.5);
  color: var(--dnk-foreground);
  cursor: pointer;
}
.room-pause:hover {
  background: oklch(from var(--dnk-bg) l c h / 0.7);
}
.room-pause svg {
  width: 14px;
  height: 14px;
}
.room-preview {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: oklch(from var(--dnk-bg) l c h / 0.5);
  color: var(--dnk-foreground);
  cursor: pointer;
}
.room-preview:hover {
  background: oklch(from var(--dnk-bg) l c h / 0.7);
}

/* ---------- gallery pattern carousel ----------
   Shares .room-slides/.room-arrow/.room-dots/.room-pause/.room-preview
   with the room card carousel above (assets/rooms.js and lightbox.js key
   off those, plus the shared ".dnk-carousel" marker) -- this just gives
   the wrapper the position/size a carousel needs. */
.dnk-gallery__carousel {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  height: 60vh;
  min-height: 320px;
  max-height: 560px;
  background-image: linear-gradient(
    160deg,
    var(--dnk-surface) 0%,
    var(--dnk-muted) 100%
  );
}
#galeria {
  padding-bottom: 3.5rem;
  background: var(--dnk-surface);
}
.dnk-room__body {
  padding: 18px 22px 1.5rem;
}
.dnk-room__heading-row {
  align-items: baseline;
  gap: 12px;
}
.dnk-room__title {
  margin: 0;
  color: var(--dnk-bg);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.dnk-room__price {
  flex-shrink: 0;
  margin: 0;
  color: var(--dnk-accent);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}
.dnk-room__price:empty {
  display: none;
}
.dnk-room__excerpt {
  font-size: 0.8rem;
  color: var(--dnk-surface);
  font-weight: 600;
  margin: 6px 0 0;
}
.wp-block-post-terms.dnk-room__terms {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 1rem;
}
.dnk-room__terms a {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--dnk-muted);
  color: var(--dnk-muted-foreground);
}

/* ---------- attractions ---------- */
.dnk-attractions {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 1rem;
  padding: 0;
}
.dnk-attraction {
  display: flex;
  flex-direction: column;
  border-radius: 1.5rem;
  overflow: hidden;
  background: var(--dnk-bg);
  box-shadow: 0 10px 26px oklch(from var(--dnk-bg) l c h / 0.25);
  padding: 0;
  padding-bottom: 1rem;
}
.dnk-attraction__media {
  height: 16rem;
  flex: none;
  display: flex;
  align-items: flex-end;
}
.dnk-attraction__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dnk-attraction__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dnk-title);
  line-height: 1.3;
  padding: 1rem;
}
.dnk-attraction__note {
  font-size: 12px;
  color: var(--dnk-muted-foreground);
  line-height: 1.5;
  padding: 0 1rem;
}

/* ---------- cta banner ---------- */
.dnk-cta {
  position: relative;
  min-height: 380px;
  background-image: linear-gradient(
    180deg,
    var(--dnk-accent) 0%,
    var(--dnk-bg) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  padding: 60px 30px;
}
.dnk-cta__text {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.5;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--dnk-title);
  text-wrap: pretty;
}
.dnk-cta__buttons.wp-block-buttons {
  justify-content: flex-start;
}
.dnk-cta .dnk-photo-tag {
  align-self: flex-start;
}

/* ---------- gallery ---------- */
.wp-block-gallery.dnk-gallery {
  margin-top: 4px;
  padding: 0 22px 2rem;
  gap: 10px !important;
}
.wp-block-gallery.dnk-gallery .wp-block-image {
  border-radius: 18px;
  overflow: hidden;
}
.wp-block-gallery.dnk-gallery .wp-block-image img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ---------- generic fallback template (blog / search / single room) ---------- */
.dnk-fallback-entry {
  padding: 0 1.5rem 2rem;
  border-bottom: 1px solid var(--dnk-muted);
  margin-bottom: 1.5rem;
}
.dnk-fallback-entry__image {
  border-radius: 18px;
  overflow: hidden;
  margin: 12px 0;
}
.dnk-fallback-entry__content {
  font-size: 15px;
  line-height: 1.7;
  color: var(--dnk-muted-foreground);
}

/* ---------- single room: gallery grid + lightbox (assets/lightbox.js) ---------- */
.room-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}
.room-gallery-grid a {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
}
.room-gallery-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dnk-lightbox {
  position: fixed;
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: oklch(from var(--dnk-bg) l c h / 0.94);
}
.dnk-lightbox::backdrop {
  background: transparent;
}
.dnk-lightbox__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  box-sizing: border-box;
}
.dnk-lightbox figure {
  position: relative;
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.dnk-lightbox img {
  max-width: min(90vw, 1100px);
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  touch-action: none;
  transition: transform 0.15s ease;
}
.dnk-lightbox img.is-zoomed {
  cursor: grab;
}
.dnk-lightbox img.is-dragging {
  cursor: grabbing;
  transition: none;
}
.dnk-lightbox figcaption {
  font-size: 13px;
  color: var(--dnk-muted-foreground);
  text-align: center;
}
.dnk-lightbox__close,
.dnk-lightbox__arrow {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: oklch(from var(--dnk-foreground) l c h / 0.12);
  color: var(--dnk-foreground);
  cursor: pointer;
}
.dnk-lightbox__close:hover,
.dnk-lightbox__arrow:hover {
  background: oklch(from var(--dnk-foreground) l c h / 0.22);
}
.dnk-lightbox__close {
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  font-size: 22px;
}
.dnk-lightbox__arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  font-size: 20px;
}
.dnk-lightbox__prev {
  left: 1rem;
}
.dnk-lightbox__next {
  right: 1rem;
}
.dnk-lightbox__zoom {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: oklch(from var(--dnk-foreground) l c h / 0.12);
}
.dnk-lightbox__zoom button {
  min-width: 2rem;
  height: 2rem;
  padding: 0 8px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--dnk-foreground);
  font-size: 13px;
  cursor: pointer;
}
.dnk-lightbox__zoom button:hover {
  background: oklch(from var(--dnk-foreground) l c h / 0.18);
}
body.lightbox-open {
  position: fixed;
  overflow: hidden;
  width: 100%;
}

@media (max-width: 480px) {
  .dnk-hero__title {
    font-size: 2rem;
  }
  .dnk-hero__card .wp-block-heading {
    font-size: 28px;
  }
}

/* ---------- desktop / large screens ---------- */
@media (min-width: 900px) {
  .wp-block-cover .wp-block-cover__inner-container {
    padding: 40px 48px;
  }

  .dnk-section {
    padding: 64px 48px 8px;
  }
  .dnk-section > p:not(.dnk-eyebrow) {
    max-width: 640px;
  }
  .dnk-section--alt {
    padding: 64px 0 48px;
  }
  .dnk-section--alt > * {
    padding-left: 48px;
    padding-right: 48px;
  }
  .dnk-section .wp-block-heading {
    font-size: 2rem;
  }

  .dnk-stats {
    padding: 48px 48px 8px;
    gap: 1rem;
  }
  .dnk-stat {
    padding: 2rem 1rem;
  }

  /* rooms: three cards per row instead of one long stack */
  .dnk-rooms .wp-block-post-template {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 26px;
    padding: 20px 48px 1rem;
  }
  .dnk-room__image {
    height: 200px;
  }

  .dnk-attractions {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .dnk-cta {
    padding: 90px 48px;
    align-items: flex-start;
  }
  .dnk-cta__text {
    font-size: 30px;
    max-width: 620px;
  }

  .wp-block-gallery.dnk-gallery {
    padding: 0 48px 48px;
    grid-template-columns: repeat(4, 1fr) !important;
  }

  .dnk-contact {
    padding: 64px 48px 56px;
  }
  .dnk-contact .wp-block-heading {
    font-size: 2rem;
  }
  .dnk-contact > p {
    max-width: 560px;
  }
  .dnk-contact__buttons.wp-block-buttons {
    flex-direction: row;
  }
  .dnk-contact__buttons.wp-block-buttons .wp-block-button {
    flex: none;
  }
}

.text-shadow {
  text-shadow: 0 1px 2px oklch(from var(--dnk-bg) l c h / 0.5);
}

.footer-banner {
  width: 100%;
  aspect-ratio: 1920/628;
  overflow: hidden;
}
.footer-banner img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.axili-footer {
  background-color: #000;
  color: var(--dnk-title);
}

.axili-footer .footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0rem;
  justify-content: space-between;
  padding: 2rem;
}
@media screen and (max-width: 1200px) {
  .axili-footer .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}
@media screen and (max-width: 768px) {
  .axili-footer .footer-content {
    grid-template-columns: 1fr;
    place-items: center;
  }
  .axili-footer .footer-content h3 {
    text-align: center;
  }
}

.axili-footer .footer-site > div {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.axili-footer .footer-site i.fas {
  font-size: 24px;
}

.axili-footer a {
  color: var(--dnk-foreground);
}
.axili-footer a:hover {
  color: var(--dnk-accent);
}

.axili-footer .footer-menu > li,
.axili-footer .footer-menu > li > a {
  padding: 0.35rem 0;
  margin-bottom: 0.25rem;
}

.contributors {
  margin-top: 2rem;
  text-align: right;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  color: color-mix(in srgb, currentColor 50%, transparent) !important;
}
