/* ==========================================================================
   Components — global, present on every page
   Template-specific components live in assets/css/templates/<slug>.css
   ========================================================================== */

/* --- 1. Icons ----------------------------------------------------------- */

.tmg-icon{
  display:inline-block;
  flex:none;
  fill:none;
  stroke:currentColor;
  stroke-width:1.6;
  stroke-linecap:round;
  stroke-linejoin:round;
  vertical-align:middle;
}
.tmg-sprite{position:absolute;width:0;height:0;overflow:hidden}

/* --- 2. Buttons --------------------------------------------------------- */

.tmg-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:var(--s-2);
  font-size:var(--fs-btn);
  font-weight:500;
  letter-spacing:.004em;
  line-height:1;
  text-decoration:none;
  border:1px solid transparent;
  border-radius:var(--r-sm);
  cursor:pointer;
  white-space:nowrap;
  transition:background var(--t-micro) var(--ease),
             border-color var(--t-micro) var(--ease),
             color var(--t-micro) var(--ease),
             transform var(--t-micro) var(--ease);
}
.tmg-btn--md{padding:13px 22px;min-height:46px}
.tmg-btn--lg{padding:16px 28px;min-height:52px}

.tmg-btn .tmg-icon{
  transition:transform var(--t-std) var(--ease);
}
.tmg-btn:hover .tmg-icon{transform:translateX(3px)}

/* Primary — forest, never gold. See the accent rule in tokens.css. */
.tmg-btn--primary{
  background:var(--color-primary);
  color:var(--color-white);
  border-color:var(--color-primary);
}
.tmg-btn--primary:hover{background:var(--color-primary-hover);border-color:var(--color-primary-hover)}

.tmg-btn--secondary{
  background:transparent;
  color:var(--color-text);
  border-color:var(--color-border);
}
.tmg-btn--secondary:hover{border-color:var(--color-primary);color:var(--color-primary)}

.tmg-btn--ghost{
  background:transparent;
  color:var(--color-text);
  padding-inline:0;
  min-height:auto;
}
.tmg-btn--ghost:hover{color:var(--color-primary)}

/* For use on dark bands and over hero photography. */
.tmg-btn--dark{
  background:rgba(255,255,255,.09);
  color:var(--color-white);
  border-color:rgba(255,255,255,.28);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
.tmg-btn--dark:hover{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.45)}

.tmg-btn[aria-disabled="true"],
.tmg-btn:disabled{opacity:.5;pointer-events:none}

/* --- 3. Arrow link ------------------------------------------------------ */

.tmg-link-arrow{
  display:inline-flex;
  align-items:center;
  gap:var(--s-2);
  font-size:var(--fs-small);
  font-weight:500;
  color:var(--color-primary);
  text-decoration:none;
  white-space:nowrap;
  padding-block:2px;
  border-bottom:1px solid transparent;
  transition:border-color var(--t-micro) var(--ease),color var(--t-micro) var(--ease);
}
.tmg-link-arrow:hover{border-bottom-color:var(--color-accent)}
.tmg-link-arrow .tmg-icon{transition:transform var(--t-std) var(--ease)}
.tmg-link-arrow:hover .tmg-icon{transform:translateX(3px)}
.tmg-section--dark .tmg-link-arrow{color:var(--color-white)}

/* --- 4. Media ----------------------------------------------------------- */

.tmg-media{
  position:relative;
  aspect-ratio:var(--ratio,3 / 2);
  overflow:hidden;
  border-radius:var(--r-md);
  background:var(--color-surface-sunken);
}
.tmg-media__img{
  width:100%;
  height:100%;
  object-fit:cover;
  object-position:center;
  transition:transform var(--t-reveal) var(--ease);
}
.tmg-media__placeholder{
  width:100%;
  height:100%;
  background:
    linear-gradient(135deg,
      color-mix(in srgb,var(--color-primary) 7%,var(--color-surface-sunken)),
      var(--color-surface-sunken));
}
/* Hover zoom belongs to the link that wraps the media, not the media itself,
   so a card only zooms when the whole card is the target. */
a:hover > .tmg-media .tmg-media__img,
a:focus-visible > .tmg-media .tmg-media__img,
.tmg-card:hover .tmg-media__img{transform:scale(1.04)}

@media (prefers-reduced-motion:reduce){
  .tmg-media__img{transition:none}
  a:hover > .tmg-media .tmg-media__img,
  .tmg-card:hover .tmg-media__img{transform:none}
}

