/* 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;
    }
}


/*
 * ВАЖНО — утверждённое решение дизайна «Запечки».
 *
 * На телефонах блоки рецепта должны быть во всю ширину экрана
 * и БЕЗ скруглений. Это намеренный, более цельный формат чтения
 * рецепта на мобильном устройстве, а не недоработка.
 *
 * Не возвращать мобильные отступы/скругления «для красоты»
 * без отдельного решения владельца проекта.
 */


/* ==========================================================
   Zapechka interface foundation polish v0.0.34
   Общая читаемость и доступность. Новых функций здесь нет.
   ========================================================== */

html {
    overflow-x: clip;
}

body {
    overflow-x: clip;
    font-synthesis: none;
}

:where(h1, h2, h3, .home-recipe-title, .recipe-card-title,
       .recipe-title, .public-profile-name, .account-identity-name) {
    overflow-wrap: anywhere;
}

:where(.home-lead, .catalog-lead, .recipe-description,
       .community-hero p, .auth-lead) {
    text-wrap: pretty;
}

:where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid rgba(183, 92, 42, .55);
    outline-offset: 3px;
}

.site-footer a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/*
 * ВАЖНО — утверждённое решение дизайна «Запечки».
 *
 * На телефонах блоки рецепта должны быть во всю ширину экрана
 * и БЕЗ скруглений. Это намеренный формат чтения рецепта.
 * Не менять мобильные отступы/скругления «для красоты».
 */

/* ==========================================================
   ZAPECHKA BIG VISUAL RELEASE V1
   Shared typography, cards, controls, footer and mobile rhythm.
   This intentionally stays in one global stylesheet so public pages
   receive a consistent interface without a frontend build system.
   ========================================================== */

:root {
    --page-width: 1180px;
    --content-readable: 760px;
    --surface-raised: rgba(255, 255, 255, .92);
    --surface-tint: #fff7f1;
    --line-soft: #eadcd2;
    --shadow-card: 0 14px 38px rgba(81, 49, 28, .08);
    --shadow-hover: 0 20px 48px rgba(81, 49, 28, .13);
}

body {
    line-height: 1.55;
    background:
        radial-gradient(circle at 93% -3%, rgba(255, 213, 190, .78) 0, transparent 29rem),
        radial-gradient(circle at 4% 22%, rgba(255, 238, 224, .72) 0, transparent 25rem),
        var(--background);
}

.site-header {
    position: relative;
    z-index: 5;
    width: min(var(--page-width), calc(100% - 40px));
    min-height: 92px;
    margin: 0 auto;
    padding: 18px 0;
}

.site-header::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(207, 169, 142, .55), transparent);
}

.container {
    width: min(var(--page-width), calc(100% - 40px));
}

.public-nav {
    gap: 5px;
    padding: 5px;
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(234, 220, 210, .9);
    border-radius: 999px;
    box-shadow: 0 7px 22px rgba(81, 49, 28, .04);
}

.public-nav-link {
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.public-nav-link:hover {
    color: var(--accent-hover);
    background: var(--accent-soft);
}

.public-nav-link-active {
    color: #fff;
    background: var(--accent);
    box-shadow: 0 5px 14px rgba(201, 83, 47, .22);
}

.public-nav-link-active:hover {
    color: #fff;
    background: var(--accent-hover);
}

main.container {
    padding-bottom: 76px;
}

.home-main {
    padding-top: clamp(30px, 5vw, 66px);
}

.home-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(30px, 6vw, 70px);
    border: 1px solid rgba(234, 220, 210, .92);
    border-radius: 32px;
    background:
        linear-gradient(115deg, rgba(255, 255, 255, .95), rgba(255, 247, 241, .91));
    box-shadow: var(--shadow-card);
}

.home-hero::after {
    content: "";
    position: absolute;
    top: -130px;
    right: -110px;
    width: 310px;
    height: 310px;
    border: 38px solid rgba(244, 199, 181, .32);
    border-radius: 50%;
    pointer-events: none;
}

.home-hero > * {
    position: relative;
    z-index: 1;
}

.home-eyebrow,
.home-section-kicker,
.contact-kicker {
    color: #a74b31;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.home-title {
    max-width: 760px;
    margin: 12px 0 18px;
    font-size: clamp(45px, 6.5vw, 78px);
    line-height: .96;
}

.home-lead {
    max-width: 650px;
    margin: 0;
    color: #655b55;
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.65;
}

.home-section {
    margin-top: clamp(52px, 7vw, 94px);
}

.home-section-head {
    gap: 18px;
    margin-bottom: 24px;
}

.home-section-title {
    margin: 5px 0 0;
    font-size: clamp(31px, 4vw, 48px);
    line-height: 1.04;
}

.home-section-link {
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    text-underline-offset: 4px;
}

.home-section-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Recipe cards and catalogue surfaces. */
.recipe-card,
.home-recipe-card,
.cuisine-directory-card,
.collection-card,
.discovery-card {
    overflow: hidden;
    border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-card);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.recipe-card:hover,
