/*
Theme Name: Astra Child — Recettes Maroc
Template: astra
Version: 1.0
*/

/* ─── Variables ─────────────────────────────────── */
:root {
    --rm-red:      #C1272D;
    --rm-red-dark: #8B1A1A;
    --rm-gold:     #D4AF37;
    --rm-cream:    #FFF8EE;
    --rm-text:     #2C1810;
}

/* ─── Hero ───────────────────────────────────────── */
.rm-hero {
    position: relative;
    min-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #1a0a00 0%, #3d0f0f 40%, #6b2020 100%);
    /* overflow visible pour laisser passer le dropdown autocomplete */
}

.rm-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(212,175,55,.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(193,39,45,.15) 0%, transparent 50%);
    pointer-events: none;
}

/* Zellige geometric overlay */
.rm-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30Z' fill='none' stroke='rgba(212,175,55,0.07)' stroke-width='1'/%3E%3Cpath d='M30 10 L50 30 L30 50 L10 30Z' fill='none' stroke='rgba(212,175,55,0.05)' stroke-width='1'/%3E%3C/svg%3E");
    pointer-events: none;
}

.rm-hero-inner {
    position: relative;
    z-index: 2;
    padding: 60px 20px;
    max-width: 720px;
    width: 100%;
}

.rm-hero-tagline {
    font-size: 13px;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--rm-gold);
    margin-bottom: 16px;
    font-family: Georgia, serif;
}

.rm-hero h1 {
    font-size: clamp(28px, 5vw, 52px);
    font-family: Georgia, 'Times New Roman', serif;
    color: #fff;
    line-height: 1.2;
    margin: 0 0 12px;
    font-weight: bold;
}

.rm-hero h1 span {
    color: var(--rm-gold);
}

.rm-hero-sub {
    color: rgba(255,255,255,.65);
    font-size: 17px;
    margin-bottom: 36px;
    font-style: italic;
}

/* ─── Autocomplete dropdown ──────────────────────── */
.rm-search-container {
    position: relative;
    max-width: 540px;
    margin: 0 auto;
}

.rm-autocomplete {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
    overflow: hidden;
    z-index: 99999;
    max-height: 380px;
    overflow-y: auto;
}

.rm-ac-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--rm-text);
    border-bottom: 1px solid #f0ebe3;
    transition: background .15s;
}

.rm-ac-item:last-child { border-bottom: none; }

.rm-ac-item:hover,
.rm-ac-item.is-active {
    background: #fff5ee;
    color: var(--rm-red);
}

