/* Taymopatina — custom.css
 * Custom styles layered on top of tailwind.css
 * Color palette:
 *   taymo-cream:       #F8F5EE
 *   taymo-gold:        #7A7542
 *   taymo-gold-dark:   #5D4203
 *   taymo-indigo:      #717FE0
 *   taymo-indigo-dark: #4F5FCC
 *   taymo-ink:         #222222
 *   taymo-ink-soft:    #4A4A4A
 *   taymo-ink-muted:   #9B9B9B
 *   taymo-yellow:      #F7C60F
 *   taymo-pink:        #E83E8C
 */

/* ====== Typography ====== */
body {
    font-family: 'Vazirmatn', 'IranSans', Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

@media (min-width: 768px) {
    body { font-size: 15px; }
}

.font-display {
    font-family: 'PlayfairDisplay', 'Vazirmatn', serif;
    font-weight: 700;
}

[dir="ltr"] body,
html[dir="ltr"] body {
    font-family: 'Inter', Tahoma, Arial, sans-serif;
}

/* Article content - normalize sizes */
.prose p {
    font-size: 14px;
    line-height: 1.85;
    margin-bottom: 0.85rem;
}
.prose h1, .prose h2, .prose h3 {
    font-weight: 700;
    color: #5D4203;
    margin-top: 1.2rem;
    margin-bottom: 0.6rem;
}
.prose h1 { font-size: 1.4rem; }
.prose h2 { font-size: 1.25rem; }
.prose h3 { font-size: 1.1rem; }
.prose img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* ====== Buttons ====== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #7A7542 0%, #5D4203 100%);
    color: #fff !important;
    padding: 0.625rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(122, 117, 66, 0.2);
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #5D4203 0%, #4a3500 100%);
    box-shadow: 0 4px 12px rgba(122, 117, 66, 0.35);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #fff;
    color: #7A7542 !important;
    padding: 0.625rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1.5px solid #7A7542;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
}
.btn-outline:hover {
    background: #7A7542;
    color: #fff !important;
}

