/* /templates/ only. Builds on styles.css tokens; loaded after it. */
html.tpl-pending [data-tpl-price], html.tpl-pending [data-tpl-worth], html.tpl-pending [data-tpl-unit] { visibility: hidden; }

.tpl-section { padding-top: clamp(64px, 8vw, 110px); }
.tpl-cur-note { font-size: .9rem; color: var(--muted-dark); max-width: 44em; margin: 10px 0 0; }

.tpl-filters { margin-bottom: 28px; }
.section-light .tpl-filters button { border-color: var(--line-light); color: var(--text-dark); }
.section-light .tpl-filters button:hover { border-color: rgba(20,22,18,.45); }
.section-light .tpl-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--lime); }

.tpl-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .tpl-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .tpl-grid { grid-template-columns: repeat(3, 1fr); } }
.tpl-grid > li[hidden] { display: none; }

.tpl-card > article { height: 100%; display: flex; flex-direction: column; background: #fffdf8; border: 1px solid var(--line-light); border-radius: var(--radius); overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tpl-card > article:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -28px rgba(30,35,20,.45); }
  .tpl-card > article:hover .tpl-media img { transform: scale(1.03); }
}
.tpl-media { aspect-ratio: 4 / 3; background: var(--ink-2); overflow: hidden; }
.tpl-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.tpl-body { display: flex; flex-direction: column; flex: 1; padding: 24px 24px 22px; color: var(--text-dark); }
.tpl-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tpl-format { display: inline-flex; align-items: center; padding: .28em .7em; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--paper-2); color: var(--text-dark); }
.tpl-meta .chip-lime { font-size: .72rem; }
.tpl-body h3 { font-family: var(--serif); font-weight: 400; font-size: 1.9rem; letter-spacing: -0.005em; line-height: 1.02; margin: 0 0 .3em; }
.tpl-line { color: var(--muted-dark); font-size: .98rem; margin: 0; }
.tpl-body .included { flex: 1; margin: 16px 0 18px; font-size: .92rem; }
.tpl-body .included li { padding: 7px 0; }
.tpl-save { font-size: .9rem; margin: -4px 0 14px; color: var(--muted-dark); }
.tpl-save strong { color: var(--text-dark); background: var(--lime); padding: .1em .45em; border-radius: 6px; }
.tpl-buy { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line-light); }
.tpl-price { display: flex; flex-direction: column; margin: 0; line-height: 1.1; }
.tpl-amount { font-size: 1.75rem; font-weight: 650; letter-spacing: -0.03em; }
.tpl-price .price-unit { font-size: .76rem; margin-top: 3px; }
.tpl-buy .btn { min-height: 46px; padding: .7em 1.2em; }
.tpl-buy .btn.is-added { --bg: var(--ink); color: var(--lime); box-shadow: none; }
.tpl-status { min-height: 1.4em; margin: 10px 0 0; font-size: .86rem; color: var(--muted-dark); }
.tpl-status:empty { min-height: 0; margin: 0; }
.tpl-status a { color: inherit; text-decoration-color: var(--lime-deep); text-underline-offset: 3px; font-weight: 600; }

/* Bundle: full-width dark feature card */
.tpl-card-bundle > article { background: var(--ink); border-color: var(--ink); color: var(--text-light); }
.tpl-card-bundle .tpl-body { color: var(--text-light); }
.tpl-card-bundle .tpl-line, .tpl-card-bundle .tpl-save, .tpl-card-bundle .price-unit { color: var(--muted-light); }
.tpl-card-bundle .included li { border-color: var(--line-dark); }
.tpl-card-bundle .tpl-buy { border-color: var(--line-dark); }
.tpl-card-bundle .tpl-format { background: var(--ink-3); color: var(--text-light); }
.tpl-card-bundle .tpl-save strong { color: var(--ink); }
.tpl-card-bundle .tpl-status { color: var(--muted-light); }
.tpl-card-bundle .tpl-buy .btn.is-added { --bg: var(--paper); color: var(--ink); }
.tpl-card-pack > article { box-shadow: 0 0 0 2px var(--lime) inset; }
@media (min-width: 1040px) {
  .tpl-card-bundle { grid-column: 1 / -1; }
  .tpl-card-bundle > article { flex-direction: row; }
  .tpl-card-bundle .tpl-media { flex: 0 0 58%; aspect-ratio: auto; }
  .tpl-card-bundle .tpl-body { padding: 40px 40px 34px; }
  .tpl-card-bundle h3 { font-size: 2.6rem; }
}
@media (min-width: 680px) and (max-width: 1039px) { .tpl-card-bundle { grid-column: 1 / -1; } }

