/* Pärnumaa Filmimiskohad — scoped design tokens, matching the original design system. */
.pfk-app {
  --pfk-color-bg: #f3f2f2;
  --pfk-color-surface: #eae9e9;
  --pfk-color-text: #201e1d;
  --pfk-color-accent: #1e78c2;
  --pfk-color-accent-600: #1a66a5;
  --pfk-color-accent-700: #155488;
  --pfk-color-accent-100: #e8f1fa;
  --pfk-color-accent-800: #11426b;
  --pfk-color-neutral-100: #f8f4f4;
  --pfk-color-neutral-800: #444141;
  --pfk-color-divider: rgba(32, 30, 29, 0.4);
  /* "Playfair Display" is hardcoded directly rather than pulled from Elementor's
     --e-global-typography-primary-font-family variable: that variable did not
     actually resolve to Playfair on this site (it kept falling through to
     Roboto), most likely because the serif look on the site's own headings
     comes from a per-widget font override rather than the Kit's global
     "Primary" typography setting. Playfair Display is already being loaded on
     the page (Elementor loads it for the site's own heading widgets), so
     referencing it by name here works reliably without depending on that
     variable resolving correctly. */
  --pfk-font-heading: "Playfair Display", Georgia, serif;
  --pfk-font-heading-weight: 800;
  /* Sisutekst (kirjeldused, tavaline lugemistekst) on Poppins — pealkirjad
     jäävad Playfair Display peale. Hardcoded nime järgi, mitte Elementori
     muutujast (vt ülal olevat kommentaari, miks see dünaamiline viide
     varem ei töötanud usaldusväärselt). */
  --pfk-font-body: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Nupud/sildid/lingid kasutavad nüüd sama Poppins fonti mis sisutekst. */
  --pfk-font-accent: var(--pfk-font-body);
  /* Buttons/tags/filters were using the same 800 (Extra Bold) weight as the
     Playfair Display headings, which looked fine on that display serif but
     came across heavy and clunky now that these render in Poppins — 600
     (Semibold) is a much more typical, comfortable weight for UI text in a
     geometric sans like this. */
  --pfk-font-accent-weight: 600;
  --pfk-space-1: 4px;
  --pfk-space-2: 8px;
  --pfk-space-3: 12px;
  --pfk-space-4: 16px;
  --pfk-space-6: 24px;
  --pfk-space-8: 32px;
  --pfk-radius: 0px;

  color: var(--pfk-color-text);
  font-family: var(--pfk-font-body);
  font-size: 15px;
  line-height: 1.55;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}
.pfk-app *, .pfk-app *::before, .pfk-app *::after { box-sizing: border-box; }

.pfk-h1 {
  font-family: var(--pfk-font-heading);
  font-weight: var(--pfk-font-heading-weight);
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 6px;
}

/* — sidebar filter layout — */
.pfk-layout { display: block; }
.pfk-layout-with-sidebar {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: var(--pfk-space-8);
  align-items: start;
}
.pfk-filterbar {
  position: sticky;
  top: var(--pfk-space-4);
  align-self: start;
  max-height: calc(100vh - 2 * var(--pfk-space-4));
  overflow-y: auto;
  padding-right: var(--pfk-space-2);
}
.pfk-filterbar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--pfk-space-3);
  padding-bottom: var(--pfk-space-3);
  border-bottom: 2px solid var(--pfk-color-divider);
  margin-bottom: var(--pfk-space-4);
}
.pfk-filterbar-title {
  font-family: var(--pfk-font-heading);
  font-weight: var(--pfk-font-heading-weight);
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pfk-filterbar-reset {
  font-family: var(--pfk-font-accent);
  font-weight: var(--pfk-font-accent-weight);
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--pfk-color-accent);
}
.pfk-filterbar-reset:hover { text-decoration: underline; }

