/**
 * PATH: /wp-content/plugins/tornado-core/assets/css/model-single.css
 *
 * Purpose:
 *   - Style the public server-rendered single Boat Model page.
 *
 * Layer:
 *   - front-assets
 *
 * Version:
 *   2.0.0
 *
 * Change:
 *   - Align with the dark brand palette used by the models hub
 *     (assets/css/models-browser.css) so a visitor arriving from search
 *     lands on a page that looks like the rest of the site.
 *
 * Notes:
 *   - Loaded only on is_singular('boat_model') by inc/front-enqueue-model-single.php.
 *   - Palette mirrors models-browser.css: #07131E surface, #FF6B00 accent,
 *     #F8FAFC primary text, #B5C0CB secondary text.
 */

.tnd-model {
  --tm-bg: #07131E;
  --tm-card: rgba(255, 255, 255, .04);
  --tm-line: rgba(255, 255, 255, .12);
  --tm-text: #F8FAFC;
  --tm-muted: #B5C0CB;
  --tm-accent: #FF6B00;
  --tm-accent-hi: #FF8533;

  padding-top: 36px;
  padding-bottom: 80px;
  color: var(--tm-text);
}

/**
 * The theme paints its own surfaces around this template
 * (body.ast-separate-container -> #page -> #content -> .ast-container),
 * so the section carries its own full-bleed background instead of
 * competing with those rules. Painting the wrappers as well only
 * removes the seams above and below.
 */
body.single-boat_model,
body.single-boat_model #page,
body.single-boat_model #content.site-content,
body.single-boat_model #content.site-content > .ast-container,
body.single-boat_model.ast-separate-container,
body.single-boat_model.ast-plain-container,
body.tax-product_range,
body.tax-product_range #page,
body.tax-product_range #content.site-content,
body.tax-product_range #content.site-content > .ast-container,
body.tax-product_range.ast-separate-container,
body.tax-product_range.ast-plain-container {
  background-color: #07131E;
  background-image: none;
}

.tnd-model {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-left: max(20px, calc(50vw - 580px));
  padding-right: max(20px, calc(50vw - 580px));
  background: var(--tm-bg);
  max-width: none;
}

.tnd-model a { color: var(--tm-accent); }
.tnd-model a:hover { color: var(--tm-accent-hi); }

.tnd-model > * { max-width: 1120px; margin-left: auto; margin-right: auto; }

.tnd-model__crumbs {
  font-size: 14px;
  margin: 0 0 24px;
  letter-spacing: .02em;
}

.tnd-model__crumbs a { text-decoration: none; }

.tnd-model__title {
  font-size: clamp(32px, 5.2vw, 52px);
  line-height: 1.06;
  margin: 0 0 10px;
  color: var(--tm-text);
  letter-spacing: -.01em;
}

.tnd-model__range {
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--tm-accent);
  font-weight: 700;
  margin: 0 0 32px;
}

/* The ranges are links to their segment pages. Astra underlines content links,
   so this has to be explicit -- same reason as the chips and the hub cards. */
.tnd-model__range--links a,
.tnd-model__range--links a:hover {
  color: var(--tm-accent);
  text-decoration: none !important;
  border-bottom: 1px solid rgba(255, 107, 0, .38);
}

.tnd-model__range--links a:hover {
  color: var(--tm-accent-hi);
  border-bottom-color: var(--tm-accent-hi);
}

.tnd-model__range-sep { color: rgba(255, 255, 255, .28); }

.tnd-model__section {
  margin: 40px 0 0;
  background: var(--tm-card);
  border: 1px solid var(--tm-line);
  border-radius: 12px;
  padding: 26px;
}

.tnd-model__h2 {
  font-size: 20px;
  margin: 0 0 18px;
  color: var(--tm-text);
}

.tnd-model__intro {
  font-size: 17px;
  line-height: 1.75;
  color: var(--tm-muted);
}

.tnd-model__intro p { margin: 0 0 16px; }
.tnd-model__intro ul { margin: 0 0 16px; padding-left: 22px; }
.tnd-model__intro li { margin: 0 0 7px; }

.tnd-model__intro h2,
.tnd-model__intro h3,
.tnd-model__intro h4 {
  color: var(--tm-text);
  margin: 30px 0 12px;
  line-height: 1.25;
}

.tnd-model__intro h2 { font-size: 25px; }
.tnd-model__intro h3 { font-size: 20px; }
.tnd-model__intro h4 { font-size: 17px; }

