:root {
    --pes-green: #0b3b2f;
    --pes-gold: #c99a36;
    --pes-cream: #f7f3e8;
    --pes-ink: #14211d;
    --pes-muted: #66706c;
    --pes-line: #e3ded1;
    --pes-white: #ffffff;
}

/* -------------------------------------------------------------------------
   Peptide Education System — frontend isolation
   Keep Elementor/WoodMart/global form styles from breaking the library.
   ------------------------------------------------------------------------- */
.pes-library,
.pes-library *,
.pes-detail,
.pes-detail * {
    box-sizing: border-box;
}

.pes-library,
.pes-detail {
    font-family: inherit;
    color: var(--pes-ink);
}

/* Library ---------------------------------------------------------------- */
.pes-library {
    width: 100% !important;
    max-width: 1480px !important;
    margin: 0 auto !important;
    padding: 64px 28px 72px !important;
    clear: both;
}

.pes-library-head {
    display: block !important;
    width: 100%;
    max-width: 820px;
    margin: 0 0 30px !important;
}

.pes-library-head h2,
.pes-section h2 {
    font-family: Georgia, "Times New Roman", serif;
    color: #101916;
    font-size: clamp(34px, 4vw, 56px);
    font-weight: 700;
    line-height: 1.06;
    letter-spacing: -0.025em;
    margin: 7px 0 12px !important;
}

.pes-library-head p {
    margin: 0 !important;
    max-width: 760px;
    color: var(--pes-muted);
    font-size: 15px;
    line-height: 1.65;
}

.pes-eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 11px;
    line-height: 1.3;
    font-weight: 800;
    color: var(--pes-gold);
}

.pes-library-toolbar {
    width: 100%;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 0 28px !important;
    padding: 16px !important;
    background: #fbfaf7;
    border: 1px solid #e7e2d7;
    border-radius: 14px;
}

.pes-controls {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 300px) auto;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 0 !important;
}

.pes-search-wrap,
.pes-select-wrap {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0 !important;
}

.pes-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    z-index: 2;
    width: 16px;
    height: 16px;
    border: 2px solid #78817d;
    border-radius: 50%;
    transform: translateY(-58%);
    pointer-events: none;
}

.pes-search-icon::after {
    content: "";
    position: absolute;
    width: 7px;
    height: 2px;
    background: #78817d;
    right: -6px;
    bottom: -3px;
    transform: rotate(45deg);
    border-radius: 2px;
}

.pes-library .pes-controls input[type="search"],
.pes-library .pes-controls select {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 50px !important;
    min-height: 50px !important;
    margin: 0 !important;
    border: 1px solid #d8d5cd !important;
    border-radius: 10px !important;
    background-color: #ffffff !important;
    color: #25312d !important;
    box-shadow: none !important;
    outline: none;
    font: inherit !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
}

