/* Shared XCake visual language: editorial display type + practical UI type. */

:root {
    --font-display: Georgia, "Times New Roman", serif;
    --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, Arial, sans-serif;
    --content-readable: 760px;
}

body {
    font-family: var(--font-ui);
    font-feature-settings: "kern" 1, "liga" 1;
    text-rendering: optimizeLegibility;
}

.recipe-title,
.home-title,
.home-section-title,
.catalog-title,
.account-hero h1,
.auth-card h1,
.public-profile-name,
.recipe-editor-page h1,
.recipe-editor-section h2,
.user-workspace-head h1,
.community-page h1,
.discovery-page h1,
.collections-page h1 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.recipe-card-title,
.discovery-section h2,
.public-profile-page h2,
.account-page h2,
.user-recipes-page h2 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -.025em;
}

p,
li,
textarea,
input,
select,
button {
    line-height: 1.55;
}

.button,
.btn,
.public-nav-link,
.public-user-shortcut,
.public-user-button,
.public-logout-button {
    font-family: var(--font-ui);
    letter-spacing: 0;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    line-height: 1.45;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.breadcrumbs [aria-current="page"] {
    color: var(--text);
    font-weight: 700;
}

.summary-category-label {
    margin: 14px 0 24px;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: clamp(25px, 3vw, 38px);
    line-height: 1.05;
    letter-spacing: -.035em;
}

.recipe-editor-row select {
    width: 100%;
    padding: 12px 13px;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 11px;
    font: inherit;
}

.ingredient-row.recipe-editor-row {
    grid-template-columns:
        minmax(150px, 1.35fr)
        minmax(95px, .55fr)
        minmax(105px, .6fr)
        minmax(150px, 1fr)
        42px;
}

.recipe-editor-message-success + .recipe-editor-form .recipe-editor-actions {
    scroll-margin-top: 24px;
}

@media (max-width: 760px) {
    .ingredient-row.recipe-editor-row {
        grid-template-columns: minmax(0, 1fr) minmax(105px, .7fr);
    }

    .ingredient-name,
    .ingredient-note {
        grid-column: 1 / -1;
    }

    .ingredient-row .recipe-row-remove {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .recipe-intro,
    .recipe-summary,
    .recipe-card,
    .recipe-author-note,
    .recipe-rating-panel,
    .recipe-comments-section {
        border-radius: 0;
    }

    .recipe-intro .recipe-rating-panel,
    .recipe-intro .recipe-comments-section {
        width: calc(100% + 32px);
        margin-inline: -16px;
    }

    .ingredient-row.recipe-editor-row {
        grid-template-columns: 1fr;
    }

    .ingredient-name,
    .ingredient-note,
    .ingredient-row .recipe-row-remove {
        grid-column: auto;
    }

    .breadcrumbs {
        padding-inline: 16px;
        font-size: 13px;
    }
}


/* ==========================================================
   Shared interaction contract
   ========================================================== */

/*
 * The public pages use several independent feature stylesheets. These rules
 * keep their keyboard focus, disabled states and long-content behaviour
 * consistent without changing each feature's geometry.
 */
::selection {
    color: var(--text);
    background: #ffd9c8;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(232, 100, 61, .26);
    outline-offset: 3px;
}

:where(button, input, select, textarea):disabled,
[aria-disabled="true"] {
    opacity: .58;
    cursor: not-allowed;
}

:where(button, .button, .btn) {
    -webkit-tap-highlight-color: transparent;
}

:where(.recipe-title, .home-title, .home-section-title, .recipes-discovery-title,
       .recipes-results-title, .cuisines-directory-name, .home-recipe-title) {
    overflow-wrap: break-word;
}

.home-recipe-card:focus-visible,
.cuisine-directory-card:focus-visible {
    outline-offset: 5px;
}

.public-nav {
    min-width: 0;
}

@media (hover: none) {
    .home-recipe-card:hover,
    .cuisine-directory-card:hover {
        transform: none;
    }
}

@media (max-width: 700px) {
    .site-header {
        flex-wrap: wrap;
        gap: 12px 16px;
    }

    .public-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        white-space: nowrap;
        scrollbar-width: none;
        scroll-snap-type: x proximity;
    }

    .public-nav::-webkit-scrollbar {
        display: none;
    }

    .public-nav-link {
        scroll-snap-align: start;
    }
}

@media (max-width: 520px) {
    input,
    select,
    textarea {
        font-size: 16px;
    }
}


/* ==========================================================
   Authentication surfaces
   ========================================================== */

/*
 * Login and registration share the same interaction language as the public
 * catalogue. No remote webfont is required: the UI stack is deterministic on
 * Windows, macOS, Android and Linux, while Georgia remains the editorial face.
 */
.auth-card {
    overflow: hidden;
}

.auth-form input {
    min-height: 50px;
    transition:
        border-color .16s ease,
        box-shadow .16s ease,
        background-color .16s ease;
}

.auth-form input:hover:not(:disabled) {
    border-color: #dfcfc4;
}

.auth-form input:focus-visible {
    outline: 0;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(232, 100, 61, .12);
}

.auth-primary-button {
    transition:
        background-color .16s ease,
        box-shadow .16s ease,
        transform .16s ease;
}

.auth-primary-button:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 10px 24px rgba(188, 70, 38, .18);
    transform: translateY(-1px);
}

