/* Silver Memories Brand CSS — derived from Brand Styleguide v1.1 */

:root {
    --sm-teal:       #3A7684;
    --sm-aqua:       #87D0D0;
    --sm-aqua-tint:  #ABDEDE;
    --sm-sand:       #D4C9BF;
    --sm-sand-light: #ede8e3;
    --sm-coral:      #D46C56;
    --sm-orange:     #EC8E3F;
    --sm-yellow:     #FFCC00;
    --sm-ink:        #1F1F1F;
    --sm-ink-soft:   #4a4a4a;
    --sm-paper:      #FFFFFF;
    --sm-bg:         #f8f6f4;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Source Sans 3', 'Source Sans Pro', system-ui, sans-serif;

    /* ── Small-text scale ─────────────────────────────────────
       Pick by role, not by look:
         --fs-xs   badges, chips, micro-labels
         --fs-sm   helper text, hints, validation, captions
         --fs-base body copy, form labels, inputs — the floor inside a form

       fs-sm's ceiling must stay below fs-base's fixed 16px, or helper text and body copy render
       at the same size on any viewport past the clamp's ~750px crossover — that's what happened
       before this was tightened to 14→15px.

       Inputs carry no font-size; they inherit --fs-base. Do not add one. */
    --fs-xs:   clamp(0.8125rem, 0.7857rem + 0.119vw, 0.875rem);  /* 13 → 14px */
    --fs-sm:   clamp(0.875rem, 0.8482rem + 0.119vw, 0.9375rem);  /* 14 → 15px */
    --fs-base: 1rem;                                             /* 16px */

    --radius-pill: 999px;
    --radius-card: 12px;
    --shadow-card: 0 2px 12px rgba(60, 117, 132, 0.10);
    --shadow-card-hover: 0 6px 24px rgba(60, 117, 132, 0.18);
}

/* ── Typography ───────────────────────────────────────────── */
/* body and h1-h6 rules live in site.css, scoped to .sm-public-site. */

/* Heading accent */
.heading-italic {
    font-family: var(--font-display);
    font-style: normal;
    font-weight: 400;
}

.heading-semibold {
    font-family: var(--font-display);
    font-weight: 600;
}

/* ── Buttons ──────────────────────────────────────────────── */

.btn-sm-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--fs-sm);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sm-paper);
    background-color: var(--sm-teal);
    border: 2px solid var(--sm-teal);
    border-radius: var(--radius-pill);
    padding: 0.65rem 1.75rem;
    min-height: 44px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, box-shadow 0.2s;
    line-height: 1;
}

.btn-sm-primary:hover,
.btn-sm-primary:focus-visible {
    background-color: var(--sm-teal);
    border-color: var(--sm-teal);
    color: var(--sm-paper);
    box-shadow: 0 0 0 3px rgba(60, 117, 132, 0.3);
    text-decoration: none;
}

.btn-sm-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--fs-sm);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sm-teal);
    background-color: transparent;
    border: 2px solid var(--sm-teal);
    border-radius: var(--radius-pill);
    padding: 0.65rem 1.75rem;
    min-height: 44px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
    line-height: 1;
}

.btn-sm-outline:hover,
.btn-sm-outline:focus-visible {
    background-color: var(--sm-teal);
    color: var(--sm-paper);
    box-shadow: 0 0 0 3px rgba(60, 117, 132, 0.3);
    text-decoration: none;
}

.btn-sm-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--fs-sm);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sm-paper);
    background-color: var(--sm-coral);
    border: 2px solid var(--sm-coral);
    border-radius: var(--radius-pill);
    padding: 0.65rem 1.75rem;
    min-height: 44px;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.2s, box-shadow 0.2s;
    line-height: 1;
}

.btn-sm-danger:hover,
.btn-sm-danger:focus-visible {
    filter: brightness(0.9);
    color: var(--sm-paper);
    box-shadow: 0 0 0 3px rgba(212, 108, 86, 0.3);
}

/* Modal close button */
.btn-sm-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    color: #b0b0b0;
    border-radius: 4px;
    transition: color 0.15s, background-color 0.15s;
    text-decoration: none;
}

