/*
Theme Name: Flexco
Theme URI: https://flexco.de
Author: Flexco
Author URI: https://flexco.de
Description: Modernes Theme fuer Flexco - Flexible Offices, Coworking, Meeting, Geschaeftsadressen, Kanzleisitz. Nutzt Tailwind CSS via CDN.
Version: 2.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flexco-theme
Tags: one-column, custom-logo, featured-images
*/

/* ===== WordPress-specific overrides (Tailwind handles the rest) ===== */

/* Frontend color tokens (needed by custom CSS that uses hsl(var(--...))) */
:root {
  --background: 210 8% 97%;
  --foreground: 220 25% 6%;
  --card: 0 0% 100%;
  --primary: 207 90% 35%;
  --primary-foreground: 0 0% 100%;
  --secondary: 210 18% 93%;
  --secondary-foreground: 220 25% 6%;
  --muted: 210 14% 92%;
  --muted-foreground: 220 12% 38%;
  --accent: 199 55% 72%;
  --accent-foreground: 0 0% 100%;
  --border: 210 16% 85%;
  --destructive: 0 84.2% 50%;
  --destructive-foreground: 0 0% 98%;

  /* Backward-compatible aliases used by Gutenberg utility classes */
  --color-background: hsl(var(--background));
  --color-foreground: hsl(var(--foreground));
  --color-card: hsl(var(--card));
  --color-primary: hsl(var(--primary));
  --color-secondary: hsl(var(--secondary));
  --color-accent: hsl(var(--accent));
  --color-muted-foreground: hsl(var(--muted-foreground));
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* WordPress color utility classes */
.has-primary-color { color: var(--color-primary); }
.has-muted-color { color: var(--color-muted-foreground); }
.has-foreground-color { color: var(--color-foreground); }
.has-background-background-color { background-color: var(--color-background); }
.has-secondary-background-color { background-color: var(--color-secondary); }
.has-accent-background-color { background-color: var(--color-accent); }
.has-primary-background-color { background-color: var(--color-primary); }

/* WordPress block alignment */
.alignwide {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.alignfull {
  max-width: none;
  width: 100%;
}

/* WordPress embeds responsive */
.wp-block-embed.is-type-video .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 0.75rem;
}

.wp-block-embed.is-type-video .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* WordPress columns spacing */
.wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.wp-block-column {
  flex: 1;
  min-width: 0;
}

@media (max-width: 767px) {
  .wp-block-columns {
    flex-direction: column;
  }
  .wp-block-column {
    flex-basis: 100% !important;
  }
}

/* WordPress group and image blocks */
.wp-block-group {
  box-sizing: border-box;
}

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

.wp-block-image.size-large img {
  width: 100%;
}

/* Gutenberg content */
.gutenberg-content {
  width: 100%;
}

.gutenberg-content > * + * {
  margin-top: 1.25rem;
}

.flexco-page-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--primary));
  margin: 0;
}

.flexco-page-title {
  margin-top: 0.5rem;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.875rem, 3.5vw, 2.25rem);
  line-height: 1.15;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.flexco-page-intro {
  margin-top: 0.75rem;
  max-width: 42rem;
  margin-left: 0 !important;
  margin-right: 0 !important;
  text-align: left !important;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}

.flexco-page-header-block--align-left {
  text-align: left;
}

.flexco-page-header-block--align-center {
  text-align: center;
}

.flexco-page-header-block--align-center .flexco-page-title,
.flexco-page-header-block--align-center .flexco-page-intro {
  margin-left: auto !important;
  margin-right: auto !important;
}

.flexco-page-header-block--align-center .flexco-page-intro {
  text-align: center !important;
}

.flexco-page-header-block--align-right {
  text-align: right;
}

.flexco-page-header-block--align-right .flexco-page-title,
.flexco-page-header-block--align-right .flexco-page-intro {
  margin-left: auto !important;
  margin-right: 0 !important;
}

.flexco-page-header-block--align-right .flexco-page-intro {
  text-align: right !important;
}

/* Mitgliederverzeichnis: Gutenberg-Seitenkopf immer im Flexco-Stil (auch mit constrained Group) */
body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content {
  --wp--style--global--content-size: 100%;
  --wp--style--global--wide-size: 100%;
}

