/* Affiliate ads on every tktf.at content page. Self-contained, so it looks the same on the web-end and studio pages. */
.aff { clear: both; box-sizing: border-box; max-width: 1132px; margin: 56px auto; padding: 0 24px; font-family: inherit; text-align: left; }
.aff *, .aff *::before { box-sizing: border-box; }
.aff-items { display: grid; gap: 16px; }
.aff p.aff-note { margin: 12px 0 0; color: #66686d; font: 400 13px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
.aff h2.aff-heading { margin: 0 0 20px; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; letter-spacing: -0.02em; }

/* A card: pictures (swipeable when there are several) and the text, both links to the offer. */
.aff-card { display: flex; overflow: hidden; border: 1px solid #d9d5cd; border-radius: 16px; background: #fff; color: #1b1c1e; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.aff-card:hover { border-color: #125ee8; box-shadow: 0 10px 30px #0b1a3a1f; }
.aff-card a { color: inherit; text-decoration: none; }
.aff-card a:focus-visible { outline: 2px solid #125ee8; outline-offset: -2px; }
.aff-pics { position: relative; flex: none; width: 34%; max-width: 280px; align-self: flex-start; background: #f3f1ed; }
.aff-shape-tall .aff-pics { width: 26%; max-width: 220px; }
.aff-shape-square .aff-pics { width: 30%; max-width: 240px; }
.aff-track { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: var(--aff-ratio, 16 / 10); }
.aff-track::-webkit-scrollbar { display: none; }
.aff-track > a { display: block; flex: 0 0 100%; scroll-snap-align: start; }
.aff-track img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aff-shape-auto .aff-track img { object-fit: contain; }
.aff-prev, .aff-next { position: absolute; top: 50%; display: grid; place-items: center; width: 32px; height: 32px; margin-top: -16px; padding: 0; border: 0; border-radius: 50%; background: #ffffffe6; box-shadow: 0 2px 8px #0003; color: #1b1c1e; font: 700 18px/1 system-ui, sans-serif; cursor: pointer; opacity: 0; transition: opacity 0.15s ease; }
.aff-prev { left: 8px; }
.aff-next { right: 8px; }
.aff-prev::before { content: '‹'; }
.aff-next::before { content: '›'; }
.aff-card:hover .aff-prev, .aff-card:hover .aff-next, .aff-prev:focus-visible, .aff-next:focus-visible { opacity: 1; }
.aff-prev:disabled, .aff-next:disabled { opacity: 0 !important; pointer-events: none; }
.aff-dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.aff-dots i { width: 7px; height: 7px; border-radius: 50%; background: #ffffff99; box-shadow: 0 0 2px #0006; }
.aff-dots i.on { background: #fff; }
@media (hover: none) { .aff-prev, .aff-next { display: none; } }

.aff-text { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; padding: 20px 22px; overflow-wrap: anywhere; }
.aff-badge { padding: 2px 8px; border: 1px solid #b9b4ab; border-radius: 999px; color: #4d4f53; font: 600 11px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.06em; text-transform: uppercase; }
.aff-title { font-size: 19px; font-weight: 650; line-height: 1.25; }
.aff-desc { color: #4d4f53; font-size: 15.5px; line-height: 1.5; }
.aff-price { font-size: 17px; font-weight: 650; }
.aff-price small { display: block; margin-top: 2px; color: #66686d; font-size: 12.5px; font-weight: 400; }
.aff-cta { margin-top: auto; padding: 9px 16px; border-radius: 9px; background: #125ee8; color: #fff; font-size: 15px; font-weight: 600; }
.aff-card:hover .aff-cta { background: #084cc8; }

/* Stacked cards: the pictures on top, full width. */
.aff-recommended .aff-items { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.aff-recommended .aff-card, .aff-sidebar .aff-card, .aff-rail .aff-card { flex-direction: column; }
.aff-recommended .aff-pics, .aff-sidebar .aff-pics, .aff-rail .aff-pics { width: 100%; max-width: none; align-self: stretch; }
.aff-inline { max-width: none; margin: 40px 0; padding: 0; }
.aff-footer { margin-bottom: 64px; }

/* Sidebar: beside the article on wide screens, below it otherwise. */
.aff-sidebar { max-width: none; margin: 40px 0 0; padding: 0; }
@media (min-width: 1420px) {
  .article { position: relative; }
  .aff-sidebar { position: absolute; top: 0; left: calc(100% + 16px); width: 250px; height: 100%; margin: 0; }
  .aff-sidebar .aff-wrap { position: sticky; top: 104px; }
}
/* Narrow cards (sidebar and side margins) use smaller type. */
.aff-sidebar .aff-text, .aff-rail .aff-text { padding: 16px; }
.aff-sidebar .aff-title, .aff-rail .aff-title { font-size: 16.5px; }
.aff-sidebar .aff-desc, .aff-rail .aff-desc { font-size: 14px; }

/* Side margins on wide screens: fixed while the page scrolls, gone near the footer. */
.aff.aff-rail { position: fixed; top: 104px; z-index: 5; max-width: none; margin: 0; padding: 0; transition: opacity 0.2s ease; }
.aff.aff-rail.aff-away { opacity: 0; pointer-events: none; }
.aff-rail p.aff-note { font-size: 11.5px; }

@media (max-width: 640px) {
  .aff { margin: 40px auto; padding: 0 16px; }
  .aff-inline, .aff-sidebar { padding: 0; }
  .aff-card { flex-direction: column; }
  .aff-pics, .aff-shape-tall .aff-pics, .aff-shape-square .aff-pics { width: 100%; max-width: none; align-self: stretch; }
  .aff-shape-tall .aff-track { aspect-ratio: 1 / 1; }
}

/* Shown to an administrator who opened a page with ?aff_preview=. */
.aff-preview-note { position: fixed; left: 50%; bottom: 16px; z-index: 2147483000; display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 32px); padding: 12px 12px 12px 18px; border-radius: 12px; background: #1b1c1e; color: #fff; font: 500 14.5px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; box-shadow: 0 10px 30px #0005; transform: translateX(-50%); }
.aff-preview-note button { flex: none; width: 30px; height: 30px; border: 0; border-radius: 8px; background: #ffffff22; color: #fff; cursor: pointer; }
[data-aff-preview] { outline: 3px solid #f5a623; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { .aff-card, .aff-prev, .aff-next, .aff.aff-rail { transition: none; } }