.rm-ac-item img,
.rm-ac-item .rm-ac-placeholder {
    width: 52px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.rm-ac-item .rm-ac-placeholder {
    background: linear-gradient(135deg, var(--rm-red), var(--rm-red-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.rm-ac-item span {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
}

/* ─── Search bar ─────────────────────────────────── */
.rm-search-wrap {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 54px;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.45);
}

.rm-search-wrap input[type="search"] {
    flex: 1;
    padding: 0 24px;
    height: 54px;
    line-height: 54px;
    font-size: 16px;
    border: none;
    outline: none !important;
    box-shadow: none !important;
    background: #fff;
    color: var(--rm-text);
    border-radius: 0;
    -webkit-appearance: none;
    display: block;
}

.rm-search-wrap input[type="search"]:focus {
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

.rm-search-wrap input[type="search"]::placeholder {
    color: #aaa;
    line-height: normal;
}

.rm-search-wrap button {
    flex-shrink: 0;
    padding: 0 28px;
    height: 54px;
    line-height: 54px;
    background: var(--rm-red);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    transition: background .2s;
    white-space: nowrap;
    display: block;
}

.rm-search-wrap button:hover {
    background: var(--rm-red-dark);
}

/* ─── Stats strip ────────────────────────────────── */
.rm-hero-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid rgba(212,175,55,.25);
}

.rm-hero-stats .stat {
    color: rgba(255,255,255,.8);
    font-size: 13px;
    text-align: center;
}

.rm-hero-stats .stat strong {
    display: block;
    font-size: 22px;
    color: var(--rm-gold);
    font-family: Georgia, serif;
}

/* ─── Menu : couleur hover + indicateur actif ────── */

/* Couleur texte hover/active → rouge */
.ast-builder-menu-1 .main-header-menu > .menu-item > .menu-link:hover,
.ast-builder-menu-1 .main-header-menu > .menu-item:hover > .menu-link,
.ast-builder-menu-1 .menu-item.current-menu-item > .menu-link,
.ast-builder-menu-1 .current-menu-ancestor > .menu-link {
    color: var(--rm-red) !important;
}

/* Indicateur bas de barre : trait rouge épais, aligné tout en bas */
.main-header-menu > .menu-item {
    position: relative;
}

.main-header-menu > .menu-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    right: 50%;
    height: 3px;
    background: var(--rm-red);
    transition: left .2s ease, right .2s ease;
}

.main-header-menu > .menu-item:hover::after,
.main-header-menu > .menu-item.current-menu-item::after,
.main-header-menu > .menu-item.current-menu-ancestor::after {
    left: 0;
    right: 0;
}

/* ─── Single post — hero avec thumbnail ─────────── */
.rm-single-hero {
    position: relative;
    min-height: 340px;
    display: flex;
    align-items: flex-end;
    background: linear-gradient(135deg, #1a0a00 0%, #3d0f0f 40%, #6b2020 100%);
    overflow: hidden;
}

.rm-single-thumb {
    position: absolute;
    inset: 0;
}

.rm-single-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: .45;
}

.rm-single-thumb-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(20,4,4,.92) 0%, rgba(20,4,4,.3) 60%, transparent 100%);
}

.rm-single-hero-inner {
    position: relative;
    z-index: 2;
    padding: 40px 40px 44px;
    max-width: 860px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.rm-single-cats {
    margin-bottom: 12px;
}

.rm-single-cats a {
    color: var(--rm-gold);
    font-size: 12px;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-decoration: none;
}

.rm-single-title {
    font-family: Georgia, serif;
    font-size: clamp(24px, 4vw, 42px);
    color: #fff;
    line-height: 1.25;
    margin: 0 0 16px;
    font-weight: bold;
}

.rm-single-meta {
    color: rgba(255,255,255,.6);
    font-size: 14px;
}

.rm-meta-sep {
    margin: 0 8px;
    color: var(--rm-gold);
}

/* ─── Share inline (dans le contenu) ─────────────── */
.rm-share-inline {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 24px;
    border-bottom: 2px solid #f0ebe3;
}

.rm-share-inline .rm-share-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #bbb;
    margin-right: 4px;
    white-space: nowrap;
}

.rm-share-icon {
    color: var(--rm-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity .15s, transform .15s;
    flex-shrink: 0;
    text-decoration: none;
}

.rm-share-icon svg { width: 22px; height: 22px; }
.rm-share-icon:hover { opacity: .5; transform: translateY(-2px); color: var(--rm-text); }
.rm-share-copy.copied { color: #16a34a; }

/* ─── Single post — contenu ──────────────────────── */
.rm-single-wrap {
    background: #f5f0e8;
    padding: 52px 0 72px;
}

.rm-single-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}

.rm-single-content {
    background: #fff;
    border-radius: 12px;
    padding: 40px 44px;
    box-shadow: 0 2px 16px rgba(0,0,0,.07);
    line-height: 1.8;
    font-size: 17px;
    color: var(--rm-text);
}

.rm-single-content h2,
.rm-single-content h3 {
    font-family: Georgia, serif;
    color: var(--rm-red);
    margin-top: 32px;
}

.rm-single-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

.rm-single-content ul,
.rm-single-content ol {
    padding-left: 24px;
    margin: 16px 0;
}

.rm-single-content li {
    margin-bottom: 6px;
}

.rm-single-content strong {
    color: var(--rm-red-dark);
}

.rm-single-content video,
.rm-single-content embed,
.rm-single-content object {
    display: block;
    width: 100%;
    height: auto;
}

.rm-single-content iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
}