.pes-library .pes-controls input[type="search"] {
    padding: 0 16px 0 44px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.pes-library .pes-controls input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.pes-library .pes-controls select {
    padding: 0 42px 0 15px !important;
    cursor: pointer;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image:
        linear-gradient(45deg, transparent 50%, #64706b 50%),
        linear-gradient(135deg, #64706b 50%, transparent 50%) !important;
    background-position:
        calc(100% - 18px) 21px,
        calc(100% - 13px) 21px !important;
    background-size: 5px 5px, 5px 5px !important;
    background-repeat: no-repeat !important;
}

.pes-library .pes-controls input[type="search"]:focus,
.pes-library .pes-controls select:focus {
    border-color: var(--pes-gold) !important;
    box-shadow: 0 0 0 3px rgba(201, 154, 54, 0.12) !important;
}

.pes-clear {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;
    min-width: 72px;
    height: 50px;
    min-height: 50px;
    margin: 0 !important;
    padding: 0 16px !important;
    border: 1px solid rgba(11, 59, 47, 0.18) !important;
    border-radius: 10px !important;
    background: #ffffff !important;
    color: var(--pes-green) !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.pes-clear:hover {
    color: #fff !important;
    background: var(--pes-green) !important;
    border-color: var(--pes-green) !important;
}

.pes-clear[hidden] {
    display: none !important;
}

.pes-result-meta {
    flex: 0 0 auto;
    min-width: 84px;
    margin: 0 !important;
    color: var(--pes-muted);
    font-size: 13px;
    line-height: 1.4;
    text-align: right;
    white-space: nowrap;
}

.pes-result-meta-solo {
    margin: 0 0 18px !important;
    text-align: left;
}

.pes-grid {
    display: grid !important;
    width: 100% !important;
    grid-template-columns: repeat(var(--pes-cols, 4), minmax(0, 1fr)) !important;
    align-items: stretch;
    gap: 22px !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pes-card {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.pes-card[hidden] {
    display: none !important;
}

.pes-card-image {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 250px;
    aspect-ratio: 1.38 / 1;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    border: 0 !important;
    border-radius: 15px !important;
    background: #071f27;
    color: #fff !important;
    text-decoration: none !important;
    box-shadow: 0 9px 26px rgba(8, 28, 24, 0.10) !important;
    isolation: isolate;
}

.pes-card-image > img,
.pes-card-image > picture,
.pes-card-image > picture > img {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: cover !important;
    object-position: center center !important;
    border: 0 !important;
    border-radius: 0 !important;
    transition: transform 0.35s ease;
}

.pes-card-image:hover > img,
.pes-card-image:hover > picture > img {
    transform: scale(1.035);
}

.pes-card-overlay {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    background: linear-gradient(180deg, rgba(3, 20, 25, 0.03) 18%, rgba(3, 20, 25, 0.36) 50%, rgba(3, 20, 25, 0.96) 100%);
    pointer-events: none;
}

.pes-card-badge {
    position: absolute;
    z-index: 3;
    top: 14px;
    left: 14px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    margin: 0 !important;
    padding: 6px 10px !important;
    border-radius: 999px;
    background: var(--pes-gold);
    color: #17140d !important;
    font-size: 10px !important;
    line-height: 1 !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.pes-card-copy {
    position: absolute !important;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    margin: 0 !important;
    padding: 22px !important;
}

.pes-card-copy h3 {
    margin: 0 0 6px !important;
    padding: 0 !important;
    color: #fff !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: clamp(23px, 2vw, 30px) !important;
    font-weight: 700 !important;
    line-height: 1.05 !important;
    letter-spacing: -0.015em !important;
    text-transform: none !important;
}

.pes-card-scientific {
    display: block;
    margin: 0 0 7px !important;
    color: #ecd58f !important;
    font-size: 12px !important;
    line-height: 1.35 !important;
}

.pes-card-copy p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 0 0 13px !important;
    padding: 0 !important;
    color: rgba(255,255,255,.92) !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    line-height: 1.42 !important;
}

.pes-card-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin: 0 !important;
    padding: 8px 13px !important;
    border-radius: 8px;
    background: #eed48b;
    color: #14211d !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.pes-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #d9ad48;
    background: radial-gradient(circle at center, #174c53, #061b23 70%);
    font-size: 70px;
}

.pes-no-results,
.pes-empty {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0 !important;
    padding: 38px !important;
    border: 1px dashed #cfc8b6 !important;
    border-radius: 12px;
    background: #fbfaf7;
    color: var(--pes-muted);
    text-align: center;
}

.pes-no-results[hidden] {
    display: none !important;
}

/* Single peptide detail --------------------------------------------------- */
.pes-template-main {
    width: 100%;
    max-width: none !important;
}

.pes-detail {
    width: 100%;
    background: #fff;
}

.pes-breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 24px;
    color: var(--pes-muted);
    font-size: 13px;
}

.pes-breadcrumb a {
    color: var(--pes-green);
    text-decoration: none;
}

.pes-detail-hero {
    position: relative;
    display: flex;
    align-items: end;
    min-height: 470px;
    overflow: hidden;
    background: linear-gradient(125deg, #06282a, #0a3940);
}

.pes-detail-hero-media {
    position: absolute;
    inset: 0;
}

.pes-detail-hero-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none !important;
    object-fit: cover;
}

.pes-detail-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(3,24,24,.93) 0%, rgba(3,24,24,.74) 46%, rgba(3,24,24,.16) 100%);
}

.pes-detail-hero-copy {
    position: relative;
    z-index: 2;
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 68px 24px;
    color: #fff;
}

.pes-detail-hero-copy h1 {
    margin: 10px 0 14px !important;
    color: #fff !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: clamp(48px, 7vw, 88px) !important;
    line-height: .95 !important;
}

.pes-detail-hero-copy > p {
    max-width: 760px;
    color: rgba(255,255,255,.9) !important;
    font-size: 20px;
    line-height: 1.5;
}

.pes-scientific-name {
    color: #eed48b !important;
    font-style: italic;
}

.pes-term-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.pes-term-row span {
    padding: 6px 10px;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    font-size: 12px;
}

.pes-status {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 14px;
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.pes-status small { font-weight: 400; opacity: .85; }
.pes-status-reviewed { background: #dceedd; color: #174d2a; }
.pes-status-awaiting { background: #fbefc9; color: #6f5713; }
.pes-status-draft { background: #ececec; color: #555; }

.pes-content-wrap {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 56px 24px 80px;
}

.pes-section { margin: 0 0 72px; }
.pes-overview { max-width: 900px; }
.pes-richtext { color: #34423d; font-size: 18px; line-height: 1.72; }

.pes-perspective {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 0;
    overflow: hidden;
    border: 1px solid #ebe5d7;
    border-radius: 18px;
    background: var(--pes-cream);
}

.pes-perspective-2 { grid-template-columns: .85fr 1.15fr; }
.pes-perspective-2 .pes-perspective-media { order: 2; }

.pes-perspective-media {
    min-height: 430px;
    background: #08242b;
}

.pes-perspective-media img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none !important;
    object-fit: cover;
}

.pes-perspective-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
}

.pes-perspective-copy h2 {
    margin: 7px 0 18px !important;
    font-size: clamp(36px, 4vw, 56px) !important;
}

.pes-concept-note {
    margin-top: 20px;
    color: #7d7566;
    font-size: 12px;
}

.pes-video {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%;
    border-radius: 16px;
    background: #061d25;
}

.pes-video iframe,
.pes-video video,
.pes-video .wp-video {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.pes-evidence {
    padding: 40px;
    border-left: 5px solid var(--pes-gold);
    border-radius: 0 14px 14px 0;
    background: #fbf8ef;
}

.pes-reference-list { margin: 18px 0 0; padding-left: 24px; }
.pes-reference-list li { margin: 10px 0; line-height: 1.55; }
.pes-reference-list a { color: var(--pes-green); }

.pes-disclaimer {
    margin: 0 0 72px;
    padding: 22px 24px;
    border: 1px solid #ddd1b3;
    border-radius: 14px;
    background: #f4efe2;
}

.pes-disclaimer strong { color: #6e5314; }
.pes-disclaimer p { margin: 7px 0 0; line-height: 1.55; }

.pes-related .pes-grid-related { --pes-cols: 3; }

.pes-peptide-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    padding-top: 28px;
    border-top: 1px solid var(--pes-line);
}

.pes-peptide-nav a {
    color: var(--pes-green);
    font-weight: 700;
    text-decoration: none;
}

.pes-next-link { text-align: right; }

.pes-library-button {
    padding: 12px 18px;
    border-radius: 999px;
    background: var(--pes-green);
    color: #fff !important;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1180px) {
    .pes-grid { --pes-cols: 3 !important; }
    .pes-library-toolbar { align-items: stretch; flex-direction: column; }
    .pes-result-meta { text-align: left; }
}

@media (max-width: 960px) {
    .pes-grid,
    .pes-related .pes-grid-related { --pes-cols: 2 !important; }

    .pes-controls {
        grid-template-columns: minmax(0, 1fr) minmax(200px, .75fr) auto;
    }

    .pes-perspective,
    .pes-perspective-2 { grid-template-columns: 1fr; }
    .pes-perspective-2 .pes-perspective-media { order: 0; }
}

@media (max-width: 700px) {
    .pes-library { padding: 42px 16px 56px !important; }
    .pes-library-head { margin-bottom: 24px !important; }
    .pes-library-toolbar { padding: 12px !important; margin-bottom: 20px !important; }

    .pes-controls {
        display: flex !important;
        flex-direction: column;
        align-items: stretch;
    }

    .pes-clear { width: 100% !important; }

    .pes-grid,
    .pes-related .pes-grid-related { --pes-cols: 1 !important; }

    .pes-card-image { min-height: 270px; aspect-ratio: 1.42 / 1; }
    .pes-detail-hero { min-height: 420px; }
    .pes-content-wrap { padding: 38px 16px 60px; }
    .pes-perspective-copy { padding: 30px 24px; }
    .pes-perspective-media { min-height: 300px; }
    .pes-evidence { padding: 28px 22px; }
    .pes-peptide-nav { grid-template-columns: 1fr; text-align: center; }
    .pes-next-link { text-align: center; }
}
