/**
 * أنماط موقع صفوة — تفاصيل، أنوثة، فخامة
 */

html { scroll-behavior: smooth; }
html, body { width: 100%; max-width: 100vw; overflow-x: hidden; }
body { margin: 0; }

/* ========== Loader ========== */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fdf2f4 0%, #faf6f4 50%, #f5efe9 100%);
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.app-loader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.app-loader__bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 50% at 50% 40%, rgba(232, 180, 184, 0.2) 0%, transparent 50%);
}
.app-loader__inner { position: relative; z-index: 1; text-align: center; }
.app-loader__dots {
    display: flex;
    gap: 6px;
    margin-bottom: 1rem;
    justify-content: center;
}
.app-loader__dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #722f3d;
    animation: loader-dot 1.4s ease-in-out infinite both;
}
.app-loader__dots span:nth-child(2) { animation-delay: 0.2s; }
.app-loader__dots span:nth-child(3) { animation-delay: 0.4s; }
.app-loader__text { font-weight: 700; font-size: 1.25rem; color: #2d2726; margin: 0 0 0.25rem; }
.app-loader__sub { font-size: 0.875rem; color: #722f3d; margin: 0; }
@keyframes loader-dot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* ========== Hero ========== */
.hero-section .hero-ribbon { letter-spacing: 0.02em; }
.hero-section .hero-title { text-shadow: 0 1px 2px rgba(255,255,255,0.5); }
.hero-section .hero-frame img { transition: transform 0.6s ease; }
.hero-section .hero-frame:hover img { transform: scale(1.02); }
.hero-section .hero-cta:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(114, 47, 61, 0.2);
}
/* بطاقتان متداخلتان — الخلفية تميل وتظهر من النص وفوق */
.hero-card-back {
    transform: rotate(-6deg) translateY(-24px) translateX(18px);
    transition: transform 0.4s ease;
}
[dir="rtl"] .hero-card-back {
    transform: rotate(-6deg) translateY(-24px) translateX(-18px);
}
.hero-cards:hover .hero-card-back {
    transform: rotate(-5deg) translateY(-22px) translateX(16px);
}
[dir="rtl"] .hero-cards:hover .hero-card-back {
    transform: rotate(-5deg) translateY(-22px) translateX(-16px);
}
.hero-card-front {
    transform: rotate(3deg);
    transition: transform 0.4s ease;
}
.hero-cards:hover .hero-card-front {
    transform: rotate(2deg) translateY(-2px);
}
.hero-card-front img { transition: transform 0.5s ease; }
.hero-card-front:hover img { transform: scale(1.02); }

/* ========== Reveal on scroll ========== */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal.delay-1 { transition-delay: 0.1s; }
.reveal.delay-2 { transition-delay: 0.2s; }
.reveal.delay-3 { transition-delay: 0.3s; }
.reveal.delay-4 { transition-delay: 0.4s; }
.reveal.delay-5 { transition-delay: 0.5s; }

/* ========== Section divider ========== */
.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(232, 180, 184, 0.35), transparent);
    margin: 0 auto;
    max-width: 12rem;
}

/* ========== Cards — توحيد الظلال والحركة ========== */
.card-hover {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.card-hover:hover {
    box-shadow: 0 12px 40px -12px rgba(114, 47, 61, 0.18), 0 0 0 1px rgba(232, 180, 184, 0.08);
    transform: translateY(-2px);
}

.shadow-card { transition: box-shadow 0.3s ease; }
.shadow-card:hover {
    box-shadow: 0 12px 40px -12px rgba(114, 47, 61, 0.18), 0 0 0 1px rgba(232, 180, 184, 0.08);
}

.quote-card {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.quote-card:hover {
    box-shadow: 0 8px 28px -8px rgba(114, 47, 61, 0.15);
}

.polaroid-tilt { transform: rotate(-1deg); }
.polaroid-tilt:nth-child(even) { transform: rotate(1.5deg); }

.memory-card {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.memory-card:hover {
    box-shadow: 0 12px 36px -10px rgba(114, 47, 61, 0.15);
}

.shelf-card {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* ========== Special section (الرفقة الآمنة) ========== */
.special-section { position: relative; }
.special-badge {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.special-badge:hover {
    box-shadow: 0 6px 20px -4px rgba(114, 47, 61, 0.15);
}
.special-title {
    letter-spacing: -0.02em;
}
.special-quote {
    letter-spacing: 0.01em;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
}
.special-photo-wrap {
    perspective: 800px;
}
.special-card {
    transition: box-shadow 0.4s ease, transform 0.3s ease;
}
.special-card:hover {
    box-shadow: 0 24px 56px -16px rgba(114, 47, 61, 0.22), 0 0 0 1px rgba(232, 180, 184, 0.2);
    transform: translateY(-4px);
}

/* ========== Quote section — reveal ========== */
.quote-reveal {
    animation: quoteFadeIn 1s ease-out forwards;
}
@keyframes quoteFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Video ========== */
video { display: block; }
video::-webkit-media-controls-panel {
    background: linear-gradient(transparent, rgba(0,0,0,0.05));
}

/* ========== Mobile — أحجام صور معقولة وتجربة استخدام ========== */
@media (max-width: 640px) {
    /* شبكات الصور: حد أقصى عرض على الموبايل لئلا تأخذ الصور الشاشة كاملة */
    .mobile-photo-grid {
        max-width: 22rem; /* 352px */
        margin-left: auto;
        margin-right: auto;
    }
    /* بطاقات الصور: لمس مريح ومساحة مناسبة */
    .mobile-photo-grid .rounded-2xl {
        min-height: 0;
    }
    /* الهيرو: ارتفاع أوضح على الشاشات الصغيرة */
    .hero-cards {
        height: 360px !important;
        max-height: 55vh;
    }
}
@media (min-width: 641px) and (max-width: 1024px) {
    .hero-cards {
        max-height: 60vh;
    }
}

/* ========== Scrollbar ========== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f5efe9; }
::-webkit-scrollbar-thumb { background: #e8c4c8; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #e8b4b8; }
