/* ═══════════════════════════════════════════════
   naily.com.ua — Shared Styles (app.css)
   ═══════════════════════════════════════════════ */

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── CSS VARIABLES ── */
:root {
    --cream: #FBF8F4;
    --warm-white: #FFFFFF;
    --blush: #EEDDD6;
    --blush-light: #F5EBE6;
    --rose: #C9928A;
    --rose-deep: #B87A72;
    --burgundy: #8B4557;
    --warm-brown: #3D2B2B;
    --gold: #C4A67D;
    --gold-light: #D4BA95;
    --text: #4A3636;
    --text-muted: #9B8A85;
    --text-light: #BEB0AB;
    --border: #EDE6E0;
    --green: #5B8C5A;
    --red: #C0392B;
    --shadow-sm: 0 1px 3px rgba(61,43,43,0.06);
    --shadow-md: 0 4px 16px rgba(61,43,43,0.08);
    --shadow-lg: 0 8px 32px rgba(61,43,43,0.12);
    --shadow-hover: 0 12px 40px rgba(61,43,43,0.16);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Outfit', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── BASE ── */
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── NOISE TEXTURE OVERLAY ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 999;
}

/* ── HEADER ── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(251,248,244,0.85);
    backdrop-filter: blur(20px) saturate(1.2);
    -webkit-backdrop-filter: blur(20px) saturate(1.2);
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.header-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.logo {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--warm-brown);
    text-decoration: none;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    transition: var(--transition);
}
.logo span { color: var(--rose); }
.logo:hover { color: var(--burgundy); }

.search-bar {
    flex: 1;
    max-width: 480px;
    position: relative;
}
.search-bar input {
    width: 100%;
    padding: 11px 20px 11px 44px;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    background: var(--warm-white);
    outline: none;
    transition: var(--transition);
}
.search-bar input::placeholder { color: var(--text-light); }
.search-bar input:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(201,146,138,0.15);
}
.search-bar svg {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    background: var(--warm-white);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.header-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.header-btn:hover {
    border-color: var(--rose);
    color: var(--burgundy);
    background: var(--blush-light);
}
.header-btn--primary {
    background: var(--warm-brown);
    color: var(--warm-white);
    border-color: var(--warm-brown);
}
.header-btn--primary:hover {
    background: var(--burgundy);
    border-color: var(--burgundy);
    color: var(--warm-white);
}

/* ── USER DROPDOWN (from header partial) ── */
.user-menu { position: relative; }
.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px 5px 5px;
    border: 1.5px solid var(--border);
    border-radius: 100px;
    background: var(--warm-white);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}
.user-menu-trigger:hover {
    border-color: var(--rose);
    background: var(--blush-light);
}
.user-avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--blush);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}
.user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
.user-menu-trigger svg.chevron {
    width: 14px;
    height: 14px;
    color: var(--text-light);
    transition: transform 0.2s ease;
}
.user-menu.open .user-menu-trigger svg.chevron {
    transform: rotate(180deg);
}
.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--warm-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 32px rgba(61,43,43,0.12);
    padding: 6px;
    z-index: 200;
}
.user-menu.open .user-dropdown { display: block; }
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 400;
    color: var(--text);
    text-decoration: none;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}
.dropdown-item:hover {
    background: var(--blush-light);
    color: var(--warm-brown);
}
.dropdown-item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }
.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}
.dropdown-item--danger:hover { color: var(--burgundy); }

/* ── FAVORITES BADGE ── */
.header-btn--favorites { position: relative; }
.header-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 100px;
    background: var(--burgundy);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── BREADCRUMB ── */
.breadcrumb {
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 32px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 400;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: var(--transition); }
.breadcrumb a:hover { color: var(--rose-deep); }
.breadcrumb svg { width: 12px; height: 12px; flex-shrink: 0; }
.breadcrumb-current { color: var(--text); font-weight: 500; }

/* ── CARD COMPONENT ── */
.card {
    background: var(--warm-white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    container-type: inline-size;
}
.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}
.card-image {
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: var(--blush-light);
    display: block;
    text-decoration: none;
}
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover .card-image img {
    transform: scale(1.05);
}
.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--warm-brown);
    color: var(--warm-white);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 100px;
}
.card-like-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(8px);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.card-like-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: var(--transition);
}
.card-like-btn:hover { background: #fff; transform: scale(1.1); }
.card-like-btn:hover svg { color: var(--rose-deep); }
.card-like-btn.liked svg { color: #E25555; fill: #E25555; }

.card-placeholder {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    color: var(--text-light);
}

.card-body { padding: 14px 16px 6px; }
.card-title {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 600;
    color: var(--warm-brown);
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-title a { color: inherit; text-decoration: none; }
.card-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 38px;
}

.card-footer {
    padding: 8px 16px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}
.card-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 400;
}
.card-stat svg { width: 14px; height: 14px; }

.card-share {
    display: flex;
    align-items: center;
    gap: 2px;
}
.card-share-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: var(--transition);
}
.card-share-btn svg { width: 13px; height: 13px; }
.card-share-btn:hover { color: var(--warm-brown); background: var(--blush-light); }