.rm-single-content .wp-video,
.rm-single-content .wp-video-shortcode {
    width: 100% !important;
    height: auto !important;
}

.rm-single-content .wp-block-video video,
.rm-single-content .wp-block-embed,
.rm-single-content .wp-block-embed__wrapper {
    width: 100%;
}

.rm-single-content .wp-block-embed__wrapper iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

/* ─── Navigation prev/next ───────────────────────── */
.rm-single-nav {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

.rm-nav-prev,
.rm-nav-next {
    flex: 1;
    min-width: 200px;
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    text-decoration: none;
    color: var(--rm-text);
    box-shadow: 0 2px 10px rgba(0,0,0,.07);
    transition: box-shadow .2s, transform .2s;
    display: block;
    border-left: 3px solid var(--rm-gold);
}

.rm-nav-next {
    text-align: right;
    border-left: none;
    border-right: 3px solid var(--rm-gold);
}

.rm-nav-prev:hover,
.rm-nav-next:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,.12);
    transform: translateY(-2px);
}

.rm-nav-prev span,
.rm-nav-next span {
    display: block;
    font-size: 12px;
    color: var(--rm-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.rm-nav-prev strong,
.rm-nav-next strong {
    font-size: 14px;
    color: var(--rm-text);
    line-height: 1.3;
    display: block;
}

@media (max-width: 600px) {
    .rm-single-content { padding: 24px 20px; }
    .rm-single-hero-inner { padding: 24px 20px 32px; }
}

/* ─── Barre de recherche archives/catégories ─────── */
.rm-archive-search {
    background: linear-gradient(135deg, #1a0a00 0%, #3d0f0f 100%);
    border-bottom: 2px solid var(--rm-gold);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 9998;
}

.rm-archive-search .rm-search-container {
    max-width: 600px;
}

/* ─── Recipe grid ────────────────────────────────── */
.rm-main {
    background: #f5f0e8;
    padding: 52px 0 64px;
}

.rm-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.rm-section-title {
    font-family: Georgia, serif;
    color: var(--rm-red);
    font-size: 26px;
    margin: 0 0 28px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--rm-gold);
    display: inline-block;
}

.rm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

.rm-card {
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.08);
    transition: transform .2s, box-shadow .2s;
    display: block;
}

.rm-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,.14);
}

.rm-card img {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
}

.rm-card-placeholder {
    width: 100%;
    height: 170px;
    background: linear-gradient(135deg, var(--rm-red), var(--rm-red-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
}

.rm-card-body {
    padding: 14px 16px 18px;
}

.rm-card-body h3 {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--rm-text);
    line-height: 1.35;
}

.rm-card-body span {
    font-size: 12px;
    color: #888;
}

/* ─── Header: masquer titre texte quand logo présent ─ */
.wp-custom-logo .site-title-wrap,
.wp-custom-logo .ast-site-identity-text {
    display: none !important;
}

/* ─── Newsletter drawer (slide-in droite) ────────── */

/* Tab : position fixed autonome, toujours visible au bord droit */
#rm-nl-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100000;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    transform: translateY(-50%) rotate(180deg);
    background: var(--rm-red);
    color: #fff;
    border: none;
    width: 48px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 0 8px 8px 0;
    transition: background .2s;
    white-space: nowrap;
    pointer-events: all;
    box-shadow: -4px 0 16px rgba(0,0,0,.3);
}

#rm-nl-tab:hover { background: var(--rm-red-dark); }

/* Panel : position fixed autonome, caché à droite hors écran */
#rm-nl-panel {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateX(100%) translateY(-50%);
    transition: transform .38s cubic-bezier(.4,0,.2,1);
    width: 300px;
    background: linear-gradient(160deg, #1a0a00 0%, #3d0f0f 100%);
    border-left: 3px solid var(--rm-gold);
    padding: 36px 26px 28px;
    color: #fff;
    pointer-events: none;
    box-shadow: -8px 0 32px rgba(0,0,0,.35);
    z-index: 99999;
}

