/*
Theme Name: Librairie Aicha
Theme URI: https://librairie-aicha.example
Author: Librairie Aicha
Author URI: https://librairie-aicha.example
Description: A native Gutenberg, Full Site Editing (FSE) WooCommerce block theme for Librairie Aicha. Block-first, theme.json-driven, Interactivity API powered.
Requires at least: 6.5
Tested up to: 6.7
Requires PHP: 7.4
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: librairie-aicha
Tags: full-site-editing, block-styles, woocommerce, e-commerce, custom-colors, custom-menu
WC requires at least: 8.0
WC tested up to: 9.0
*/

/* ═══════════════════════════════════════════════════════════════
   VARIABLES ORIENTALES
   Palette : navy (#0f2abf) × sky (#97a4e6)
═══════════════════════════════════════════════════════════════ */
:root {
  --orient-navy:      #1D4ED8;
  --orient-sky:       #93C5FD;
  --orient-navy-rgb:  29, 78, 216;
  --orient-sky-rgb:   147, 197, 253;
}

/* ═══════════════════════════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════════════════════════ */
@keyframes orient-drift {
  0%   { transform: translateY(0px)   rotate(0deg); }
  33%  { transform: translateY(-8px)  rotate(0.3deg); }
  66%  { transform: translateY(-4px)  rotate(-0.2deg); }
  100% { transform: translateY(0px)   rotate(0deg); }
}
@keyframes glow-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%       { opacity: 0.85; transform: scale(1.08); }
}
@keyframes orb-float {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(-20px, 15px); }
}
@keyframes shimmer-line {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* Arabic letter floating animations */
@keyframes arabic-float-1 {
  0%, 100% { transform: translateY(0px) rotate(var(--la-rot, 0deg)); opacity: var(--la-op, 0.06); }
  50%       { transform: translateY(-18px) rotate(calc(var(--la-rot, 0deg) + 3deg)); opacity: calc(var(--la-op, 0.06) * 1.3); }
}
@keyframes arabic-float-2 {
  0%, 100% { transform: translateY(0px) rotate(var(--la-rot, 0deg)); opacity: var(--la-op, 0.06); }
  40%       { transform: translateY(14px) rotate(calc(var(--la-rot, 0deg) - 2deg)); opacity: calc(var(--la-op, 0.06) * 0.7); }
  70%       { transform: translateY(-10px) rotate(calc(var(--la-rot, 0deg) + 1deg)); opacity: calc(var(--la-op, 0.06) * 1.2); }
}
@keyframes arabic-float-3 {
  0%, 100% { transform: translateY(0px) rotate(var(--la-rot, 0deg)) scale(1); opacity: var(--la-op, 0.06); }
  60%       { transform: translateY(-22px) rotate(calc(var(--la-rot, 0deg) + 4deg)) scale(1.04); opacity: calc(var(--la-op, 0.06) * 1.4); }
}

/* ═══════════════════════════════════════════════════════════════
   FOND CALIGRAPHIQUE ARABE — Lettres décoratives
═══════════════════════════════════════════════════════════════ */
.la-arabic-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  /* height is set inline to match document height */
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.la-arabic-letter {
  position: absolute;
  font-family: 'Noto Naskh Arabic', 'Arabic Typesetting', 'Traditional Arabic', 'Scheherazade New', serif;
  color: var(--orient-navy);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}

/* Individual letter animation variants */
.la-arabic-letter:nth-child(3n+1) { animation: arabic-float-1 var(--la-dur, 8s) ease-in-out infinite; }
.la-arabic-letter:nth-child(3n+2) { animation: arabic-float-2 var(--la-dur, 10s) ease-in-out infinite; }
.la-arabic-letter:nth-child(3n)   { animation: arabic-float-3 var(--la-dur, 12s) ease-in-out infinite; }

/* Wrapper that stretches to full page height */
#la-calligraphy-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════
   BASE — Corps de page
═══════════════════════════════════════════════════════════════ */
body {
  position: relative;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE BACKGROUND — Fond zellige animé
═══════════════════════════════════════════════════════════════ */
.page-bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
/* zellige pattern removed — Arabic calligraphic backdrop used instead */
.page-bg > * { position: relative; z-index: 1; }

/* Fond doux pour sections de contenu */
.page-bg--soft {
  background: linear-gradient(180deg,
    rgba(var(--orient-sky-rgb),  0.06) 0%,
    rgba(var(--orient-navy-rgb), 0.03) 100%
  );
}

/* ═══════════════════════════════════════════════════════════════
   BORDURE DÉCORATIVE — Frise orientale bleue
═══════════════════════════════════════════════════════════════ */
.orient-border-blue {
  height: 24px;
  width: 100%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='24' viewBox='0 0 60 24'%3E%3Cdefs%3E%3Cstyle%3E.a%7Bfill:none;stroke:%230f2abf;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round%7D.b%7Bfill:none;stroke:%2397a4e6;stroke-width:1;stroke-linecap:round;stroke-linejoin:round%7D.c%7Bfill:%230f2abf%7D.d%7Bfill:%2397a4e6%7D%3C/style%3E%3C/defs%3E%3Cpolygon class='a' points='15,2 28,12 15,22 2,12'/%3E%3Cpolygon class='b' points='45,2 58,12 45,22 32,12'/%3E%3Ccircle cx='15' cy='12' r='3' class='d'/%3E%3Ccircle cx='45' cy='12' r='3' class='c'/%3E%3Ccircle cx='30' cy='12' r='2' class='c'/%3E%3Ccircle cx='0' cy='12' r='2' class='d'/%3E%3Ccircle cx='60' cy='12' r='2' class='d'/%3E%3Cline x1='0' y1='12' x2='60' y2='12' class='b'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: auto 24px;
  opacity: 0.85;
  margin: 0;
}

/* ═══════════════════════════════════════════════════════════════
   COINS ORNEMENTÉS
═══════════════════════════════════════════════════════════════ */
.orient-corners { position: relative; }
.orient-corners::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(15, 42, 191, 0.1);
  pointer-events: none;
  z-index: 5;
  border-radius: inherit;
}
.orient-corners::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M2 14V2h12M5 5h3v3H5z' fill='none' stroke='%230f2abf' stroke-width='1.2' opacity='0.7'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M14 14V2H2m9 3H8v3h3z' fill='none' stroke='%230f2abf' stroke-width='1.2' opacity='0.7'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M2 2v12h12M5 11h3V8H5z' fill='none' stroke='%230f2abf' stroke-width='1.2' opacity='0.7'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M14 2v12H2m9-3H8V8h3z' fill='none' stroke='%230f2abf' stroke-width='1.2' opacity='0.7'/%3E%3C/svg%3E");
  background-position: top 4px left 4px, top 4px right 4px, bottom 4px left 4px, bottom 4px right 4px;
  background-repeat: no-repeat;
  background-size: 14px 14px;
}

