/* Links section styles */

.section--links .card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Clickable card links */
.section--links a.card--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.section--links a.card--link:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 48px rgba(100, 116, 139, 0.18);
}

.section--links a.card--link h3,
.section--links a.card--link p {
    color: inherit;
}

.section--links .card[hidden] {
    display: none;
}

.section--links .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.section--links .card-button {
    display: flex;
    justify-content: center;
    width: 100%;
}

.section--links .card-content p {
    flex: 1;
}

/* Image styles for link cards */
.section--links .card-image {
    width: calc(100% + 2 * var(--card-padding, 1.5rem));
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin: calc(-1 * var(--card-padding, 1.5rem));
    margin-bottom: 1rem;
}

.section--links .card--has-image {
    padding-top: 0;
}

.section--links .card--has-image .card-image {
    margin-top: 0;
}

/* Grid with images modifier */
.section--links .grid--with-images .card-image + .card-content {
    padding-top: 1rem;
}

/* Editor controls */
.section--links .section-editor-controls {
    margin-top: 1.5rem;
    text-align: center;
}

/* Links sortable item styles for the drawer */
.page-editor-sortable-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 6px;
}

.page-editor-sortable-item__handle {
    cursor: grab;
    color: var(--muted-foreground);
    flex: 0 0 auto;
}

.page-editor-sortable-item__handle:active {
    cursor: grabbing;
}

.page-editor-sortable-item__checkbox {
    flex: 0 0 auto !important;
    display: flex;
    align-items: center;
}

.page-editor-sortable-item__checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0 !important;
    accent-color: var(--primary);
}

.page-editor-sortable-item__thumbnail {
    width: 48px;
    height: 36px;
    flex: 0 0 auto;
    border-radius: 4px;
    overflow: hidden;
    background: var(--muted);
}

.page-editor-sortable-item__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-editor-sortable-item__content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-editor-sortable-item__title {
    font-weight: 500;
    font-size: 14px;
    color: var(--foreground);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-editor-sortable-item__meta {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.page-editor-sortable-item__actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

/* Drag state */
.page-editor-sortable-item.is-dragging {
    opacity: 0.5;
    background: var(--muted);
}

/* Badge styles for link types */
.page-editor-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.page-editor-badge--form {
    background: oklch(0.95 0.05 162);
    color: var(--primary);
}

.page-editor-badge--internal {
    background: hsl(210 40% 96%);
    color: hsl(210 40% 40%);
}

.page-editor-badge--external {
    background: hsl(280 40% 96%);
    color: hsl(280 40% 40%);
}

/* Switch toggle styles */
.page-editor-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.page-editor-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.page-editor-switch__slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: hsl(215 20% 85%);
    border-radius: 12px;
    transition: background 0.2s;
}

.page-editor-switch__slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.page-editor-switch input:checked + .page-editor-switch__slider {
    background: var(--primary);
}

.page-editor-switch input:checked + .page-editor-switch__slider::before {
    transform: translateX(20px);
}

.page-editor-switch__label {
    font-weight: 500;
    color: var(--foreground);
}

/* Image preview in link edit modal */
.page-editor-image-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--muted);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.page-editor-image-preview img {
    border-radius: var(--radius);
    object-fit: cover;
}

/* Radio group styles */
.page-editor-radio-group {
    display: flex;
    gap: 16px;
}

.page-editor-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.page-editor-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}