.home-recipe-card:hover,
.cuisine-directory-card:hover,
.collection-card:hover,
.discovery-card:hover {
    border-color: #e4c8b8;
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
}

.recipe-card-title,
.home-recipe-title {
    line-height: 1.13;
    text-wrap: balance;
}

.recipe-card-title a,
.home-recipe-title a {
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.recipe-card-meta,
.home-recipe-meta,
.recipe-description,
.recipe-card-description {
    color: var(--muted);
    line-height: 1.58;
}

/* Shared controls: clear focus, tactile hover and comfortable touch targets. */
.button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid transparent;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.button,
.btn,
.home-search-submit,
.auth-primary-button,
.contact-submit,
.public-profile-retry {
    min-height: 46px;
    border-radius: 14px;
    font-weight: 800;
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.button:hover:not(:disabled),
.btn:hover:not(:disabled),
.home-search-submit:hover:not(:disabled),
.contact-submit:hover:not(:disabled),
.public-profile-retry:hover:not(:disabled) {
    box-shadow: 0 10px 23px rgba(189, 75, 40, .19);
    transform: translateY(-2px);
}

.button:active:not(:disabled),
.btn:active:not(:disabled),
.home-search-submit:active:not(:disabled),
.contact-submit:active:not(:disabled),
.public-profile-retry:active:not(:disabled) {
    box-shadow: none;
    transform: translateY(0);
}

input,
select,
textarea {
    border-color: var(--line-soft);
    border-radius: 13px;
    background: rgba(255, 255, 255, .94);
    transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: #d9bfae;
}

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

/* Footer lives globally, not in contact.css: it is injected on every page. */
.site-footer {
    margin-top: auto;
    padding: 36px 0 30px;
    color: #685c55;
    border-top: 1px solid var(--line-soft);
    background: rgba(255, 247, 241, .86);
}

.site-footer-inner {
    display: grid;
    grid-template-columns: auto minmax(190px, 1fr) auto;
    align-items: center;
    gap: 18px 34px;
}

.site-footer-brand .brand-wordmark {
    font-size: 32px;
}

.site-footer-note,
.site-footer-copy {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
}

.site-footer-copy {
    color: #8b7d74;
    text-align: right;
}

.site-footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px 18px;
}

.site-footer-nav a {
    color: #655750;
    font-size: 14px;
    font-weight: 750;
    text-decoration: none;
    text-underline-offset: 4px;
}

.site-footer-nav a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Contact page now feels like part of the same product. */
.contact-page {
    max-width: 900px;
    padding-top: clamp(32px, 6vw, 72px);
}

.contact-intro {
    max-width: 650px;
    margin-bottom: 28px;
}

.contact-intro h1,
.contact-card h2 {
    font-family: var(--font-display);
    font-weight: 400;
    letter-spacing: -.04em;
    line-height: 1.04;
}

.contact-intro h1 {
    margin: 8px 0 13px;
    font-size: clamp(43px, 6vw, 66px);
}

.contact-card {
    padding: clamp(22px, 4vw, 42px);
    border: 1px solid var(--line-soft);
    border-radius: 28px;
    background: var(--surface-raised);
    box-shadow: var(--shadow-card);
}

.contact-card h2 {
    margin-top: 0;
    font-size: clamp(28px, 3.5vw, 38px);
}

.contact-fields {
    gap: 18px;
}

.contact-fields label {
    gap: 7px;
    color: #51463f;
    font-size: 14px;
    font-weight: 750;
}

.contact-fields input,
.contact-fields select,
.contact-fields textarea {
    min-height: 48px;
    padding: 12px 14px;
    color: var(--text);
    font: inherit;
}

.contact-fields textarea {
    min-height: 156px;
    resize: vertical;
}

/* Smaller screens retain spaciousness and avoid edge-to-edge card fatigue. */
@media (max-width: 700px) {
    .site-header,
    .container {
        width: min(100% - 28px, var(--page-width));
    }

    .site-header {
        min-height: 0;
        padding-top: 14px;
    }

    .home-hero {
        padding: 30px 22px;
        border-radius: 25px;
    }

    .home-hero::after {
        top: -150px;
        right: -155px;
        width: 270px;
        height: 270px;
    }

    .home-title {
        font-size: clamp(42px, 12vw, 61px);
    }

    .home-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer-inner {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 16px;
    }

    .site-footer-nav {
        justify-content: flex-start;
    }

    .site-footer-copy {
        text-align: left;
    }
}

@media (max-width: 520px) {
    main.container {
        padding-bottom: 48px;
    }

    .public-nav {
        width: 100%;
    }

    .public-nav-link {
        padding-inline: 13px;
    }

    .home-lead {
        font-size: 17px;
    }

    .recipe-card:hover,
    .home-recipe-card:hover,
    .cuisine-directory-card:hover,
    .collection-card:hover,
    .discovery-card:hover {
        transform: none;
    }

    .contact-page {
        padding-top: 28px;
    }

    .contact-card {
        padding: 23px 18px;
        border-radius: 22px;
    }

    .site-footer {
        padding-block: 29px 24px;
    }
}