/* ═══════════════════════════════════════════════════════════════
   CARTES PRODUITS — Double bordure marine orientale
═══════════════════════════════════════════════════════════════ */
.orient-card-double-border {
  position: relative;
  border: 1px solid rgba(15, 42, 191, 0.22) !important;
  border-radius: 10px;
  box-shadow: 0 4px 12px -2px rgba(var(--orient-navy-rgb), 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.orient-card-double-border:hover {
  transform: translateY(-5px);
  box-shadow: 0 14px 28px -6px rgba(var(--orient-navy-rgb), 0.15);
}
.orient-card-double-border::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(var(--orient-sky-rgb), 0.40);
  pointer-events: none;
  border-radius: 6px;
  z-index: 1;
}

/* Images produits */
.la-boutique-card .wp-block-woocommerce-product-image img {
  object-fit: contain !important;
  padding: 0.75rem;
  transition: transform 0.5s ease;
}
.la-boutique-card:hover .wp-block-woocommerce-product-image img {
  transform: scale(1.06);
}

/* Bouton "Ajouter au panier" — pill style */
.la-boutique-card .wp-block-button__link {
  border-radius: 50px !important;
  padding: 0.4rem 0.9rem !important;
  font-size: var(--wp--preset--font-size--small) !important;
}

/* ═══════════════════════════════════════════════════════════════
   SCROLLBAR PERSONNALISÉE
═══════════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 7px; }
::-webkit-scrollbar-track { background: rgba(var(--orient-navy-rgb), 0.04); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--orient-navy) 0%, var(--orient-sky) 100%);
  border-radius: 6px;
}
::-webkit-scrollbar-thumb:hover { background: var(--orient-navy); }

/* ═══════════════════════════════════════════════════════════════
   PAGES A PROPOS & EVENEMENTS
═══════════════════════════════════════════════════════════════ */

/* Lettrine Orientale */
.orient-lettrine::first-letter {
  float: left;
  font-family: "Georgia", serif;
  font-size: 4rem;
  line-height: 0.8;
  margin-right: 0.5rem;
  margin-top: 0.2rem;
  color: var(--orient-navy);
  font-weight: bold;
}

/* Timeline */
.orient-timeline-container {
  position: relative;
  padding: 2rem 0;
}
.orient-timeline-line {
  position: absolute;
  left: 1rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: rgba(var(--orient-navy-rgb), 0.15);
}
@media (min-width: 768px) {
  .orient-timeline-line {
    left: 50%;
    transform: translateX(-50%);
  }
}
.orient-timeline-dot {
  width: 24px;
  height: 24px;
  background-color: var(--orient-navy);
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(var(--orient-navy-rgb), 0.1);
}

/* Newsletter Box */
.la-newsletter-box {
  border-radius: 2rem;
  background: linear-gradient(135deg, var(--orient-navy) 0%, #081666 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  padding: 4rem 2rem;
  text-align: center;
}
.la-newsletter-box::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
  filter: blur(40px);
}
.la-newsletter-box::after {
  content: '';
  position: absolute;
  bottom: -50px;
  left: -50px;
  width: 250px;
  height: 250px;
  background: rgba(var(--orient-sky-rgb), 0.15);
  border-radius: 50%;
  filter: blur(40px);
}
.la-newsletter-input {
  border: none !important;
  border-radius: 12px !important;
  padding: 1rem 1.5rem !important;
  outline: none !important;
  width: 100%;
  max-width: 300px;
  margin-bottom: 1rem;
}
.la-newsletter-btn {
  background-color: var(--orient-sky) !important;
  color: var(--orient-navy) !important;
  border-radius: 12px !important;
  padding: 1rem 2rem !important;
  font-weight: bold !important;
}

/* ═══════════════════════════════════════════════════════════════
   CARROUSEL AUTO-DÉFILANT (ÉVÉNEMENTS)
═══════════════════════════════════════════════════════════════ */
@keyframes scroll-carousel {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-380px * 5 - 2rem * 5)); } /* adjusted for 380px items */
}

.orient-carousel-wrapper {
  overflow: hidden;
  width: 100%;
  position: relative;
  padding: 2rem 0;
  mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
  -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.orient-carousel-track {
  display: flex;
  gap: 2rem;
  width: max-content;
  animation: scroll-carousel 15s linear infinite;
}

.orient-carousel-track:hover {
  animation-play-state: paused;
}

.orient-carousel-item {
  width: 380px; /* fixed width for items (made larger) */
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.orient-carousel-item a {
  position: relative;
  z-index: 2;
  cursor: pointer;
}

.orient-carousel-item:hover {
  z-index: 5;
}
