/* Conversion and decision module for brand pages (briefing section 8)
   Colours follow the site's existing TastyDaily palette. */

.tmf-brandheader {
  --tmf-green: #5EAD39;
  --tmf-dark: #243F2F;
  --tmf-grey: #858585;
  --tmf-line: #e4e7e4;
  --tmf-surface: #f6f8f5;

  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  margin: 0 0 34px;
  padding: 26px 28px;
  background: #fff;
  border: 1px solid var(--tmf-line);
  border-radius: 20px;
}

@media (max-width: 880px) {
  .tmf-brandheader {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 20px;
  }
}

/* ----------------------------------------------------- left column */

.tmf-brandheader__eyebrow {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--tmf-green);
}

.tmf-brandheader__verdict {
  margin: 0 0 18px;
  color: var(--tmf-dark);
}

.tmf-brandheader__verdict p {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.6;
}

.tmf-brandheader__verdict p:last-child { margin-bottom: 0; }

/* First paragraph is the human verdict, so it carries more weight */
.tmf-brandheader__verdict p:first-child { font-size: 18px; }

.tmf-brandheader__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tmf-brandheader__badges li {
  margin: 0;
  padding: 7px 13px;
  font-size: 14px;
  line-height: 1.3;
  color: var(--tmf-dark);
  background: var(--tmf-surface);
  border: 1px solid var(--tmf-line);
  border-radius: 999px;
}

/* Untested brand: neutral badge, no green seal-of-approval feel */
.tmf-brandheader--untested .tmf-brandheader__eyebrow { color: var(--tmf-grey); }
.tmf-brandheader--untested .tmf-brandheader__badges li:first-child {
  background: #fff6e8;
  border-color: #f0dcc0;
}

/* --------------------------------------------------- right panel */

.tmf-brandheader__panel {
  padding: 20px;
  background: var(--tmf-surface);
  border: 1px solid var(--tmf-line);
  border-radius: 16px;
}

/* Brand image at the top of the panel: the visual anchor above the facts
   and the button. No fixed aspect ratio is forced, because brand images
   range from wide banners (1280x299) to almost square. There is a maximum
   height, so a tall image cannot pull the panel apart. */
.tmf-brandheader__image {
  margin: -4px 0 16px;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
  background: #fff;
}

.tmf-brandheader__image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 210px;
  object-fit: cover;
  object-position: center;
}

.tmf-brandheader__facts { margin: 0 0 18px; }

.tmf-brandheader__facts > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--tmf-line);
}

.tmf-brandheader__facts > div:last-child { border-bottom: 0; }

.tmf-brandheader__facts dt {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--tmf-grey);
}

.tmf-brandheader__facts dd {
  margin: 0;
  flex: 1 1 auto;
  text-align: right;
  font-size: 14px;
  line-height: 1.4;
  color: var(--tmf-dark);
}

.tmf-brandheader__pricelevel { font-weight: 700; letter-spacing: 1px; }
.tmf-brandheader__pricelevel .is-on { color: var(--tmf-green); }
.tmf-brandheader__pricelevel .is-off { color: #c9d2c9; }

.tmf-brandheader__price { display: block; font-size: 13px; }
.tmf-brandheader__price small { display: block; color: var(--tmf-grey); font-size: 11px; }

/* ------------------------------------------------------------ CTA's */

.tmf-brandheader__cta,
.tmf-brandheader__cta-secondary {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  border-radius: 999px;
  transition: background-color .15s ease, color .15s ease;
}

.tmf-brandheader__cta {
  color: #fff;
  background: var(--tmf-dark);
}

.tmf-brandheader__cta:hover,
.tmf-brandheader__cta:focus-visible {
  background: var(--tmf-green);
  color: #fff;
}

.tmf-brandheader__cta-secondary {
  margin-top: 9px;
  color: var(--tmf-dark);
  background: transparent;
  border: 1px solid var(--tmf-dark);
  font-weight: 600;
}

.tmf-brandheader__cta-secondary:hover,
.tmf-brandheader__cta-secondary:focus-visible {
  background: #fff;
  border-color: var(--tmf-green);
  color: var(--tmf-green);
}

/* Disclosure sits directly below the button, as the briefing requires */
.tmf-brandheader__disclosure {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--tmf-grey);
}

/* Shown instead of the CTA when trading status is not confirmed. Deliberately
   plain: this is an honest note, not a button dressed up as one. */
.tmf-brandheader__unavailable {
  margin: 0;
  padding: 13px 15px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--tmf-dark);
  background: #fff6e8;
  border: 1px solid #f0dcc0;
  border-radius: 12px;
}

.tmf-brandheader__unavailable a {
  color: var(--tmf-dark);
  font-weight: 700;
}

/* Supporting line under a fact: price-level basis, offer check date. */
.tmf-brandheader__facts dd small {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--tmf-grey);
}
.tmf-brandheader__facts dd small a { color: var(--tmf-green); font-weight: 700; text-decoration: underline; }
