/* Reviews ticker, reviews + contact sections added to the StemTube pages when they are
   hosted on Unraid. Uses the design tokens of the site's own css/style.css (same in both
   editions). */

:root { --cm-star: #f5b942; --cm-star-off: #3a3a4c; }

/* ── Reviews ticker, under the menu ───────────────────────────── */
.cm-ticker {
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
    font-size: 0.85rem;
}
/* Room for it above the hero text. */
.hero { padding-top: 148px; }

.cm-ticker-badge,
.cm-ticker-cta {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    transition: var(--transition);
}
.cm-ticker-badge i { color: var(--cm-star); }
.cm-ticker-badge strong { color: var(--text-primary); font-family: var(--font-mono); }
.cm-ticker-cta { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.cm-ticker-badge:hover,
.cm-ticker-cta:hover { border-color: var(--accent); color: var(--text-primary); }
.cm-ticker-badge[hidden] { display: none; }

.cm-ticker-view {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(18, 18, 26, 0.7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}
.cm-ticker-view.cm-scrolling {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 48px, #000 calc(100% - 48px), transparent);
}
.cm-ticker-track {
    display: inline-flex;
    align-items: center;
    height: 100%;
    white-space: nowrap;
    padding: 0 18px;
    will-change: transform;
}
.cm-scrolling .cm-ticker-track {
    padding: 0;
    animation: cm-ticker var(--cm-ticker-time, 60s) linear infinite;
}
.cm-ticker-view:hover .cm-ticker-track,
.cm-ticker-view:focus-within .cm-ticker-track { animation-play-state: paused; }
@keyframes cm-ticker { to { transform: translateX(-50%); } }
[dir="rtl"] .cm-scrolling .cm-ticker-track { animation-direction: reverse; }

.cm-tick {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 22px;
    color: var(--text-secondary);
    border-inline-end: 1px solid var(--border);
    height: 16px;
    line-height: 16px;
}
.cm-tick:hover .cm-tick-text { color: var(--text-primary); }
.cm-tick-text { transition: color var(--transition); }
.cm-tick-author { color: var(--text-primary); font-weight: 600; }
.cm-tick-empty { color: var(--text-secondary); padding: 0 4px; border: 0; }

.cm-stars { color: var(--cm-star); letter-spacing: 1px; font-size: 0.8rem; white-space: nowrap; }
.cm-stars i.cm-off { color: var(--cm-star-off); }
.cm-stars-lg { font-size: 1.15rem; letter-spacing: 3px; }

@media (prefers-reduced-motion: reduce) {
    .cm-scrolling .cm-ticker-track { animation: none; }
    .cm-ticker-view.cm-scrolling { overflow-x: auto; scrollbar-width: none; }
}

/* ── Sections ─────────────────────────────────────────────────── */
.cm-section { background: var(--bg-secondary); }
.cm-section.cm-contact { background: var(--bg-primary); }

.cm-subtitle {
    color: var(--text-secondary);
    max-width: 640px;
    margin-bottom: 40px;
    font-size: 1.05rem;
}

.cm-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    max-width: 820px;
}

/* ── Published reviews ────────────────────────────────────────── */
.cm-summary { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.cm-summary[hidden] { display: none; }
.cm-summary-avg { font-family: var(--font-mono); font-size: 2.6rem; font-weight: 800; line-height: 1; }
.cm-summary-count { color: var(--text-secondary); font-size: 0.95rem; }

.cm-reviews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}
.cm-reviews:empty { display: none; }
.cm-review {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: var(--transition);
}
.cm-review:hover { border-color: var(--text-muted); transform: translateY(-2px); }
.cm-review[hidden] { display: none; }
.cm-review-text { color: var(--text-secondary); line-height: 1.7; white-space: pre-line; overflow-wrap: anywhere; flex: 1; }
.cm-review-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-muted); }
.cm-review-author { color: var(--text-primary); font-weight: 700; }
.cm-chip {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 999px;
    padding: 3px 10px;
}
.cm-more { margin-bottom: 40px; }
.cm-more[hidden] { display: none; }
.cm-review-form { margin-top: 16px; }
.cm-form-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 20px; }

/* ── Forms ────────────────────────────────────────────────────── */
.cm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cm-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; min-width: 0; border: 0; }
.cm-field label, .cm-field legend { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); }
.cm-field legend { margin-bottom: 8px; padding: 0; }

.cm-field input[type="text"],
.cm-field input[type="email"],
.cm-field textarea {
    width: 100%;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    font: inherit;
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.cm-field textarea { resize: vertical; min-height: 110px; }
.cm-contact .cm-field textarea { min-height: 140px; }
.cm-field input:focus,
.cm-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.cm-form.cm-tried input:invalid,
.cm-form.cm-tried textarea:invalid { border-color: var(--accent); }

/* Star picker: radios in reverse order, so that "this star and the ones before" is
   "this label and the following siblings". */
.cm-rating-stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.cm-rating-stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cm-rating-stars label { cursor: pointer; font-size: 1.7rem; line-height: 1; color: var(--cm-star-off); transition: color 0.15s, transform 0.15s; }
.cm-rating-stars label span { position: absolute; left: -99999px; }
.cm-rating-stars label:hover,
.cm-rating-stars label:hover ~ label,
.cm-rating-stars input:checked ~ label { color: var(--cm-star); }
.cm-rating-stars label:hover { transform: scale(1.15); }
.cm-rating-stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.cm-form.cm-tried .cm-rating-stars:not(:has(input:checked)) label { color: rgba(229, 57, 53, 0.45); }

.cm-actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.cm-actions .btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.cm-status { font-size: 0.9rem; color: var(--text-secondary); min-height: 1.4em; flex: 1 1 240px; }
.cm-status.cm-ok { color: #6fcf97; }
.cm-status.cm-err { color: #ff8a80; }

/* Honeypot: off-screen, never shown to people. */
.cm-hp { position: absolute; left: -99999px; width: 1px; height: 1px; overflow: hidden; }

.cm-privacy { margin-top: 28px; font-size: 0.8rem; color: var(--text-muted); max-width: 820px; }
.cm-privacy i { margin-right: 6px; }

/* ── Menu: two more entries must not make the bar wrap ─────────── */
@media (min-width: 769px) {
    .nav-links { gap: 22px; }
    .nav-links a { white-space: nowrap; }
}
/* Not enough room next to the long labels of some languages: there the two entries
   stay in the footer only (and in the mobile menu below 769px). */
@media (min-width: 769px) and (max-width: 1519px) {
    .nav-links .cm-nav { display: none; }
}
/* On wide screens the bar may use more than the 1200px of the page column. */
@media (min-width: 1520px) {
    .nav-inner { max-width: 1440px; }
}

@media (max-width: 720px) {
    .cm-row { grid-template-columns: 1fr; gap: 0; }
    .cm-card { padding: 22px 18px; }
    .cm-ticker { top: 72px; gap: 8px; padding: 0 16px; font-size: 0.8rem; }
    .cm-ticker-cta span { display: none; }
    .cm-ticker-cta { padding: 0 12px; }
    .cm-ticker-badge span { display: none; }
    .cm-reviews { grid-template-columns: 1fr; }
}