/* ====== Cards ====== */
.card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0ebe0;
}
.card-hover {
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card-hover:hover {
    box-shadow: 0 10px 25px rgba(122, 117, 66, 0.15);
    transform: translateY(-3px);
}

/* ====== Gradient ====== */
.gradient-taymo {
    background: linear-gradient(135deg, #5D4203 0%, #7A7542 50%, #9B9461 100%);
}

/* ====== Shadows ====== */
.shadow-taymo {
    box-shadow: 0 4px 14px rgba(122, 117, 66, 0.12);
}

/* ====== Tables ====== */
.table-th {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: right;
    white-space: nowrap;
}
.table-td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: #4A4A4A;
    vertical-align: middle;
}

/* ====== Badges ====== */
.badge-gold, .badge-blue, .badge-gray, .badge-green, .badge-red {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
}
.badge-gold { background: #fef3c7; color: #92400e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-gray { background: #f3f4f6; color: #6b7280; }
.badge-green { background: #d1fae5; color: #065f46; }
.badge-red { background: #fee2e2; color: #991b1b; }

/* ====== Inputs ====== */
.input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    color: #222;
    background: #fff;
    border: 1.5px solid #e5e7eb;
    border-radius: 0.5rem;
    transition: all 0.15s;
}
.input:focus {
    outline: none;
    border-color: #7A7542;
    box-shadow: 0 0 0 3px rgba(122, 117, 66, 0.1);
}
.label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4A4A4A;
    margin-bottom: 0.375rem;
}

/* ====== Animations ====== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}
.animate-slide-up {
    animation: slideUp 0.6s ease-out;
}

/* ====== Line clamp (works without tailwind plugin) ====== */
.line-clamp-1, .line-clamp-2, .line-clamp-3, .line-clamp-4 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-1 { -webkit-line-clamp: 1; }
.line-clamp-2 { -webkit-line-clamp: 2; }
.line-clamp-3 { -webkit-line-clamp: 3; }
.line-clamp-4 { -webkit-line-clamp: 4; }

/* ====== Aspect ratios ====== */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-\[4\/5\] { aspect-ratio: 4 / 5; }

/* ====== Rounded sizes (backward compat with old tailwind classes) ====== */
.rounded-xl2 { border-radius: 1rem; }

/* ====== Misc ====== */
.prose {
    color: #4A4A4A;
    line-height: 1.85;
}
.prose img { max-width: 100%; height: auto; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f8f5ee; }
::-webkit-scrollbar-thumb {
    background: #c4b990;
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover { background: #7A7542; }

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 1rem;
    animation: fadeIn 0.2s ease-out;
}
.modal-content {
    background: #fff;
    border-radius: 1rem;
    max-width: 56rem;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

/* RTL fixes */
[dir="rtl"] .ltr-nums { direction: ltr; display: inline-block; }

/* Article detail typography */
.article-content {
    font-size: 15px;
    line-height: 2;
    color: #4A4A4A;
}
.article-content h1 { font-size: 1.5rem; margin-top: 1.5rem; margin-bottom: 0.75rem; font-weight: 700; color: #5D4203; }
.article-content h2 { font-size: 1.3rem; margin-top: 1.25rem; margin-bottom: 0.625rem; font-weight: 700; color: #5D4203; }
.article-content h3 { font-size: 1.15rem; margin-top: 1rem; margin-bottom: 0.5rem; font-weight: 600; color: #5D4203; }
.article-content p { margin-bottom: 1rem; }
.article-content ul, .article-content ol { margin: 1rem 0; padding-right: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1rem 0; }
.article-content a { color: #717FE0; text-decoration: underline; }

/* Hide elements on mobile/desktop */
@media (max-width: 767px) {
    .hidden-mobile { display: none !important; }
}
@media (min-width: 768px) {
    .hidden-desktop { display: none !important; }
}

/* Admin panel — RTL sidebar fix */
.admin-sidebar {
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
}

/* Admin sidebar links */
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.15s;
    text-decoration: none;
}
.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}
.sidebar-link-active {
    background: linear-gradient(135deg, #7A7542 0%, #5D4203 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(122, 117, 66, 0.3);
}
.sidebar-link-active:hover {
    background: linear-gradient(135deg, #5D4203 0%, #4a3500 100%);
}

/* Ghost button (admin) */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #4A4A4A;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
    text-decoration: none;
}
.btn-ghost:hover {
    background: #f3f4f6;
    color: #222;
}

/* Page heading (admin) */
.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Scrollbar (thin) */
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* Print-friendly invoice */
@media print {
    .no-print { display: none !important; }
    body { background: #fff !important; color: #000 !important; }
}

/* ============================================================
 *  v1.3 — Global typography + responsive fixes
 * ============================================================ */

/* Improved line-height for paragraphs sitewide */
p { line-height: 1.75; margin-bottom: 0.75rem; }
h1, h2, h3, h4, h5, h6 { line-height: 1.4; }

/* Article content — proper typography */
.article-content {
    font-size: 0.95rem;
    line-height: 2;
    color: #2a2a2a;
}
.article-content p { margin-bottom: 1rem; font-size: 0.95rem; line-height: 2; }
.article-content img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1rem 0; }
.article-content h1 { font-size: 1.5rem; margin: 1.5rem 0 0.75rem; }
.article-content h2 { font-size: 1.3rem; margin: 1.25rem 0 0.5rem; }
.article-content h3 { font-size: 1.15rem; margin: 1rem 0 0.5rem; }
.article-content ul, .article-content ol { padding-right: 1.5rem; margin: 1rem 0; }
.article-content li { margin-bottom: 0.5rem; line-height: 1.8; }
.article-content a { color: #5D4203; text-decoration: underline; }
.article-content blockquote {
    border-right: 4px solid #7A7542;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    background: #F8F5EE;
    border-radius: 0.5rem;
    font-style: italic;
}
.article-content pre {
    background: #1a1a1a;
    color: #f5f5f5;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    direction: ltr;
}

/* Responsive tables */
.table-th, .table-td {
    padding: 0.625rem 0.75rem;
    text-align: right;
    font-size: 0.85rem;
}
@media (min-width: 1024px) {
    .table-th, .table-td { padding: 0.75rem 1rem; font-size: 0.875rem; }
}

/* Mobile-first: prevent horizontal overflow on small screens */
html, body { overflow-x: hidden; max-width: 100%; }
img { max-width: 100%; height: auto; }
table { max-width: 100%; }

/* Better mobile button targets */
button, a.btn, .btn-primary, .btn-outline, .btn-ghost {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Toast container fixed */
#toastContainer { z-index: 9999; }

/* Drawer animation */
@keyframes slide-up {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.animate-slide-up { animation: slide-up 0.25s ease-out; }

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
.animate-fade-in { animation: fade-in 0.3s ease-out; }

/* v1.3 — Hide scrollbars on mobile horizontal scrollers but keep functionality */
.overflow-x-auto { -webkit-overflow-scrolling: touch; }
.overflow-x-auto::-webkit-scrollbar { height: 6px; }
.overflow-x-auto::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 3px; }

/* v1.3 — Line clamp helpers (in case Tailwind line-clamp isn't available) */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* v1.3 — Aspect ratio helpers (in case Tailwind aspect-* isn't available) */
.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }

/* v1.3 — Card hover */
.card-hover {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.10);
}

/* v1.3 — Newsletter box improvements */
.gradient-taymo {
    background: linear-gradient(135deg, #5D4203 0%, #7A7542 50%, #9b8e4e 100%);
}

/* v1.3 — Inputs */
.input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    background: #fff;
    color: #222;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
    outline: none;
    border-color: #7A7542;
    box-shadow: 0 0 0 3px rgba(122, 117, 66, 0.15);
}
.label {
    display: block;
    font-size: 0.8rem;
    color: #4A4A4A;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

/* v1.3 — Buttons */
.btn-primary, .btn-outline, .btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    border: 1px solid transparent;
}
.btn-primary {
    background: linear-gradient(135deg, #7A7542 0%, #5D4203 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(122, 117, 66, 0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #5D4203 0%, #4a3500 100%);
    box-shadow: 0 4px 10px rgba(122, 117, 66, 0.35);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    color: #5D4203;
    border: 1px solid #7A7542;
}
.btn-outline:hover {
    background: rgba(122, 117, 66, 0.10);
}

/* v1.3 — Badges */
.badge-green {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #dcfce7;
    color: #15803d;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-gray {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #f3f4f6;
    color: #4b5563;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-yellow {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #fef3c7;
    color: #92400e;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-blue {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-red {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #fee2e2;
    color: #b91c1c;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* v1.3 — Lightbox image */
#lightbox img {
    transition: opacity 0.2s;
}

/* v1.3 — Cart drawer animation */
#cartDrawer:not(.hidden) aside {
    animation: slide-in-0 0.3s ease-out;
}
@keyframes slide-in-0 {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* v1.3 — Hide number input spinner */
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* v1.3 — Long word break */
.break-words, .prose, .article-content { word-wrap: break-word; overflow-wrap: break-word; }

/* v1.3 — Pointer fine → no mobile tap highlight */
@media (hover: hover) and (pointer: fine) {
    /* Desktop-only hover effects here */
}

/* v1.3 — Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
