/* tools/lut-generator.css
   The LUT generator reuses the watermark maker's layout (watermark.css:
   settings open beside the results). This sheet adds the reference slot in
   the settings, the before/after cards, the worked example and the
   "where to use it" list in the page copy. */

.lut-page .lut-wide {
    width: 100%;
}

/* The reference: an empty drop slot, then the photo itself. */
.lut-ref {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    max-height: 260px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.lut-ref:hover,
.lut-ref.highlight {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.09);
}

.lut-ref.has-ref {
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.14);
    background: #0d0d0f;
}

.lut-ref-canvas {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.lut-ref.has-ref .lut-ref-canvas {
    display: block;
}

.lut-ref-empty {
    padding: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
}

.lut-ref.has-ref .lut-ref-empty {
    display: none;
}

.lut-ref.is-reading::after {
    content: 'Reading\2026';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(13, 13, 15, 0.8);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.lut-ref-name {
    margin: 0 0 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lut-ref-name:empty {
    display: none;
}

/* A quiet text button: the sample photos, the Hald image. */
.lut-link {
    display: block;
    margin: 8px auto 0;
    padding: 4px 2px;
    font: inherit;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    background: none;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.lut-link:hover:not(:disabled) {
    color: #fff;
}

.lut-link:disabled {
    opacity: 0.4;
    cursor: default;
}

.lut-page .btn-action:disabled,
.lut-page .btn-secondary:disabled {
    opacity: 0.45;
    cursor: default;
}

.lut-files {
    padding-top: 4px;
}

.lut-note {
    margin: 8px 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.6);
}

.lut-note:empty {
    display: none;
}

.lut-save-note {
    margin: 10px 0 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
}

.lut-page .wm-actions {
    flex-wrap: wrap;
}

/* Before / after cards: the card takes the photo's own shape (set inline). */
.lut-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    align-items: start;
}

.lut-card .lut-thumb,
.lut-example-compare {
    position: relative;
    aspect-ratio: 3 / 2;
    background: #0d0d0f;
    overflow: hidden;
}

.lut-card .compress-thumb canvas.lut-canvas,
.lut-example-compare canvas.lut-canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: ew-resize;
    touch-action: pan-y;
}

.lut-thumb.no-after canvas.lut-canvas {
    cursor: default;
}

.lut-canvas:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: -2px;
}

.lut-tag {
    position: absolute;
    top: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    pointer-events: none;
}

.lut-tag--before,
.lut-tag--static {
    left: 8px;
}

.lut-tag--after {
    right: 8px;
}

.no-after .lut-tag {
    display: none;
}

.lut-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.lut-card .compress-detail {
    min-width: 0;
}

/* iPhone: the files were made after the first tap; the second tap saves. */
.lut-page .is-ready {
    animation: lut-ready 1.2s ease-in-out 2;
}

@keyframes lut-ready {
    50% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.25); }
}

/* The worked example in the page copy. */
.lut-example {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
    gap: 12px;
    margin: 12px 0 28px;
    align-items: start;
}

.lut-example-ref {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: #0d0d0f;
}

.lut-example-ref img {
    display: block;
    width: 100%;
    height: auto;
}

.lut-example-compare {
    border-radius: 14px;
    aspect-ratio: 1200 / 896;
}

.lut-example-fallback {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lut-example canvas.lut-canvas,
.lut-example .lut-tag--before,
.lut-example .lut-tag--after {
    display: none;
}

.lut-example.is-ready .lut-example-fallback {
    display: none;
}

.lut-example.is-ready canvas.lut-canvas,
.lut-example.is-ready .lut-tag--before,
.lut-example.is-ready .lut-tag--after {
    display: block;
}

.lut-example figcaption {
    grid-column: 1 / -1;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

@media (max-width: 640px) {
    .lut-example {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* "Where to use the .cube file" */
.lut-howto {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin: 12px 0 16px;
}

.lut-howto-item {
    padding: 16px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.lut-howto-item h3 {
    margin: 0 0 6px;
    font-size: 1rem;
}

.lut-howto-item p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.75);
}

/* Phones: the reference comes first, above the drop tile for the photos. */
@media (max-width: 760px) {
    .lut-page > .tool-header {
        order: -2;
    }
    .lut-page > .tool-settings {
        order: -1;
    }
}
