/*
Theme Name: Beebli Theme
Theme URI: https://beebli.com
Author: Beebli
Author URI: https://beebli.com
Description: Thème custom pour l'application Beebli — bibliothèque chrétienne numérique. Architecture Gutenberg native avec blocs custom, deux templates de page (standard et landing page pure).
Version: 1.0.6
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
License: Proprietary
Text Domain: beebli-theme
Tags: gutenberg, custom-blocks, landing-page
*/

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #1a1a1a;
    background: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =============================================
   CONTAINER GLOBAL
   ============================================= */
.beebli-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* =============================================
   SCROLL SENTINEL
   ============================================= */
#beebli-scroll-sentinel {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

/* =============================================
   HEADER
   ============================================= */
.beebli-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: #ffffff;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.beebli-header--scrolled {
    border-bottom-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.beebli-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.beebli-header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.beebli-header__logo img {
    height: 36px;
    width: auto;
    display: block;
}

/* Navigation desktop */
.beebli-nav {
    display: flex;
    align-items: center;
}

.beebli-nav__list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2px;
    margin: 0;
    padding: 0;
}

.beebli-nav__list li a {
    display: block;
    color: #1a1a1a;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.beebli-nav__list li a:hover,
.beebli-nav__list li.current-menu-item a {
    color: #1a1a1a;
    background: rgba(0, 0, 0, 0.06);
}

/* Bouton CTA — classe .beebli-nav__cta ajoutée sur le <li> via WP Admin > Menus > Classes CSS */
.beebli-nav__list li.beebli-nav__cta {
    margin-left: 8px;
}

.beebli-nav__list li.beebli-nav__cta > a {
    background: linear-gradient(135deg, #ffde01 0%, #ffa200 100%);
    color: #1a1a1a !important;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 8px;
    transition: opacity 0.15s, transform 0.15s;
}

.beebli-nav__list li.beebli-nav__cta > a:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #1a1a1a !important;
}

/* Burger button */
.beebli-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.15s;
    flex-shrink: 0;
}

.beebli-burger:hover {
    background: rgba(0, 0, 0, 0.06);
}

.beebli-burger__bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
    transform-origin: center;
}

.beebli-burger.is-active .beebli-burger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.beebli-burger.is-active .beebli-burger__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.beebli-burger.is-active .beebli-burger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   DRAWER MOBILE
   ============================================= */
.beebli-drawer {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 199;
}

.beebli-drawer[aria-hidden="false"] {
    display: block;
}

.beebli-drawer__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    animation: beebliOverlayIn 0.2s ease;
}