body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content .flexco-page-eyebrow,
body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content > p:first-child,
body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content > .wp-block-group:first-child > p:first-child {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--primary));
  text-align: left !important;
}

body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content .flexco-page-title,
body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content > :is(h1, h2, h3):nth-child(2),
body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content > .wp-block-group:first-child > :is(h1, h2, h3):nth-child(2) {
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.875rem, 3.5vw, 2.25rem);
  line-height: 1.15;
  font-weight: 700;
  color: hsl(var(--foreground));
  text-align: left !important;
}

body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content .flexco-page-intro,
body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content > p:nth-child(3),
body.page-template-template-mitgliederverzeichnis-flexco .flexco-members-content > .wp-block-group:first-child > p:nth-child(3) {
  margin-top: 0.75rem;
  margin-bottom: 0;
  max-width: 42rem;
  margin-left: 0 !important;
  margin-right: 0 !important;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
  text-align: left !important;
}

.gutenberg-content .alignwide {
  max-width: min(100%, 72rem);
  margin-left: auto;
  margin-right: auto;
}

.gutenberg-content .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Kontaktseite (Gutenberg Pattern) */
.flexco-contact-page {
  width: 100%;
  max-width: 76rem;
  margin-left: auto;
  margin-right: auto;
}

.flexco-contact-page > .wp-block-group,
.flexco-contact-page > .wp-block-columns {
  margin-top: 0;
  margin-bottom: 0;
}

.flexco-contact-header {
  margin: 0 auto 3.25rem;
  max-width: 52rem;
  text-align: center;
}

.flexco-contact-eyebrow {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: hsl(var(--primary));
}

.flexco-contact-title {
  margin: 0.6rem 0 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.875rem, 3.2vw, 2.35rem);
  line-height: 1.12;
  font-weight: 700;
  color: hsl(var(--foreground));
  text-wrap: balance;
}

.flexco-contact-intro {
  margin: 1rem auto 0;
  max-width: 44rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.55;
  font-size: 1.02rem;
}

.flexco-contact-grid.wp-block-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: start;
  margin-top: 0 !important;
}

.flexco-contact-grid.wp-block-columns > .wp-block-column {
  margin-top: 0 !important;
}

@media (min-width: 1024px) {
  .flexco-contact-grid.wp-block-columns > .wp-block-column.flexco-contact-main {
    flex: 0 1 calc(60% - 1rem);
    max-width: calc(60% - 1rem);
  }

  .flexco-contact-grid.wp-block-columns > .wp-block-column.flexco-contact-side {
    flex: 0 1 calc(40% - 1rem);
    max-width: calc(40% - 1rem);
  }
}

@media (max-width: 1023px) {
  .flexco-contact-grid.wp-block-columns > .wp-block-column.flexco-contact-main,
  .flexco-contact-grid.wp-block-columns > .wp-block-column.flexco-contact-side {
    flex-basis: 100% !important;
    max-width: 100%;
  }

  .flexco-contact-main {
    width: 100%;
    max-width: 100%;
  }

  .flexco-contact-header {
    margin-bottom: 2rem;
  }
}

.flexco-contact-card {
  border: 1px solid #d1d6dc;
  border-color: hsl(var(--border));
  border-radius: 1.2rem;
  background: #ffffff;
  background: hsl(var(--card));
  box-shadow: 0 8px 24px hsl(var(--foreground) / 0.06);
  padding: 2rem 2rem 1.9rem;
}

@media (max-width: 640px) {
  .flexco-contact-card {
    padding: 1.4rem 1.2rem;
  }
}

.flexco-contact-form-card .wpcf7 {
  margin-top: 1.25rem;
}

.flexco-contact-form-card .wp-block-shortcode {
  margin-top: 1.2rem;
  margin-bottom: 0;
  padding: 0.85rem 0.95rem;
  border: 1px dashed hsl(var(--border));
  border-radius: 0.8rem;
  background: hsl(var(--background));
  color: hsl(var(--muted-foreground));
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}

.flexco-contact-form-card .wpcf7 form {
  display: grid;
  gap: 0.9rem;
}

