/* Watts' Tops Testimonials - front-end styles */

/* ---------- Grid ---------- */
.wt-testimonials-grid {
    display: grid;
    grid-template-columns: repeat(var(--wt-columns, 3), minmax(0, 1fr));
    gap: 24px;
    margin: 32px 0;
    align-items: start; /* cards size to their content so text-only cards don't stretch */
}
@media (max-width: 900px) { .wt-testimonials-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .wt-testimonials-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Card ---------- */
.wt-card {
    background: #faf9f7;
    border: 1px solid #e5e0d8;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
    transition: box-shadow .2s ease;
}
.wt-card:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .08); }
.wt-media { min-width: 0; }
.wt-body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.wt-stars { color: #c9a227; font-size: 18px; letter-spacing: 2px; margin-bottom: 12px; }
.wt-testimonial-text { font-style: italic; line-height: 1.6; flex-grow: 1; margin-bottom: 16px; }
.wt-card .wt-testimonial-text p { margin: 0 0 .8em; padding: 0; }
.wt-card .wt-testimonial-text p:last-child { margin-bottom: 0; }
.wt-testimonial-text > p:first-child::before { content: "\201C"; }
.wt-testimonial-text > p:last-child::after { content: "\201D"; }
.wt-testimonial-author { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-weight: 600; }
.wt-location { font-weight: 400; color: #777; }
.wt-model { margin-top: 4px; font-size: 13px; color: #8a7f6e; text-transform: none; }
.wt-disclosure { margin-top: 6px; font-size: 13px; line-height: 1.45; color: #6b6458; font-style: italic; }
.wt-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
    margin-top: 10px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #eaf3ea;
    color: #2f6b34;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}
.wt-empty { color: #777; font-style: italic; }

/* Product pages (WooCommerce) */
.wt-product-testimonials { clear: both; margin: 40px 0 8px; }
.wt-product-testimonials .wt-testimonials-grid { margin-top: 16px; }

/* ---------- Clickable image tile (shared) ---------- */
.wt-card .wt-img {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    background: #e9e5de;
    cursor: zoom-in;
    line-height: 0;
    text-decoration: none;
    border: 0;
}
.wt-card .wt-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    margin: 0;
    transition: transform .35s ease;
}
.wt-card .wt-img:hover img { transform: scale(1.03); }
.wt-card .wt-img:focus-visible,
.wt-card .wt-thumb:focus-visible { outline: 3px solid #c9a227; outline-offset: -3px; }

.wt-more {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
    padding: 5px 11px;
    border-radius: 999px;
    pointer-events: none;
}
.wt-more-overlay {
    inset: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    background: rgba(0, 0, 0, .5);
}

/* ---------- Layout: mosaic (2-3 photos) ---------- */
.wt-mosaic { display: grid; gap: 3px; aspect-ratio: 4 / 3; background: #faf9f7; }
.wt-mosaic .wt-img { aspect-ratio: auto; min-height: 0; }
.wt-mosaic.wt-n2 { grid-template-columns: 1fr 1fr; }
.wt-mosaic.wt-n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.wt-mosaic.wt-n3 .wt-img:first-child { grid-row: 1 / span 2; }

/* ---------- Layout: carousel ---------- */
.wt-carousel { position: relative; }
.wt-slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.wt-slides::-webkit-scrollbar { display: none; }
.wt-slides:focus-visible { outline: 3px solid #c9a227; outline-offset: -3px; }
.wt-card .wt-slides .wt-slide { flex: 0 0 100%; scroll-snap-align: center; }
.wt-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .88);
    color: #222;
    font-size: 26px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
    z-index: 2;
}
.wt-nav:hover { background: #fff; }
.wt-nav[disabled] { opacity: .35; cursor: default; }
.wt-prev { left: 10px; }
.wt-next { right: 10px; }
.wt-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    background: rgba(0, 0, 0, .65);
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
    padding: 5px 11px;
    border-radius: 999px;
    z-index: 2;
    pointer-events: none;
}

/* ---------- Layout: gallery (large photo + thumbnails) ---------- */
.wt-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: #f1eee8; scrollbar-width: thin; }
.wt-thumb {
    flex: 0 0 64px;
    height: 64px;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    border: 2px solid transparent;
    opacity: .7;
    line-height: 0;
    transition: opacity .15s ease;
}
.wt-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; margin: 0; }
.wt-thumb:hover { opacity: 1; }
.wt-thumb.is-active { opacity: 1; border-color: #c9a227; }

/* ---------- Layout: spotlight (wide card: photos left, quote right) ---------- */
.wt-layout-spotlight { grid-column: 1 / -1; flex-direction: row; }
.wt-layout-spotlight .wt-media { flex: 0 0 46%; max-width: 46%; }
.wt-layout-spotlight .wt-body { justify-content: center; padding: 32px 36px; }
.wt-layout-spotlight .wt-testimonial-text { font-size: 1.15em; flex-grow: 0; }
@media (max-width: 700px) {
    .wt-layout-spotlight { flex-direction: column; }
    .wt-layout-spotlight .wt-media { flex: none; max-width: 100%; }
    .wt-layout-spotlight .wt-body { padding: 22px 24px 24px; }
}

/* ---------- Lightbox (bounded, never full-bleed image) ---------- */
.wt-lb {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 15, .88);
}
.wt-lb[hidden] { display: none; }
.wt-lb-fig { margin: 0; text-align: center; max-width: 92vw; }
.wt-lb-fig img {
    display: block;
    margin: 0 auto;
    max-width: min(92vw, 1100px);
    max-height: 76vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.wt-lb-fig figcaption { color: #e8e4dc; font-size: 14px; margin-top: 12px; }
.wt-lb button {
    position: absolute;
    border: 0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    padding: 0;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 30px;
    line-height: 42px;
    cursor: pointer;
}
.wt-lb button:hover, .wt-lb button:focus-visible { background: rgba(255, 255, 255, .3); outline: 0; }
.wt-lb-close { top: 16px; right: 16px; }
.wt-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.wt-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
body.wt-lb-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
    .wt-card, .wt-card .wt-img img, .wt-thumb { transition: none; }
    .wt-card .wt-img:hover img { transform: none; }
}

/* ---------- Submission form ---------- */
.wt-testimonial-form-wrap { margin: 32px 0; }

/* Title and form both run the full width of the page content, left-aligned. */
.wt-form-section { margin: 40px 0 32px; }
.wt-form-section .wt-form-title { margin: 0 0 16px; text-align: left; }
.wt-form-section .wt-testimonial-form-wrap { margin-top: 0; margin-bottom: 0; }

/* Collapsible form (default): a single bar until the visitor opens it */
.wt-form-toggle { border: 1px solid #e5e0d8; border-radius: 10px; background: #faf9f7; }
.wt-form-toggle > .wt-form-summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    color: #222;
    border-radius: 10px;
    user-select: none;
}
.wt-form-toggle > .wt-form-summary::-webkit-details-marker { display: none; }
.wt-form-toggle > .wt-form-summary::marker { content: ""; }
.wt-form-toggle > .wt-form-summary::after {
    content: "";
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-right: 2px solid #8a7f6e;
    border-bottom: 2px solid #8a7f6e;
    transform: rotate(45deg);
    margin-top: -4px;
    transition: transform .2s ease;
}
.wt-form-toggle[open] > .wt-form-summary::after { transform: rotate(-135deg); margin-top: 4px; }
.wt-form-toggle > .wt-form-summary:hover { background: #f3f0ea; }
.wt-form-toggle > .wt-form-summary:focus-visible { outline: 3px solid #c9a227; outline-offset: 2px; }
.wt-form-toggle[open] > .wt-form-summary { border-bottom: 1px solid #e5e0d8; border-radius: 10px 10px 0 0; }

/* Closed: a compact button-sized bar, only as wide as its text. Open: full width. */
.wt-form-toggle:not([open]) { width: fit-content; max-width: 100%; }
.wt-form-toggle:not([open]) > .wt-form-summary { padding: 9px 16px; font-size: 15px; gap: 14px; }
.wt-form-panel { padding: 16px 18px 6px; }
.wt-form-intro { margin: 0 0 12px; color: #555; }
@media (prefers-reduced-motion: reduce) { .wt-form-toggle > .wt-form-summary::after { transition: none; } }
.wt-testimonial-form label { font-weight: 600; }
.wt-testimonial-form input[type=text],
.wt-testimonial-form input[type=email],
.wt-testimonial-form select,
.wt-testimonial-form textarea {
    width: 100%;
    padding: 10px;
    margin-top: 4px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
}
.wt-submit-btn { background: #222; color: #fff; border: none; padding: 12px 28px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.wt-submit-btn:hover { background: #444; }
.wt-form-success { background: #eaf6ea; border: 1px solid #b6dab6; padding: 14px; border-radius: 6px; }
.wt-form-error { background: #fbeaea; border: 1px solid #e3b6b6; padding: 14px; border-radius: 6px; }
.wt-form-closed { background: #f4f2ee; border: 1px solid #e5e0d8; padding: 14px; border-radius: 6px; }
.wt-testimonial-form .wt-models { border: 0; margin: 0 0 1em; padding: 0; min-width: 0; }
.wt-testimonial-form .wt-models legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.wt-testimonial-form .wt-models .wt-optional { font-weight: 400; color: #777; font-size: 13px; }
/* Options flow side by side and wrap as whole items: a checkbox never separates
   from its text, and an item's text never breaks across lines. */
.wt-testimonial-form .wt-model-options { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.wt-testimonial-form .wt-models label.wt-model-option {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    max-width: 100%;
    cursor: pointer;
}
.wt-testimonial-form .wt-models label.wt-model-option input[type=checkbox] { margin: 0; flex: 0 0 auto; width: auto; }
.wt-testimonial-form .wt-hint { display: block; color: #777; font-size: 13px; margin-top: 4px; }
.wt-testimonial-form .wt-consent label { font-weight: 400; display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }
.wt-testimonial-form .wt-consent input[type=checkbox] { margin-top: 4px; flex: 0 0 auto; }

/* ---------- Arrangements (shortcode arrange="...") ---------- */

/* masonry: cards packed into columns so short and long entries sit together without gaps.
   Reading order runs down each column. */
.wt-testimonials-grid.wt-arrange-masonry { display: block; column-count: var(--wt-columns, 3); column-gap: 24px; }
@media (max-width: 900px) { .wt-testimonials-grid.wt-arrange-masonry { column-count: 2; } }
@media (max-width: 600px) { .wt-testimonials-grid.wt-arrange-masonry { column-count: 1; } }
.wt-arrange-masonry .wt-card {
    width: 100%;
    margin: 0 0 24px;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
}
.wt-arrange-masonry .wt-layout-spotlight { flex-direction: column; }
.wt-arrange-masonry .wt-layout-spotlight .wt-media { flex: none; max-width: 100%; }

/* list: one card per row; photos sit beside the text on wide screens. */
.wt-testimonials-grid.wt-arrange-list { grid-template-columns: repeat(var(--wt-columns, 1), minmax(0, 1fr)); }
@media (max-width: 900px) { .wt-testimonials-grid.wt-arrange-list { grid-template-columns: minmax(0, 1fr); } }
.wt-arrange-list .wt-card.wt-has-media { flex-direction: row; }
.wt-arrange-list .wt-card.wt-has-media .wt-media { flex: 0 0 34%; max-width: 34%; }
.wt-arrange-list .wt-layout-spotlight .wt-media { flex: 0 0 46%; max-width: 46%; }
@media (max-width: 700px) {
    .wt-arrange-list .wt-card.wt-has-media { flex-direction: column; }
    .wt-arrange-list .wt-card.wt-has-media .wt-media { flex: none; max-width: 100%; }
}

/* ---------- Read more (shortcode clamp="N") ----------
   Only applied once the script has run (.wt-clamp-ready), so without JavaScript
   the full text is always shown. */
.wt-clamp-ready .wt-testimonial-text { position: relative; flex-grow: 0; }
.wt-clamp-ready .wt-card:not(.is-expanded) .wt-testimonial-text {
    max-height: calc(var(--wt-clamp, 6) * 1.6em);
    overflow: hidden;
}
.wt-clamp-ready .wt-card.is-clamped:not(.is-expanded) .wt-testimonial-text::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.6em;
    background: linear-gradient(rgba(250, 249, 247, 0), #faf9f7);
    pointer-events: none;
}
.wt-readmore {
    align-self: flex-start;
    margin: -6px 0 14px;
    padding: 0;
    border: 0;
    background: none;
    color: #8a6d1f;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.wt-readmore:hover { color: #5f4a12; }
.wt-readmore:focus-visible { outline: 3px solid #c9a227; outline-offset: 2px; }

/* Optional link under any list (link="...") */
.wt-more-link { margin: 14px 0 0; font-weight: 600; }
.wt-more-link a { color: #8a6d1f; text-decoration: none; }
.wt-more-link a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Stacked columns (set up by the script for multi-column list / masonry) ---------- */
.wt-testimonials-grid.wt-stack-ready { display: flex !important; align-items: flex-start; gap: 24px; column-count: auto; }
.wt-stack-ready > .wt-stack-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.wt-stack-ready > .wt-stack-col > .wt-card { margin: 0; width: 100%; }
