/* Visual retrofit of the public Cornerstone homepage. Enqueue on the main domain's front page only.
   Set --sm-main-photo to the locally packaged storefront distillery-background.jpg. */
body.home.x-ethos {
  --sm-paper: #f6efe4;
  --sm-surface: #fffaf3;
  --sm-ink: #2e221a;
  --sm-muted: #665447;
  --sm-copper: #8c4829;
  --sm-action: #8c4829;
  --sm-line: #e4d5c3;
  --sm-hover: #f5e8da;
  --sm-shade: linear-gradient(180deg, rgb(246 239 228 / 44%), rgb(246 239 228 / 65%));
  --sm-shadow: 0 12px 32px rgb(59 38 25 / 14%);
  --sm-serif: "DM Serif Display", Georgia, serif;
  --sm-gutter: clamp(.75rem, 2.2vw, 2.375rem);
  background: var(--sm-paper);
  color: var(--sm-ink);
  font-family: Montserrat, Arial, sans-serif;
}

html[data-samaria-theme="dark"] body.home.x-ethos {
  --sm-paper: #211915;
  --sm-surface: #2d231d;
  --sm-ink: #fff4e8;
  --sm-muted: #ceb9a8;
  --sm-copper: #e6aa7d;
  --sm-action: #a45230;
  --sm-line: #5b4436;
  --sm-hover: #3b2a21;
  --sm-shade: linear-gradient(180deg, rgb(33 25 21 / 68%), rgb(33 25 21 / 87%));
  --sm-shadow: 0 18px 40px rgb(0 0 0 / 45%);
}

.home.x-ethos #top.site {
  position: relative;
  isolation: isolate;
  background: transparent;
}

.home.x-ethos #top.site::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--sm-shade), var(--sm-main-photo, none) 76% center / cover no-repeat;
  content: "";
  pointer-events: none;
}

.home.x-ethos #top .masthead :is(.x-logobar, .x-navbar) {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.home.x-ethos #top .masthead .x-navbar-inner > .x-container {
  box-sizing: border-box;
  width: min(1740px, calc(100% - 2 * var(--sm-gutter)));
  max-width: none;
  margin: .6rem auto;
  padding-inline: clamp(.75rem, 2vw, 2.375rem);
  border: 1px solid var(--sm-line);
  border-radius: 22px;
  background: var(--sm-surface);
  box-shadow: var(--sm-shadow);
}

.home.x-ethos #top .masthead :is(.x-brand, .x-nav > li > a, .x-btn-navbar) {
  color: var(--sm-ink);
  box-shadow: none;
  text-shadow: none;
}

.home.x-ethos #top .masthead .x-nav > li > a {
  min-height: 44px;
  font-family: inherit;
  font-size: .86rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.home.x-ethos #top .masthead .x-nav > li > a:is(:hover, :focus-visible, [aria-current="page"]) {
  border-radius: .7rem;
  background: var(--sm-hover);
  color: var(--sm-copper);
}

.home.x-ethos #top .x-container.main,
.home.x-ethos #top .entry-wrap {
  background: transparent;
}

.home.x-ethos #cs-content {
  box-sizing: border-box;
  width: min(1240px, calc(100% - 2 * var(--sm-gutter)));
  margin: clamp(1rem, 3vw, 2.5rem) auto;
}

/* Cornerstone writes section backgrounds, padding, and margins inline. */
.home.x-ethos #cs-content > .x-section {
  box-sizing: border-box;
  min-width: 0;
  margin: 0 0 clamp(.85rem, 2.3vw, 2rem) !important;
  padding: clamp(1.1rem, 4vw, 3.2rem) var(--sm-gutter) !important;
  border: 1px solid var(--sm-line) !important;
  border-radius: 22px;
  background-color: var(--sm-surface) !important;
  color: var(--sm-ink);
  scroll-margin-block-start: 6rem;
}

.home.x-ethos #cs-content .x-section > .x-container {
  box-sizing: border-box;
  width: 100%;
  max-width: 74rem;
}

.home.x-ethos #cs-content :is(h1, h2, h3, h4) {
  color: var(--sm-ink);
  font-family: var(--sm-serif);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -.025em;
  text-transform: none;
  text-wrap: balance;
}

.home.x-ethos #cs-content :is(.x-text, .x-accordion-inner, .x-accordion-toggle) {
  color: var(--sm-muted);
}

.home.x-ethos #cs-content :is(.x-btn, .x-accordion-toggle) {
  min-height: 44px;
  border: 1px solid var(--sm-line);
  border-radius: 10px;
  background: var(--sm-surface);
  box-shadow: none;
  text-shadow: none;
}

.home.x-ethos #cs-content a.x-btn {
  border-color: var(--sm-action);
  background: var(--sm-action);
  color: #fff;
}

