/*
 * TKA-UI-TYPO-01 v3: desktop layout and typography for the CMS page home-v7.
 * Loaded after home-v7.css, only when hp_customization/home_v7/typography_v3 = 1 (store view, default 0),
 * see Magento_Cms/templates/home-v7-typography.phtml. The flag is the only switch: no CMS marker needed.
 * Everything is scoped to #tka-home-v7, so it wins over the .tka-home-v7 rules without touching the
 * storefront shell. No colours, copy, links or behaviour change.
 * - One content grid from 1024 px: the same lines as the header and footer (.container of the theme:
 *   max 1024/1280/1320 px per breakpoint, 24 px inner space). Full-bleed backgrounds stay full-bleed;
 *   the content inside them sits on the grid through padding, never negative margins or 100vw.
 * - Mulish (self-hosted in the theme, already preloaded) for all UI and body text, 16 px mobile and
 *   17 px desktop, line height 1.6. Georgia stays the editorial face until the Garamond file is approved.
 * - The two photo splits are bounded compositions on the grid with a fixed image ratio; strips get their
 *   height from their content.
 */
#tka-home-v7 {
  --tka-layout-max: 64rem;
  --tka-layout-gutter: 1.5rem;
  --tka-layout-section: 3rem;
  /* Content width and the inline space of a full-width block whose content follows the theme .container
     (only -, * and /: the deploy minifier keeps these calc() forms intact, as in home-v7.min.css) */
  --tka-layout-content: calc(var(--tka-layout-max) - 2 * var(--tka-layout-gutter));
  --tka-layout-inline: calc((100% - var(--tka-layout-content)) / 2);
  --tka-type-body: 1rem;
  --tka-type-leading: 1.6;
  --tka-type-label: .75rem;
  --tka-type-action: 1rem;
  --tka-type-card: 1.25rem;
  --tka-type-title: clamp(2rem, 3.1vw, 2.75rem);
  --tka-type-hero: clamp(2.25rem, 4.2vw, 4.75rem);
  --tka-font-ui: Mulish, Arial, sans-serif;
  --tka-font-editorial: Georgia, "Times New Roman", serif;
  font-family: var(--tka-font-ui);
  font-size: var(--tka-type-body);
  line-height: var(--tka-type-leading);
  font-synthesis: none;
}

/* Body text roles */
#tka-home-v7 :is(.tka-hero__body, .tka-intro, .tka-maker__copy p, .origin-note, .tka-faq__item p, .tka-tool-card p,
    .tka-world-card p, .tka-advice-card > p:not(.tka-eyebrow), .tka-mood__copy p:not(.tka-eyebrow):not(.small-note),
    .showroom-info > div > p:not(.tka-eyebrow):not(.small-note)) {
  font-family: var(--tka-font-ui);
  font-size: var(--tka-type-body);
  line-height: var(--tka-type-leading);
}

/* Editorial headings */
#tka-home-v7 :is(.tka-title, .tka-hero h1, .tka-world-card h3, .tka-maker__copy h3, .tka-advice-card h3) {
  font-family: var(--tka-font-editorial);
  font-weight: 400;
  letter-spacing: -.025em;
  text-wrap: balance;
}
#tka-home-v7 .tka-title { font-size: var(--tka-type-title); line-height: 1.12; }
#tka-home-v7 .tka-hero h1 { font-size: var(--tka-type-hero); line-height: 1.06; }
#tka-home-v7 .tka-world-card__copy h3 span { font-family: var(--tka-font-ui); }

/* Labels, actions and small print */
#tka-home-v7 :is(.tka-eyebrow, .tool-kind, .tool-number) {
  font: 600 var(--tka-type-label)/1.4 var(--tka-font-ui);
  letter-spacing: .11em;
}
#tka-home-v7 :is(.tka-btn, .tool-filters button, .tool-search input, .tka-tool-card__label, .tka-hero__minor, .tka-inline-link) {
  font-family: var(--tka-font-ui);
  font-size: var(--tka-type-action);
}
#tka-home-v7 :is(.small-note, .origin-note, .tka-mood__credit, .tka-hero__caption, .tool-photo-note, .tool-status) { opacity: 1; }
#tka-home-v7 :is(.small-note, .tka-mood__credit, .tool-status, .shipping-strip) { font-size: .875rem; line-height: 1.6; }
#tka-home-v7 :is(.tool-photo-note, .tka-hero__caption) { font-size: .75rem; line-height: 1.4; }

/* Choice cards: title, explanation and action read as three levels */
#tka-home-v7 .tka-tool-card h3 { font: 700 var(--tka-type-card)/1.25 var(--tka-font-ui); letter-spacing: 0; text-wrap: pretty; }
#tka-home-v7 .tka-tool-card__copy { display: flex; flex-direction: column; min-block-size: 0; gap: .125rem; padding: 1rem 1rem .75rem; }
#tka-home-v7 .tka-tool-card__label { font-weight: 600; line-height: 1.4; min-block-size: 2.75rem; margin-block-start: auto; padding-block-start: .75rem; }
#tka-home-v7 :is(.tka-tool-card__copy, .tka-tool-card h3, .tka-tool-card p, .tka-tool-card__label) { min-inline-size: 0; overflow-wrap: anywhere; hyphens: auto; }
#tka-home-v7 .tool-kind { margin-block-end: .375rem; }

/* FAQ: readable measure, every answer stays visible */
#tka-home-v7 .tka-faq { max-inline-size: 62ch; }
#tka-home-v7 .tka-faq__item { padding-block: 1.25rem; }
#tka-home-v7 .tka-faq__item h3 { font: 700 1.125rem/1.45 var(--tka-font-ui); }

