/*
Theme Name: Ankizy
Theme URI:
Author: ankizy
Author URI:
Description:
Requires at least: 6.8
Tested up to: 6.8
Requires PHP: 5.7
Version:
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ankizy
Tags:
*/

.read-more-btn{
    border-radius: 30px;
    text-decoration: none;
}

.ankizy .um-field-label {
    color: #fff !important;
}

/* ==========================================================
   QUERY LOOP → CARROUSEL HORIZONTAL
   Classe à mettre sur le bloc Query Loop :
   → wp-query-carousel
   ========================================================== */

.wp-query-carousel {
    position: relative;
    width: 100%;
}

/* ==========================================================
   PISTE SCROLLABLE
   ========================================================== */

.wp-query-carousel .wp-block-post-template {
    display: flex !important;
    flex-wrap: nowrap !important;

    overflow-x: auto;
    overflow-y: hidden;

    gap: 16px;
    padding: 16px 64px;

    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;

    list-style: none;
    margin: 0;

    /* Masquage scrollbar */
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* Edge legacy */
}

.wp-query-carousel .wp-block-post-template::-webkit-scrollbar {
    display: none;                  /* Chrome / Safari */
}

/* ==========================================================
   CARTES (POSTS)
   ========================================================== */

.wp-query-carousel .wp-block-post-template > li {
    flex: 0 0 auto;
    width: 280px;
    max-width: 85vw;
    scroll-snap-align: start;
}

.wp-query-carousel .wp-block-post-template > li > * {
    height: 100%;
}

/* ==========================================================
   FLÈCHES — VISIBILITÉ MAXIMALE
   ========================================================== */

.wp-query-carousel .wp-scroll-arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50; /* AU-DESSUS DE TOUT */

    width: 44px;
    height: 44px;

    border-radius: 999px;

    /* CONTRASTE FORT */
    background: #000;               /* noir plein */
    color: #fff;                    /* icône blanche */

    border: 2px solid #fff;
    box-shadow:
            0 6px 16px rgba(0,0,0,0.45),
            0 0 0 2px rgba(255,255,255,0.6);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 24px;
    font-weight: bold;

    cursor: pointer;
    opacity: 0.95;

    transition:
            transform 0.2s ease,
            opacity 0.2s ease,
            box-shadow 0.2s ease;
}

/* Hover très visible */
.wp-query-carousel .wp-scroll-arrow-btn:hover {
    transform: translateY(-50%) scale(1.15);
    opacity: 1;
    box-shadow:
            0 10px 24px rgba(0,0,0,0.6),
            0 0 0 3px rgba(255,255,255,0.9);
}

/* Position */
.wp-query-carousel .wp-scroll-arrow-btn.is-left {
    left: 8px;
}

.wp-query-carousel .wp-scroll-arrow-btn.is-right {
    right: 8px;
}

/* Désactivé */
.wp-query-carousel .wp-scroll-arrow-btn:disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

/* ==========================================================
   FADE LATÉRAL (NE MASQUE PAS LES FLÈCHES)
   ========================================================== */

.wp-query-carousel::before,
.wp-query-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    width: 40px;
    height: 100%;
    z-index: 10;          /* inférieur aux flèches */
    pointer-events: none;
}

.wp-query-carousel::before {
    left: 0;
    background: linear-gradient(
            to right,
            rgba(255,255,255,1),
            rgba(255,255,255,0)
    );
}

.wp-query-carousel::after {
    right: 0;
    background: linear-gradient(
            to left,
            rgba(255,255,255,1),
            rgba(255,255,255,0)
    );
}

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 768px) {
    .wp-query-carousel .wp-scroll-arrow-btn {
        display: none; /* swipe uniquement */
    }

    .wp-query-carousel .wp-block-post-template {
        padding-left: 16px;
        padding-right: 16px;
    }
}