.btn-sm-close:hover {
    color: #555;
    background-color: rgba(0,0,0,0.07);
}

/* Ghost / text link */
.btn-sm-ghost {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--sm-teal);
    background: none;
    border: none;
    padding: 0.25rem 0;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.btn-sm-ghost:hover { color: var(--sm-teal); }

/* ── Focus rings ──────────────────────────────────────────── */

:focus-visible {
    outline: 3px solid var(--sm-aqua);
    outline-offset: 2px;
}

/* ── Type badges ──────────────────────────────────────────── */

.type-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--sm-teal);
    background-color: var(--sm-aqua-tint);
    border-radius: var(--radius-pill);
    padding: 0.2rem 0.75rem;
    margin: 0.125rem;
    white-space: nowrap;
}

/* ── Cards ────────────────────────────────────────────────── */

.sm-card {
    background: var(--sm-paper);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.sm-card:hover {
    box-shadow: var(--shadow-card-hover);
}

/* ── Act type segmented toggle ────────────────────────────── */

.sm-act-type-toggle {
    display: inline-flex;
    border: 1.5px solid var(--sm-teal);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.sm-act-type-btn {
    padding: 0.5rem 1.75rem;
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--sm-teal);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    min-height: 44px;
    touch-action: manipulation;
    line-height: 1;
}

.sm-act-type-btn + .sm-act-type-btn {
    border-left: 1.5px solid var(--sm-teal);
}

.sm-act-type-btn.selected {
    background-color: var(--sm-teal);
    color: var(--sm-paper);
}

.sm-act-type-btn:not(.selected):hover {
    background-color: var(--sm-aqua-tint);
}

/* ── Entertainment type chips ─────────────────────────────── */

.sm-type-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sm-type-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--sm-teal);
    background: transparent;
    color: var(--sm-teal);
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    user-select: none;
    -webkit-user-select: none;
    min-height: 44px;
    touch-action: manipulation;
}

.sm-type-chip:hover {
    background-color: var(--sm-aqua-tint);
}

.sm-type-chip.selected {
    background-color: var(--sm-teal);
    color: var(--sm-paper);
}

.sm-type-chip.selected:hover {
    filter: brightness(0.92);
}

/* ── Forms ────────────────────────────────────────────────── */

.sm-form-label {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-base);
    color: var(--sm-ink);
    margin-bottom: 0.25rem;
    display: block;
}

/* "Optional" qualifier inside a label */
.sm-form-label-optional {
    font-size: var(--fs-sm);
    font-weight: 400;
    font-style: italic;
    color: var(--sm-ink-soft);
}

/* Helper text under a field. Always use this class — never inline a size. */
.sm-form-help {
    font-family: var(--font-body);
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--sm-ink-soft);
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.sm-form-input,
.sm-form-select,
.sm-form-textarea {
    font-family: var(--font-body);
    width: 100%;
    border: 1.5px solid var(--sm-sand);
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    color: var(--sm-ink);
    background-color: var(--sm-paper);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sm-form-input:focus,
.sm-form-select:focus,
.sm-form-textarea:focus {
    border-color: var(--sm-teal);
    box-shadow: 0 0 0 3px rgba(60, 117, 132, 0.15);
    outline: none;
}

.form-check-input:checked {
    background-color: var(--sm-teal);
    border-color: var(--sm-teal);
}

.sm-form-input.invalid,
.sm-form-select.invalid,
.sm-form-textarea.invalid {
    border-color: var(--sm-coral);
}

/* Field-level error message */
.sm-validation-msg {
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.5;
    color: var(--sm-coral);
    margin-top: 0.25rem;
}

.sm-fieldset {
    border: none;
    padding: 0;
}

/* Fieldset legend — matches .sm-form-label */
.sm-fieldset-legend {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--sm-ink);
    margin-bottom: 0;
    padding: 0;
}

/* Fieldset helper text */
.sm-fieldset-helper {
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--sm-ink-soft);
    margin-bottom: 0.75rem;
}

.sm-fieldset-inline .form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-right: 1.5rem;
    margin-bottom: 0;
}

