/* The Coin Daily — "For brands" sponsorship promotion.
   Shared component, scoped to .tcd-sponsor. No JavaScript and no remote assets.
   Variants: --banner (homepage / below main content) and --sidebar (article aside).
   Photo crops use object-fit/object-position so the portrait never leaves the
   frame at intermediate widths; no negative pixel offsets. */

@font-face {
  font-family: "TCD Sponsor Newsreader";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/sponsorship/newsreader-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "TCD Sponsor Newsreader";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/sponsorship/newsreader-latin-500-italic.woff2") format("woff2");
}
@font-face {
  font-family: "TCD Sponsor Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/sponsorship/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "TCD Sponsor Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/sponsorship/inter-latin-600-normal.woff2") format("woff2");
}

.tcd-sponsor {
  --tcd-charcoal: #211e1c;
  --tcd-ivory: #fff3e5;
  --tcd-ivory-70: rgba(255, 243, 229, 0.78);
  --tcd-red: #d71920;
  --tcd-red-hover: #b9151c;
  --tcd-serif: "TCD Sponsor Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --tcd-sans: "TCD Sponsor Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --tcd-photo-pos: 72% 0%;

  position: relative;
  box-sizing: border-box;
  overflow: hidden;
  width: 100%;
  background: var(--tcd-charcoal);
  color: var(--tcd-ivory);
  font-family: var(--tcd-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.tcd-sponsor *,
.tcd-sponsor *::before,
.tcd-sponsor *::after { box-sizing: border-box; }

/* Photo layer — full-bleed cover crop, blended into the charcoal ground. */
.tcd-sponsor__visual {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.tcd-sponsor__media {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow: hidden;
}
.tcd-sponsor__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: var(--tcd-photo-pos);
  display: block;
}
/* Shared overlay surface; each variant supplies its own gradient. */
.tcd-sponsor__media::after {
  content: "";
  position: absolute;
  inset: 0;
}
.tcd-sponsor__rule {
  position: absolute;
  background: var(--tcd-red);
}
.tcd-sponsor__ai {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px 6px 7px;
  border-radius: 999px;
  background: rgba(33, 30, 28, 0.62);
  color: rgba(255, 243, 229, 0.9);
  font: 500 11px/1 var(--tcd-sans);
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.tcd-sponsor__ai svg { width: 12px; height: 12px; flex: none; }

/* Copy */
.tcd-sponsor__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.tcd-sponsor__eyebrow {
  display: inline-block;
  margin: 0;
  padding: 6px 8px 5px;
  border-radius: 2px;
  background: var(--tcd-red);
  color: var(--tcd-ivory);
  font: 600 11px/1 var(--tcd-sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tcd-sponsor__title {
  margin: 0;
  font-family: var(--tcd-serif);
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--tcd-ivory);
  text-wrap: balance;
}
.tcd-sponsor__title em { font-style: italic; font-weight: 500; }
.tcd-sponsor__text {
  margin: 0;
  font: 400 15px/1.45 var(--tcd-sans);
  color: var(--tcd-ivory-70);
  text-wrap: pretty;
}
.tcd-sponsor__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 6px;
  background: var(--tcd-red);
  color: var(--tcd-ivory);
  font: 600 14px/1.2 var(--tcd-sans);
  letter-spacing: 0.005em;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}
.tcd-sponsor__cta:hover { background: var(--tcd-red-hover); color: var(--tcd-ivory); text-decoration: none; }
.tcd-sponsor__cta:focus-visible {
  outline: 2px solid var(--tcd-ivory);
  outline-offset: 3px;
}
.tcd-sponsor__arrow { display: inline-block; transition: transform 0.15s ease; }
.tcd-sponsor__cta:hover .tcd-sponsor__arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .tcd-sponsor__cta, .tcd-sponsor__arrow { transition: none; }
}

/* ==========================================================================
   Banner — homepage column, restacks automatically below 760px.
   ========================================================================== */
.tcd-sponsor--banner {
  max-width: 1140px;
  min-height: 240px;
  display: flex;
  align-items: center;
  padding: 20px 40px;
}
.tcd-sponsor--banner .tcd-sponsor__visual { left: 44%; }
.tcd-sponsor--banner .tcd-sponsor__media { left: 0; }
.tcd-sponsor--banner .tcd-sponsor__photo { --tcd-photo-pos: 72% 0%; }
.tcd-sponsor--banner .tcd-sponsor__media::after {
  background:
    linear-gradient(90deg, var(--tcd-charcoal) 0%, var(--tcd-charcoal) 10%, rgba(33, 30, 28, 0) 46%),
    linear-gradient(180deg, rgba(33, 30, 28, 0.6) 0%, rgba(33, 30, 28, 0) 30%, rgba(33, 30, 28, 0) 68%, rgba(33, 30, 28, 0.55) 100%),
    linear-gradient(270deg, rgba(33, 30, 28, 0.35) 0%, rgba(33, 30, 28, 0) 14%);
}
.tcd-sponsor--banner .tcd-sponsor__rule {
  top: -8%;
  bottom: -8%;
  /* The visual starts at 44% of the banner, so 31.25% inside it places the
     rule at the intended 61.5% of the whole banner (44 + 0.3125 x 56). */
  left: 31.25%;
  width: 3px;
  transform: skewX(-9deg);
}
.tcd-sponsor--banner .tcd-sponsor__ai { right: 16px; bottom: 14px; }
.tcd-sponsor--banner .tcd-sponsor__body {
  width: min(600px, 58%);
  gap: 0;
}
.tcd-sponsor--banner .tcd-sponsor__eyebrow { margin-bottom: 12px; }
.tcd-sponsor--banner .tcd-sponsor__title {
  font-size: clamp(2rem, 3.3vw, 2.375rem);
  line-height: 1.04;
  max-width: 12em;
  margin-bottom: 10px;
}
.tcd-sponsor--banner .tcd-sponsor__text { margin-bottom: 14px; }

/* Narrow desktop/tablet: keep copy clear of the portrait and rule. */
@media (min-width: 760px) and (max-width: 1023px) {
  .tcd-sponsor--banner { padding: 20px 28px; }
  .tcd-sponsor--banner .tcd-sponsor__visual { left: 48%; }
  .tcd-sponsor--banner .tcd-sponsor__body { width: 52%; }
  /* Visual starts at 48%, so 30.769% inside it keeps the rule at 64% of the
     whole banner (48 + 0.30769 x 52). */
  .tcd-sponsor--banner .tcd-sponsor__rule { left: 30.769%; }
  .tcd-sponsor--banner .tcd-sponsor__title { font-size: clamp(1.75rem, 3vw, 2.1rem); }
}

@media (max-width: 759px) {
  .tcd-sponsor--banner {
    display: block;
    min-height: 0;
    padding: 0;
  }
  .tcd-sponsor--banner .tcd-sponsor__visual {
    position: relative;
    inset: auto;
    height: 230px;
  }
  .tcd-sponsor--banner .tcd-sponsor__media {
    left: 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 22px));
  }
  .tcd-sponsor--banner .tcd-sponsor__photo {
    --tcd-photo-pos: 70% 0%;
    top: 0;
    left: 70%;
    width: auto;
    max-width: none;
    height: 165%;
    transform: translateX(-70%);
  }
  .tcd-sponsor--banner .tcd-sponsor__media::after {
    background:
      linear-gradient(180deg, rgba(33, 30, 28, 0.55) 0%, rgba(33, 30, 28, 0) 26%, rgba(33, 30, 28, 0) 60%, rgba(33, 30, 28, 0.6) 100%);
  }
  .tcd-sponsor--banner .tcd-sponsor__rule {
    top: auto; left: -2%; right: -2%; bottom: 10px;
    width: auto; height: 3px;
    transform: rotate(-3.2deg);
  }
  .tcd-sponsor--banner .tcd-sponsor__ai { right: 14px; bottom: 36px; }
  .tcd-sponsor--banner .tcd-sponsor__body { width: auto; max-width: none; padding: 22px 24px 26px; }
  .tcd-sponsor--banner .tcd-sponsor__title {
    font-size: clamp(1.7rem, 7vw, 2rem);
    line-height: 1.06;
    max-width: none;
    margin-bottom: 10px;
  }
  .tcd-sponsor--banner .tcd-sponsor__text { margin-bottom: 18px; }
  .tcd-sponsor--banner .tcd-sponsor__cta { align-self: stretch; min-height: 48px; justify-content: space-between; }
}