.home.x-ethos #cs-content :is(.x-text, .x-accordion-inner) a {
  color: var(--sm-copper);
  text-decoration: underline;
  text-underline-offset: .16em;
}

.home.x-ethos #cs-content .x-accordion-group,
.home.x-ethos #cs-content .x-accordion-inner {
  border-color: var(--sm-line);
  background-color: var(--sm-surface);
}

/* Preserve the existing boiler photograph, including the original inline image URL. */
.home.x-ethos #cs-content .sm-facts {
  position: relative;
  isolation: isolate;
  background-position: center;
  background-size: cover;
}

.home.x-ethos #cs-content .sm-facts::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  border-radius: inherit;
  background: rgb(37 24 17 / 84%);
  content: "";
}

.home.x-ethos #cs-content .sm-facts :is(.x-text, .x-text a, .x-text strong) { color: #fff4e8; }

.home.x-ethos #cs-content :is(#prevadzky, #x-section-8, #x-section-9) img,
.home.x-ethos #cs-content #galeria .fg-item-inner {
  border-radius: 13px;
}

.home.x-ethos #cs-content #x-section-1 .x-column.x-1-5 img.x-img,
.home.x-ethos #cs-content #x-section-1 .x-column.x-1-5 a.x-img img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: contain;
}

/* Both #cennik and #x-section-4 hold a price list. The desktop version
   contains the complete text. Keep its canonical anchor visible on every device. */
.home.x-ethos.page-id-6 #cs-content > #cennik { display: block !important; }
.home.x-ethos.page-id-6 #cs-content > #x-section-4 { display: none !important; }

.home.x-ethos #cs-content #kontakt > .x-container:has(> .x-1-4) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: clamp(.9rem, 2vw, 1.7rem);
  padding: 0 !important;
}

.home.x-ethos #cs-content #kontakt > .x-container:has(> .x-1-4)::before,
.home.x-ethos #cs-content #kontakt > .x-container:has(> .x-1-4)::after {
  display: none;
}

.home.x-ethos #cs-content #kontakt .x-column.x-1-4 {
  box-sizing: border-box;
  float: none;
  min-width: 0;
  width: auto;
  margin: 0;
  padding: .95rem !important;
  border: 1px solid var(--sm-line);
  border-radius: 13px;
  text-align: start;
  overflow-wrap: anywhere;
}

.home.x-ethos #cs-content #kontakt .x-column.x-1-4 .right {
  display: inline;
  float: none;
  margin-inline-start: .35em;
}

.home.x-ethos #top > footer.x-colophon.bottom {
  padding: clamp(1.8rem, 4vw, 3rem) var(--sm-gutter);
  border-top: 1px solid var(--sm-line);
  background: var(--sm-surface);
  box-shadow: none;
  color: var(--sm-muted);
}

.home.x-ethos #top > .x-colophon :is(a, .x-colophon-content) {
  color: var(--sm-copper);
  text-transform: none;
  text-shadow: none;
}

/* Style the existing Age Gate 3.6.1 form. Its challenge, buttons and remember field
   stay in the plugin's DOM and retain their existing behavior. */
.home.x-ethos .age-gate-wrapper .age-gate {
  max-width: min(30rem, calc(100% - 2 * var(--sm-gutter)));
  padding: clamp(1rem, 4vw, 2rem);
  border: 1px solid var(--sm-line);
  border-radius: 22px;
  background: var(--sm-surface);
  box-shadow: var(--sm-shadow);
  color: var(--sm-ink);
}

.home.x-ethos .age-gate-wrapper .age-gate-headline {
  color: var(--sm-ink);
  font-family: var(--sm-serif);
  font-weight: 400;
  text-transform: none;
}

.home.x-ethos .age-gate-wrapper button.age-gate-submit {
  min-height: 44px;
  border: 1px solid var(--sm-action);
  border-radius: 10px;
  background: var(--sm-action);
  color: #fff;
}

.home.x-ethos .age-gate-wrapper button.age-gate-submit-no {
  border-color: var(--sm-line);
  background: var(--sm-paper);
  color: var(--sm-ink);
}

.home.x-ethos :is(#top, .age-gate-wrapper) :is(a, button, input):focus-visible {
  outline: 2px solid var(--sm-copper);
  outline-offset: 3px;
}

@media (min-width: 980px) {
  .home.x-ethos #top.site::before { background-position: center; }
}

@media (max-width: 767px) {
  .home.x-ethos #cs-content > .x-section { border-radius: 18px; }
  .home.x-ethos #cs-content .sm-facts { background-attachment: scroll; }
  .home.x-ethos #cs-content .x-text p[style*="justify"] { text-align: start !important; }
}
