:root {
    --afede-wep-navy: #123d72;
    --afede-wep-navy-deep: #0a2b54;
    --afede-wep-gold: #f2c235;
    --afede-wep-text: #1f2937;
    --afede-wep-muted: #667085;
    --afede-wep-line: #e4e8ef;
    --afede-wep-soft: #f5f7fa;
    --afede-wep-white: #fff;
}

.afede-wep-page,
.afede-wep-catalog-section {
    color: var(--afede-wep-text);
    font-family: inherit;
}

.afede-wep-page *,
.afede-wep-catalog-section * {
    box-sizing: border-box;
}

.afede-wep-hero {
    display: grid;
    grid-template-columns: minmax(220px, 340px) 1fr;
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    max-width: 1160px;
    margin: 24px auto 56px;
    padding: clamp(24px, 4vw, 54px);
    background: linear-gradient(135deg, #f7f9fc 0%, #ffffff 65%);
    border: 1px solid var(--afede-wep-line);
    border-radius: 20px;
}

.afede-wep-hero-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 5px;
    box-shadow: 0 18px 50px rgba(10, 43, 84, .18);
}

.afede-wep-kicker {
    margin-bottom: 10px;
    color: var(--afede-wep-navy);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.afede-wep-hero h1 {
    margin: 0;
    color: var(--afede-wep-navy-deep);
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.02;
    letter-spacing: -.035em;
}

.afede-wep-lead {
    margin: 16px 0 2px;
    color: var(--afede-wep-text);
    font-size: clamp(20px, 2.5vw, 28px);
    font-weight: 700;
}

.afede-wep-sublead {
    margin: 0 0 26px;
    color: var(--afede-wep-muted);
    font-size: 17px;
}

.afede-wep-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 26px;
    margin: 0 0 26px;
    padding: 20px 0;
    border-top: 1px solid var(--afede-wep-line);
    border-bottom: 1px solid var(--afede-wep-line);
}