/* Image upload */
.image-drop-zone {
    border: 2px dashed var(--sm-teal);
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    background-color: var(--sm-bg);
    transition: background-color 0.2s;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.image-drop-zone:hover {
    background-color: var(--sm-aqua-tint);
}

.image-drop-zone.drag-over {
    background-color: var(--sm-aqua-tint);
    border-color: var(--sm-teal);
}

.image-drop-zone p {
    margin: 0;
    color: var(--sm-ink-soft);
    font-size: var(--fs-base);
}

.image-drop-zone .icon {
    color: var(--sm-teal);
    margin-bottom: 0.75rem;
    line-height: 0;
}

.hidden-file-input {
    display: none;
}

.image-thumbnail-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.image-thumbnail {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--sm-sand);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.image-thumbnail:hover {
    border-color: var(--sm-teal);
}

.image-thumbnail.feature {
    border-color: var(--sm-teal);
    box-shadow: 0 0 0 2px var(--sm-teal);
}

.image-thumbnail img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.image-thumbnail-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    background-color: var(--sm-teal);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: var(--fs-xs);
    font-weight: 600;
    display: none;
}

.image-thumbnail.feature .image-thumbnail-badge {
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-thumbnail-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: var(--sm-coral);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    padding: 0;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-thumbnail:hover .image-thumbnail-remove {
    opacity: 1;
}

.image-thumbnail-focus {
    position: absolute;
    left: 4px;
    bottom: 4px;
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--sm-teal);
    border: 1px solid var(--sm-teal);
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
}

.image-thumbnail-focus:hover {
    background-color: var(--sm-teal);
    color: white;
}

/* Touch devices: keep hover-only controls visible */
@media (hover: none) {
    .image-thumbnail-remove {
        opacity: 1;
    }
}

/* ── Focal point picker ───────────────────────────────────── */
/* Shared by the register flow and the admin editor (FocalPointPicker.razor). */

.sm-focal-editor {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: 1px solid var(--sm-sand);
    border-radius: 10px;
    background-color: var(--sm-sand-light);
}

.sm-focal-title {
    font-size: var(--fs-base);
    margin: 0 0 0.35rem;
}

.sm-focal-help {
    margin: 0 0 1rem;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--sm-ink-soft);
}

.sm-focal-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 1.25rem;
    align-items: start;
}

/* Click target for the focal point — its box must match the photo's; no padding or border. */
.sm-focal-stage {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: crosshair;
    border-radius: 8px;
    overflow: hidden;
    touch-action: manipulation;
}

/* Keep the stage as the event target for click offsets. */
.sm-focal-stage img,
.sm-focal-marker {
    pointer-events: none;
}

.sm-focal-stage img {
    display: block;
    width: 100%;
    height: auto;
}

.sm-focal-marker {
    position: absolute;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid white;
    border-radius: 50%;
    background-color: rgba(58, 118, 132, 0.45);
    box-shadow: 0 0 0 2px var(--sm-teal), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.sm-focal-preview-label,
.sm-focal-coords {
    font-size: var(--fs-sm);
    color: var(--sm-ink-soft);
    margin: 0 0 0.4rem;
}

.sm-focal-coords {
    margin: 0.5rem 0 0;
}

/* Mirrors .sm-card-img-wrap */
/* Must match .sm-card-img-wrap in site.css. The pane claims to show "how the directory card
   will look", so any other shape means the registrant aims their focus point at a crop that
   never gets applied. */
.sm-focal-preview {
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--sm-aqua-tint);
}

.sm-focal-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sm-focal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .sm-focal-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── Toast / alert ────────────────────────────────────────── */

.sm-alert {
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-family: var(--font-body);
    margin-bottom: 1rem;
}

.sm-alert:last-child {
    margin-bottom: 0;
}

.sm-alert-success {
    background-color: #e6f5f5;
    color: var(--sm-teal);
    border: 1px solid var(--sm-aqua);
}

.sm-alert-error {
    background-color: #fdf0ed;
    color: #9e3a26;
    border: 1px solid var(--sm-coral);
}

.sm-alert-info {
    background-color: var(--sm-aqua-tint);
    color: var(--sm-teal);
    border: 1px solid var(--sm-aqua);
}