/* Proof strip and brand row */
#tka-home-v7 .tka-proof-strip { font-size: var(--tka-type-body); line-height: 1.5; }
#tka-home-v7 .tka-proof-strip > :is(span, a) { font-size: inherit; line-height: inherit; }
#tka-home-v7 .tka-brand-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem 1rem;
  font: 600 1.125rem/1.4 var(--tka-font-ui);
}
#tka-home-v7 .tka-brand-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-inline-size: 0;
  min-block-size: 3rem;
  text-align: center;
  font-weight: 600;
  overflow-wrap: break-word;
}
#tka-home-v7 .brand-block { margin-block-start: .75rem; padding-block-start: 1.25rem; }

@media (max-width: 1023px) {
  #tka-home-v7 .tka-proof-strip > span:first-child { inline-size: 100%; }
  #tka-home-v7 .tool-filters { flex-wrap: wrap; overflow: visible; }
  #tka-home-v7 .tool-filters button { flex: 0 1 auto; white-space: normal; }
  #tka-home-v7 .tka-tools-grid .tka-tool-card__copy { padding: 1rem; }
}

@media (min-width: 768px) {
  #tka-home-v7 .tka-brand-links { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  #tka-home-v7 {
    --tka-layout-section: 4rem;
    --tka-type-body: 1.0625rem;
    --tka-type-card: clamp(1.25rem, 1.15vw, 1.375rem);
  }

  /* One grid. Backgrounds stay full width; the content sits on the grid. */
  #tka-home-v7 .tka-shell { padding-inline: var(--tka-layout-inline); }
  #tka-home-v7 .tka-section { padding-block: var(--tka-layout-section); }
  #tka-home-v7 #tka-tools { padding-block: 3rem; }

  #tka-home-v7 .tka-proof-strip {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, .65fr);
    gap: 2rem;
    align-items: center;
    padding-block: 1rem;
  }
  #tka-home-v7 .tka-proof-strip > :last-child { justify-self: end; text-align: end; }

  #tka-home-v7 .tka-world-card:nth-child(-n+2) .tka-world-card__media { block-size: clamp(20rem, 25vw, 25rem); }
  #tka-home-v7 .tka-world-card h3 { font-size: 1.75rem; line-height: 1.15; }
  #tka-home-v7 .tka-tools-grid { gap: 1.25rem; }

  /* Photo splits: bounded compositions on the same grid, image with a fixed ratio */
  #tka-home-v7 .tka-editorial,
  #tka-home-v7 .tka-editorial--reverse {
    inline-size: var(--tka-layout-content);
    margin: 3rem auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  /* Fixed width: the column sets the width, the ratio the minimum height, a taller text may grow the row.
     Without it a stretched frame derives its width from the row height and overflows its column. */
  #tka-home-v7 .tka-editorial__media {
    position: relative;
    inline-size: 100%;
    min-block-size: 0;
    aspect-ratio: 3 / 2;
    align-self: stretch;
    overflow: hidden;
  }
  #tka-home-v7 .tka-editorial__media img {
    position: absolute;
    inset: 0;
    inline-size: 100%;
    block-size: 100%;
    object-fit: cover;
  }
  #tka-home-v7 .tka-editorial__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3rem clamp(2rem, 3vw, 3.5rem);
  }
  #tka-home-v7 .tka-editorial__copy > * { max-inline-size: 48ch; }
  #tka-home-v7 .tka-editorial__copy .tka-title { max-inline-size: 24ch; font-size: clamp(2.25rem, 2.6vw, 2.75rem); }
  #tka-home-v7 .tka-editorial--forest .tka-editorial__copy { padding-block: 2rem; }
  /* Only the short living story uses the compact ratio */
  #tka-home-v7 #tka-look .tka-editorial__media { aspect-ratio: 1.85; }

  /* Bathroom band: heading left, text and button right, brands on their own row */
  #tka-home-v7 .tka-mood__media { block-size: clamp(22rem, 29vw, 32rem); }
  #tka-home-v7 .tka-mood__copy {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 2rem 4rem;
    align-items: center;
    padding-block: 2.5rem;
  }
  #tka-home-v7 .tka-mood__copy .brand-block { grid-column: 1 / -1; }
  #tka-home-v7 .tka-mood__copy .tka-actions { margin-block-start: 1rem; }

  #tka-home-v7 .tka-cinema__media { block-size: clamp(22rem, 28vw, 31rem); max-block-size: none; }
  #tka-home-v7 .tka-cinema__caption { inset-inline: var(--tka-layout-inline); }
  #tka-home-v7 .showroom-info { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; align-items: center; padding-block: 2.5rem; }

  #tka-home-v7 .tka-maker__media { aspect-ratio: 3 / 2; }
  #tka-home-v7 .tka-faq-layout { grid-template-columns: minmax(0, 1.3fr) minmax(20rem, .7fr); gap: 4rem; align-items: start; }

  /* Closing call to action right next to its text, not pushed to the far edge */
  #tka-home-v7 .tka-newsletter { padding-block: 2.5rem; }
  #tka-home-v7 .tka-newsletter__inner { grid-template-columns: minmax(0, 48rem) max-content; justify-content: start; align-items: center; gap: 3rem; }
  #tka-home-v7 .inspiration-action { justify-self: start; }
}

@media (min-width: 1280px) {
  #tka-home-v7 { --tka-layout-max: 80rem; }
  #tka-home-v7 .tka-tools-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1320px) {
  #tka-home-v7 { --tka-layout-max: 82.5rem; }
}