.pfk-filtergroup { margin-bottom: var(--pfk-space-6); }
.pfk-filtergroup:last-child { margin-bottom: 0; }
.pfk-filtergroup-title {
  font-family: var(--pfk-font-heading);
  font-weight: var(--pfk-font-heading-weight);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 0 0 var(--pfk-space-3);
}

.pfk-check-list { display: flex; flex-direction: column; }
.pfk-check-option,
.pfk-radio-option {
  display: flex;
  align-items: center;
  gap: 10px;
  /* Padding alone (no gap on the parent, no negative margins) provides the
     row spacing here — that keeps the math simple and guaranteed not to
     overlap: each row's own top+bottom padding is what separates it from its
     neighbours, and it also expands the tappable area close to the ~44px
     minimum recommended touch target size, which the bare 15px label text
     alone would fall well short of on a phone. */
  padding: 7px 0;
  text-decoration: none;
  /* !important because the theme's own link color has been winning over plain
     specificity here for every other link in this plugin (buttons, cards) —
     same fix, applied preemptively. */
  color: var(--pfk-color-text) !important;
  font-family: var(--pfk-font-accent);
  font-size: 15px;
  cursor: pointer;
}
.pfk-check-box,
.pfk-radio-box {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 2px solid var(--pfk-color-divider);
  background: var(--pfk-color-bg);
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pfk-radio-box { border-radius: 50%; }
.pfk-check-option:hover .pfk-check-box,
.pfk-radio-option:hover .pfk-radio-box { border-color: var(--pfk-color-accent); }
.pfk-check-option:hover .pfk-check-label,
.pfk-radio-option:hover .pfk-check-label { text-decoration: underline; }

.pfk-check-option.is-checked .pfk-check-box,
.pfk-radio-option.is-checked .pfk-radio-box {
  background: var(--pfk-color-accent);
  border-color: var(--pfk-color-accent);
}
.pfk-check-option.is-checked .pfk-check-box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.pfk-radio-option.is-checked .pfk-radio-box::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}
.pfk-check-label { line-height: 1.3; }

.pfk-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--pfk-font-accent);
  font-weight: var(--pfk-font-accent-weight);
  font-size: 14px;
  color: var(--pfk-color-text);
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 14px;
  border-radius: var(--pfk-radius);
}
.pfk-btn-ghost { color: var(--pfk-color-accent); padding-left: 4px; padding-right: 4px; }
.pfk-btn-ghost:hover { text-decoration: underline; }

/* — load more — */
.pfk-load-more { display: flex; justify-content: center; margin-top: var(--pfk-space-8); }
.pfk-load-more-btn {
  /* This is a <div role="button">, not a real <button> — a real <button> here
     picked up the theme's own default button styling (pink text/border),
     exactly the same issue the gallery/lightbox controls had. */
  all: unset;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  cursor: pointer;
  text-align: center;
  font-family: var(--pfk-font-accent);
  font-weight: var(--pfk-font-accent-weight);
  font-size: 14px;
  color: var(--pfk-color-text);
  background: transparent;
  border: 1px solid var(--pfk-color-text);
  padding: 10px 20px;
}
.pfk-load-more-btn:hover,
.pfk-load-more-btn:focus-visible { background: var(--pfk-color-surface); }
.pfk-load-more-btn:focus-visible { outline: 2px solid var(--pfk-color-accent); outline-offset: 2px; }
.pfk-load-more-btn.is-loading { opacity: 0.6; cursor: wait; }

/* — teaser head (title + "Vaata kõiki" link row, used on the homepage teaser) — */
.pfk-teaser-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--pfk-space-4);
  margin-bottom: var(--pfk-space-4);
}
.pfk-teaser-head .pfk-h1 { margin-bottom: 0; }
.pfk-teaser-head .pfk-more-link { margin-left: auto; }
.pfk-more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  text-decoration: none;
  font-family: var(--pfk-font-accent);
  font-weight: var(--pfk-font-accent-weight);
  font-size: 17px;
  color: var(--pfk-color-accent);
}
.pfk-more-link:hover { text-decoration: underline; }