/* --- 5. Section heading ------------------------------------------------- */

.tmg-section-head{
  display:flex;
  flex-wrap:wrap;
  align-items:end;
  justify-content:space-between;
  gap:var(--s-4) var(--s-6);
  margin-block-end:clamp(28px,3.5vw,48px);
}
.tmg-section-head__text{
  display:flex;
  flex-direction:column;
  gap:var(--s-3);
  max-width:60ch;
}
.tmg-section-head__lede{
  font-size:var(--fs-body-lg);
  line-height:1.6;
  color:var(--color-text-muted);
}
.tmg-section--dark .tmg-section-head__lede{color:var(--color-on-dark)}
.tmg-section-head--center{
  justify-content:center;
  text-align:center;
}
.tmg-section-head--center .tmg-section-head__text{margin-inline:auto;align-items:center}

/* --- 6. Header ---------------------------------------------------------- */

.tmg-header{
  position:fixed;
  inset-block-start:0;
  inset-inline:0;
  z-index:var(--z-header);
  height:var(--header-h);
  display:flex;
  align-items:center;
  background:var(--color-background);
  border-bottom:1px solid var(--color-rule);
  transition:height var(--t-std) var(--ease),
             background var(--t-std) var(--ease),
             border-color var(--t-std) var(--ease),
             box-shadow var(--t-std) var(--ease);
}
body:not(.tmg-has-overlay-header){padding-block-start:var(--header-h)}

/* Transparent over a hero, solid once scrolled. */
.tmg-has-overlay-header .tmg-header{
  background:transparent;
  border-bottom-color:transparent;
  color:var(--color-white);
}
.tmg-header.is-stuck{
  height:var(--header-h-stuck);
  background:var(--color-background);
  border-bottom-color:var(--color-rule);
  box-shadow:var(--sh-1);
  color:var(--color-text);
}

.tmg-header__inner{
  width:100%;
  max-width:var(--shell);
  margin-inline:auto;
  padding-inline:var(--gutter);
  display:flex;
  align-items:center;
  gap:var(--s-6);
}

.tmg-logo{
  display:inline-flex;
  align-items:center;
  gap:var(--s-3);
  text-decoration:none;
  color:inherit;
  flex:none;
}
.tmg-logo__mark{height:34px;width:auto}
.tmg-logo__name{
  font-family:var(--font-display);
  font-variation-settings:var(--fv-display);
  font-weight:600;
  font-size:19px;
  letter-spacing:-.018em;
  line-height:1;
}
.tmg-logo__tag{
  display:block;
  font-family:var(--font-ui);
  font-size:9.5px;
  font-weight:500;
  letter-spacing:.19em;
  text-transform:uppercase;
  opacity:.62;
  margin-block-start:3px;
}
/* Two logo files, one shown at a time — the light mark over hero photography,
   the dark mark once the header turns solid. */
.tmg-logo__mark--dark{display:none}
.tmg-has-overlay-header .tmg-header:not(.is-stuck) .tmg-logo__mark--light{display:block}
.tmg-has-overlay-header .tmg-header:not(.is-stuck) .tmg-logo__mark--dark{display:none}
.tmg-header.is-stuck .tmg-logo__mark--light{display:none}
.tmg-header.is-stuck .tmg-logo__mark--dark{display:block}
body:not(.tmg-has-overlay-header) .tmg-logo__mark--light{display:none}
body:not(.tmg-has-overlay-header) .tmg-logo__mark--dark{display:block}

/* --- 7. Primary navigation ---------------------------------------------- */

.tmg-nav{display:none}
@media (min-width:1024px){
  .tmg-nav{display:block;margin-inline-start:auto}
}
.tmg-nav__list{display:flex;align-items:center;gap:var(--s-6)}
.tmg-nav__item{position:relative}

.tmg-nav__link{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:15px;
  font-weight:500;
  color:inherit;
  text-decoration:none;
  padding-block:6px;
  position:relative;
}
/* The underline grows from the left rather than fading in — a small thing,
   but it reads as deliberate where a fade reads as a default. */
