/* ==========================================================================
   TTT CMS theme. ALL colours come from the Branding admin, injected as CSS
   variables (--color-*) for light (:root) and dark ([data-theme="dark"]).
   This file only references those variables (with safe fallbacks).
   ========================================================================== */

:root {
    --ttt-max: 1100px;       /* outer container */
    --ttt-content: 760px;    /* reading width for content blocks */
    --ttt-radius: 10px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.65;
    background: var(--color-background, #ffffff);
    color: var(--color-on-background, #1c1b1a);
    transition: background-color .2s ease, color .2s ease;
    /* Sticky footer: header / main / footer stacked, main grows. */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.ttt-no-scroll { overflow: hidden; }

a { color: var(--color-primary, #E4572E); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--color-on-background, #1c1b1a); line-height: 1.2; }

img { max-width: 100%; height: auto; }

.ttt-btn {
    display: inline-block;
    background: var(--color-primary, #E4572E);
    color: var(--color-on-primary, #fff);
    padding: .7rem 1.4rem;
    border: 0;
    border-radius: var(--ttt-radius);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: filter .15s ease;
}
.ttt-btn:hover { filter: brightness(1.08); text-decoration: none; }

/* ---------- Header ---------- */
.ttt-header {
    position: sticky; top: 0; z-index: 500;
    /* Header background + text are admin-overridable for the DAY view via
       --ttt-header-bg/-fg (see CmsSettings::headerColorsCss). Default = surface,
       which matches the night view. Set a darker bg when the logo's light parts
       blend into the surface. */
    background: var(--ttt-header-bg, var(--color-surface, #faf6f2));
    color: var(--ttt-header-fg, var(--color-on-surface, #3a3735));
    box-shadow: 0 1px 10px rgba(0, 0, 0, .08);
}
/* Bar text follows the header colour; the dropdown PANEL keeps the surface
   colours (it is a separate light panel, not part of the coloured bar). */
.ttt-header .ttt-nav a,
.ttt-header .ttt-lang-trigger,
.ttt-header .ttt-login,
.ttt-header .ttt-theme-toggle,
.ttt-header .ttt-burger { color: var(--ttt-header-fg, var(--color-on-surface, #3a3735)); }
.ttt-header__nav .ttt-nav__submenu a { color: var(--color-on-surface, #3a3735); }
.ttt-header__inner {
    max-width: var(--ttt-content); margin: 0 auto;
    /* Only horizontal padding on the shared bar. The vertical breathing room
       lives on the menu + actions (below), NOT on the container — otherwise it
       would also force top/bottom space around the logo. The logo's own spacing
       is admin-configurable (height + margin/padding on .ttt-logo). */
    display: flex; align-items: center; gap: 1rem; padding: 0 1rem;
}
.ttt-header__nav, .ttt-header__actions { padding-block: .55rem; }
.ttt-logo { display: flex; align-items: center; text-decoration: none; }
/* Height is admin-configurable (--ttt-logo-h, set inline); width scales
   automatically to keep the aspect ratio. */
.ttt-logo img { height: var(--ttt-logo-h, 40px); width: auto; max-width: 260px; object-fit: contain; display: block; }
.ttt-logo__text { font-weight: 800; font-size: 1.3rem; color: var(--ttt-header-fg, var(--color-primary, #E4572E)); }
@media (max-width: 640px) {
    /* Never exceed a sensible mobile cap, but honour smaller configured heights. */
    .ttt-logo img { height: min(var(--ttt-logo-h, 40px), 40px); max-width: 60vw; }
}
.ttt-header__nav { flex: 1; }
.ttt-header__actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* header navigation + dropdowns */
.ttt-header__nav .ttt-nav__list { display: flex; gap: .15rem; list-style: none; margin: 0; padding: 0; }
.ttt-header__nav .ttt-nav__submenu { list-style: none; margin: 0; padding: 0; }
.ttt-header__nav .ttt-nav__item { position: relative; }
.ttt-header__nav .ttt-nav a {
    display: block; padding: .5rem .8rem; color: var(--ttt-header-fg, var(--color-on-surface, #3a3735));
    border-radius: 6px; white-space: nowrap;
}
/* Hover tint derived from the current text colour → works on light AND dark headers. */
.ttt-header__nav .ttt-nav a:hover { background: color-mix(in srgb, currentColor 14%, transparent); text-decoration: none; }
.ttt-header__nav .ttt-nav__submenu a:hover { background: rgba(0, 0, 0, .06); }
.ttt-header__nav .ttt-nav__item--has-children > a::after { content: " ▾"; font-size: .8em; }
.ttt-header__nav .ttt-nav__submenu {
    position: absolute; left: 0; top: 100%; min-width: 210px;
    background: var(--color-surface, #fff); box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    border-radius: 8px; padding: .3rem; display: none; z-index: 600;
}
.ttt-header__nav .ttt-nav__item:hover > .ttt-nav__submenu { display: block; }
.ttt-header__nav .ttt-nav__submenu .ttt-nav__submenu { left: 100%; top: 0; }

/* language: trigger button + centered animated modal (no jumpy hover) */
.ttt-lang-trigger {
    background: none; border: 0; cursor: pointer; font: inherit; border-radius: 6px;
    display: inline-flex; align-items: center; gap: .3rem; color: var(--color-on-surface, #3a3735); padding: .35rem .5rem;
}
.ttt-lang-trigger:hover { background: rgba(0, 0, 0, .06); }
.ttt-header .ttt-lang-trigger:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.ttt-footer .ttt-lang-trigger { border: 1px solid var(--color-divider, #ddd); }

.ttt-langmodal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; transition: opacity .22s ease; z-index: 1100; }
.ttt-langmodal-overlay.is-open { opacity: 1; visibility: visible; }
.ttt-langmodal {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -48%) scale(.96);
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .22s ease, transform .22s cubic-bezier(.2, .8, .2, 1), visibility .22s;
    z-index: 1101; width: 340px; max-width: 90vw; max-height: 85vh;
    color: var(--color-on-surface, #3a3735);
    /* Subtle branded background (derived from the brand primary), not plain white. */
    --ttt-modal-bg: var(--color-surface, #faf6f2); /* fallback */
    --ttt-modal-bg: color-mix(in srgb, var(--color-primary, #E4572E) 8%, var(--color-surface, #faf6f2));
    background: var(--ttt-modal-bg);
    border: 1px solid color-mix(in srgb, var(--color-primary, #E4572E) 20%, transparent);
    border-radius: 14px; box-shadow: 0 24px 70px rgba(0, 0, 0, .35); padding: 1.5rem;
}
.ttt-langmodal.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.ttt-langmodal__close { float: right; background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; }
.ttt-langmodal__title { margin: 0 0 1rem; font-size: 1.15rem; }
.ttt-langmodal__scroll { position: relative; }
/* "more below" fade hint; hidden once scrolled to the end. */
.ttt-langmodal__scroll::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 38px; pointer-events: none;
    background: linear-gradient(to top, var(--ttt-modal-bg, #faf6f2), transparent);
    opacity: 1; transition: opacity .2s ease;
}
.ttt-langmodal__scroll.is-end::after { opacity: 0; }
.ttt-langmodal__list { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.ttt-langmodal__list li { margin-bottom: .25rem; }
.ttt-langmodal__list a { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: 9px; text-decoration: none; color: inherit; }
.ttt-langmodal__list a:hover { background: rgba(0, 0, 0, .06); text-decoration: none; }
.ttt-langmodal__list a[aria-current="true"] { background: rgba(0, 0, 0, .06); font-weight: 700; }
.ttt-langmodal__flag { font-size: 1.25rem; }
@media (prefers-reduced-motion: reduce) { .ttt-langmodal { transition: opacity .15s ease; transform: translate(-50%, -50%); } }

/* theme toggle (moon in light, sun in dark) */
.ttt-theme-toggle { background: none; border: 0; cursor: pointer; font-size: 1.15rem; color: var(--color-on-surface, #3a3735); padding: .3rem; }
.ttt-theme-toggle__sun { display: none; }
.ttt-theme-toggle__moon { display: inline; }
[data-theme="dark"] .ttt-theme-toggle__sun { display: inline; }
[data-theme="dark"] .ttt-theme-toggle__moon { display: none; }
.ttt-theme-toggle__label { display: none; }

.ttt-login { color: var(--color-on-surface, #3a3735); font-weight: 600; padding: .4rem .5rem; }
.ttt-burger { display: none; background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: var(--color-on-surface, #3a3735); }

/* ---------- Content blocks ---------- */
.ttt-main { flex: 1 0 auto; }   /* grow so the footer stays at the bottom */
.ttt-heading, .ttt-text, .ttt-image, .ttt-gallery, .ttt-cols, .ttt-divider, .ttt-video, .ttt-map, .ttt-featured, .ttt-cta {
    max-width: var(--ttt-content); margin-left: auto; margin-right: auto; padding-left: 1rem; padding-right: 1rem;
}
/* Heading + text blocks are editable <div>s (so the rich-text toolbar offers
   block tools: H1–H4, lists, alignment, quote). Default look = a section
   heading / a paragraph; formatted content (inner h-tags, lists, p) renders
   cleanly. */
.ttt-heading { margin-top: 2rem; margin-bottom: .6rem; font-weight: 700; font-size: 1.9rem; line-height: 1.25; }
.ttt-heading :where(h1, h2, h3, h4) { margin: 0; }
.ttt-text { margin: 0 auto 1.1rem; }
.ttt-text :where(p, ul, ol) { margin: 0 0 1rem; }
.ttt-text :where(ul, ol) { padding-left: 1.4rem; }
.ttt-text :where(h1, h2, h3, h4) { margin: 1.2rem 0 .5rem; }
.ttt-text blockquote, .ttt-text :where(p, ul, ol, h1, h2, h3, h4):last-child { margin-bottom: 0; }
.ttt-text blockquote {
    margin: 1rem 0; padding: .4rem 0 .4rem 1rem;
    border-left: 3px solid var(--color-primary, #E4572E); color: var(--color-on-surface, #555);
}

/* Editable headings/quotes are now <div phpb-editable> (so the full RTE toolbar
   opens — H/p single-block hosts only get the limited toolbar). As <div>s they
   lose the browser's default heading weight, so restore it here by class. */
.ttt-hero__title, .ttt-cta__title, .ttt-imgtext__title, .ttt-overlay__title,
.ttt-card__title, .ttt-feature__title, .ttt-newsletter__title {
    font-weight: 700; line-height: 1.2;
}

.ttt-hero {
    position: relative; padding: 5rem 1.5rem; text-align: center; color: #fff;
    background: linear-gradient(135deg, var(--color-primary, #E4572E), var(--color-primary-dark, #B23A18));
}
.ttt-hero__inner { max-width: var(--ttt-content); margin: 0 auto; }
.ttt-hero__title { font-size: 2.6rem; margin: 0 0 .5rem; color: #fff; }
.ttt-hero__subtitle { font-size: 1.25rem; opacity: .95; margin: 0 0 1.5rem; }
.ttt-hero .ttt-btn { background: #fff; color: var(--color-primary, #E4572E); }

.ttt-image { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.ttt-image img { width: 100%; border-radius: var(--ttt-radius); display: block; }
.ttt-image figcaption { margin-top: .5rem; font-size: .85rem; color: var(--color-on-surface, #777); text-align: center; }
.ttt-image figcaption:empty { display: none; }

.ttt-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .6rem; margin-top: 1.5rem; margin-bottom: 1.5rem; }
.ttt-gallery img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 8px; }
/* When the gallery hosts full Image blocks (figure), keep the grid tight. */
.ttt-gallery .ttt-image { margin: 0; }
.ttt-gallery .ttt-image figcaption { margin-top: .35rem; }

.ttt-cols { display: grid; gap: 1.5rem; margin-top: 1.5rem; margin-bottom: 1.5rem; }
.ttt-cols--2 { grid-template-columns: repeat(2, 1fr); }
.ttt-cols--3 { grid-template-columns: repeat(3, 1fr); }

.ttt-divider { border: 0; border-top: 1px solid var(--color-divider, #e2e2e2); margin-top: 2.5rem; margin-bottom: 2.5rem; }

.ttt-video iframe, .ttt-map iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--ttt-radius); }
.ttt-video__placeholder, .ttt-map__placeholder { display: flex; align-items: center; justify-content: center; aspect-ratio: 16/9; background: var(--color-surface, #f1f1f1); color: var(--color-on-surface, #888); border-radius: var(--ttt-radius); text-align: center; padding: 1rem; }

.ttt-featured { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; margin-bottom: 1.5rem; }
.ttt-featured__card { display: flex; flex-direction: column; gap: .4rem; padding: 1rem; border: 1px solid var(--color-divider, #e2e2e2); border-radius: var(--ttt-radius); text-decoration: none; color: var(--color-on-surface, inherit); background: var(--color-surface, #fff); }
.ttt-featured__card:hover { border-color: var(--color-primary, #E4572E); }
.ttt-featured__img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 6px; }
.ttt-featured__title { font-weight: 600; }
.ttt-featured__excerpt { color: var(--color-on-surface, #666); font-size: .9rem; }

/* ---------- Footer ---------- */
.ttt-footer { margin-top: 3rem; flex-shrink: 0; background: var(--color-surface, #faf6f2); color: var(--color-on-surface, #3a3735); border-top: 1px solid var(--color-divider, #eee); }
/* Footer spans the full width (independent of the content reading width) so its
   columns spread evenly and the middle one is centred. */
.ttt-footer__inner { max-width: none; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; padding: 2.5rem clamp(1rem, 4vw, 4rem); }
/* First column left, middle column(s) centred, last column right-aligned. */
.ttt-footer__col { text-align: left; }
.ttt-footer__col:not(:first-child):not(:last-child) { text-align: center; }
.ttt-footer__col:last-child { text-align: right; }
.ttt-footer__col h4 { margin: 0 0 .6rem; font-size: 1rem; }
.ttt-footer__col ul { list-style: none; margin: 0; padding: 0; }
.ttt-footer__col li { margin-bottom: .35rem; }
.ttt-footer__col a { color: var(--color-on-surface, #3a3735); }
.ttt-footer__col a:hover { color: var(--color-primary, #E4572E); text-decoration: none; }
.ttt-footer__logo { height: 32px; display: block; margin-bottom: .5rem; }
.ttt-footer__social a { margin-right: .6rem; }
.ttt-footer__bottom { text-align: center; padding: 1rem; border-top: 1px solid var(--color-divider, #eee); font-size: .9rem; }

/* ---------- Mobile off-canvas drawer (slide-in from right) ---------- */
.ttt-drawer {
    position: fixed; top: 0; right: 0; height: 100%; width: 320px; max-width: 85%;
    background: var(--color-surface, #fff); color: var(--color-on-surface, #3a3735);
    transform: translateX(100%); transition: transform .28s ease; z-index: 1000;
    overflow-y: auto; padding: 1.2rem; box-shadow: -8px 0 28px rgba(0, 0, 0, .25);
}
.ttt-drawer.is-open { transform: translateX(0); }
.ttt-drawer__close { background: none; border: 0; font-size: 1.5rem; cursor: pointer; color: inherit; float: right; }
.ttt-drawer__section { margin-top: 1.2rem; clear: both; }
.ttt-drawer__auth { display: flex; flex-direction: column; gap: .6rem; }
.ttt-drawer-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; transition: opacity .28s ease; z-index: 999; }
.ttt-drawer-overlay.is-open { opacity: 1; visibility: visible; }
.ttt-drawer .ttt-nav__list, .ttt-drawer .ttt-nav__submenu { list-style: none; margin: 0; padding: 0; }
.ttt-drawer .ttt-nav__submenu { padding-left: 1rem; }
.ttt-drawer .ttt-nav a { display: block; padding: .6rem .2rem; color: inherit; border-bottom: 1px solid var(--color-divider, #eee); }
.ttt-drawer .ttt-theme-toggle__label { display: inline; margin-left: .4rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .ttt-header__nav,
    .ttt-header__actions .ttt-lang-trigger,
    .ttt-header__actions .ttt-login,
    .ttt-header__actions .ttt-register { display: none; }
    .ttt-burger { display: inline-block; }
}
@media (max-width: 640px) {
    .ttt-cols--2, .ttt-cols--3 { grid-template-columns: 1fr; }
    .ttt-hero { padding: 3.5rem 1.25rem; }
    .ttt-hero__title { font-size: 2rem; }
}

/* ---------- Contact / forms ---------- */
.ttt-form-page { max-width: var(--ttt-content); margin: 0 auto; padding: 2rem 1rem 3rem; }
/* Compact, centred form (not edge-to-edge). */
.ttt-form { display: flex; flex-direction: column; gap: .9rem; margin: 1.5rem auto 0; max-width: 560px; }
.ttt-form__row { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; }
.ttt-field { display: flex; flex-direction: column; gap: .35rem; }
.ttt-field label { font-weight: 600; }
.ttt-field input, .ttt-field textarea {
    font: inherit; padding: .65rem .85rem; border-radius: 8px; width: 100%;
    /* Clear, contrasty border (derived from the text colour, works light + dark). */
    border: 1.5px solid color-mix(in srgb, var(--color-on-background, #1c1b1a) 28%, transparent);
    background: var(--color-background, #fff); color: var(--color-on-background, #1c1b1a);
}
.ttt-field input::placeholder, .ttt-field textarea::placeholder { color: color-mix(in srgb, var(--color-on-background, #1c1b1a) 45%, transparent); }
.ttt-field textarea { resize: vertical; }
.ttt-field input:focus, .ttt-field textarea:focus {
    outline: none; border-color: var(--color-primary, #E4572E);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #E4572E) 22%, transparent);
}
.ttt-field__error { color: var(--color-error, #E53935); font-size: .85rem; }
.ttt-form .ttt-btn { align-self: flex-start; }
.ttt-alert { padding: .9rem 1.1rem; border-radius: 8px; margin: 1rem 0; }
.ttt-alert--success { background: color-mix(in srgb, var(--color-success, #4CAF50) 15%, var(--color-surface, #fff)); border: 1px solid var(--color-success, #4CAF50); }
.ttt-alert--error { background: color-mix(in srgb, var(--color-error, #E53935) 12%, var(--color-surface, #fff)); border: 1px solid var(--color-error, #E53935); }
.ttt-field--np { position: absolute !important; left: -9999px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

@media (max-width: 560px) {
    .ttt-form__row { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Block library — extra blocks. All colours via branding --color-* variables.
   Centred to the content width (full-width banners opt out below).
   ========================================================================== */
.ttt-cards, .ttt-features, .ttt-stats, .ttt-testimonial, .ttt-imgtext,
.ttt-accordion, .ttt-tabs, .ttt-btngroup, .ttt-newsletter, .ttt-social {
    max-width: var(--ttt-content); margin: 1.6rem auto; padding-left: 1rem; padding-right: 1rem;
}

/* ---------- Buttons: ghost variant + group ---------- */
.ttt-btn--ghost {
    background: transparent; color: var(--color-primary, #E4572E);
    box-shadow: inset 0 0 0 2px var(--color-primary, #E4572E);
}
.ttt-btn--ghost:hover { background: color-mix(in srgb, var(--color-primary, #E4572E) 10%, transparent); }
.ttt-btngroup { display: flex; flex-wrap: wrap; gap: .8rem; }

/* ---------- 4 columns + spacer ---------- */
.ttt-cols--4 { grid-template-columns: repeat(4, 1fr); }
.ttt-col { min-width: 0; }
.ttt-spacer { width: 100%; }

/* ---------- Card grid ---------- */
/* Cards grid: columns-per-row from the data-cols trait (2/3/4). Even fractions
   (repeat(N, 1fr)) so card widths derive automatically from the column count and
   the gap — no hardcoded percentages. Responsive: chosen count on desktop, capped
   to 2 on tablet, 1 on mobile. */
.ttt-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; }
.ttt-cards[data-cols="2"] { grid-template-columns: repeat(2, 1fr); }
.ttt-cards[data-cols="3"] { grid-template-columns: repeat(3, 1fr); }
.ttt-cards[data-cols="4"] { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
    .ttt-cards[data-cols="3"], .ttt-cards[data-cols="4"] { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .ttt-cards, .ttt-cards[data-cols="2"], .ttt-cards[data-cols="3"], .ttt-cards[data-cols="4"] { grid-template-columns: 1fr; }
}
.ttt-card {
    display: flex; flex-direction: column; background: var(--color-surface, #fff);
    border: 1px solid var(--color-divider, #e7e1da); border-radius: var(--ttt-radius);
    overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.ttt-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0, 0, 0, .1); }
.ttt-card__img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.ttt-card__body { display: flex; flex-direction: column; gap: .5rem; padding: 1.1rem; }
.ttt-card__title { margin: 0; font-size: 1.15rem; }
.ttt-card__text { margin: 0; color: var(--color-on-surface, #666); font-size: .95rem; flex: 1; }
.ttt-card .ttt-btn { align-self: flex-start; }

/* ---------- CTA banner (full width) ---------- */
.ttt-cta {
    max-width: none; margin: 2rem 0; padding: 3.5rem 1.5rem; text-align: center; color: #fff;
    background: linear-gradient(135deg, var(--color-primary, #E4572E), var(--color-primary-dark, #B23A18));
}
.ttt-cta__inner { max-width: var(--ttt-content); margin: 0 auto; }
.ttt-cta__title { color: #fff; margin: 0 0 .5rem; font-size: 1.9rem; }
.ttt-cta__text { margin: 0 0 1.4rem; opacity: .95; font-size: 1.1rem; }
.ttt-cta__btn { background: #fff; color: var(--color-primary, #E4572E); }

/* ---------- Testimonial ---------- */
.ttt-testimonial {
    text-align: center; background: var(--color-surface, #faf6f2);
    border-radius: var(--ttt-radius); padding: 2rem 1.5rem; margin-left: auto; margin-right: auto;
}
.ttt-testimonial__stars { color: var(--color-primary, #E4572E); letter-spacing: .15em; font-size: 1.1rem; }
.ttt-testimonial__quote { font-size: 1.3rem; line-height: 1.5; margin: .8rem auto 1.2rem; max-width: 38ch; border: 0; }
.ttt-testimonial__author { display: inline-flex; align-items: center; gap: .8rem; }
.ttt-testimonial__avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.ttt-testimonial__meta { text-align: left; font-size: .9rem; }

/* ---------- Features ---------- */
.ttt-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }
.ttt-feature { text-align: center; }
.ttt-feature__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 58px; height: 58px; border-radius: 50%; font-size: 1.5rem; margin-bottom: .6rem;
    background: color-mix(in srgb, var(--color-primary, #E4572E) 14%, transparent);
    color: var(--color-primary, #E4572E);
}
.ttt-feature__title { margin: 0 0 .3rem; font-size: 1.15rem; }
.ttt-feature__text { margin: 0; color: var(--color-on-surface, #666); font-size: .95rem; }

/* ---------- Stats ---------- */
.ttt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.2rem; text-align: center; }
.ttt-stat__num { font-size: 2.3rem; font-weight: 800; color: var(--color-primary, #E4572E); line-height: 1.1; }
.ttt-stat__label { color: var(--color-on-surface, #666); font-size: .95rem; margin-top: .2rem; }

/* ---------- Image + text ---------- */
.ttt-imgtext { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: center; }
.ttt-imgtext--reverse .ttt-imgtext__media { order: 2; }
.ttt-imgtext__media img { width: 100%; border-radius: var(--ttt-radius); display: block; }
.ttt-imgtext__title { margin-top: 0; }

/* ---------- Full-width image with text overlay ---------- */
.ttt-overlay { position: relative; margin: 2rem 0; }
.ttt-overlay__img { width: 100%; max-height: 460px; object-fit: cover; display: block; }
.ttt-overlay__content {
    position: absolute; inset: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center; gap: .8rem;
    padding: 1.5rem; color: #fff; background: rgba(0, 0, 0, .4);
}
.ttt-overlay__title { color: #fff; margin: 0; font-size: 2.2rem; }
.ttt-overlay__text { margin: 0; font-size: 1.2rem; opacity: .95; }

/* ---------- Accordion (native details) ---------- */
.ttt-accordion__item { border: 1px solid var(--color-divider, #e7e1da); border-radius: var(--ttt-radius); margin-bottom: .6rem; overflow: hidden; background: var(--color-surface, #fff); }
.ttt-accordion__head { cursor: pointer; padding: .9rem 1.1rem; font-weight: 700; list-style: none; position: relative; }
.ttt-accordion__head::-webkit-details-marker { display: none; }
.ttt-accordion__head::after { content: "+"; position: absolute; right: 1.1rem; color: var(--color-primary, #E4572E); font-weight: 700; }
.ttt-accordion__item[open] .ttt-accordion__head::after { content: "–"; }
.ttt-accordion__body { padding: 0 1.1rem 1rem; color: var(--color-on-surface, #555); }

/* ---------- Tabs ---------- */
.ttt-tabs__nav { display: flex; flex-wrap: wrap; gap: .3rem; border-bottom: 2px solid var(--color-divider, #e7e1da); }
.ttt-tabs__tab {
    border: 0; background: none; cursor: pointer; font: inherit; font-weight: 600;
    padding: .6rem 1rem; color: var(--color-on-surface, #777); border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.ttt-tabs__tab.is-active { color: var(--color-primary, #E4572E); border-bottom-color: var(--color-primary, #E4572E); }
.ttt-tabs__panel { display: none; padding: 1.2rem 0; }
.ttt-tabs__panel.is-active { display: block; }

/* ---------- Slider (Swiper.js) ----------
   The slider is a server-side dynamic block rendering the chosen admin slider.
   Swiper handles the carousel: layout, transitions (slide/fade), navigation and
   pagination — and runs in BOTH the published page and the editor canvas, so the
   preview matches 1:1. This file styles the chrome — fixed band height, image fit
   + PER-SLIDE vertical crop — and themes Swiper's arrows/bullets with the brand
   colour. Options come from data-attributes via slider.js (see --vars below). */
.ttt-slider {
    position: relative;
    max-width: var(--ttt-content); margin: 0 auto;
    --ttt-slider-h: 460px;          /* desktop band height */
    --ttt-slider-h-mobile: 240px;   /* mobile band height (<= 640px) */
    --ttt-slider-fit: cover;        /* cover = fill+crop (default); contain = whole image */
    --ttt-slider-radius: 0px;       /* slide corner radius (slider-wide) */
    /* Theme Swiper's nav arrows + pagination bullets with the brand colour. */
    --swiper-theme-color: var(--color-primary, #E4572E);
    --swiper-navigation-size: 26px;
}
/* Placeholder shown when the block has no slider chosen yet (editor + page). */
.ttt-slider--empty {
    display: flex; align-items: center; justify-content: center;
    min-height: 120px; padding: 1.5rem; text-align: center;
    color: var(--color-on-surface-variant, #666);
    background: var(--color-surface, #f1f1f1);
    border: 1px dashed var(--color-outline, #ccc); border-radius: 8px;
}
.ttt-slider__slide {
    position: relative;
    height: var(--ttt-slider-h); max-height: 85vh; overflow: hidden;
    background: var(--color-surface, #f1f1f1); border-radius: var(--ttt-slider-radius);
}
.ttt-slider__img {
    width: 100%; height: 100%; display: block;
    object-fit: var(--ttt-slider-fit);
    /* PER-SLIDE vertical crop: each slide carries its own --ttt-slide-pos-y
       (set from its data-posy by slider.js); pure CSS, independent of Swiper. */
    object-position: center var(--ttt-slide-pos-y, 50%);
}
/* Mobile height — AFTER the base rule so it wins the cascade. */
@media (max-width: 640px) {
    .ttt-slider__slide { height: var(--ttt-slider-h-mobile); }
}
/* When Swiper is running (frontend only), the CONTAINER drives the band height.
   Swiper's own CSS sets `.swiper-slide{height:auto}` (loaded after this file), so
   without this the configured height collapses to the image's natural height.
   Higher-specificity + scoped to .swiper-initialized so the editor (no Swiper,
   stacked view) is unaffected. */
.ttt-slider.swiper-initialized { height: var(--ttt-slider-h); max-height: 85vh; }
.ttt-slider.swiper-initialized .ttt-slider__slide { height: 100%; max-height: none; }
@media (max-width: 640px) { .ttt-slider.swiper-initialized { height: var(--ttt-slider-h-mobile); } }
/* Keep Swiper's pagination bullets inside the band. */
.ttt-slider .swiper-pagination { bottom: 8px; z-index: 3; }

/* ----- Per-slide text overlay (heading/subtext/button) -----
   The overlay fills the slide; alignment (flex + text-align) is driven by the
   data-vd/hd (desktop) and data-vm/hm (mobile) attributes the block writes from
   the per-image position. The caption gets a soft scrim + text-shadow so text
   stays readable over any image. */
.ttt-slider__overlay {
    position: absolute; inset: 0; z-index: 2; display: flex;
    box-sizing: border-box; padding: clamp(14px, 4vw, 48px);
    pointer-events: none; /* clicks fall through to the slide, only the caption is interactive */
}
.ttt-slider__caption {
    pointer-events: auto; max-width: min(620px, 82%);
    color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .6);
    background: rgba(0, 0, 0, .30); border-radius: 12px;
    padding: clamp(.7rem, 2.2vw, 1.2rem) clamp(.9rem, 2.6vw, 1.5rem);
}
.ttt-slider__heading { margin: 0; font-weight: 800; line-height: 1.15; font-size: clamp(1.3rem, 3.2vw, 2.3rem); color: #fff; }
.ttt-slider__subtext { margin: .35em 0 0; line-height: 1.4; font-size: clamp(.95rem, 1.7vw, 1.15rem); color: #fff; }
.ttt-slider__btn {
    display: inline-block; margin-top: .9em; padding: .6em 1.3em; border-radius: 999px;
    background: var(--color-primary, #E4572E); color: var(--color-on-primary, #fff);
    font-weight: 700; text-decoration: none; text-shadow: none;
}
/* Desktop placement (> 640px). */
@media (min-width: 641px) {
    .ttt-slider__overlay[data-vd="top"]    { align-items: flex-start; }
    .ttt-slider__overlay[data-vd="middle"] { align-items: center; }
    .ttt-slider__overlay[data-vd="bottom"] { align-items: flex-end; }
    .ttt-slider__overlay[data-hd="left"]   { justify-content: flex-start; }
    .ttt-slider__overlay[data-hd="center"] { justify-content: center; }
    .ttt-slider__overlay[data-hd="right"]  { justify-content: flex-end; }
    .ttt-slider__overlay[data-hd="left"]   .ttt-slider__caption { text-align: left; }
    .ttt-slider__overlay[data-hd="center"] .ttt-slider__caption { text-align: center; }
    .ttt-slider__overlay[data-hd="right"]  .ttt-slider__caption { text-align: right; }
}
/* Mobile placement (<= 640px). */
@media (max-width: 640px) {
    .ttt-slider__overlay[data-vm="top"]    { align-items: flex-start; }
    .ttt-slider__overlay[data-vm="middle"] { align-items: center; }
    .ttt-slider__overlay[data-vm="bottom"] { align-items: flex-end; }
    .ttt-slider__overlay[data-hm="left"]   { justify-content: flex-start; }
    .ttt-slider__overlay[data-hm="center"] { justify-content: center; }
    .ttt-slider__overlay[data-hm="right"]  { justify-content: flex-end; }
    .ttt-slider__overlay[data-hm="left"]   .ttt-slider__caption { text-align: left; }
    .ttt-slider__overlay[data-hm="center"] .ttt-slider__caption { text-align: center; }
    .ttt-slider__overlay[data-hm="right"]  .ttt-slider__caption { text-align: right; }
}

/* ---------- Newsletter ---------- */
.ttt-newsletter {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem;
    background: var(--color-surface, #faf6f2); border: 1px solid var(--color-divider, #e7e1da);
    border-radius: var(--ttt-radius); padding: 1.6rem 1.8rem;
}
.ttt-newsletter__title { margin: 0 0 .2rem; }
.ttt-newsletter__sub { margin: 0; color: var(--color-on-surface, #666); }
.ttt-newsletter__form { display: flex; gap: .6rem; flex: 1; min-width: 260px; }
.ttt-newsletter__input {
    flex: 1; font: inherit; padding: .65rem .85rem; border-radius: 8px;
    border: 1.5px solid color-mix(in srgb, var(--color-on-background, #1c1b1a) 28%, transparent);
    background: var(--color-background, #fff); color: var(--color-on-background, #1c1b1a);
}
.ttt-newsletter__input:focus { outline: 0; border-color: var(--color-primary, #E4572E); box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary, #E4572E) 20%, transparent); }

/* ---------- Social links ---------- */
.ttt-social { display: flex; flex-wrap: wrap; gap: .7rem; justify-content: center; }
.ttt-social__link {
    padding: .5rem 1rem; border-radius: 999px; font-weight: 600;
    background: color-mix(in srgb, var(--color-primary, #E4572E) 10%, transparent);
    color: var(--color-primary, #E4572E);
}
.ttt-social__link:hover { background: var(--color-primary, #E4572E); color: var(--color-on-primary, #fff); text-decoration: none; }
.ttt-social__hint { color: var(--color-on-surface, #888); text-align: center; }

/* ---------- Block library responsive ---------- */
@media (max-width: 720px) {
    .ttt-cols--4 { grid-template-columns: repeat(2, 1fr); }
    .ttt-imgtext { grid-template-columns: 1fr; }
    .ttt-imgtext--reverse .ttt-imgtext__media { order: 0; }
    .ttt-overlay__title { font-size: 1.6rem; }
    .ttt-newsletter { flex-direction: column; align-items: stretch; text-align: center; }
}
@media (max-width: 480px) {
    .ttt-cols--4 { grid-template-columns: 1fr; }
    .ttt-newsletter__form { flex-direction: column; }
}