.flexco-contact-form-card .wpcf7 p {
  margin: 0;
}

.flexco-contact-form-card .wpcf7 label {
  display: block;
  margin: 0 0 0.35rem;
  color: hsl(var(--foreground));
  font-size: 0.95rem;
  font-weight: 500;
}

.flexco-contact-form-card .wpcf7-form-control-wrap {
  display: block;
}

.flexco-contact-form-card .wpcf7 :is(input[type="text"], input[type="email"], input[type="tel"], select, textarea) {
  width: 100%;
  border: 1px solid #d1d6dc;
  border-color: hsl(var(--border));
  border-radius: 0.75rem;
  background: #f5f6f7;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  padding: 0.7rem 0.95rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.flexco-contact-form-card .wpcf7 textarea {
  min-height: 7rem;
  resize: vertical;
}

.flexco-contact-form-card .wpcf7 :is(input, select, textarea):focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
}

.flexco-contact-form-card .wpcf7 :is(input::placeholder, textarea::placeholder) {
  color: hsl(var(--muted-foreground));
}

.flexco-contact-form-card .wpcf7 .wpcf7-submit {
  border: 0;
  border-radius: 0.7rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  padding: 0.75rem 1.7rem;
  cursor: pointer;
  min-width: 10.5rem;
}

.flexco-contact-form-card .wpcf7 .wpcf7-submit:hover {
  background: hsl(var(--primary) / 0.9);
}

.flexco-contact-card-title {
  margin: 0 0 0.15rem;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.2rem, 1.5vw, 1.38rem);
  line-height: 1.2;
  color: hsl(var(--foreground));
}

.flexco-contact-muted {
  margin: 0;
  color: hsl(var(--muted-foreground));
}

.flexco-contact-side {
  display: grid;
  gap: 1.4rem;
  width: 100%;
}

.flexco-contact-main {
  width: 100%;
}

.flexco-contact-side > .flexco-contact-card {
  width: 100%;
  max-width: 100%;
}

.flexco-contact-info-card > * {
  margin-top: 0;
  margin-bottom: 0;
}

.flexco-contact-card-head {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.flexco-contact-icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  margin: 0;
  border-radius: 0.75rem;
  background: hsl(var(--accent) / 0.6);
  color: hsl(var(--primary));
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
}

.flexco-contact-card-heading {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: clamp(1.12rem, 1.2vw, 1.28rem);
  line-height: 1.2;
  color: hsl(var(--foreground));
}

.flexco-contact-company {
  margin: 0 0 0.2rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.flexco-contact-lines {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.75rem;
}

.flexco-contact-line {
  margin: 0;
  color: hsl(var(--muted-foreground));
  line-height: 1.5;
  font-size: 0.95rem;
}

.flexco-contact-line a {
  color: hsl(var(--primary));
  text-decoration: none;
}

.flexco-contact-line a:hover {
  text-decoration: underline;
}

.flexco-contact-hours {
  display: grid;
  gap: 0.5rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.95rem;
}

.flexco-contact-hours-row {
  margin: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.flexco-contact-hours-row p {
  margin: 0;
}

.flexco-contact-hours-value {
  font-weight: 700;
  color: hsl(var(--foreground));
}

/* Gutenberg Pattern: Kontaktkarte Person */
.flexco-person-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  background: hsl(var(--card));
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.06);
  transition: box-shadow 200ms ease;
}

.flexco-person-card:hover {
  box-shadow: 0 8px 16px hsl(var(--foreground) / 0.12);
}

.flexco-person-card__media {
  position: relative;
  height: 14rem;
  overflow: hidden;
  background: hsl(var(--muted));
}

.flexco-person-card__image-wrap,
.flexco-person-card__image-wrap img,
.flexco-person-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  margin: 0;
  transition: transform 420ms ease;
}

.flexco-person-card:hover .flexco-person-card__image-wrap img,
.flexco-person-card:hover .flexco-person-card__image {
  transform: scale(1.05);
}

.flexco-person-card__badge {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  margin: 0;
  display: inline-flex;
  align-items: center;
  border-radius: 9999px;
  background: hsl(var(--primary) / 0.92);
  color: hsl(var(--primary-foreground));
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1rem;
  backdrop-filter: blur(4px);
}