.beebli-drawer__nav {
    position: absolute;
    top: 0;
    right: 0;
    width: min(320px, 85vw);
    height: 100%;
    background: #1a1a1a;
    padding: 80px 24px 40px;
    overflow-y: auto;
    animation: beebliDrawerIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.beebli-drawer__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.beebli-drawer__list li a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.beebli-drawer__list li a:hover,
.beebli-drawer__list li.current-menu-item a {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.beebli-drawer__list li.beebli-nav__cta {
    margin-top: 16px;
}

.beebli-drawer__list li.beebli-nav__cta > a {
    background: linear-gradient(135deg, #ffde01 0%, #ffa200 100%);
    color: #1a1a1a !important;
    font-weight: 700;
    text-align: center;
    border-radius: 8px;
}

.beebli-drawer__list li.beebli-nav__cta > a:hover {
    opacity: 0.88;
    color: #1a1a1a !important;
}

/* Empêcher le scroll du body quand drawer ouvert */
body.beebli-drawer-open {
    overflow: hidden;
}

@keyframes beebliOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes beebliDrawerIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* =============================================
   FOOTER
   ============================================= */
.beebli-footer {
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.6);
    padding: 56px 0 24px;
    font-size: 0.875rem;
}

.beebli-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.beebli-footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 24px;
}

/* Col 1 — brand */
.beebli-footer__brand {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.beebli-footer__brand-logo {
    display: inline-block;
    line-height: 0;
}

.beebli-footer__tagline {
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    max-width: 260px;
}

.beebli-footer__stores {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
}

.beebli-footer__store-badge {
    display: inline-block;
    line-height: 0;
    transition: opacity 0.15s;
}

.beebli-footer__store-badge:hover {
    opacity: 0.85;
}

.beebli-footer__store-badge img {
    height: 40px;
    width: auto;
}

/* Cols 2-4 — navigation */
.beebli-footer__col-title {
    color: #ffffff;
    font-weight: 600;
    margin-bottom: 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.beebli-footer__links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.beebli-footer__links a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.15s;
}

.beebli-footer__links a:hover {
    color: #ffffff;
}

/* Barre inférieure */
.beebli-footer__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8125rem;
}

.beebli-footer__copyright {
    margin: 0;
}

.beebli-footer__legal {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin: 0;
    padding: 0;
}

.beebli-footer__legal a {
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.15s;
}

.beebli-footer__legal a:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* =============================================
   PAGE CONTENT (template standard)
   ============================================= */
.beebli-page-content {
    min-height: 60vh;
    background: #ffffff;
}

/* Hero titre de page */
.beebli-page-hero {
    background: #f7f6f3;
    border-bottom: 1px solid #eeece8;
    padding: 56px 0 48px;
    position: relative;
    overflow: hidden;
}

/* Variante avec image à la une */
.beebli-page-hero--has-image {
    background-image: var(--hero-bg);
    background-size: cover;
    background-position: center;
    border-bottom: none;
    padding: 88px 0 72px;
}

/* Overlay sombre */
.beebli-page-hero--has-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.45) 0%,
        rgba(0, 0, 0, 0.62) 100%
    );
}

.beebli-page-hero__inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative; /* passe au-dessus de l'overlay */
}

.beebli-page-hero__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #1a1a1a;
    margin: 0;
}

/* Titre blanc quand image présente */
.beebli-page-hero--has-image .beebli-page-hero__title {
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* Zone de contenu */
.beebli-page-body {
    padding: 56px 0 80px;
}

.beebli-post-content {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 24px;
    color: #2d2d2d;
    font-size: 1.0625rem;
    line-height: 1.75;
}

/* Titres dans le contenu */
.beebli-post-content h1,
.beebli-post-content h2,
.beebli-post-content h3,
.beebli-post-content h4 {
    color: #1a1a1a;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    margin-top: 2.25em;
    margin-bottom: 0.75em;
}

.beebli-post-content h1 { font-size: 1.875rem; font-weight: 800; }
.beebli-post-content h2 { font-size: 1.375rem; }
.beebli-post-content h3 { font-size: 1.125rem; }
.beebli-post-content h4 { font-size: 1rem; }

/* Accent jaune sous les H2 */
.beebli-post-content h2 {
    padding-bottom: 12px;
    position: relative;
}

.beebli-post-content h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(135deg, #ffde01 0%, #ffa200 100%);
    border-radius: 2px;
}

/* Paragraphes */
.beebli-post-content p {
    margin-top: 0;
    margin-bottom: 1.35em;
}

/* Listes */
.beebli-post-content ul,
.beebli-post-content ol {
    padding-left: 1.5em;
    margin-bottom: 1.35em;
}

.beebli-post-content li {
    margin-bottom: 0.4em;
}

/* Liens */
.beebli-post-content a {
    color: #1a1a1a;
    text-decoration: underline;
    text-decoration-color: #ffa200;
    text-underline-offset: 3px;
    text-decoration-thickness: 2px;
    transition: text-decoration-color 0.15s;
}

.beebli-post-content a:hover {
    text-decoration-color: #ffa200;
}

/* Texte en gras */
.beebli-post-content strong,
.beebli-post-content b {
    font-weight: 700;
    color: #1a1a1a;
}

/* Citations */
.beebli-post-content blockquote {
    margin: 2em 0;
    padding: 20px 24px;
    border-left: 4px solid #ffa200;
    background: #f7f6f3;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #444;
}

.beebli-post-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Code inline */
.beebli-post-content code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875em;
    background: #f0efe9;
    padding: 2px 6px;
    border-radius: 4px;
    color: #1a1a1a;
}