.pfk-count { font-size: 13px; opacity: 0.6; margin-bottom: var(--pfk-space-4); }
.pfk-empty { opacity: 0.7; }

/* — grid + cards — */
.pfk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--pfk-space-4);
}
.pfk-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  /* Explicit color + !important, not just "inherit": the theme's own link
     color (blue) was winning over a plain inherit here and cascading that
     blue down into the card title/meta text underneath it, exactly the same
     class of theme-styling-leak the buttons and gallery items had. */
  color: var(--pfk-color-text) !important;
  background: var(--pfk-color-surface);
  border-radius: var(--pfk-radius);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pfk-card:hover { box-shadow: 0 3px 10px rgba(45, 43, 43, 0.16); }
.pfk-card-img { width: 100%; height: 160px; overflow: hidden; background: var(--pfk-color-neutral-100); }
.pfk-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfk-card-img-placeholder {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: rgba(32, 30, 29, 0.4); font-size: 12px;
}
.pfk-card-body { padding: var(--pfk-space-3); }
.pfk-card-title {
  font-family: var(--pfk-font-heading);
  font-weight: var(--pfk-font-heading-weight);
  font-size: 17px;
  line-height: 1.2;
  margin-bottom: 4px;
}
.pfk-card-meta { font-size: 11px; color: rgba(32, 30, 29, 0.5); margin-bottom: 10px; }

/* — tags — */
.pfk-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pfk-tag {
  display: inline-flex; align-items: center; font-size: 11px;
  letter-spacing: 0.02em; padding: 3px 10px; border-radius: 0;
}
.pfk-tag-accent { background: var(--pfk-color-accent-100); color: var(--pfk-color-accent-800); }
.pfk-tag-neutral { background: var(--pfk-color-neutral-100); color: var(--pfk-color-neutral-800); }

/* — detail view — */
.pfk-detail {
  max-width: 900px;
  /* This padding is scoped to the single object page only (not the shared
     .pfk-app base), so the homepage teaser can stay flush with its Elementor
     column while this standalone page still gets proper breathing room. */
  padding: 40px var(--pfk-space-4) 80px;
}
.pfk-back { margin-bottom: var(--pfk-space-4); }
.pfk-detail-img { width: 100%; height: 380px; margin-bottom: var(--pfk-space-6); overflow: hidden; }
.pfk-detail-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pfk-detail-tags { margin-bottom: var(--pfk-space-3); }
.pfk-detail-title { margin-bottom: 4px; }
.pfk-detail-address { font-size: 15px; opacity: 0.7; margin-bottom: 6px; }
.pfk-maps-link { display: inline-flex; margin-bottom: var(--pfk-space-4); }
.pfk-detail-map { margin-bottom: var(--pfk-space-6); }
.pfk-detail-map iframe { display: block; width: 100%; }
.pfk-map-placeholder {
  padding: var(--pfk-space-4);
  background: var(--pfk-color-surface);
  font-size: 13px;
  opacity: 0.75;
}
.pfk-detail-content { font-size: 16px; line-height: 1.75; }

/* — gallery (single detail page) — */
.pfk-divider { border: none; border-top: 2px solid var(--pfk-color-divider); margin: var(--pfk-space-6) 0; }
.pfk-h2 {
  font-family: var(--pfk-font-heading);
  font-weight: var(--pfk-font-heading-weight);
  font-size: 24px;
  line-height: 1.2;
  margin: 0 0 var(--pfk-space-4);
}
.pfk-gallery-grid {
  column-count: 3;
  column-gap: var(--pfk-space-4);
}
.pfk-gallery-item {
  /* Explicitly reset any theme/browser default <button>-like styling — this is
     a plain div (role="button"), but we keep these resets as a safety net in
     case a theme targets [role="button"] generically. */
  all: unset;
  display: block;
  width: 100%;
  margin: 0 0 var(--pfk-space-4);
  break-inside: avoid;
  position: relative;
  background: var(--pfk-color-neutral-100);
  cursor: zoom-in;
  overflow: hidden;
  box-sizing: border-box;
}
.pfk-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.25s ease;
}
.pfk-gallery-item:hover img,
.pfk-gallery-item:focus-visible img { transform: scale(1.03); }