.tmg-nav__link::after{
  content:"";
  position:absolute;
  inset-inline:0;
  inset-block-end:0;
  height:1px;
  background:var(--color-accent);
  transform:scaleX(0);
  transform-origin:left;
  transition:transform var(--t-std) var(--ease);
}
.tmg-nav__link:hover::after,
.tmg-nav__item.is-open > .tmg-nav__link::after,
.tmg-nav__item.current-menu-item > .tmg-nav__link::after{transform:scaleX(1)}

.tmg-nav__toggle .tmg-icon{transition:transform var(--t-micro) var(--ease)}
.tmg-nav__item.is-open .tmg-nav__toggle .tmg-icon{transform:rotate(180deg)}

/* --- 8. Mega menu ------------------------------------------------------- */

.tmg-mega{
  position:absolute;
  inset-block-start:calc(100% + 14px);
  inset-inline-start:-24px;
  min-width:520px;
  padding:var(--s-6);
  background:var(--color-surface);
  color:var(--color-text);
  border:1px solid var(--color-border-soft);
  border-radius:var(--r-lg);
  box-shadow:var(--sh-3);
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:var(--s-6);
  opacity:0;
  visibility:hidden;
  transform:translateY(-6px);
  transition:opacity var(--t-std) var(--ease),
             transform var(--t-std) var(--ease),
             visibility var(--t-std);
}
.tmg-nav__item.is-open > .tmg-mega{opacity:1;visibility:visible;transform:none}

.tmg-mega__group{display:flex;flex-direction:column;gap:var(--s-3)}
.tmg-mega__title{
  font-size:var(--fs-label);
  font-weight:500;
  letter-spacing:var(--ls-label);
  text-transform:uppercase;
  color:var(--color-text-faint);
  padding-block-end:var(--s-2);
  border-bottom:1px solid var(--color-border-soft);
}
.tmg-mega__list{display:flex;flex-direction:column;gap:2px}
.tmg-mega__link{
  display:block;
  padding:7px 10px;
  margin-inline:-10px;
  font-size:15px;
  text-decoration:none;
  border-radius:var(--r-sm);
  transition:background var(--t-micro) var(--ease),color var(--t-micro) var(--ease);
}
.tmg-mega__link:hover{background:var(--color-surface-sunken);color:var(--color-primary)}
.tmg-mega__all{margin-block-start:var(--s-2)}

/* --- 9. Header actions -------------------------------------------------- */

.tmg-header__actions{
  display:flex;
  align-items:center;
  gap:var(--s-4);
  margin-inline-start:auto;
}
@media (min-width:1024px){
  .tmg-header__actions{margin-inline-start:var(--s-6)}
}

.tmg-header__contact{
  display:none;
  align-items:center;
  gap:var(--s-2);
  font-size:14px;
  font-weight:500;
  text-decoration:none;
  color:inherit;
  opacity:.85;
}
@media (min-width:1280px){ .tmg-header__contact{display:inline-flex} }
.tmg-header__contact:hover{opacity:1}

.tmg-header__cta{display:none}
@media (min-width:768px){ .tmg-header__cta{display:inline-flex} }

/* Over a hero the primary button would be a forest block on a dark photo, so
   it takes the translucent treatment until the header turns solid. */
.tmg-has-overlay-header .tmg-header:not(.is-stuck) .tmg-header__cta{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.32);
  color:var(--color-white);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
.tmg-has-overlay-header .tmg-header:not(.is-stuck) .tmg-header__cta:hover{
  background:rgba(255,255,255,.2);
}

.tmg-burger{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  margin-inline-end:-10px;
  border-radius:var(--r-sm);
  color:inherit;
}
@media (min-width:1024px){ .tmg-burger{display:none} }

/* --- 10. Mobile drawer -------------------------------------------------- */

.tmg-drawer{
  position:fixed;
  inset:0;
  z-index:var(--z-drawer);
  display:flex;
  flex-direction:column;
  background:var(--color-background);
  transform:translateX(100%);
  visibility:hidden;
  transition:transform var(--t-reveal) var(--ease),visibility var(--t-reveal);
  overflow-y:auto;
  overscroll-behavior:contain;
}
.tmg-drawer.is-open{transform:none;visibility:visible}

.tmg-drawer__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--s-4);
  height:var(--header-h);
  padding-inline:var(--gutter);
  border-bottom:1px solid var(--color-rule);
  flex:none;
}
.tmg-drawer__body{
  padding:var(--s-6) var(--gutter) var(--s-7);
  display:flex;
  flex-direction:column;
  gap:var(--s-6);
  flex:1;
}