/* Séparateur */
.beebli-post-content hr {
    border: none;
    border-top: 1px solid #eeece8;
    margin: 2.5em 0;
}

/* Images dans le contenu */
.beebli-post-content img {
    border-radius: 8px;
    margin: 1em 0;
}

/* Blocs Gutenberg dans le contenu */
.beebli-post-content .wp-block-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.beebli-post-content .wp-block-table td,
.beebli-post-content .wp-block-table th {
    padding: 10px 14px;
    border: 1px solid #eeece8;
    text-align: left;
}

.beebli-post-content .wp-block-table th {
    background: #f7f6f3;
    font-weight: 600;
    color: #1a1a1a;
}

/* =============================================
   LANDING PAGE (no header/footer)
   ============================================= */
.beebli-landing {
    min-height: 100vh;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .beebli-nav {
        display: none;
    }

    .beebli-burger {
        display: flex;
    }

    .beebli-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .beebli-footer__stores {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .beebli-footer__grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   LANDING PAGE — body background
   ============================================= */
.beebli-landing-body {
    background: #ffffff;
}

/* =============================================
   BANNIÈRE NOËL — desktop only
   ============================================= */
.beebli-top-banner {
    width: 100%;
    background: #ffffff !important;
    text-align: center;
    padding: 10px 16px;
}

.beebli-top-banner p {
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Caché sur mobile */
@media (max-width: 768px) {
    .beebli-top-banner {
        display: none !important;
    }
}

/* =============================================
   PAGE TÉLÉCHARGER — RESPONSIVE MOBILE
   ============================================= */
@media (max-width: 600px) {
    /* Hero : titre plus petit */
    .beebli-landing h1.wp-block-heading {
        font-size: 32px !important;
    }

    /* Hero : sous-titre plus petit */
    .beebli-landing .has-text-align-center[style*="font-size:22px"] {
        font-size: 18px !important;
    }

    /* Hero : rassurance text */
    .beebli-landing .has-text-align-center[style*="font-size:17px"][style*="font-weight:600"] {
        font-size: 15px !important;
    }

    /* Section sombre : titre */
    .beebli-landing h2.wp-block-heading[style*="font-size:36px"] {
        font-size: 26px !important;
    }

    /* Section sombre : description */
    .beebli-landing .has-text-align-center[style*="font-size:20px"] {
        font-size: 17px !important;
    }

    /* Rassurance : titre */
    .beebli-landing h2.wp-block-heading[style*="font-size:28px"] {
        font-size: 22px !important;
    }

    /* Rassurance : liste */
    .beebli-landing ul[style*="font-size:17px"] {
        font-size: 15px !important;
    }
}

/* =============================================
   IPHONE MOCKUP BLOCK STYLE
   ============================================= */
.wp-block-image.is-style-iphone-mockup {
    position: relative;
    display: inline-block;
    padding: 2.2% 4%;
    /* Margins to align screen with the bezel */
    box-sizing: border-box;
    max-width: 300px;
    /* Example max width */
    margin-left: auto;
    margin-right: auto;
}

.wp-block-image.is-style-iphone-mockup::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('assets/images/iphone-mockup.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 10;
}

.wp-block-image.is-style-iphone-mockup img {
    border-radius: 20px;
    /* iPhone screen corner radius */
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 1179 / 2556;
    /* Default iPhone 14/15 Pro resolution */
}

/* =============================================
   3 PHONES SHOWCASE (Visually Adjusted Layout)
   ============================================= */
.beebli-phones-showcase {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 550px;
    margin: 0 auto;
}

.beebli-phones-showcase .wp-block-image.is-style-iphone-mockup {
    position: absolute;
    width: 44%;
    max-width: 250px;
    padding: 1.1% 2%;
    margin: 0;
    transition: transform 0.3s ease;
}

/* Base adjustment for the mockup border scale */
.beebli-phones-showcase .wp-block-image.is-style-iphone-mockup img {
    border-radius: 12%;
}

/* Left Phone - (Smallest, pushed back and down) */
.beebli-phones-showcase .beebli-mockup-left {
    transform: translate(-65%, -277px) scale(0.92);
    z-index: 1;
}

/* Center Phone - (Largest, centered, in foreground) */
.beebli-phones-showcase .beebli-mockup-center {
    transform: translate(0, -295px) scale(1.15);
    z-index: 3;
}

/* Right Phone - (Medium, pushed right) */
.beebli-phones-showcase .beebli-mockup-right {
    transform: translate(62%, -277px) scale(0.92);
    z-index: 2;
}

@media (max-width: 768px) {
    .beebli-phones-showcase {
        height: 380px;
        transform: scale(0.8);
    }
}

/* ─────────────────────────────────────────────
   PAGES DE CONTENU (header + footer via page.php)
   ───────────────────────────────────────────── */

.beebli-page-content {
    padding: 40px 0 64px;
}

.beebli-page-content h1 {
    font-size: 32px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 24px;
    line-height: 1.3;
}

.beebli-page-content h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 36px 0 16px;
}

.beebli-page-content h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 28px 0 12px;
}

.beebli-page-content h4 {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 20px 0 8px;
}

.beebli-page-content p {
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 16px;
}

.beebli-page-content ul,
.beebli-page-content ol {
    margin: 12px 0 20px 24px;
    line-height: 1.7;
    color: #333;
}

.beebli-page-content li {
    margin-bottom: 6px;
}

.beebli-page-content a {
    color: #ffa200;
    text-decoration: underline;
}

.beebli-page-content a:hover {
    color: #1a1a1a;
}

/* Pages légales (Mentions, CGU, CGV, Politique) */
.beebli-legal-page h2 {
    font-size: 20px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.beebli-legal-page h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

/* Page Télécharger */
.beebli-download-badges {
    display: flex;
    gap: 16px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.beebli-download-badges a img {
    height: 50px;
    width: auto;
}

/* Page Newsletter (form simple) */
.beebli-newsletter-form {
    max-width: 480px;
    margin-top: 24px;
}

.beebli-newsletter-form .beebli-newsletter-row {
    display: flex;
    gap: 12px;
}

.beebli-newsletter-form input[type="email"] {
    flex: 1;
    padding: 10px 14px;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
}

.beebli-newsletter-form input[type="email"]:focus {
    outline: none;
    border-color: #ffa200;
    box-shadow: 0 0 0 3px rgba(255, 162, 0, 0.15);
}

.beebli-newsletter-form button {
    padding: 10px 24px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #ffde01 0%, #ffa200 100%);
    color: #1a1a1a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.beebli-newsletter-form button:hover {
    background: #ffa200;
}

@media (max-width: 768px) {
    .beebli-page-content h1 {
        font-size: 26px;
    }
    .beebli-page-content h2 {
        font-size: 20px;
    }
    .beebli-download-badges {
        flex-direction: column;
        align-items: flex-start;
    }
    .beebli-newsletter-form .beebli-newsletter-row {
        flex-direction: column;
    }

    /* Badges stores — centrer sur mobile (page Télécharger) */
    .beebli-badge,
    figure.beebli-badge {
        float: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
        text-align: center;
    }
    .beebli-badge.alignright,
    .beebli-badge.alignleft {
        float: none !important;
        display: flex;
        justify-content: center;
    }
}