.tnd-model__specs {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.tnd-model__specs th,
.tnd-model__specs td {
  text-align: left;
  padding: 12px 4px;
  border-bottom: 1px solid var(--tm-line);
  vertical-align: top;
}

.tnd-model__specs tr:last-child th,
.tnd-model__specs tr:last-child td { border-bottom: 0; }

.tnd-model__specs th {
  font-weight: 500;
  color: var(--tm-muted);
  width: 58%;
}

.tnd-model__specs td { color: var(--tm-text); font-weight: 600; }

.tnd-model__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.tnd-model__gallery img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
}

.tnd-model__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tnd-model__swatch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--tm-text);
  padding: 9px 15px 9px 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .075);
}

.tnd-model__chip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35);
  flex: 0 0 auto;
}

.tnd-model__group {
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tm-muted);
  font-weight: 700;
  margin: 26px 0 12px;
}

.tnd-model__section > .tnd-model__group:first-of-type { margin-top: 0; }

.tnd-model__items {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 10px;
}

.tnd-model__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--tm-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
}

.tnd-model__thumb {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #F1F5F9;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tnd-model__thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tnd-model__item-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.tnd-model__item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tm-text);
  line-height: 1.3;
}

.tnd-model__badge {
  align-self: flex-start;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 700;
  color: #07131E;
  background: var(--tm-accent);
  border-radius: 4px;
  padding: 2px 7px;
}

.tnd-model__item-note {
  font-size: 13px;
  color: var(--tm-muted);
  line-height: 1.4;
}

.tnd-model__3d iframe {
  width: 100%;
  min-height: 460px;
  border: 0;
  display: block;
  border-radius: 10px;
  background: transparent;
}

.tnd-model__cta {
  margin: 40px 0 0;
  padding: 40px 28px;
  border: 1px solid var(--tm-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  text-align: center;
}

.tnd-model__cta h2 {
  font-size: 26px;
  margin: 0 0 22px;
  color: var(--tm-text);
}

.tnd-model__btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.tnd-model__btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  background: var(--tm-accent);
  color: #07131E !important;
  border: 1px solid var(--tm-accent);
  transition: background-color .18s ease, border-color .18s ease;
}

.tnd-model__btn:hover {
  background: var(--tm-accent-hi);
  border-color: var(--tm-accent-hi);
  color: #07131E !important;
}

.tnd-model__btn--ghost {
  background: transparent;
  color: var(--tm-text) !important;
  border-color: rgba(255, 255, 255, .28);
}

.tnd-model__btn--ghost:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .45);
  color: var(--tm-text) !important;
}

@media (max-width: 700px) {
  .tnd-model {
    padding-top: 22px;
    padding-bottom: 56px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .tnd-model__section { padding: 20px 16px; }
  .tnd-model__specs th { width: 60%; }
  .tnd-model__3d iframe { min-height: 280px; }
  .tnd-model__cta { padding: 28px 18px; }
  .tnd-model__btns { flex-direction: column; }
  .tnd-model__items { grid-template-columns: 1fr; }
}

.tnd-model__hero {
  margin: 0 auto 28px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--tm-line);
}

.tnd-model__hero img {
  width: 100%;
  height: auto;
  display: block;
}

.tnd-model__siblings-label {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tm-muted);
  font-weight: 700;
  margin: 0 auto 10px;
}

.tnd-model__siblings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 8px;
}

.tnd-model__sib {
  display: inline-block;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 8px;
  background: rgba(255, 255, 255, .075);
  color: var(--tm-text) !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.1;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.tnd-model__sib:hover {
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .34);
  color: var(--tm-text) !important;
}

.tnd-model__sib.is-current {
  background: var(--tm-accent);
  border-color: var(--tm-accent);
  color: #07131E !important;
}

/* ============================================================
 * Segment pages (taxonomy-product_range.php)
 *
 * Same layout, same tokens: the .tnd-range element also carries
 * .tnd-model, so everything above applies. Only the model card
 * is new -- the model page has no equivalent of it.
 * ============================================================ */

.tnd-range__cards {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.tnd-range__card {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--tm-line);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, .03);
  text-decoration: none;
  color: var(--tm-text) !important;
  transition: background-color .18s ease, border-color .18s ease;
}

.tnd-range__card:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .34);
  color: var(--tm-text) !important;
}

.tnd-range__card-shot {
  display: block;
  aspect-ratio: 4 / 3;
  background: rgba(255, 255, 255, .04);
  overflow: hidden;
}

.tnd-range__card-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tnd-range__card-name {
  display: block;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
}

@media (max-width: 700px) {
  .tnd-range__cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .tnd-range__card-name { padding: 11px 12px; font-size: 15px; }
}