.auth-primary-button:active:not(:disabled) {
    box-shadow: none;
    transform: translateY(0);
}

.auth-form.is-busy .auth-primary-button {
    cursor: wait;
}

.auth-form.is-busy .auth-primary-button::after {
    content: "…";
    margin-left: 4px;
}

.auth-switch a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.auth-switch a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.auth-provider-button:focus-visible {
    outline: 3px solid rgba(232, 100, 61, .26);
    outline-offset: 3px;
}

.auth-error,
.auth-provider-error {
    overflow-wrap: anywhere;
}

@media (max-width: 520px) {
    .auth-page {
        padding-top: 22px;
    }

    .auth-card {
        padding: 25px 20px;
        border-radius: 22px;
    }

    .auth-card h1 {
        font-size: clamp(38px, 12vw, 48px);
    }

    .auth-form-columns {
        grid-template-columns: 1fr;
    }

    .auth-provider-button {
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* ==========================================================
   Zapechka visual wordmark and resilient profile states
   ========================================================== */

/*
 * The public brand changes visually before the domain migration. Technical
 * XCake identifiers and URLs intentionally remain untouched until zapechka.ru
 * becomes the canonical host.
 */
.brand-link {
    min-width: 0;
    line-height: 1;
}

.brand-wordmark {
    display: inline-block;
    color: var(--accent);
    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 700;
    line-height: .95;
    letter-spacing: -.065em;
    text-transform: lowercase;
    white-space: nowrap;
    transform: rotate(-1deg);
}

.brand-link:hover .brand-wordmark {
    color: var(--accent-hover);
}

.brand-link:focus-visible {
    border-radius: 8px;
}

.public-profile-empty.is-error {
    color: #8c3825;
    background: #fff5ef;
    border: 1px solid #efc7b8;
}

.public-profile-retry {
    min-height: 40px;
    margin-top: 12px;
    padding: 8px 15px;
    color: #fff;
    background: var(--accent);
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.public-profile-retry:hover {
    background: var(--accent-hover);
}

@media (max-width: 520px) {
    .brand-wordmark {
        font-size: 34px;
    }
}




/* ==========================================================
   Zapechka wordmark v2

   Restores the original warm handwritten display type while
   retaining the subtle baked-peach highlight requested for the
   new Zapechka identity.
   ========================================================== */

.brand-wordmark {
    position: relative;
    z-index: 0;

    display: inline-block;

    padding: 0.05em 0.14em 0.11em;

    color: var(--accent);

    font-family: var(--font-display);
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.065em;

    text-transform: lowercase;
    white-space: nowrap;

    transform: rotate(-1deg);
    transform-origin: center;
}

/*
 * The highlight deliberately covers only the lower part of the letters,
 * preserving the light handwritten appearance of the original logo.
 */
.brand-wordmark::before {
    content: "";

    position: absolute;
    z-index: -1;

    left: 0;
    right: -0.04em;
    bottom: 0.02em;

    height: 0.44em;

    background: #f4c7b5;
    border-radius: 3px;

    transform: rotate(0.3deg);
    transform-origin: center;
}

.brand-link:hover .brand-wordmark {
    color: var(--accent-hover);
}

.brand-link:focus-visible {
    outline: 3px solid rgba(201, 92, 62, 0.3);
    outline-offset: 6px;
    border-radius: 8px;
}

@media (max-width: 520px) {
    .brand-wordmark {
        font-size: 34px;
    }
}