.tmg-drawer__list{display:flex;flex-direction:column}
.tmg-drawer__link{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--s-4);
  padding-block:var(--s-4);
  font-family:var(--font-display);
  font-variation-settings:var(--fv-display);
  font-size:26px;
  font-weight:500;
  letter-spacing:-.02em;
  line-height:1.2;
  text-decoration:none;
  border-bottom:1px solid var(--color-rule);
  min-height:56px;
}
.tmg-drawer__sub{
  display:none;
  flex-direction:column;
  gap:var(--s-1);
  padding:var(--s-3) 0 var(--s-4);
  border-bottom:1px solid var(--color-rule);
}
.tmg-drawer__item.is-open .tmg-drawer__sub{display:flex}
.tmg-drawer__sublink{
  padding:11px 0;
  font-size:16px;
  color:var(--color-text-muted);
  text-decoration:none;
  min-height:44px;
  display:flex;
  align-items:center;
}
.tmg-drawer__actions{display:flex;flex-direction:column;gap:var(--s-3);margin-block-start:auto}
.tmg-drawer__contact{
  display:flex;
  flex-direction:column;
  gap:var(--s-2);
  padding-block-start:var(--s-5);
  border-top:1px solid var(--color-rule);
  font-size:var(--fs-small);
  color:var(--color-text-muted);
}
.tmg-drawer__contact a{display:inline-flex;align-items:center;gap:var(--s-2);text-decoration:none;min-height:44px}

body.tmg-drawer-open{overflow:hidden}

/* --- 11. Footer --------------------------------------------------------- */

.tmg-footer{
  background:var(--color-primary-dark);
  color:var(--color-on-dark);
  padding-block:clamp(48px,5vw,80px) var(--s-7);
}
.tmg-footer h2,.tmg-footer h3,.tmg-footer h4{color:var(--color-white)}
.tmg-footer a{color:inherit;text-decoration:none}
.tmg-footer a:hover{color:var(--color-white)}

.tmg-footer__top{
  display:grid;
  gap:var(--s-7);
  grid-template-columns:1fr;
  padding-block-end:var(--s-7);
  border-bottom:1px solid var(--color-on-dark-line);
}
@media (min-width:700px){
  .tmg-footer__top{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (min-width:1024px){
  .tmg-footer__top{grid-template-columns:1.6fr 1fr 1fr 1.2fr;gap:var(--s-6)}
}

.tmg-footer__brand{display:flex;flex-direction:column;gap:var(--s-4);max-width:36ch}
.tmg-footer__col{display:flex;flex-direction:column;gap:var(--s-3)}
.tmg-footer__title{
  font-size:var(--fs-label);
  font-weight:500;
  letter-spacing:var(--ls-label);
  text-transform:uppercase;
  color:var(--color-on-dark-faint);
}
.tmg-footer__list{display:flex;flex-direction:column;gap:var(--s-2)}
.tmg-footer__list a{font-size:15px;display:inline-block;padding-block:3px}

.tmg-footer__bottom{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:var(--s-4);
  padding-block-start:var(--s-6);
  font-size:13.5px;
  color:var(--color-on-dark-faint);
}
.tmg-footer__legal{display:flex;flex-wrap:wrap;gap:var(--s-4)}

.tmg-social{display:flex;gap:var(--s-2)}
.tmg-social a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:38px;height:38px;
  border:1px solid var(--color-on-dark-line);
  border-radius:var(--r-sm);
  transition:border-color var(--t-micro) var(--ease),background var(--t-micro) var(--ease);
}
.tmg-social a:hover{border-color:rgba(255,255,255,.4);background:rgba(255,255,255,.06)}

/* --- 12. Placeholder marker --------------------------------------------- */

/* [TMG_PHONE] and friends render literally until real details are supplied.
   This makes them impossible to miss on a staging review. */
.tmg-placeholder{
  font-family:ui-monospace,SFMono-Regular,Consolas,monospace;
  font-size:.9em;
  padding:1px 5px;
  border-radius:var(--r-xs);
  background:var(--color-error-bg);
  color:var(--color-error);
  white-space:nowrap;
}

/* --- 13. Empty state ---------------------------------------------------- */

.tmg-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:var(--s-4);
  text-align:center;
  padding:var(--s-9) var(--gutter);
  border:1px dashed var(--color-border);
  border-radius:var(--r-lg);
}
.tmg-empty__title{font-family:var(--font-display);font-variation-settings:var(--fv-display);font-size:var(--fs-h3);font-weight:500}
.tmg-empty__actions{display:flex;flex-wrap:wrap;gap:var(--s-3);justify-content:center;margin-block-start:var(--s-2)}