/* ── GRID ── */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ── RESULTS BAR ── */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.results-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 400;
}
.results-count strong {
    color: var(--text);
    font-weight: 600;
}
.sort-select {
    padding: 7px 32px 7px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text);
    background: var(--warm-white) url("data:image/svg+xml,%3Csvg width='10' height='6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239B8A85' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center;
    appearance: none;
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}
.sort-select:focus { border-color: var(--rose); }

/* ── PAGINATION ── */
.pagination-wrapper {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Desktop layout */
.pagination__desktop {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pagination__mobile { display: none; }

/* Page numbers row */
.pagination__pages {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 4px;
}

/* Arrow buttons (prev/next) */
.pagination__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--warm-white);
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.pagination__btn:hover {
    border-color: var(--rose);
    color: var(--rose-deep);
    background: var(--blush-light);
}
.pagination__btn--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Page number links */
.pagination__num {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 6px;
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.pagination__num:hover {
    color: var(--text);
    background: var(--blush-light);
}

/* Active page */
.pagination__num--active {
    background: var(--warm-brown);
    color: var(--warm-white);
    cursor: default;
    font-weight: 600;
}

/* Ellipsis dots */
.pagination__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 40px;
    color: var(--text-light);
    font-size: 14px;
    letter-spacing: 2px;
    pointer-events: none;
}

/* Mobile indicator "3 / 12" */
.pagination__indicator {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    padding: 0 16px;
    white-space: nowrap;
}
.pagination__indicator-sep {
    color: var(--text-light);
    margin: 0 3px;
}

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
}
.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    color: var(--blush);
}
.empty-state h3 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.empty-state p { font-size: 14px; color: var(--text-light); }

/* ── FORM CONTROLS ── */
.form-group {
    display: flex;
    flex-direction: column;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}
.form-input, .form-textarea {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text);
    background: var(--warm-white);
    outline: none;
    transition: var(--transition);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-light); }
.form-input:focus, .form-textarea:focus {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(201,146,138,0.15);
}
.form-input.is-invalid, .form-textarea.is-invalid { border-color: var(--red); }
.form-textarea {
    resize: vertical;
    min-height: 100px;
}
.form-error {
    font-size: 12px;
    color: var(--red);
    margin-top: 4px;
}
.form-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 4px;
}

/* ── ANIMATION ── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.card {
    opacity: 0;
    animation: fadeUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    cursor: pointer;
    will-change: transform;
}

/* ── FOCUS-VISIBLE (keyboard navigation) ── */
:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--rose);
    outline-offset: 2px;
}
/* Remove outline on mouse focus */
:focus:not(:focus-visible) { outline: none; }

/* ── RESPONSIVE: ULTRAWIDE ── */
@media (min-width: 1600px) {
    .grid { grid-template-columns: repeat(5, 1fr); }
}
@media (min-width: 2000px) {
    .grid { grid-template-columns: repeat(6, 1fr); }
}

/* ── RESPONSIVE: GRID ── */
@media (max-width: 1200px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .grid { grid-template-columns: repeat(2, 1fr); }
    .pagination__btn { width: 38px; height: 38px; }
    .pagination__num { min-width: 36px; height: 36px; font-size: 13px; }
    .pagination__dots { width: 28px; height: 36px; }
}
@media (max-width: 600px) {
    .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .header-inner { height: 56px; gap: 8px; padding: 0 12px; }
    .logo { font-size: 22px; }
    .search-bar { max-width: none; flex: 1; min-width: 0; }
    .search-bar input { padding: 9px 16px 9px 38px; font-size: 13px; }
    .search-bar svg { left: 12px; width: 16px; height: 16px; }
    .header-btn span { display: none; }
    .header-btn { padding: 9px 12px; min-width: 44px; min-height: 44px; justify-content: center; }
    .header-actions { gap: 4px; }
    .user-menu-trigger { padding: 4px 10px 4px 4px; font-size: 0; gap: 0; }
    .user-menu-trigger svg.chevron { display: none; }
    .card-body { padding: 10px 12px 4px; }
    .card-footer { padding: 6px 12px 12px; }
    .card-title { font-size: 15px; }
    .card-desc { font-size: 11.5px; }
    .results-bar { flex-direction: column; gap: 8px; align-items: flex-start; }
    .breadcrumb { padding: 14px 16px 0; font-size: 12px; }
    /* Pagination mobile */
    .pagination-wrapper { margin-top: 32px; padding-top: 24px; }
    .pagination__desktop { display: none; }
    .pagination__mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }
    .pagination__btn { width: 44px; height: 44px; }
    .pagination__indicator { font-size: 15px; padding: 0 12px; }
}

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
.footer {
    background: var(--warm-brown);
    color: rgba(255,255,255,0.75);
    margin-top: 80px;
}
.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px 40px 32px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
}
.footer-logo {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 12px;
}
.footer-logo span { color: var(--rose); }
.footer-desc {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,0.55);
    max-width: 280px;
}
.footer-heading {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 16px;
}
.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 14px;
    transition: color var(--transition);
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 24px;
    text-align: center;
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

@media (max-width: 900px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 600px) {
    .footer { margin-top: 48px; }
    .footer-inner { padding: 40px 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