.flexco-person-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem;
}

.flexco-person-card__name {
  margin: 0;
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.75rem;
  font-weight: 700;
  color: hsl(var(--foreground));
}

.flexco-person-card__meta {
  display: flex;
  flex-direction: column;
  gap: 0.62rem;
}

.flexco-person-card__line {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.flexco-person-card__icon {
  width: 0.875rem;
  height: 0.875rem;
  flex-shrink: 0;
  color: hsl(var(--primary));
}

.flexco-person-card__line a {
  color: inherit;
  text-decoration: none;
}

.flexco-person-card__line a:hover {
  color: hsl(var(--foreground));
}

.flexco-person-card__line--email,
.flexco-person-card__line--email a {
  color: hsl(var(--primary));
}

.flexco-person-card__line--email a:hover {
  text-decoration: underline;
}

/* ACF Block: Geschäftsstelle */
.flexco-office-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border: 1px solid hsl(var(--border));
  border-radius: 1rem;
  background: hsl(var(--card));
  padding: 1.5rem;
  box-shadow: 0 1px 2px hsl(var(--foreground) / 0.06);
  transition: box-shadow 0.2s ease;
}

.flexco-office-card:hover {
  box-shadow: 0 8px 16px hsl(var(--foreground) / 0.12);
}

.flexco-office-card.ring-1 {
  box-shadow: 0 0 0 1px hsl(var(--primary) / 0.1), 0 1px 2px hsl(var(--foreground) / 0.06);
}

.flexco-office-card__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.flexco-office-card__icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  border-radius: 0.75rem;
  background: hsl(var(--accent));
}

.flexco-office-card__head-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: hsl(var(--accent-foreground));
}

.flexco-office-card__head-initials {
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  color: hsl(var(--accent-foreground));
}

.flexco-office-card__title {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.375;
  color: hsl(var(--foreground));
}

.flexco-office-card__person {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
  white-space: pre-line;
}

.flexco-office-card__person--first {
  margin-top: 0.125rem;
}

.flexco-office-card__divider {
  border-top: 1px solid hsl(var(--border));
}

.flexco-office-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.flexco-office-card__row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.flexco-office-card__row-icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: hsl(var(--primary));
  margin-top: 0.125rem;
}

.flexco-office-card__text p {
  margin: 0;
}

.flexco-office-card__text--address {
  font-size: 0.875rem;
  line-height: 1.625;
  color: hsl(var(--muted-foreground));
}

.flexco-office-card__text--contact {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--muted-foreground));
}

.flexco-office-card__text--contact a {
  color: inherit;
  text-decoration: none;
}

.flexco-office-card__text--contact a:hover {
  text-decoration: underline;
}

.flexco-office-card__fax {
  margin-top: 0.125rem;
}

.flexco-office-card__email {
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: hsl(var(--primary));
  text-decoration: none;
}

.flexco-office-card__email:hover {
  color: hsl(var(--primary) / 0.8);
  text-decoration: underline;
}

/* Divider block */
.flexco-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.flexco-divider__line {
  height: 1px;
  flex: 1 1 0%;
  background: hsl(var(--border));
}

.flexco-divider__title {
  margin: 0;
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  color: hsl(var(--foreground));
  white-space: nowrap;
}

/* Equal height for Geschäftsstelle cards in Gutenberg columns (opt-in) */
.wp-block-columns:has(.flexco-office-card--equal-height),
.wp-block-columns.is-layout-flex:has(.flexco-office-card--equal-height) {
  align-items: stretch;
}

.wp-block-columns:has(.flexco-office-card--equal-height) > .wp-block-column,
.wp-block-columns.is-layout-flex:has(.flexco-office-card--equal-height) > .wp-block-column {
  display: flex;
  flex-direction: column;
}

.wp-block-columns:has(.flexco-office-card--equal-height) > .wp-block-column > .flexco-office-card--equal-height,
.wp-block-columns.is-layout-flex:has(.flexco-office-card--equal-height) > .wp-block-column > .flexco-office-card--equal-height {
  width: 100%;
  flex: 1 1 auto;
  min-height: 100%;
}