/* ==========================================================================
   Sidebar — 280px column on desktop, fluid card once the sidebar stacks.
   ========================================================================== */
.tcd-sponsor--sidebar {
  width: 100%;
  max-width: 280px;
}
.tcd-sponsor--sidebar .tcd-sponsor__visual {
  position: relative;
  inset: auto;
  height: 262px;
}
.tcd-sponsor--sidebar .tcd-sponsor__media {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 22px));
}
.tcd-sponsor--sidebar .tcd-sponsor__photo {
  --tcd-photo-pos: 76% 0%;
  top: 0;
  left: 74%;
  width: auto;
  max-width: none;
  height: 170%;
  transform: translateX(-74%);
}
.tcd-sponsor--sidebar .tcd-sponsor__media::after {
  background:
    linear-gradient(180deg, rgba(33, 30, 28, 0.55) 0%, rgba(33, 30, 28, 0) 26%, rgba(33, 30, 28, 0) 58%, rgba(33, 30, 28, 0.62) 100%);
}
.tcd-sponsor--sidebar .tcd-sponsor__rule {
  left: -2%; right: -2%; bottom: 10px;
  height: 3px;
  transform: rotate(-4.5deg);
}
.tcd-sponsor--sidebar .tcd-sponsor__ai { right: 12px; bottom: 34px; }
.tcd-sponsor--sidebar .tcd-sponsor__body { padding: 20px 22px 24px; }
.tcd-sponsor--sidebar .tcd-sponsor__eyebrow { margin-bottom: 12px; }
.tcd-sponsor--sidebar .tcd-sponsor__title {
  font-size: clamp(1.55rem, 4.6vw, 1.875rem);
  line-height: 1.06;
  margin-bottom: 10px;
}
.tcd-sponsor--sidebar .tcd-sponsor__text { font-size: 14px; line-height: 1.45; margin-bottom: 18px; }
.tcd-sponsor--sidebar .tcd-sponsor__cta {
  align-self: stretch;
  justify-content: space-between;
  padding: 10px 16px;
}

/* Sidebar stacks under the article below 1024px: use the available width
   instead of a fixed 280px card. */
@media (max-width: 1023px) {
  .tcd-sponsor--sidebar { max-width: 420px; }
  .tcd-sponsor--sidebar .tcd-sponsor__visual { height: 240px; }
}
@media (max-width: 479px) {
  .tcd-sponsor--sidebar { max-width: none; }
  .tcd-sponsor--sidebar .tcd-sponsor__visual { height: 230px; }
  .tcd-sponsor--sidebar .tcd-sponsor__body { padding: 20px 20px 24px; }
}

/* ==========================================================================
   Page placement
   ========================================================================== */
.editorial-home > .tcd-sponsor--banner { margin: 30px 0 32px; }
.article-sidebar > .tcd-sponsor { margin: 0 0 1.5rem; }
.sponsorship-banner-page { margin: 32px auto 8px; }
.market-layout + .sponsorship-banner-page { max-width: var(--w-wide); }
@media (max-width: 759px) {
  .editorial-home > .tcd-sponsor--banner { margin: 24px 0 26px; }
}