.wp-query-carousel .is-layout-flow, .card .is-layout-flow {
    background: #ffff;
    box-shadow: 0 1px 35px rgba(0,0,0,0.2);
    border-radius: 100px;
    margin: 0 0.5em;
}

@keyframes load89234 {
    100% {
        background-position: -100% 0;
    }
}

/* ==========================================================
   Histoires
   ========================================================== */
/* ---------- Grid ---------- */
:root {
  /* Palette */
  --cream-50: #FDFBF6;
  --cream-100: #FAF5EB;
  --cream-200: #F3EBDB;
  --cream-300: #E8DDC8;
  --cream-400: #D9C9AC;

  --ink-900: #2A2520;
  --ink-700: #4A4239;
  --ink-500: #756B5F;
  --ink-400: #978C7C;
  --ink-300: #BAB0A0;
  --ink-200: #DDD4C5;

  --terracotta-500: #E07A4A;
  --terracotta-600: #C66437;
  --terracotta-100: #FBE6D6;

  --sage-500: #5B8A6A;
  --sage-600: #3F6B4E;
  --sage-100: #DDE8DE;

  --blue-500: #6D9BC3;
  --blue-600: #4E80AB;
  --blue-100: #DCE7F0;

  --amber-500: #D9A648;
  --amber-100: #F5E6C0;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(42, 37, 32, 0.04), 0 1px 3px rgba(42, 37, 32, 0.06);
  --shadow-md: 0 4px 16px -4px rgba(42, 37, 32, 0.08), 0 2px 6px -2px rgba(42, 37, 32, 0.06);
  --shadow-lg: 0 20px 40px -16px rgba(42, 37, 32, 0.18), 0 6px 16px -8px rgba(42, 37, 32, 0.10);
  --shadow-inset: inset 0 0 0 1px rgba(42, 37, 32, 0.06);

  /* Radius */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  /* Type */
  --font-display: "Bricolage Grotesque", "Plus Jakarta Sans", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}
.story-audio-grid { 
  margin: 2rem auto 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.story-audio-card {
  background: var(--cream-50);
  border-radius: var(--r-lg);
  border: 1px solid rgba(42, 37, 32, 0.04);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.22s ease;
  cursor: pointer;
  position: relative;
}

.story-audio-card a {
  text-decoration: none;
}
.story-audio-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(42, 37, 32, 0.08);
}
.story-audio-card-art {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
}
.story-audio-card-fav {
  position: absolute;
  top: 12px; right: 12px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(253, 251, 246, 0.92);
  backdrop-filter: blur(8px);
  border: none;
  display: grid;
  place-items: center;
  color: var(--ink-700);
  transition: all 0.18s ease;
  z-index: 2;
}
.story-audio-card-fav:hover { background: white; transform: scale(1.05); }
.story-audio-card-fav svg { width: 16px; height: 16px; }
.story-audio-card-fav.story-audio-is-fav { color: var(--terracotta-500); }
.story-audio-card-fav.story-audio-is-fav svg { fill: var(--terracotta-500); }
.story-audio-card-region {
  position: absolute;
  bottom: 12px; left: 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-700);
  background: rgba(253, 251, 246, 0.88);
  backdrop-filter: blur(8px);
  padding: 5px 10px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.story-audio-card-region svg { width: 10px; height: 10px; }