/* --- 14. Breadcrumbs ---------------------------------------------------- */

.tmg-crumbs{margin-block-end:var(--s-6)}
.tmg-crumbs__list{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:var(--s-2);
  font-size:13px;
  color:var(--color-text-muted);
}
.tmg-crumbs__item{display:flex;align-items:center;gap:var(--s-2)}
.tmg-crumbs__item + .tmg-crumbs__item::before{
  content:"/";
  color:var(--color-text-faint);
}
.tmg-crumbs a{text-decoration:none}
.tmg-crumbs a:hover{color:var(--color-primary)}
.tmg-crumbs [aria-current="page"]{color:var(--color-text)}

/* --- 15. Journal card --------------------------------------------------- */

.tmg-post-card{border-bottom:1px solid var(--color-rule);padding-block-end:var(--s-6)}
.tmg-post-card:last-child{border-bottom:0;padding-block-end:0}

.tmg-post-card__link{
  display:grid;
  gap:var(--s-4);
  grid-template-columns:1fr;
  text-decoration:none;
  color:inherit;
}
@media (min-width:640px){
  .tmg-post-card__link{
    grid-template-columns:280px minmax(0,1fr);
    gap:var(--s-6);
    align-items:start;
  }
}
.tmg-post-card__body{display:flex;flex-direction:column;gap:var(--s-2);max-width:62ch}
.tmg-post-card__title{
  font-size:clamp(20px,2vw,25px);
  transition:color var(--t-micro) var(--ease);
}
.tmg-post-card__link:hover .tmg-post-card__title{color:var(--color-primary)}
.tmg-post-card__meta{
  font-size:13px;
  color:var(--color-text-faint);
  margin-block-start:var(--s-1);
}

/* --- 16. Pagination ----------------------------------------------------- */

.pagination{margin-block-start:var(--s-8)}
.pagination .nav-links{
  display:flex;
  flex-wrap:wrap;
  gap:var(--s-2);
  align-items:center;
  justify-content:center;
}
.pagination .page-numbers{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:44px;
  height:44px;
  padding-inline:var(--s-3);
  border:1px solid var(--color-border);
  border-radius:var(--r-sm);
  font-size:var(--fs-small);
  text-decoration:none;
  transition:border-color var(--t-micro) var(--ease),background var(--t-micro) var(--ease);
}
.pagination .page-numbers:hover{border-color:var(--color-primary)}
.pagination .page-numbers.current{
  background:var(--color-primary);
  border-color:var(--color-primary);
  color:var(--color-white);
}
.pagination .page-numbers.dots{border-color:transparent}

/* --- 17. Trip card ------------------------------------------------------
   Global, not a homepage component: this renders on the homepage, the trip
   archive, destination and style archives, related trips and search.
   ----------------------------------------------------------------------- */

.tmg-trip-grid{
  display:grid;
  gap:var(--grid-gap);
  grid-template-columns:1fr;
}
@media (min-width:600px){ .tmg-trip-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (min-width:1024px){ .tmg-trip-grid{grid-template-columns:repeat(3,minmax(0,1fr))} }

.tmg-trip-card{
  background:var(--color-surface);
  border:1px solid var(--color-border-soft);
  border-radius:var(--r-lg);
  overflow:hidden;
  transition:border-color var(--t-std) var(--ease),box-shadow var(--t-std) var(--ease);
}
.tmg-trip-card:hover{border-color:var(--color-border);box-shadow:var(--sh-2)}

.tmg-trip-card__link{
  display:flex;
  flex-direction:column;
  height:100%;
  text-decoration:none;
  color:inherit;
}
.tmg-trip-card .tmg-media{border-radius:0}

.tmg-trip-card__body{
  display:flex;
  flex-direction:column;
  gap:var(--s-2);
  padding:var(--s-5);
  flex:1;
}
.tmg-trip-card__title{
  font-size:21px;
  line-height:1.22;
  transition:color var(--t-micro) var(--ease);
}
.tmg-trip-card__link:hover .tmg-trip-card__title{color:var(--color-primary)}

.tmg-trip-card__places{
  font-size:13px;
  color:var(--color-text-muted);
  letter-spacing:.005em;
}
.tmg-trip-card__text{font-size:var(--fs-small);color:var(--color-text-muted)}

.tmg-trip-card__foot{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:var(--s-4);
  margin-block-start:auto;
  padding-block-start:var(--s-4);
}
.tmg-trip-card__duration{
  display:inline-flex;
  align-items:center;
  gap:6px;
  font-size:13px;
  color:var(--color-text-muted);
}
.tmg-trip-card__price{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  line-height:1.15;
  text-align:right;
}
.tmg-trip-card__from{
  font-size:11px;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--color-text-faint);
}
/* Price is one of the four sanctioned uses of the accent. */
.tmg-trip-card__price .tmg-tnum{
  font-size:var(--fs-price);
  font-weight:600;
  letter-spacing:-.018em;
  color:var(--color-primary);
}
.tmg-trip-card__cta{
  margin-block-start:var(--s-3);
  padding-block-start:var(--s-3);
  border-top:1px solid var(--color-border-soft);
  border-bottom:0;
  align-self:flex-start;
}

