/* Receptai User Suite public styles */

/* --- Modal --- */
.rus-modal-overlay[hidden] {
    display: none !important;
}

.rus-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

html.rus-modal-open,
body.rus-modal-open {
    overflow: hidden;
}

.rus-modal {
    position: relative;
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

body.dark .rus-modal {
    background: #1a1a1a;
    color: #f3f3f3;
}

.rus-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.rus-modal__close:hover {
    background: rgba(0, 0, 0, 0.08);
}

body.dark .rus-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.rus-modal__title {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 700;
}

.rus-modal__tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid #e8e8e8;
}

body.dark .rus-modal__tabs {
    border-color: #2a2a2a;
}

.rus-modal__tab {
    padding: 10px 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.rus-modal__tab.is-active,
.rus-modal__tab:hover {
    border-bottom-color: #d9381e;
    color: #d9381e;
}

body.dark .rus-modal__tab.is-active,
body.dark .rus-modal__tab:hover {
    color: #ff5c43;
    border-bottom-color: #ff5c43;
}

.rus-modal__panel {
    display: none;
}

.rus-modal__panel.is-active {
    display: block;
}

/* --- Forms --- */
.rus-form,
.rus-auth-form {
    max-width: 600px;
}

.rus-field {
    display: block;
    margin-bottom: 16px;
}

.rus-field__label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

body.dark .rus-field__label {
    color: #d6d6d6;
}

.rus-field input[type="text"],
.rus-field input[type="email"],
.rus-field input[type="password"],
.rus-field input[type="tel"],
.rus-field textarea,
.rus-auth-form input[type="text"],
.rus-auth-form input[type="email"],
.rus-auth-form input[type="password"],
.rus-auth-form input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 15px;
    line-height: 1.4;
}

body.dark .rus-field input,
body.dark .rus-field textarea,
body.dark .rus-auth-form input {
    background: #111;
    border-color: #2a2a2a;
    color: #f3f3f3;
}

.rus-field input:focus,
.rus-field textarea:focus,
.rus-auth-form input:focus {
    outline: none;
    border-color: #d9381e;
    box-shadow: 0 0 0 2px rgba(217, 56, 30, 0.15);
}

.rus-field--checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.rus-field--checkbox input {
    width: auto;
}

/* --- Buttons --- */
.rus-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.rus-btn:hover {
    background: #d9381e;
    transform: translateY(-1px);
}

.rus-btn--small {
    padding: 8px 16px;
    font-size: 12px;
}

body.dark .rus-btn {
    background: #f3f3f3;
    color: #111;
}

body.dark .rus-btn:hover {
    background: #ff5c43;
    color: #fff;
}

/* Outlined secondary buttons on the recipe form */
.rus-recipe-form-page .rus-btn--secondary {
    background: #fff;
    color: #111;
    border: 1px solid #111;
}

.rus-recipe-form-page .rus-btn--secondary:hover {
    background: #111;
    color: #fff;
    transform: none;
}

body.dark .rus-recipe-form-page .rus-btn--secondary {
    background: #1a1a1a;
    color: #f3f3f3;
    border-color: #f3f3f3;
}

body.dark .rus-recipe-form-page .rus-btn--secondary:hover {
    background: #f3f3f3;
    color: #111;
}

/* Required field asterisks */
.rus-recipe-form-page .acf-field.is-required .acf-label label .acf-required,
.rus-recipe-form-page .acf-field.is-required > .acf-label > label > .acf-required {
    color: #d9381e;
}

body.dark .rus-recipe-form-page .acf-field.is-required .acf-label label .acf-required,
body.dark .rus-recipe-form-page .acf-field.is-required > .acf-label > label > .acf-required {
    color: #ff5c43;
}

.rus-recipe-form-page .acf-field.rus-ingredients-compact .acf-label label::after,
.rus-recipe-form-page .acf-field.rus-steps-compact .acf-label label::after,
.rus-recipe-form-page .acf-field[data-name="rus_featured_image_upload"] > .acf-label > label::after {
    content: ' *';
    color: #d9381e;
}

body.dark .rus-recipe-form-page .acf-field.rus-ingredients-compact .acf-label label::after,
body.dark .rus-recipe-form-page .acf-field.rus-steps-compact .acf-label label::after,
body.dark .rus-recipe-form-page .acf-field[data-name="rus_featured_image_upload"] > .acf-label > label::after {
    color: #ff5c43;
}