.tpl-delivery { margin-top: 36px; padding: 22px 26px; border-radius: var(--radius-sm); background: var(--paper-2); color: var(--text-dark); font-size: .98rem; }
.tpl-delivery p { margin: 0; }
.tpl-delivery-title { font-size: 1.15rem; margin: 0 0 10px; color: var(--text-dark); }
.tpl-order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tpl-order-list li { padding-left: 18px; position: relative; }
.tpl-order-list li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 50%; background: var(--lime-deep); }
.tpl-delivery .tpl-order-cart { margin-top: 12px; }
.tpl-delivery a { color: inherit; text-decoration-color: var(--lime-deep); text-underline-offset: 3px; font-weight: 600; }
.tpl-section + .faq { padding-top: 0; }

@media (prefers-reduced-motion: reduce) {
  .tpl-card > article, .tpl-media img { transition: none; }
}

/* UGC sample adverts section */
.tpl-ugc .section-head h2 em { color: var(--lime); }
.tpl-ugc-row { list-style: none; margin: 0; padding: 0 0 6px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(160px, 44%); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
@media (min-width: 900px) { .tpl-ugc-row { grid-auto-flow: row; grid-template-columns: repeat(5, minmax(0, 1fr)); overflow: visible; } }
.tpl-ugc-tile { scroll-snap-align: start; min-width: 0; }
.tpl-ugc-tile figure { margin: 0; }
.tpl-ugc-media { position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius-sm); overflow: hidden; background: var(--ink-2); }
.tpl-ugc-media video, .tpl-ugc-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tpl-ugc-media img { transition: opacity .3s; }
.tpl-ugc-media.is-playing img { opacity: 0; pointer-events: none; }
.tpl-ugc-play { position: absolute; inset: 0; width: 100%; height: 100%; display: grid; place-items: center; background: linear-gradient(transparent 55%, rgba(0,0,0,.45)); border: 0; padding: 0; cursor: pointer; color: inherit; }
.tpl-ugc-play .play-mark { width: 52px; height: 52px; transition: opacity .25s, transform .25s var(--ease); }
.tpl-ugc-play .play-mark rect { fill: var(--lime); } .tpl-ugc-play .play-mark g { stroke: var(--ink); }
.tpl-ugc-media.is-playing .tpl-ugc-play { background: transparent; }
.tpl-ugc-media.is-playing .play-mark { opacity: 0; transform: scale(.8); }
.tpl-ugc-play:focus-visible { outline-offset: -4px; }
.tpl-ugc-len { position: absolute; right: 10px; bottom: 10px; font: 600 .74rem/1 var(--sans); padding: 5px 7px; border-radius: 6px; background: rgba(14,16,13,.8); color: var(--text-light); pointer-events: none; }
.tpl-ugc-tile figcaption { display: grid; gap: 2px; margin-top: 10px; font-size: .9rem; line-height: 1.35; }
.tpl-ugc-tile figcaption strong { font-weight: 600; }
.tpl-ugc-tile figcaption span { color: var(--muted-light); font-size: .8rem; }
.tpl-ugc .ugc-note { margin: 14px 0 0; }
.tpl-ugc-foot { display: grid; gap: 20px; margin-top: 40px; }
@media (min-width: 960px) { .tpl-ugc-foot { grid-template-columns: 1.15fr .85fr; } }
.tpl-ugc-diy, .tpl-ugc-cta { padding: clamp(24px, 3vw, 34px); border-radius: var(--radius); border: 1px solid var(--line-dark); background: var(--ink-2); }
.tpl-ugc-cta { background: var(--ink-3); }
.tpl-ugc-products { list-style: none; margin: 0; padding: 0; }
.tpl-ugc-product { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 0; border-top: 1px solid var(--line-dark); }
.tpl-ugc-product > div:first-child { display: grid; gap: 2px; flex: 1 1 220px; }
.tpl-ugc-product-name { font-weight: 600; text-decoration: none; }
.tpl-ugc-product-name:hover { text-decoration: underline; text-decoration-color: var(--lime); text-underline-offset: 3px; }
.tpl-ugc-product > div:first-child > span { color: var(--muted-light); font-size: .86rem; }
.tpl-ugc-product-buy { display: flex; align-items: center; gap: 12px; }
.tpl-ugc-product .tpl-ugc-product-price { color: var(--text-light); font-size: 1.1rem; font-weight: 650; letter-spacing: -0.02em; }
.tpl-ugc-product .btn.is-added { --bg: var(--paper); color: var(--ink); box-shadow: none; }
.tpl-ugc-product .tpl-status { flex-basis: 100%; color: var(--muted-light); }
.tpl-ugc-cta h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(1.7rem, 2.8vw, 2.2rem); line-height: 1.08; }
.tpl-ugc-cta h3 em { color: var(--lime); }
.tpl-ugc-counts { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tpl-ugc-counts li { display: grid; gap: 2px; text-align: center; padding: 12px 6px; border-radius: var(--radius-sm); background: rgba(255,255,255,.05); border: 1px solid var(--line-dark); }
.tpl-ugc-counts strong { font-size: 1.6rem; font-weight: 650; color: var(--lime); line-height: 1; }
.tpl-ugc-counts span { font-size: .78rem; color: var(--muted-light); }
html.tpl-pending .tpl-ugc-product-price { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .tpl-ugc-media img, .tpl-ugc-play .play-mark { transition: none; } }
.page-templates .section-light .kicker { color: #4f6800; } /* 5.6:1 on paper (AA at small size) */

/* Finance & budget calculators */
.tpl-finance { padding-top: 0; }
.tpl-finance > .container { border-top: 1px solid var(--line-light); padding-top: clamp(56px, 7vw, 96px); }
.tpl-section[hidden] { display: none; }
.tpl-fine { font-size: .82rem; color: var(--muted-dark); margin: -6px 0 14px; }
.tpl-finance-note { margin: 28px 0 0; font-size: .9rem; color: var(--muted-dark); }
.tpl-empty { padding: 22px 26px; border-radius: var(--radius-sm); background: var(--paper-2); color: var(--text-dark); margin: 0 0 20px; }
.tpl-empty a { color: inherit; font-weight: 600; text-decoration-color: var(--lime-deep); text-underline-offset: 3px; }
.page-templates .tpl-section .tpl-delivery + * { margin-top: 0; }

/* SITEWATCH-SPACING:BEGIN */
/* Site Watch 19 Oct 2026: S5 first templates section uses the standard 120 / 115 / 64px top; S8 UGC captions 16px under the video */
.tpl-section { padding-top: var(--section-y); }
.tpl-ugc-tile figcaption { margin-top: 16px; }
/* SITEWATCH-SPACING:END */

/* TPL-IMAGE-FIT:BEGIN */
/* Bundle feature cards: show the whole 4:3 artwork (no cropping) when the card is a side-by-side row */
.tpl-card-bundle .tpl-media { position: relative; isolation: isolate; background: linear-gradient(180deg, #121510 0%, #0e100d 55%, #17130f 100%); }
@media (min-width: 1040px) {
  .tpl-card-bundle .tpl-media { display: flex; align-items: center; justify-content: center; align-self: stretch; }
  .tpl-card-bundle .tpl-media::before { content: ""; position: absolute; inset: -40px; z-index: -1; background: var(--tpl-media-bg, none) center / cover no-repeat; filter: blur(28px) saturate(1.1) brightness(.4); transform: scale(1.1); pointer-events: none; }
  .tpl-card-bundle .tpl-media img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; flex: none;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 2.5%, #000 97.5%, transparent 100%);
            mask-image: linear-gradient(180deg, transparent 0, #000 2.5%, #000 97.5%, transparent 100%); }
}
/* TPL-IMAGE-FIT:END */