/* --- 18. Destination tile ----------------------------------------------- */

.tmg-dest-tile{
  display:flex;
  flex-direction:column;
  gap:var(--s-3);
  text-decoration:none;
  color:inherit;
}
.tmg-dest-tile__body{display:flex;flex-direction:column;gap:2px}
.tmg-dest-tile__name{
  font-size:20px;
  line-height:1.2;
  transition:color var(--t-micro) var(--ease);
}
.tmg-dest-tile:hover .tmg-dest-tile__name{color:var(--color-primary)}
.tmg-dest-tile__intro{font-size:13.5px;color:var(--color-text-muted);line-height:1.45}

/* --- 19. Form controls --------------------------------------------------
   The shared field system. The trip finder predates this and keeps its own
   compact variant; everything else — Plan My Trip, contact, booking — uses
   these classes so one change to focus or error styling reaches all of them.

   Three things here are load-bearing rather than cosmetic:

     - 16px minimum font size on every control. Anything smaller and iOS
       zooms the viewport on focus, which on a long form reads as the page
       jumping away from the person filling it in.
     - 48px minimum height, so a control is a comfortable touch target.
     - Errors are marked by colour, a left rule AND a message. Colour alone
       fails for the ~8% of men with a red-green deficiency.
   ----------------------------------------------------------------------- */

.tmg-field{display:flex;flex-direction:column;gap:7px;min-width:0}

.tmg-field__label{
  font-size:var(--fs-small);
  font-weight:500;
  color:var(--color-text);
  display:flex;
  align-items:baseline;
  gap:var(--s-2);
}
.tmg-field__optional{
  font-size:12.5px;
  font-weight:400;
  color:var(--color-text-faint);
}
/* Required is marked in words, not with an asterisk nobody explains. */
.tmg-field__required{
  font-size:12.5px;
  font-weight:400;
  color:var(--color-text-muted);
}
.tmg-field__hint{
  font-size:13px;
  line-height:1.45;
  color:var(--color-text-muted);
}

.tmg-input,
.tmg-select,
.tmg-textarea{
  width:100%;
  font-size:16px;
  line-height:1.4;
  min-height:48px;
  padding:12px 14px;
  background:var(--color-surface);
  border:1px solid var(--color-border);
  border-radius:var(--r-sm);
  color:var(--color-text);
  appearance:none;
  transition:border-color var(--t-micro) var(--ease),box-shadow var(--t-micro) var(--ease);
}
.tmg-textarea{min-height:120px;resize:vertical;line-height:var(--lh-body)}

.tmg-input::placeholder,
.tmg-textarea::placeholder{color:var(--color-text-faint)}

.tmg-input:hover,
.tmg-select:hover,
.tmg-textarea:hover{border-color:var(--color-text-faint)}

.tmg-input:focus-visible,
.tmg-select:focus-visible,
.tmg-textarea:focus-visible{
  border-color:var(--color-primary);
  box-shadow:0 0 0 3px rgba(18,60,52,.12);
}

.tmg-select{
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),
                   linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:calc(100% - 18px) calc(50% + 1px),calc(100% - 13px) calc(50% + 1px);
  background-size:5px 5px,5px 5px;
  background-repeat:no-repeat;
  padding-inline-end:38px;
}