.afede-wep-meta-grid div { display: flex; flex-direction: column; gap: 2px; }
.afede-wep-meta-grid strong { color: var(--afede-wep-muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.afede-wep-meta-grid span { font-size: 15px; }

.afede-wep-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin: 6px 0 20px; }
.afede-wep-price-current { color: var(--afede-wep-navy-deep); font-size: 30px; font-weight: 850; }
.afede-wep-price-old { color: #8a94a4; font-size: 17px; }
.afede-wep-price-note { flex-basis: 100%; color: var(--afede-wep-muted); font-size: 13px; }
.afede-wep-price.is-compact { margin: 12px 0 16px; }
.afede-wep-price.is-compact .afede-wep-price-current { font-size: 24px; }

.afede-wep-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.afede-wep-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.2;
    text-decoration: none !important;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.afede-wep-btn:hover { transform: translateY(-1px); }
.afede-wep-btn-primary { background: var(--afede-wep-navy); color: var(--afede-wep-white) !important; box-shadow: 0 8px 20px rgba(18, 61, 114, .17); }
.afede-wep-btn-primary:hover { background: var(--afede-wep-navy-deep); }
.afede-wep-btn-secondary { border: 1px solid #cfd6e2; background: #fff; color: var(--afede-wep-navy) !important; }
.afede-wep-btn-large { min-height: 50px; padding: 14px 22px; }

.afede-wep-content {
    max-width: 900px;
    margin: 0 auto 70px;
}

.afede-wep-content > section {
    padding: 0 6px;
    margin: 0 0 44px;
}

.afede-wep-content h2 {
    margin: 0 0 16px;
    color: var(--afede-wep-navy-deep);
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.2;
}

.afede-wep-content p,
.afede-wep-content li {
    font-size: 16.5px;
    line-height: 1.72;
}

.afede-wep-list { margin: 0; padding-left: 1.25rem; }
.afede-wep-list li { margin-bottom: 7px; }

.afede-wep-highlight,
.afede-wep-note {
    padding: 26px 28px !important;
    border-radius: 14px;
}
.afede-wep-highlight { background: #f3f7fb; border-left: 4px solid var(--afede-wep-navy); }
.afede-wep-note { background: #fff9e8; border-left: 4px solid var(--afede-wep-gold); }

.afede-wep-chain-section { text-align: center; }
.afede-wep-chain {
    margin: 22px 0;
    padding: 18px 20px;
    border-radius: 12px;
    background: var(--afede-wep-navy-deep);
    color: #fff;
    font-weight: 800;
    line-height: 1.75;
}
.afede-wep-chain span { color: var(--afede-wep-gold); padding: 0 3px; }

.afede-wep-biblio { border-top: 1px solid var(--afede-wep-line); padding-top: 34px !important; }

.afede-wep-final-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 26px 28px !important;
    background: var(--afede-wep-soft);
    border: 1px solid var(--afede-wep-line);
    border-radius: 14px;
}
.afede-wep-final-cta h2 { margin-bottom: 6px; }
.afede-wep-final-cta .afede-wep-price { margin-bottom: 0; }

.afede-wep-catalog-section {
    max-width: 1160px;
    margin: 64px auto 24px;
    padding: 0 16px;
}
.afede-wep-catalog-heading { margin-bottom: 22px; }
.afede-wep-catalog-heading span { color: var(--afede-wep-navy); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.afede-wep-catalog-heading h2 { margin: 5px 0 0; color: var(--afede-wep-navy-deep); font-size: clamp(25px, 3vw, 34px); }

.afede-wep-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    max-width: 760px;
    overflow: hidden;
    border: 1px solid var(--afede-wep-line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 36px rgba(17, 35, 58, .07);
}
.afede-wep-card-cover { display: block; background: #eef2f7; }
.afede-wep-card-cover img { display: block; width: 100%; height: 100%; min-height: 270px; object-fit: cover; }
.afede-wep-card-body { padding: 24px 26px; }
.afede-wep-card h3 { margin: 4px 0 7px; color: var(--afede-wep-navy-deep); font-size: 27px; line-height: 1.08; }
.afede-wep-card-subtitle { margin: 0 0 12px; color: #344054; font-size: 15px; line-height: 1.45; }
.afede-wep-card-subtitle span { color: var(--afede-wep-muted); font-size: 13px; }
.afede-wep-card-author { margin: 0 0 3px; font-weight: 700; }
.afede-wep-isbn { margin: 0 0 8px; color: var(--afede-wep-muted); font-size: 13px; }

@media (max-width: 760px) {
    .afede-wep-hero { grid-template-columns: 1fr; padding: 22px; }
    .afede-wep-hero-cover { max-width: 300px; margin: 0 auto; }
    .afede-wep-meta-grid { grid-template-columns: 1fr; }
    .afede-wep-card { grid-template-columns: 130px minmax(0, 1fr); }
    .afede-wep-card-cover img { min-height: 220px; }
    .afede-wep-card-body { padding: 18px; }
    .afede-wep-card h3 { font-size: 22px; }
    .afede-wep-final-cta { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 520px) {
    .afede-wep-card { grid-template-columns: 1fr; }
    .afede-wep-card-cover img { width: 165px; min-height: 0; margin: 22px auto 0; box-shadow: 0 10px 26px rgba(10,43,84,.13); }
    .afede-wep-card-body { text-align: center; }
    .afede-wep-card-body .afede-wep-actions,
    .afede-wep-card-body .afede-wep-price { justify-content: center; }
    .afede-wep-actions .afede-wep-btn { width: 100%; }
}

/* ============================================================
   AFEDE Publishing – first publication page polish
   Targeted only through body.afede-first-publication-page.
   It does not change the publication text; it corrects layout,
   image cropping, spacing, typography and mobile behaviour.
   ============================================================ */
body.afede-first-publication-page {
    --afede-pub-navy: #082f4b;
    --afede-pub-navy-2: #0d4668;
    --afede-pub-blue: #2457b8;
    --afede-pub-gold: #e7b52b;
    --afede-pub-text: #162033;
    --afede-pub-muted: #5f6b7a;
    --afede-pub-line: rgba(8, 47, 75, .14);
}

body.afede-first-publication-page .entry-content,
body.afede-first-publication-page .site-main,
body.afede-first-publication-page main {
    overflow: visible;
}

body.afede-first-publication-page .entry-content {
    font-size: 17px;
    line-height: 1.72;
}

body.afede-first-publication-page .entry-content h1,
body.afede-first-publication-page .entry-content h2,
body.afede-first-publication-page .entry-content h3,
body.afede-first-publication-page .entry-content h4 {
    color: var(--afede-pub-navy);
    text-wrap: balance;
}

body.afede-first-publication-page .entry-content h1 {
    line-height: 1.08;
    letter-spacing: -.025em;
}

body.afede-first-publication-page .entry-content h2 {
    margin-top: clamp(34px, 5vw, 58px);
    margin-bottom: 14px;
    line-height: 1.18;
}

body.afede-first-publication-page .entry-content p,
body.afede-first-publication-page .entry-content li {
    line-height: 1.72;
}

body.afede-first-publication-page .entry-content p {
    margin-bottom: 1.05em;
}

/* The cover itself. JS marks the principal portrait image so only the book
   cover receives these stronger rules. */
body.afede-first-publication-page img.afede-first-book-cover {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: min(680px, 92vw) !important;
    max-height: none !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto !important;
    border-radius: 8px;
    box-shadow: 0 24px 60px rgba(3, 28, 48, .27);
}

body.afede-first-publication-page .afede-first-book-cover-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding: clamp(24px, 4vw, 52px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box !important;
}

/* Parent containers that were responsible for cropping the cover are only
   relaxed when the script identifies them as part of the cover hierarchy. */
body.afede-first-publication-page .afede-first-book-cover-uncrop {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

body.afede-first-publication-page .afede-first-book-cover-card {
    width: min(1120px, calc(100% - 32px)) !important;
    margin: clamp(22px, 4vw, 48px) auto !important;
    padding: clamp(22px, 4vw, 46px) !important;
    background: linear-gradient(145deg, var(--afede-pub-navy) 0%, #0a3a59 100%) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 46px rgba(4, 37, 60, .14) !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* Normal content images should remain responsive and must never be cropped. */
body.afede-first-publication-page .entry-content figure img:not(.afede-first-book-cover),
body.afede-first-publication-page .entry-content .wp-block-image img:not(.afede-first-book-cover) {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Cleaner presentation for metadata / info blocks already present on page. */
body.afede-first-publication-page .entry-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid var(--afede-pub-line);
    border-radius: 12px;
    background: #fff;
}

body.afede-first-publication-page .entry-content th,
body.afede-first-publication-page .entry-content td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--afede-pub-line);
    vertical-align: top;
}

body.afede-first-publication-page .entry-content tr:last-child td {
    border-bottom: 0;
}

body.afede-first-publication-page .wp-element-button,
body.afede-first-publication-page .elementor-button,
body.afede-first-publication-page .button,
body.afede-first-publication-page a.button {
    border-radius: 9px !important;
    font-weight: 750 !important;
    text-decoration: none !important;
    box-shadow: 0 8px 20px rgba(8, 47, 75, .14);
}

body.afede-first-publication-page .entry-content blockquote {
    margin: 28px 0;
    padding: 20px 24px;
    border-left: 4px solid var(--afede-pub-gold);
    border-radius: 0 12px 12px 0;
    background: rgba(255,255,255,.72);
}

@media (max-width: 782px) {
    body.afede-first-publication-page .entry-content {
        font-size: 16px;
    }

    body.afede-first-publication-page .afede-first-book-cover-card {
        width: calc(100% - 20px) !important;
        padding: 18px !important;
        border-radius: 18px !important;
    }

    body.afede-first-publication-page .afede-first-book-cover-wrap {
        padding: 10px !important;
    }

    body.afede-first-publication-page img.afede-first-book-cover {
        max-width: min(100%, 520px) !important;
        border-radius: 5px;
    }
}