/* Ouvert : panel glisse à gauche du tab (48px = largeur du tab) */
#rm-nl-container.is-open #rm-nl-panel {
    transform: translateX(-48px) translateY(-50%);
    pointer-events: all;
}

/* Container : juste pour porter la classe is-open */
#rm-nl-container {
    position: fixed;
    right: 0;
    top: 0;
    pointer-events: none;
    z-index: 99998;
}

#rm-nl-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: rgba(255,255,255,.45);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 6px;
    transition: color .15s;
}
#rm-nl-close:hover { color: #fff; }

.rm-nl-icon {
    font-size: 30px;
    margin-bottom: 10px;
}

#rm-nl-panel h3 {
    font-family: Georgia, serif;
    color: var(--rm-gold);
    font-size: 19px;
    margin: 0 0 8px;
    line-height: 1.3;
}

#rm-nl-panel > p {
    color: rgba(255,255,255,.6);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 20px;
}

#rm-nl-form input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid rgba(212,175,55,.25);
    border-radius: 6px;
    background: rgba(255,255,255,.07);
    color: #fff;
    font-size: 14px;
    margin-bottom: 10px;
    outline: none;
    transition: border-color .2s;
}
#rm-nl-form input::placeholder { color: rgba(255,255,255,.35); }
#rm-nl-form input:focus { border-color: var(--rm-gold); }

#rm-nl-form button[type="submit"] {
    display: block;
    width: 100%;
    background: var(--rm-red);
    color: #fff;
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
    letter-spacing: .5px;
    margin-top: 4px;
}
#rm-nl-form button[type="submit"]:hover:not(:disabled) { background: var(--rm-red-dark); }
#rm-nl-form button[type="submit"]:disabled { opacity: .6; cursor: default; }

.rm-nl-success { color: #86efac; font-size: 14px; margin-top: 14px; text-align: center; font-weight: 500; }
.rm-nl-error   { color: #fca5a5; font-size: 13px; margin-top: 10px; text-align: center; }

.rm-nl-privacy {
    color: rgba(255,255,255,.3) !important;
    font-size: 11px !important;
    margin: 14px 0 0 !important;
    text-align: center;
}

/* ─── YouTube widget ─────────────────────────────── */
.rm-yt-widget {
    margin: 20px 0 4px;
}

.rm-yt-label {
    color: rgba(255,255,255,.55);
    font-size: 12px;
    letter-spacing: .5px;
    margin-bottom: 10px;
}

.rm-yt-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: #FF0000;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 4px;
    transition: background .2s, transform .15s;
    letter-spacing: .3px;
}

.rm-yt-btn:hover {
    background: #cc0000;
    transform: translateY(-1px);
    color: #fff;
}

.rm-yt-hero-btn {
    font-size: 12px;
    padding: 8px 14px;
    align-self: center;
    margin-top: 0;
}

.rm-yt-archive-btn {
    font-size: 13px;
    padding: 8px 16px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ─── Footer ─────────────────────────────────────── */
.rm-footer {
    background: #1a0a00;
    text-align: center;
    padding: 40px 20px 32px;
    border-top: 3px solid var(--rm-gold);
}

.rm-footer-logo {
    margin-bottom: 16px;
}

.rm-footer-logo img {
    max-width: 280px;
    height: auto;
    display: inline-block;
}

.rm-footer-nav {
    margin: 20px 0 24px;
}

.rm-footer-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 24px;
}

.rm-footer-menu li a {
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: .5px;
    transition: color .2s;
}

.rm-footer-menu li a:hover {
    color: var(--rm-gold);
}

.rm-footer-copy {
    color: rgba(255,255,255,.35);
    font-size: 12px;
    letter-spacing: .5px;
    margin-top: 8px;
}

/* ─── Header logo sizing ──────────────────────────── */
.site-header .custom-logo {
    max-height: 64px;
    width: auto;
}

/* ─── General tweaks ─────────────────────────────── */
.ast-container { max-width: 1200px !important; }