/* Error state ------------------------------------------------------------ */

.tmg-field.has-error .tmg-input,
.tmg-field.has-error .tmg-select,
.tmg-field.has-error .tmg-textarea{
  border-color:var(--color-error);
  border-inline-start-width:3px;
  background:var(--color-error-bg);
}
.tmg-field__error{
  display:flex;
  align-items:flex-start;
  gap:6px;
  font-size:13px;
  line-height:1.45;
  color:var(--color-error);
  font-weight:500;
}

/* Choice chips -----------------------------------------------------------
   A radio or checkbox rendered as a chip. The input stays in the DOM and
   keeps its own focus ring — this is a label wrapping a real control, not a
   div pretending to be one, so keyboard and screen-reader behaviour is the
   browser's rather than ours.
   ----------------------------------------------------------------------- */

.tmg-choices{display:flex;flex-wrap:wrap;gap:var(--s-2)}
.tmg-choices--stack{flex-direction:column;gap:var(--s-2)}

.tmg-choice{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:var(--s-2);
  min-height:44px;
  padding:10px 16px;
  border:1px solid var(--color-border);
  border-radius:var(--r-pill);
  background:var(--color-surface);
  font-size:15px;
  cursor:pointer;
  transition:border-color var(--t-micro) var(--ease),background var(--t-micro) var(--ease);
}
.tmg-choice:hover{border-color:var(--color-text-faint)}
.tmg-choice input{
  position:absolute;
  opacity:0;
  width:1px;
  height:1px;
  margin:0;
}
.tmg-choice:has(input:checked){
  border-color:var(--color-primary);
  background:var(--color-primary);
  color:var(--color-white);
}
.tmg-choice:has(input:focus-visible){
  outline:2px solid var(--color-primary);
  outline-offset:2px;
}
/* Fallback for browsers without :has() — the script mirrors the state. */
.tmg-choice.is-checked{
  border-color:var(--color-primary);
  background:var(--color-primary);
  color:var(--color-white);
}

/* A checkbox that reads as a sentence rather than a chip. */
.tmg-check{
  display:flex;
  align-items:flex-start;
  gap:var(--s-3);
  font-size:15px;
  line-height:1.45;
  cursor:pointer;
  min-height:44px;
  padding-block:6px;
}
.tmg-check input{
  appearance:none;
  flex:0 0 auto;
  width:20px;
  height:20px;
  margin-block-start:2px;
  border:1px solid var(--color-border);
  border-radius:var(--r-xs);
  background:var(--color-surface);
  transition:border-color var(--t-micro) var(--ease),background var(--t-micro) var(--ease);
}
.tmg-check input:checked{
  background:var(--color-primary);
  border-color:var(--color-primary);
  /* The tick is drawn rather than pulled from the sprite: an <svg> cannot
     live inside an <input>, and a pseudo-element on an input is not painted
     in every engine. */
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 5'/%3E%3C/svg%3E");
  background-size:14px;
  background-position:center;
  background-repeat:no-repeat;
}

/* Honeypot. Off-screen rather than display:none — some bots skip anything
   that is not rendered, and this one needs to look fillable. */
.tmg-hp{
  position:absolute;
  left:-9999px;
  width:1px;
  height:1px;
  overflow:hidden;
}

/* --- 20. Notices --------------------------------------------------------
   Form-level feedback: sent, expired, or "check these fields".
   ----------------------------------------------------------------------- */

.tmg-notice{
  display:flex;
  gap:var(--s-3);
  padding:var(--s-4) var(--s-5);
  border-radius:var(--r-md);
  border:1px solid var(--color-border);
  background:var(--color-surface);
  font-size:15px;
  line-height:1.55;
}
.tmg-notice__body{display:flex;flex-direction:column;gap:var(--s-2)}
.tmg-notice__title{font-weight:600;font-size:16px;color:var(--color-text)}
.tmg-notice--error{
  border-color:var(--color-error);
  border-inline-start-width:3px;
  background:var(--color-error-bg);
}
.tmg-notice--error .tmg-notice__title{color:var(--color-error)}
.tmg-notice--warn{
  border-color:var(--color-warning);
  border-inline-start-width:3px;
  background:rgba(154,107,20,.07);
}
.tmg-notice__list{display:flex;flex-direction:column;gap:4px;font-size:14px}
.tmg-notice__list a{color:inherit}
