/*
 * Front page (Naslovna): the hero as a core Cover block Tanja edits in the
 * page editor, the collection tiles from [tt_collections], the featured
 * prints on cream-alt, and the core button variants the page uses.
 * Reference: .hero, .tiles and the featured section in design/shop/Main.dc.html.
 */

/* --- Full-bleed screens: no page container ------------------------------- */
.tt-bleed .wd-content-layout.container {
  max-width: none;
  padding: 0;
}

.tt-bleed .wd-content-area,
.tt-bleed .entry-content {
  padding-bottom: 0;
}

.tt-bleed .wd-page-content > .container {
  max-width: none;
  padding: 0;
}

/* --- Hero (core Cover block with the tt-hero class) ----------------------- */
.wp-block-cover.tt-hero {
  min-height: clamp(640px, 85vh, 780px);
  padding: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  background: var(--tt-forest-2);
  color: var(--tt-cream-hi);
}

.wp-block-cover.tt-hero .wp-block-cover__image-background {
  object-position: center 35%;
}

/* The two scrims of the design, instead of the block's single dim. */
.wp-block-cover.tt-hero .wp-block-cover__background {
  background: var(--tt-scrim-hero);
  /* Keep the custom scrim visible over Gutenberg's dimRatio: 0 rule. */
  opacity: 1 !important;
}

.wp-block-cover.tt-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tt-scrim-hero-2);
  z-index: 1;
  pointer-events: none;
}

.wp-block-cover.tt-hero .wp-block-cover__inner-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 760px;
  margin: 0;
  /* Match the centered section container while preserving the copy measure. */
  margin-inline-end: max(0px, calc((100% - var(--tt-container)) / 2 - var(--tt-section-x)));
  padding: 120px var(--tt-section-x) 72px;
  color: var(--tt-cream-hi);
}

.wp-block-cover.tt-hero .tt-kicker {
  font-size: var(--tt-size-kicker-hero);
  letter-spacing: var(--tt-tracking-hero-kicker);
  color: var(--tt-sage-2);
}

.wp-block-cover.tt-hero h1 {
  font-size: var(--tt-size-display-hero);
  line-height: var(--tt-lh-display);
  letter-spacing: var(--tt-tracking-display);
  margin: 22px 0 0;
  color: var(--tt-cream-hi);
}

.wp-block-cover.tt-hero h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--tt-sage-3);
}

.wp-block-cover.tt-hero .tt-lede {
  color: var(--tt-hero-lede);
  margin-top: 26px;
  /* Core's constrained layout centers narrower children with !important. */
  margin-inline: 0 !important;
}

.wp-block-cover.tt-hero .tt-buttons {
  margin-top: 34px;
}

.tt-hero__stat {
  margin: 40px 0 0;
  font-family: var(--tt-sans);
  font-size: var(--tt-size-caption);
  letter-spacing: 0.02em;
  color: var(--tt-footer-muted);
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-weight: 400;
}

.tt-hero__stat b,
.tt-hero__stat strong {
  font-weight: 400;
  color: var(--tt-sage-3);
}

/* --- Core button variants used in page content ----------------------------- */
.wp-block-button.tt-pill--cream > .wp-block-button__link {
  background: var(--tt-cream);
  color: var(--tt-ink);
}

.wp-block-button.tt-pill--cream > .wp-block-button__link:hover,
.wp-block-button.tt-pill--cream > .wp-block-button__link:focus-visible {
  background: var(--tt-white);
  color: var(--tt-ink);
}

.wp-block-button.tt-pill--outline-cream > .wp-block-button__link {
  background: transparent;
  border-color: var(--tt-outline-cream-55);
  color: var(--tt-cream);
}

.wp-block-button.tt-pill--outline-cream > .wp-block-button__link:hover,
.wp-block-button.tt-pill--outline-cream > .wp-block-button__link:focus-visible {
  background: transparent;
  border-color: var(--tt-cream);
  color: var(--tt-cream);
}

.wp-block-buttons.tt-buttons {
  gap: var(--tt-gap-buttons);
}

/* --- Section groups in page content ---------------------------------------- */
.entry-content .tt-section > .tt-wrap,
.entry-content .tt-section > .tt-wrap > * {
  max-width: none;
}

.entry-content .tt-section > .tt-wrap {
  max-width: var(--tt-container);
}

.entry-content .tt-head > .wp-block-group {
  margin: 0;
}

.entry-content .tt-head .tt-lede {
  margin-top: 0;
}

.entry-content .tt-kicker,
.entry-content .tt-h2 {
  margin-bottom: 0;
}

/* --- Collection tiles (the [tt_collections] shortcode) ---------------------- */
.tt-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--tt-tile-min)), 1fr));
  gap: var(--tt-gap-tiles);
  margin-top: var(--tt-head-gap);
}

.tt-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border: var(--tt-hairline) solid var(--tt-forest-rule);
  aspect-ratio: 4 / 5;
  background: var(--tt-forest-2);
  color: var(--tt-cream);
  text-decoration: none;
}

.tt-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--tt-motion-zoom) var(--tt-ease);
}

.tt-tile:hover img,
.tt-tile:focus-visible img {
  transform: scale(1.05);
}

.tt-tile:focus-visible {
  outline: 2px solid var(--tt-royal);
  outline-offset: 4px;
}

.tt-tile__scrim {
  position: absolute;
  inset: 0;
  background: var(--tt-scrim-tile);
}

.tt-tile__body {
  position: absolute;
  left: 26px;
  right: 26px;
  bottom: 24px;
  color: var(--tt-cream);
}

.tt-tile__name {
  display: block;
  font-family: var(--tt-display);
  font-weight: 500;
  font-size: var(--tt-size-card-title);
  line-height: 1;
}

.tt-tile__cap {
  display: block;
  margin-top: 8px;
  font-family: var(--tt-sans);
  font-size: var(--tt-size-caption);
  letter-spacing: var(--tt-tracking-caption);
  text-transform: uppercase;
  color: var(--tt-sage-2);
  font-weight: 400;
}

/* --- Featured prints: the [products] shortcode inside a cream-alt section --- */
.tt-section--alt .wd-products.wd-grid-g {
  margin-top: var(--tt-head-gap);
}

.tt-section--alt .tt-pc__fig {
  background: var(--tt-white);
}

@media (prefers-reduced-motion: reduce) {
  .tt-tile img {
    transition: none;
  }

  .tt-tile:hover img {
    transform: none;
  }
}