.story-audio-card-body { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
.story-audio-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--ink-500);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}
.story-audio-card-meta .story-audio-dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-300); }
.story-audio-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
  text-wrap: balance;
}
.story-audio-card-sub {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.4;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.story-audio-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px;
  margin-top: 4px;
}
.story-audio-age-badges { display: flex; gap: 4px; }
.story-audio-age-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  background: var(--cream-200);
  color: var(--ink-700);
  letter-spacing: 0.04em;
}
.story-audio-age-badge.story-audio-age-3 { background: var(--terracotta-100); color: var(--terracotta-600); }
.story-audio-age-badge.story-audio-age-5 { background: var(--sage-100); color: var(--sage-600); }
.story-audio-age-badge.story-audio-age-7 { background: var(--blue-100); color: var(--blue-600); }
.story-audio-card-play {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #0b68ea;
  color: #ffffff;
  display: grid;
  place-items: center;
  transition: all 0.18s ease;
}
.story-audio-card-play svg {
  color: #0b68ea;
}
.story-audio-card-play:hover {  transform: scale(1.06); } 
.story-audio-card-play svg { width: 13px; height: 13px; }
/* ---------- Animal artwork (geometric placeholders) ---------- */
.story-audio-animal-art {
  width: 100%; height: 100%;
  position: relative;
  display: grid;
  place-items: center;
}
.story-audio-animal-art .story-audio-placeholder-label {
  position: absolute;
  bottom: 6px; right: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(42, 37, 32, 0.35);
  text-transform: uppercase;
}
/* ---------- Pagination ---------- */
.story-audio-pagination {
  max-width: 1320px;
  margin: 56px auto 0;
  padding: 0 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}
.story-audio-page-btn {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  background: var(--cream-50);
  border: 1px solid rgba(42, 37, 32, 0.08);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  text-decoration: none;
}
.story-audio-page-btn:hover { background: var(--cream-200); }
.story-audio-page-btn.story-audio-is-active { background: var(--ink-900); color: var(--cream-100); border-color: var(--ink-900); }
.story-audio-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.story-audio-page-btn svg { width: 14px; height: 14px; }

.ankizy-story-tabs {
  margin: 2rem 0;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.ankizy-story-tabs__nav {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.ankizy-story-tabs__button {
  flex: 1;
  padding: 0.85rem 1rem;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}

.ankizy-story-tabs__button.is-active {
  background: #0b68ea;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ankizy-story-tabs__panel {
  padding: 1.25rem;
}

.ankizy-story-tabs__panel h2 {
  margin-top: 0;
  font-size: 1.5rem;
}

.ankizy-story-tabs__audio {
  margin: 1rem 0 1.5rem;
  padding: 1rem;
  border: 2px solid #3b82f6;
  border-radius: 18px;
  background: #eff6ff;
  box-shadow: 0 12px 28px rgba(11, 104, 234, 0.16);
}

.ankizy-story-tabs__audio p {
  margin: 0 0 1.5rem;
  color: #1e3a8a;
  font-size: 1.5rem;
  font-weight: 700;
}

.ankizy-story-tabs__audio-player {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.ankizy-story-tabs__audio-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  flex: 0 0 auto;
  min-width: 50px;
  min-height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #0b68ea;
  color: #ffffff;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(11, 104, 234, 0.35);
  transition: transform 0.1s ease;
}

.ankizy-story-tabs__audio-toggle:hover,
.ankizy-story-tabs__audio-toggle:focus {
  transform: scale(1.05);
  outline: 3px solid #93c5fd;
}

.ankizy-story-tabs__audio-toggle-icon {
  font-size: 1.7rem;
  display: block;
}

.ankizy-story-tabs__audio-controls {
  flex: 1;
  min-width: 0;
}

.ankizy-story-tabs__audio-progress {
  width: 100%;
  height: 24px;
  accent-color: #0b68ea;
  cursor: pointer;
}

.ankizy-story-tabs__audio-time {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  color: #1e3a8a;
  font-size: 1.1rem;
  font-weight: 700;
}

.ankizy-story-tabs__audio-source {
  display: none;
}

.ankizy-story-tabs__text {
  line-height: 1.75;
  font-size: 1.05rem;
}

.ankizy-story-tabs__transcript a {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 600px) {
  .ankizy-story-tabs__nav {
    flex-direction: column;
  }

  .ankizy-story-tabs__button {
    text-align: left;
  }

  .ankizy-story-tabs__audio-player { 
    flex-direction: column;
  }

  .ankizy-story-tabs__audio-toggle {
    width: 50px;
    height: 50px;
  }
}