.pfk-gallery-zoom-icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(20, 19, 18, 0);
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  pointer-events: none;
}
.pfk-gallery-item:hover .pfk-gallery-zoom-icon,
.pfk-gallery-item:focus-visible .pfk-gallery-zoom-icon {
  opacity: 1;
  background: rgba(20, 19, 18, 0.32);
}
.pfk-gallery-item:focus-visible { outline: 2px solid var(--pfk-color-accent); outline-offset: 2px; }

@media (max-width: 900px) {
  .pfk-gallery-grid { column-count: 2; }
}
@media (max-width: 560px) {
  .pfk-gallery-grid { column-count: 1; }
}

/* — lightbox overlay (vanilla JS, see pfk-lightbox.js) — */
.pfk-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(20, 19, 18, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--pfk-space-4);
  padding: var(--pfk-space-6) 24px;
  box-sizing: border-box;
}
.pfk-lightbox.is-open { display: flex; }
body.pfk-lightbox-open { overflow: hidden; }

.pfk-lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--pfk-space-3);
  max-width: 100%;
  min-width: 0;
  position: relative;
}
.pfk-lightbox-img { max-width: 100%; max-height: 78vh; object-fit: contain; display: block; }
.pfk-lightbox-counter {
  color: rgba(255, 255, 255, 0.75);
  font-family: var(--pfk-font-body);
  font-size: 14px;
  letter-spacing: 0.02em;
}

/* Prev/next sit in the flex row beside the stage (not layered on top of the
   photo) so they always read as separate controls, however wide the image is. */
.pfk-lightbox-nav {
  all: unset;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease;
}
.pfk-lightbox-nav:hover,
.pfk-lightbox-nav:focus-visible { background: rgba(255, 255, 255, 0.28); }
.pfk-lightbox-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.pfk-lightbox-close {
  all: unset;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 19, 18, 0.55);
  color: #fff;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s ease;
}
.pfk-lightbox-close:hover,
.pfk-lightbox-close:focus-visible { background: rgba(20, 19, 18, 0.75); }
.pfk-lightbox-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (max-width: 900px) {
  .pfk-layout-with-sidebar { grid-template-columns: 1fr; }
  .pfk-filterbar {
    position: static;
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    margin-bottom: var(--pfk-space-6);
  }
  /* Once the sidebar drops to full page width on mobile/tablet, there's
     enough room to lay each filter group's options out in two columns
     instead of one long vertical list — roughly halves how far someone has
     to scroll past filters before reaching the results. */
  .pfk-check-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 var(--pfk-space-4);
  }
}

@media (max-width: 640px) {
  /* .pfk-app itself has no padding (see the top of this file — that's
     deliberate so the homepage teaser sits flush inside its own Elementor
     column, which already has its own gutter). pfk-app-full marks the
     unlimited/paginated listing specifically (the standalone archive page),
     which isn't wrapped in anything that supplies side spacing of its own,
     so on a phone its content was touching the screen edges outright. The
     capped teaser (pfk-app without this class) is deliberately left alone. */
  .pfk-app-full { padding-left: var(--pfk-space-4); padding-right: var(--pfk-space-4); }
  .pfk-h1 { font-size: 28px; }
  .pfk-detail-img { height: 220px; }
  .pfk-lightbox { padding: var(--pfk-space-4) 8px; gap: var(--pfk-space-2); }
  .pfk-lightbox-nav { width: 40px; height: 40px; }
  .pfk-lightbox-nav svg { width: 20px; height: 20px; }
  .pfk-lightbox-img { max-height: 70vh; }
}