/* --- Messages --- */
.rus-auth-message {
    margin-top: 12px;
    font-size: 14px;
    min-height: 20px;
}

.rus-auth-message.is-error {
    color: #d9381e;
}

.rus-auth-message.is-success {
    color: #1f8d5c;
}

body.dark .rus-auth-message.is-error {
    color: #ff5c43;
}

.rus-notice {
    margin-bottom: 20px;
    padding: 14px 18px;
    border-radius: 8px;
}

.rus-form-validation-error {
    margin-bottom: 24px;
    font-size: 14px;
}

.rus-notice--success {
    background: #e8f7f1;
    color: #1f8d5c;
}

.rus-notice--error {
    background: #fdecea;
    color: #d9381e;
}

body.dark .rus-notice--success {
    background: #152d24;
}

body.dark .rus-notice--error {
    background: #3a1a16;
}

/* --- Tabs --- */
.rus-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.rus-tab {
    padding: 12px 20px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--muted, #666);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

body.dark .rus-tab {
    color: var(--muted, #999);
}

.rus-tab:hover {
    background: var(--bg-soft, #f5f4f2);
    color: var(--ink, #111);
    transform: translateY(-1px);
}

body.dark .rus-tab:hover {
    background: var(--line, #2a2a2a);
    color: var(--ink, #f3f3f3);
}

.rus-tab.is-active {
    background: var(--ink, #111);
    color: #fff;
}

body.dark .rus-tab.is-active {
    background: var(--ink, #f3f3f3);
    color: var(--bg, #111);
}

.rus-tab-panel {
    display: none;
}

.rus-tab-panel.is-active {
    display: block;
    animation: rus-fade-in 0.2s ease;
}

@keyframes rus-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- User zone --- */
.rus-user-zone .rus-form {
    background: #f5f4f2;
    padding: 24px;
    border-radius: 12px;
}

body.dark .rus-user-zone .rus-form {
    background: #1a1a1a;
}

.rus-form__subtitle {
    margin: 24px 0 12px;
    font-size: 16px;
    font-weight: 700;
}

.rus-comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 16px;
}

.rus-comment-item {
    padding: 20px;
    border-radius: 12px;
    background: #f5f4f2;
    border-bottom: 0;
}

body.dark .rus-comment-item {
    background: #1a1a1a;
}

.rus-comment-meta {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.rus-comment-meta a {
    color: var(--ink, #111);
    font-weight: 600;
    text-decoration: none;
}

.rus-comment-meta a:hover {
    text-decoration: underline;
}

body.dark .rus-comment-meta {
    color: #aaa;
}

body.dark .rus-comment-meta a {
    color: var(--ink, #f3f3f3);
}

.rus-comment-date {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e8e8e8;
    font-size: 12px;
    color: #777;
}

body.dark .rus-comment-date {
    background: #333;
    color: #999;
}

.rus-comment-text {
    font-size: 15px;
    line-height: 1.6;
    color: #111;
}

body.dark .rus-comment-text {
    color: #f3f3f3;
}

.rus-my-recipe {
    position: relative;
}

.rus-my-recipe__overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    pointer-events: none;
    z-index: 2;
}
.rus-my-recipe__overlay > * {
    pointer-events: auto;
}

.rus-my-recipe__edit {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--ink, #111);
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background 0.2s ease;
}
body.dark .rus-my-recipe__edit {
    background: #2a2a2a;
    color: #f3f3f3;
}
body.dark .rus-my-recipe__edit:hover {
    background: var(--accent, #d9381e);
    color: #fff;
}
.rus-my-recipe__edit:hover {
    background: var(--accent, #d9381e);
}
.rus-my-recipe__edit svg {
    width: 16px;
    height: 16px;
}

.rus-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.rus-status--publish {
    background: #e8f7f1;
    color: #1f8d5c;
}

body.dark .rus-status--publish {
    background: #152d24;
}

.rus-status--pending {
    background: #fff3cd;
    color: #9a6b00;
}

body.dark .rus-status--pending {
    background: #3d3108;
}

/* --- Recipe form page --- */
.rus-recipe-form-page .acf-form {
    background: #f5f4f2;
    padding: 28px;
    border-radius: 12px;
}

body.dark .rus-recipe-form-page .acf-form {
    background: #1a1a1a;
}

.rus-recipe-form-page .acf-fields > .acf-field {
    border: 0;
    padding: 18px 0;
}

.rus-recipe-form-page .acf-fields > .acf-field:first-child {
    padding-top: 0;
}

.rus-recipe-form-page .acf-fields > .acf-field:last-child {
    padding-bottom: 0;
}

body.dark .rus-recipe-form-page .acf-fields > .acf-field {
    border-bottom-color: #2a2a2a;
}

.rus-recipe-form-page .acf-label {
    margin-bottom: 10px;
}

.rus-recipe-form-page .acf-label label {
    font-size: 15px;
    font-weight: 700;
    color: #111;
}

body.dark .rus-recipe-form-page .acf-label label {
    color: #f3f3f3;
}

.rus-recipe-form-page .acf-input input[type="text"],
.rus-recipe-form-page .acf-input input[type="number"],
.rus-recipe-form-page .acf-input textarea,
.rus-recipe-form-page .acf-input select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.dark .rus-recipe-form-page .acf-input input,
body.dark .rus-recipe-form-page .acf-input textarea,
body.dark .rus-recipe-form-page .acf-input select {
    background: #111;
    border-color: #2a2a2a;
    color: #f3f3f3;
}

.rus-recipe-form-page .acf-input input:focus,
.rus-recipe-form-page .acf-input textarea:focus,
.rus-recipe-form-page .acf-input select:focus {
    outline: none;
    border-color: #d9381e;
    box-shadow: 0 0 0 3px rgba(217, 56, 30, 0.12);
}

/* Time + servings fields */
.rus-recipe-form-page .acf-field[data-name="prep_time"],
.rus-recipe-form-page .acf-field[data-name="cook_time"],
.rus-recipe-form-page .acf-field[data-name="servings"] {
    padding: 12px 0;
    box-sizing: border-box;
}

.rus-recipe-form-page .acf-field[data-name="prep_time"] {
    padding-right: 6px;
}

.rus-recipe-form-page .acf-field[data-name="cook_time"] {
    padding-left: 6px;
    padding-right: 6px;
}

.rus-recipe-form-page .acf-field[data-name="servings"] {
    padding-left: 6px;
}

.rus-recipe-form-page .acf-field[data-name="prep_time"] .acf-label,
.rus-recipe-form-page .acf-field[data-name="cook_time"] .acf-label,
.rus-recipe-form-page .acf-field[data-name="servings"] .acf-label {
    margin-bottom: 6px;
}

.rus-recipe-form-page .acf-field[data-name="prep_time"] .acf-label label,
.rus-recipe-form-page .acf-field[data-name="cook_time"] .acf-label label,
.rus-recipe-form-page .acf-field[data-name="servings"] .acf-label label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

body.dark .rus-recipe-form-page .acf-field[data-name="prep_time"] .acf-label label,
body.dark .rus-recipe-form-page .acf-field[data-name="cook_time"] .acf-label label,
body.dark .rus-recipe-form-page .acf-field[data-name="servings"] .acf-label label {
    color: #aaa;
}

/* Repeater tables */
.rus-recipe-form-page .acf-repeater .acf-table {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    background: #fff;
}

body.dark .rus-recipe-form-page .acf-repeater .acf-table {
    border-color: #2a2a2a;
    background: #111;
}

.rus-recipe-form-page .acf-repeater .acf-th {
    background: #fff;
    color: #111;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

body.dark .rus-recipe-form-page .acf-repeater .acf-th {
    background: #111;
    color: #f3f3f3;
}

.rus-recipe-form-page .acf-repeater .acf-row-handle {
    background: #f5f4f2;
    color: #777;
    font-weight: 700;
}

body.dark .rus-recipe-form-page .acf-repeater .acf-row-handle {
    background: #1a1a1a;
    color: #999;
}

.rus-recipe-form-page .acf-repeater .acf-actions {
    margin-top: 12px;
}

.rus-recipe-form-page .acf-repeater .acf-button,
.rus-recipe-form-page .acf-repeater .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 1px solid #111;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}

body.dark .rus-recipe-form-page .acf-repeater .acf-button,
body.dark .rus-recipe-form-page .acf-repeater .button {
    background: #f3f3f3;
    border-color: #f3f3f3;
    color: #111;
}

.rus-recipe-form-page .acf-repeater .acf-button:hover,
.rus-recipe-form-page .acf-repeater .button:hover {
    background: #d9381e;
    border-color: #d9381e;
    color: #fff;
}

body.dark .rus-recipe-form-page .acf-repeater .acf-button:hover,
body.dark .rus-recipe-form-page .acf-repeater .button:hover {
    background: #ff5c43;
    border-color: #ff5c43;
    color: #fff;
}

/* Ingredient repeater as compact stacked rows */
.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-table {
    display: block;
    border: 0;
    background: transparent;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-table thead,
.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-table tbody,
.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-table tr,
.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-table td {
    display: block;
    width: 100%;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-table thead {
    display: none;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row {
    position: relative;
    margin-bottom: 12px;
    padding: 12px 40px 12px 12px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

body.dark .rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row {
    border-color: #2a2a2a;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row .acf-field {
    padding: 0 0 10px;
    margin: 0;
    border: 0;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row .acf-field:last-child {
    padding-bottom: 0;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row .acf-label {
    margin-bottom: 4px;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row .acf-label label {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

body.dark .rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row .acf-label label {
    color: #999;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row-handle {
    display: none;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row-handle.remove {
    display: flex;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: transparent;
    color: #aaa;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}

body.dark .rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row-handle.remove {
    color: #777;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row-handle.remove:hover {
    background: #fdecea;
    color: #d9381e;
}

body.dark .rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row-handle.remove:hover {
    background: #3a1a16;
}

.rus-recipe-form-page .acf-field[data-name="ingredients"] .acf-repeater .acf-row-handle.remove a {
    color: inherit;
    text-decoration: none;
}

/* Featured image upload */
.rus-featured-image-upload {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 24px;
}

.rus-featured-image-preview {
    margin-bottom: 12px;
}

.rus-featured-image-preview img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.rus-featured-image-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.rus-featured-image-label,
.rus-featured-image-remove {
    width: 180px;
    min-height: 42px;
    padding: 0 12px;
    justify-content: center;
    text-align: center;
    border-radius: 999px;
}

.rus-featured-image-remove {
    background: #d9381e;
    color: #fff;
    border-color: #d9381e;
}

body.dark .rus-featured-image-remove {
    background: #ff5c43;
    border-color: #ff5c43;
    color: #fff;
}

.rus-featured-image-remove:hover {
    background: #b92d16;
    border-color: #b92d16;
}

body.dark .rus-featured-image-remove:hover {
    background: #e64a33;
    border-color: #e64a33;
}

/* Submit button */
.rus-recipe-form-page .acf-form-submit {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
}

.rus-recipe-form-page .acf-form-submit .rus-btn {
    padding: 10px 20px;
    font-size: 14px;
}

.rus-recipe-form-page .rus-btn {
    border-radius: 999px;
}

body.dark .rus-recipe-form-page .acf-form-submit .rus-btn {
    background: #f3f3f3;
    color: #111;
}

.rus-recipe-form-page .acf-form-submit .rus-btn:hover {
    background: #d9381e;
    transform: translateY(-1px);
}

body.dark .rus-recipe-form-page .acf-form-submit .rus-btn:hover {
    background: #ff5c43;
    color: #fff;
}

@media (max-width: 600px) {
    .rus-recipe-form-page .acf-form {
        padding: 18px;
    }
}

/* --- Load more button --- */
.load-more-wrap {
    display: flex;
    justify-content: center;
}

.load-more-btn {
    width: auto;
    max-width: 100%;
}

@media (max-width: 600px) {
    .rus-modal {
        padding: 22px;
    }
    .rus-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
}


/* --- Compact ingredients editor ---------------------------------------- */
.rus-ingredients-compact {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 24px;
}

.rus-ingredients-compact .acf-label label {
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 600;
}

.rus-ingredient-row {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: 0;
}

.rus-ingredient-row::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 1px;
    background: #e8e8e8;
}

body.dark .rus-ingredient-row::after {
    background: #2a2a2a;
}

.rus-ingredient-row:last-of-type::after {
    display: none;
}

.rus-ingredient-row--prototype {
    display: none !important;
}

.rus-ingredient-row__main,
.rus-ingredient-row__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.rus-ingredient-row__main {
    margin-bottom: 4px;
}

.rus-ingredient-row__meta {
    margin-bottom: 0;
}

.rus-ingredient-input--group {
    flex: 0 0 35%;
    min-width: 140px;
}

.rus-ingredient-input--note {
    flex: 1;
    min-width: 140px;
}

.rus-ingredient-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #aaa;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    flex-shrink: 0;
}

.rus-ingredient-remove:hover {
    background: #fdecea;
    color: #d9381e;
}

body.dark .rus-ingredient-remove:hover {
    background: #3a1a16;
}

.rus-ingredient-row__main .rus-ingredient-select--ingredient,
.rus-ingredient-row__main .rus-ingredient-select--ingredient + .select2-container {
    flex: 1 1 200px;
    min-width: 180px;
}

.rus-ingredient-input--qty {
    flex: 0 0 80px;
    width: 80px;
}

.rus-ingredient-row__main .rus-ingredient-select--unit,
.rus-ingredient-row__main .rus-ingredient-select--unit + .select2-container {
    flex: 0 0 90px;
    width: 90px !important;
}

.rus-ingredient-input,
.rus-ingredient-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 15px;
    line-height: 1.4;
}

body.dark .rus-ingredient-input,
body.dark .rus-ingredient-select {
    background: #111;
    border-color: #333;
    color: #f3f3f3;
}

.rus-ingredient-input:focus,
.rus-ingredient-select:focus {
    outline: none;
    border-color: #111;
}

body.dark .rus-ingredient-input:focus,
body.dark .rus-ingredient-select:focus {
    border-color: #f3f3f3;
}

/* Style Select2 to match the regular ACF inputs */
.rus-ingredient-row__main .select2-container--default .select2-selection--single {
    height: auto;
    padding: 12px 34px 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 15px;
    line-height: 1.4;
}

.rus-ingredient-row__main .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0;
    color: #111;
    line-height: 1.4;
}

.rus-ingredient-row__main .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #888;
}

.rus-ingredient-row__main .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 6px;
    width: 20px;
}

body.dark .rus-ingredient-row__main .select2-container--default .select2-selection--single {
    background: #111;
    border-color: #333;
    color: #f3f3f3;
}

body.dark .rus-ingredient-row__main .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #f3f3f3;
}

body.dark .rus-ingredient-row__main .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #888;
}

body.dark .select2-dropdown {
    background-color: #111;
    border-color: #333;
    color: #f3f3f3;
}

body.dark .select2-container--default .select2-results__option[aria-selected="true"] {
    background-color: #333;
}

body.dark .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #d9381e;
}

.rus-ingredients-add {
    margin-top: 6px;
}

/* ACF already shows a label for the native ingredients field, hide it on front-end. */
.rus-recipe-form-page .acf-field[data-key="field_69944c9292ab5"] {
    display: none;
}


/* --- Compact steps editor ------------------------------------------------ */
.rus-steps-compact {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
    margin-bottom: 24px;
}

.rus-steps-compact .acf-label label {
    display: inline-block;
    margin-bottom: 10px;
    font-weight: 600;
}

.rus-steps-rows {
    counter-reset: step-counter;
}

.rus-step-row {
    position: relative;
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: 0;
    counter-increment: step-counter;
}

.rus-step-row::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -10px;
    height: 1px;
    background: #e8e8e8;
}

body.dark .rus-step-row::after {
    background: #2a2a2a;
}

.rus-step-row:last-of-type::after {
    display: none;
}

.rus-step-row--prototype-wrap {
    display: none !important;
}

.rus-step-row__main {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.rus-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    margin-top: 8px;
}

.rus-step-number::before {
    content: counter(step-counter) '.';
}

body.dark .rus-step-number {
    background: #f3f3f3;
    color: #111;
}

.rus-step-text {
    flex: 1;
    min-width: 200px;
    min-height: 90px;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    resize: vertical;
}

body.dark .rus-step-text {
    background: #111;
    border-color: #333;
    color: #f3f3f3;
}

.rus-step-text:focus {
    outline: none;
    border-color: #111;
}

body.dark .rus-step-text:focus {
    border-color: #f3f3f3;
}

.rus-step-row__image {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding-left: 42px;
}

.rus-step-image-preview {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rus-step-image-preview:empty::before {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    border: 2px dashed #bbb;
    border-radius: 8px;
}

body.dark .rus-step-image-preview {
    background: #222;
}

body.dark .rus-step-image-preview:empty::before {
    border-color: #555;
}

.rus-step-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rus-step-image-label,
.rus-step-image-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border: 0;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.2s ease;
    width: 165px;
    height: 36px;
    box-sizing: border-box;
}

.rus-step-image-label:hover,
.rus-step-image-remove:hover {
    background: #d9381e;
}

body.dark .rus-step-image-label,
body.dark .rus-step-image-remove {
    background: #f3f3f3;
    color: #111;
}

body.dark .rus-step-image-label:hover,
body.dark .rus-step-image-remove:hover {
    background: #ff5c43;
    color: #fff;
}

.rus-step-remove {
    margin-top: 8px;
}

.rus-steps-add {
    margin-top: 6px;
}

.rus-recipe-form-page .acf-field[data-key="field_69944d6f92abe"] {
    display: none;
}

/* Dark mode polish */
body.dark .rus-auth-message.is-success { color: #5cdb7e; }
body.dark .rus-notice--success { color: #5cdb7e; }
body.dark .rus-notice--error { color: #ff7a66; }
body.dark .rus-status--publish { color: #5cdb7e; }
body.dark .rus-status--pending { color: #e0c066; }
body.dark .rus-ingredient-remove { color: #777; }
body.dark .rus-ingredient-remove:hover { color: #ff7a66; }

/* Simplified front-end WYSIWYG editor styling */
.rus-recipe-form-page .acf-editor-wrap {
    border: 1px solid var(--line, #e8e8e8);
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg, #fff);
}

body.dark .rus-recipe-form-page .acf-editor-wrap {
    border-color: #2a2a2a;
    background: #111;
}

.rus-recipe-form-page .acf-editor-wrap .wp-editor-tabs {
    background: var(--bg-soft, #f5f4f2);
    border-bottom: 1px solid var(--line, #e8e8e8);
}

body.dark .rus-recipe-form-page .acf-editor-wrap .wp-editor-tabs {
    background: #1a1a1a;
    border-color: #2a2a2a;
}

.rus-recipe-form-page .acf-editor-wrap .wp-switch-editor {
    border: 0;
    background: transparent;
    color: var(--muted, #777);
}

body.dark .rus-recipe-form-page .acf-editor-wrap .wp-switch-editor {
    color: #999;
}

.rus-recipe-form-page .acf-editor-wrap .wp-switch-editor:hover {
    color: var(--ink, #111);
}

body.dark .rus-recipe-form-page .acf-editor-wrap .wp-switch-editor:hover {
    color: #f3f3f3;
}

.rus-recipe-form-page .acf-editor-wrap .tmce-active .switch-tmce,
.rus-recipe-form-page .acf-editor-wrap .html-active .switch-html {
    color: var(--ink, #111);
    background: var(--bg, #fff);
}

body.dark .rus-recipe-form-page .acf-editor-wrap .tmce-active .switch-tmce,
body.dark .rus-recipe-form-page .acf-editor-wrap .html-active .switch-html {
    color: #f3f3f3;
    background: #111;
}

.rus-recipe-form-page .acf-editor-wrap .wp-editor-container {
    background: var(--bg, #fff);
}

body.dark .rus-recipe-form-page .acf-editor-wrap .wp-editor-container {
    background: #111;
}

.rus-recipe-form-page .acf-editor-wrap textarea.wp-editor-area {
    border: 0;
    border-radius: 0;
    background: var(--bg, #fff);
    color: var(--ink, #111);
}

body.dark .rus-recipe-form-page .acf-editor-wrap textarea.wp-editor-area {
    background: #111;
    color: #f3f3f3;
}

.rus-recipe-form-page .acf-editor-wrap .mce-toolbar .mce-btn,
.rus-recipe-form-page .acf-editor-wrap .mce-toolbar .mce-btn:hover,
.rus-recipe-form-page .acf-editor-wrap .mce-toolbar .mce-btn:focus {
    background: transparent;
}

/* ACF Select2 dropdowns on recipe form */
.rus-recipe-form-page .acf-input .select2-container--default .select2-selection--single {
    height: auto;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body.dark .rus-recipe-form-page .acf-input .select2-container--default .select2-selection--single {
    background: #111;
    border-color: #2a2a2a;
    color: #f3f3f3;
}

.rus-recipe-form-page .acf-input .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: inherit;
    line-height: inherit;
    padding-left: 0;
    padding-right: 22px;
}

.rus-recipe-form-page .acf-input .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #999;
}

body.dark .rus-recipe-form-page .acf-input .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #777;
}

.rus-recipe-form-page .acf-input .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 12px;
    width: 20px;
}

.rus-recipe-form-page .acf-input .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #777 transparent transparent transparent;
    border-width: 5px 5px 0 5px;
}

body.dark .rus-recipe-form-page .acf-input .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #999 transparent transparent transparent;
}

.rus-recipe-form-page .acf-input .select2-container--default.select2-container--focus .select2-selection--single,
.rus-recipe-form-page .acf-input .select2-container--default.select2-container--open .select2-selection--single,
.rus-recipe-form-page .acf-input .select2-container--default.select2-container--focus .select2-selection--multiple,
.rus-recipe-form-page .acf-input .select2-container--default.select2-container--open .select2-selection--multiple {
    border-color: #d9381e;
    box-shadow: 0 0 0 3px rgba(217, 56, 30, 0.12);
}

body.dark .rus-recipe-form-page .acf-input .select2-container--default.select2-container--focus .select2-selection--single,
body.dark .rus-recipe-form-page .acf-input .select2-container--default.select2-container--open .select2-selection--single,
body.dark .rus-recipe-form-page .acf-input .select2-container--default.select2-container--focus .select2-selection--multiple,
body.dark .rus-recipe-form-page .acf-input .select2-container--default.select2-container--open .select2-selection--multiple {
    box-shadow: 0 0 0 3px rgba(255, 92, 67, 0.15);
}

/* Select2 dropdown (appended to body) */
body.dark .select2-container--default .select2-dropdown {
    background: #111;
    border-color: #2a2a2a;
}

body.dark .select2-container--default .select2-results__option {
    color: #d6d6d6;
}

body.dark .select2-container--default .select2-results__option--highlighted[aria-selected],
body.dark .select2-container--default .select2-results__option--highlighted[data-selected] {
    background: #2a2a2a;
    color: #f3f3f3;
}

body.dark .select2-container--default .select2-results__option[aria-selected="true"],
body.dark .select2-container--default .select2-results__option[data-selected="true"] {
    background: #333;
    color: #f3f3f3;
}

/* ACF image upload field */
.rus-recipe-form-page .acf-image-uploader .hide-if-value p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 15px;
    color: var(--muted, #777);
}

body.dark .rus-recipe-form-page .acf-image-uploader .hide-if-value p {
    color: #999;
}

.rus-recipe-form-page .acf-image-uploader .acf-button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: 1px solid #111;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body.dark .rus-recipe-form-page .acf-image-uploader .acf-button.button {
    background: #f3f3f3;
    border-color: #f3f3f3;
    color: #111;
}

.rus-recipe-form-page .acf-image-uploader .acf-button.button:hover {
    background: #d9381e;
    border-color: #d9381e;
    color: #fff;
}

body.dark .rus-recipe-form-page .acf-image-uploader .acf-button.button:hover {
    background: #ff5c43;
    border-color: #ff5c43;
    color: #fff;
}

/* Three taxonomy selects in one row on recipe form */
.rus-recipe-form-page .acf-fields:has(.acf-field[data-key="field_rus_tax_difficulty"]) {
    display: flex;
    flex-wrap: wrap;
}

.rus-recipe-form-page .acf-field[data-key="field_rus_tax_difficulty"],
.rus-recipe-form-page .acf-field[data-key="field_rus_tax_cuisine"],
.rus-recipe-form-page .acf-field[data-key="field_rus_tax_diet"] {
    width: 33.333%;
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
}

.rus-recipe-form-page .acf-field[data-key="field_rus_tax_difficulty"] {
    padding-left: 0;
}

.rus-recipe-form-page .acf-field[data-key="field_rus_tax_diet"] {
    padding-right: 0;
}

.rus-recipe-form-page .acf-field[data-key="field_rus_featured_image_upload"] {
    width: 100%;
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 640px) {
    .rus-recipe-form-page .acf-field[data-key="field_rus_tax_difficulty"],
    .rus-recipe-form-page .acf-field[data-key="field_rus_tax_cuisine"],
    .rus-recipe-form-page .acf-field[data-key="field_rus_tax_diet"] {
        width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
}

/* --- Social login --- */
.rus-social-login {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}
body.dark .rus-social-login {
    border-top-color: #333;
}
.rus-social-login__divider {
    text-align: center;
    margin: 0 0 16px;
    color: #777;
    font-size: 13px;
    position: relative;
}
body.dark .rus-social-login__divider {
    color: #aaa;
}
.rus-social-login__divider span {
    background: #fff;
    padding: 0 12px;
    position: relative;
}
body.dark .rus-social-login__divider span {
    background: #1a1a1a;
}
.rus-social-login__divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e5e5;
    z-index: 0;
}
body.dark .rus-social-login__divider::before {
    background: #333;
}

#g_id_signin {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
}

.rus-btn--facebook {
    background: #1877f2;
    color: #fff;
    border: none;
    width: 100%;
}
.rus-btn--facebook:hover,
.rus-btn--facebook:focus {
    background: #166fe5;
    color: #fff;
}

/* --- Profile layout --- */
.rus-profile-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 920px) {
    .rus-profile-layout {
        grid-template-columns: 1fr;
    }
    .rus-profile-card {
        order: -1;
        max-width: none;
        width: 100%;
    }
}

.rus-profile-form .rus-form {
    max-width: none;
    padding: 24px;
}

.rus-profile-form .rus-field {
    margin-bottom: 18px;
}

.rus-profile-form .rus-field__label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.rus-profile-form .rus-field:has(input:required) .rus-field__label::after,
.rus-profile-form .rus-field:has(textarea:required) .rus-field__label::after {
    content: ' *';
    color: #d9381e;
}

body.dark .rus-profile-form .rus-field__label {
    color: #aaa;
}

body.dark .rus-profile-form .rus-field:has(input:required) .rus-field__label::after,
body.dark .rus-profile-form .rus-field:has(textarea:required) .rus-field__label::after {
    color: #ff5c43;
}

.rus-profile-form .rus-field input[type="text"],
.rus-profile-form .rus-field input[type="email"],
.rus-profile-form .rus-field input[type="password"],
.rus-profile-form .rus-field input[type="tel"],
.rus-profile-form .rus-field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rus-profile-form .rus-field textarea {
    min-height: 100px;
    resize: vertical;
}

.rus-profile-form .rus-field input:focus,
.rus-profile-form .rus-field textarea:focus {
    outline: none;
    border-color: #d9381e;
    box-shadow: 0 0 0 3px rgba(217, 56, 30, 0.12);
}

body.dark .rus-profile-form .rus-field input,
body.dark .rus-profile-form .rus-field textarea {
    background: #111;
    border-color: #2a2a2a;
    color: #f3f3f3;
}

body.dark .rus-profile-form .rus-field input:focus,
body.dark .rus-profile-form .rus-field textarea:focus {
    border-color: #ff5c43;
    box-shadow: 0 0 0 3px rgba(255, 92, 67, 0.15);
}

.rus-profile-form .rus-form__subtitle {
    margin: 24px 0 12px;
    font-size: 18px;
    font-weight: 700;
}

.rus-profile-form .rus-form__submit {
    display: flex;
    justify-content: flex-end;
}

.rus-profile-form .rus-form__submit .rus-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
}

.rus-profile-card {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
body.dark .rus-profile-card {
    background: #1f1f1f;
}

.rus-profile-card__avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 14px;
    border-radius: 50%;
    overflow: hidden;
    background: #e0e0e0;
}
body.dark .rus-profile-card__avatar {
    background: #333;
}
.rus-profile-card__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rus-profile-card__name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 4px;
}
.rus-profile-card__email {
    font-size: 14px;
    color: #555;
    margin: 0 0 4px;
    word-break: break-all;
}
body.dark .rus-profile-card__email {
    color: #aaa;
}
.rus-profile-card__since {
    font-size: 13px;
    color: #777;
    margin: 0 0 16px;
}
body.dark .rus-profile-card__since {
    color: #999;
}

.rus-profile-card__stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 18px;
}
.rus-profile-card__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 13px;
    color: #555;
}
body.dark .rus-profile-card__stat {
    color: #aaa;
}
.rus-profile-card__stat strong {
    font-size: 22px;
    font-weight: 700;
    color: #111;
}
body.dark .rus-profile-card__stat strong {
    color: #f3f3f3;
}

.rus-profile-card__social h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
}
.rus-profile-card__social .rus-btn {
    width: 100%;
    margin-bottom: 8px;
}
.rus-profile-card__social .rus-btn:last-child {
    margin-bottom: 0;
}