/* Fallback for nested wrappers generated by some Gutenberg layouts */
.wp-block-columns:has(.flexco-office-card--equal-height) > .wp-block-column > .wp-block-group > .flexco-office-card--equal-height,
.wp-block-columns.is-layout-flex:has(.flexco-office-card--equal-height) > .wp-block-column > .wp-block-group > .flexco-office-card--equal-height {
  width: 100%;
  flex: 1 1 auto;
  min-height: 100%;
}

/* Search dropdown */
.search-dropdown {
  display: none;
  z-index: 100;
}

.search-dropdown.active {
  display: block;
}

/* News image fallback logo */
.news-card__logo-fallback-image,
.news-single__logo-fallback-image {
  width: min(52%, 220px);
  height: auto;
  opacity: 0.32;
  filter: grayscale(100%);
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

/* Mobile nav */
.navbar-mobile {
  display: none;
}

.navbar-mobile.open {
  display: flex;
}

/* Navbar dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 0.5rem;
}

.nav-dropdown-menu {
  display: none;
  margin-top: 0.5rem;
}

.nav-dropdown.admin-menu {
  max-height: 40px;
}

.nav-dropdown.admin-menu > button {
  max-height: 40px;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  display: block;
}

/* Offset fixed header when WordPress admin bar is visible */
body.admin-bar #navbar,
body.admin-bar #site-header {
  top: 32px;
}

@media screen and (max-width: 782px) {
  body.admin-bar #navbar,
  body.admin-bar #site-header {
    top: 46px;
  }
}

/* Suche page template (Location Finder layout) */
body.flexco-search-template {
  overflow: hidden;
}

#flexco-search-shell {
  min-height: 100vh;
}

body.admin-bar #flexco-search-shell {
  min-height: calc(100vh - 32px);
  height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
  body.admin-bar #flexco-search-shell {
    min-height: calc(100vh - 46px);
    height: calc(100vh - 46px);
  }
}

@media (max-width: 767px) {
  body.flexco-search-template {
    overflow: auto;
  }

  .flexco-search-shell[data-mobile-view="list"] .lf-map-panel {
    display: none;
  }

  .flexco-search-shell[data-mobile-view="map"] .lf-results-panel {
    display: none;
  }

  .flexco-search-shell[data-mobile-view="map"] .lf-map-panel {
    display: block;
  }
}

@media (min-width: 768px) {
  .flexco-search-shell .lf-results-panel,
  .flexco-search-shell .lf-map-panel {
    display: block !important;
  }
}

/* Single location thumbnail skeleton */
@keyframes location-thumb-skeleton-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

@keyframes location-gallery-loader-spin {
  to {
    transform: rotate(360deg);
  }
}

.location-detail__gallery-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
  z-index: 4;
}

.location-detail__gallery-loader.is-visible {
  opacity: 1;
}

.location-detail__gallery-loader-bubble {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(2px);
  box-shadow: 0 6px 20px hsl(var(--foreground) / 0.18);
}

.location-detail__gallery-loader-spinner {
  display: block;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  border: 2px solid hsl(var(--primary) / 0.24);
  border-top-color: hsl(var(--primary));
  animation: location-gallery-loader-spin 0.75s linear infinite;
}

.location-detail__thumb {
  background: hsl(var(--muted));
}

.location-detail__thumb-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    hsl(var(--muted) / 0.95) 0%,
    hsl(var(--card) / 0.7) 50%,
    hsl(var(--muted) / 0.95) 100%
  );
  z-index: 1;
  pointer-events: none;
}

.location-detail__thumb-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    hsl(var(--card) / 0.45) 50%,
    transparent 100%
  );
  animation: location-thumb-skeleton-shimmer 1.15s ease-in-out infinite;
}

.location-detail__thumb-image {
  position: relative;
  z-index: 2;
  opacity: 0;
  transition: opacity 180ms ease;
}

.location-detail__thumb.is-loaded .location-detail__thumb-image {
  opacity: 1;
}

.location-detail__thumb.is-loaded .location-detail__thumb-skeleton {
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}
