/*
Theme Name: Peptide Perspectives Cosmic
Theme URI: https://peptideperspectives.com/
Author: Peptide Perspectives
Description: Sci-fi education and community theme for Peptide Perspectives.
Version: 1.5.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: peptide-perspectives
*/

:root {
    --bg: #050b1b;
    --bg-2: #09142a;
    --panel: #0d1730;
    --panel-2: #101d3d;
    --line: #233a59;
    --line-2: #33557c;
    --ink: #edf6ff;
    --muted: #aabed7;
    --cyan: #66e8ff;
    --cyan-2: #8ad5ff;
    --purple: #a694ff;
    --blue: #6aa1ff;
    --gold: #fdcb72;
    --shadow: 0 22px 60px rgba(0, 0, 0, .28);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.65;
    color: var(--ink);
    background:
        radial-gradient(circle at 85% 0%, rgba(111, 121, 255, .18), transparent 25%),
        radial-gradient(circle at 10% 35%, rgba(68, 211, 255, .16), transparent 30%),
        linear-gradient(180deg, #051020 0%, #040912 100%);
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
iframe { max-width: 100%; }

h1, h2, h3, h4 {
    line-height: 1.12;
    letter-spacing: -.03em;
    margin: 0 0 .65em;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.95rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.35rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.wrap { width: min(1240px, calc(100% - 48px)); margin: 0 auto; }
.section { padding: 58px 0; }
.section-tight { padding-top: 32px; }
.content-shell { padding: 58px 0; }
.eyebrow,
.pill {
    display: inline-block;
    color: var(--cyan);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.gradient {
    background: linear-gradient(100deg, #fff 5%, #9feeff 48%, #b9a9ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.muted { color: var(--muted); }
.intro {
    max-width: 860px;
    color: var(--muted);
    font-size: 1.06rem;
}

.site-header {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(95, 134, 179, .25);
    background:
        radial-gradient(circle at 100% 0%, rgba(138, 90, 255, .14), transparent 26%),
        radial-gradient(circle at 0% 100%, rgba(36, 140, 255, .14), transparent 23%),
        linear-gradient(180deg, rgba(6, 14, 29, .96), rgba(5, 10, 20, .94));
}
.site-header__nebula {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 80% 12%, rgba(193, 160, 255, .18), transparent 22%),
        radial-gradient(circle at 12% 88%, rgba(47, 136, 255, .18), transparent 20%);
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px 0;
    backdrop-filter: blur(16px);
}
body.admin-bar .topbar { top: 32px; }

.brand-mini {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: #fff;
}
.brand-mini:hover { text-decoration: none; }
.brand-mini__thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(140, 188, 255, .35);
    box-shadow: 0 0 0 1px rgba(255,255,255,.05) inset, 0 12px 30px rgba(0,0,0,.18);
}
.brand-mini__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.brand-mini__text strong {
    display: block;
    font-size: 1.2rem;
    letter-spacing: .02em;
}
.brand-mini__text small {
    display: block;
    color: var(--muted);
    font-size: .82rem;
    line-height: 1.35;
}

.primary-nav,
.primary-nav ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.primary-nav a {
    color: #ebf3ff;
    font-weight: 650;
    font-size: .94rem;
}
.primary-nav a:hover { color: var(--cyan); }

.header-showcase {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(360px, .9fr);
    gap: 34px;
    align-items: center;
    padding: 24px 0 72px;
}
.header-showcase__copy p {
    max-width: 640px;
    color: var(--muted);
    font-size: 1.1rem;
}
.header-showcase__art { justify-self: end; width: 100%; }
.art-frame {
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid rgba(131, 189, 255, .28);
    background: linear-gradient(180deg, rgba(11, 20, 42, .92), rgba(10, 18, 33, .9));
    box-shadow: 0 25px 70px rgba(0,0,0,.35);
}
.art-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(145deg, rgba(255,255,255,.08), transparent 28%);
}
.art-frame img {
    display: block;
    width: 100%;
    height: auto;
}

.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 22px;
    border-radius: 12px;
    font-weight: 800;
    color: #06132b !important;
    background: linear-gradient(105deg, var(--cyan) 0%, #a2d4ff 100%);
    box-shadow: 0 8px 20px rgba(88, 214, 255, .16);
}
.btn.alt {
    color: #fff !important;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(120, 162, 211, .34);
    box-shadow: none;
}
.btn:hover { text-decoration: none; }

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 26px;
}
.section-head--simple { margin-bottom: 18px; }

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.related-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.card {
    background: linear-gradient(155deg, rgba(17, 28, 55, .95), rgba(10, 18, 38, .98));
    border: 1px solid rgba(70, 108, 153, .45);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.card--compact { padding: 20px; }
.card h3 { margin-top: 10px; }
.card p,
.card li,
.article p,
.article li,
.rich-copy,
.rich-copy p,
.rich-copy li { color: #d7e4f3; }
.card-tags { margin-bottom: 10px; }
.tag {
    display: inline-block;
    margin: 0 6px 6px 0;
    border: 1px solid rgba(104, 146, 194, .4);
    background: rgba(255,255,255,.04);
    border-radius: 999px;
    color: #d3ecff;
    padding: 5px 12px;
    font-size: .78rem;
}

.page-hero {
    padding: 54px 0 24px;
}
.peptide-hero {
    background:
        radial-gradient(circle at 100% 0%, rgba(140, 98, 255, .10), transparent 22%),
        radial-gradient(circle at 0% 100%, rgba(65, 138, 255, .10), transparent 20%);
}
.peptide-subtitle {
    font-size: 1.2rem;
    color: #cde2ff;
    margin-top: -4px;
}
.hero-tags { margin: 18px 0 10px; }
.facts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
}
.fact-card {
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(82, 118, 162, .42);
    border-radius: 16px;
    padding: 16px;
}
.fact-card b {
    display: block;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .73rem;
    margin-bottom: 7px;
}
.hero-detail-card { margin-top: 20px; }

.video-shell { max-width: 980px; }
.media-frame {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(79, 116, 158, .48);
    background: linear-gradient(180deg, rgba(5, 11, 24, .98), rgba(11, 19, 36, .96));
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.media-frame--video {
    aspect-ratio: 16 / 9;
    min-height: 260px;
}
.media-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.peptide-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr);
    gap: 28px;
    align-items: start;
}
.peptide-main { min-width: 0; }
.peptide-section + .peptide-section { margin-top: 24px; }
.rich-copy > *:last-child { margin-bottom: 0; }

.peptide-rail { min-width: 0; }
.sticky-card {
    position: sticky;
    top: 96px;
}
.infographic-card h3 { margin-bottom: 14px; }
.media-frame--infographic {
    min-height: 640px;
    max-height: 76vh;
    padding: 8px;
    align-items: stretch;
}
.media-frame--infographic iframe,
.media-frame--infographic img {
    width: 100%;
    height: 100%;
    display: block;
}
.media-frame--infographic img {
    object-fit: contain;
    object-position: top center;
    cursor: zoom-in;
    background: #fff;
    border-radius: 12px;
}
.infographic-note { margin-top: 12px; font-size: .92rem; }

.article { max-width: none; }
.article h2 { margin-top: 0; }

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(63, 97, 138, .55);
    border-radius: 14px;
    margin-top: 16px;
}
.table-wrap table {
    width: 100%;
    min-width: 740px;
    border-collapse: collapse;
}
th,
td {
    text-align: left;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(65, 97, 136, .42);
    vertical-align: top;
    font-size: .94rem;
}
th {
    background: rgba(102, 167, 255, .10);
    color: #d8efff;
}
td { color: #d0def0; }

input,
select,
textarea {
    width: 100%;
    background: #08142a;
    color: #fff;
    border: 1px solid #38506e;
    border-radius: 10px;
    padding: 13px;
    font: inherit;
}
label {
    display: block;
    font-weight: 650;
    font-size: .92rem;
    margin: 13px 0 6px;
}
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 25px 0;
}
.filters input { flex: 2; min-width: 220px; }
.filters select { flex: 1; min-width: 180px; }

.notice {
    background: rgba(70, 170, 216, .12);
    border-left: 3px solid var(--cyan);
    padding: 14px 18px;
    border-radius: 8px;
    color: #d1e9ec;
    margin-bottom: 14px;
}
.pp-experience-form { margin-top: 20px; }
.pp-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}
.pp-form-grid .full { grid-column: 1 / -1; }
.pp-rating { font-weight: 800; color: var(--gold); }

.footer {
    margin-top: 60px;
    padding: 40px 0;
    border-top: 1px solid rgba(70, 108, 153, .34);
    color: var(--muted);
    font-size: .88rem;
}

.pagination {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    padding: 8px 13px;
    border: 1px solid rgba(70, 108, 153, .45);
    border-radius: 10px;
}

#pp-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .87);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 30px;
}
#pp-lightbox.active { display: flex; }
#pp-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
}
#pp-lightbox button {
    position: absolute;
    top: 14px;
    right: 20px;
    background: transparent;
    color: white;
    border: 0;
    font-size: 35px;
    cursor: pointer;
}
.sr-only {
    position: absolute;
    left: -9999px;
}

@media (max-width: 1000px) {
    .header-showcase,
    .peptide-layout,
    .grid {
        grid-template-columns: 1fr;
    }
    .header-showcase__art {
        justify-self: stretch;
    }
    .facts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sticky-card {
        position: static;
        top: auto;
    }
    .media-frame--infographic {
        min-height: 520px;
        max-height: none;
    }
}

@media (max-width: 760px) {
    .wrap { width: min(1240px, calc(100% - 32px)); }
    .topbar {
        position: relative;
        flex-direction: column;
        align-items: flex-start;
    }
    .primary-nav,
    .primary-nav ul { gap: 12px; }
    .brand-mini__thumb { width: 56px; height: 56px; flex-basis: 56px; }
    .header-showcase { padding-bottom: 48px; }
    .section { padding: 40px 0; }
    .facts-grid,
    .pp-form-grid { grid-template-columns: 1fr; }
    .media-frame--video { min-height: 220px; }
    .media-frame--infographic { min-height: 430px; }
}

@media (max-width: 480px) {
    body.admin-bar .topbar { top: 0; }
    .brand-mini {
        align-items: flex-start;
    }
    .brand-mini__text strong { font-size: 1rem; }
    .brand-mini__text small { font-size: .76rem; }
    h1 { font-size: clamp(2.1rem, 12vw, 3.1rem); }
}

/* v1.2: portrait infographic fit-to-frame and accessible enlargement */
.media-frame--infographic {
    height: min(68vh, 650px);
    min-height: 0;
    max-height: none;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
}
.media-frame--infographic img.pp-zoom {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center center;
    border-radius: 8px;
    background: transparent;
    cursor: zoom-in;
}
.infographic-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 14px; }
.pp-infographic-expand {
    background: linear-gradient(110deg, var(--cyan), #9abfff);
    color: #06132b;
    border: 0;
    border-radius: 9px;
    padding: 10px 14px;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
}
.infographic-actions a { font-weight: 700; }
.infographic-note { margin: 10px 0 0; }
body.pp-modal-open { overflow: hidden; }
#pp-lightbox { z-index: 999999; }
#pp-lightbox.active { display: flex; }
#pp-lightbox img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(96vw, 1300px);
    max-height: 92vh;
    object-fit: contain;
    border-radius: 6px;
}
#pp-lightbox .pp-lightbox-close {
    position: fixed;
    z-index: 2;
    top: 18px;
    right: 20px;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(11, 23, 46, .9);
    border: 1px solid #52708d;
    color: #fff;
    font-size: 32px;
    line-height: 1;
}
.pp-zoom:focus-visible, .pp-infographic-expand:focus-visible, #pp-lightbox button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 4px;
}
@media(max-width:760px) {
    .media-frame--infographic { height: min(66vh, 600px); min-height: 0; max-height: none; }
}

/* v1.3 fixed-height infographic viewport: image always scales to both axes */
.infographic-card .media-frame--infographic {
  position: relative !important;
  display: block !important;
  height: min(68vh, 620px) !important;
  min-height: 0 !important;
  max-height: min(68vh, 620px) !important;
  overflow: hidden !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}
.infographic-card .media-frame--infographic img.pp-zoom {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center center !important;
  display: block !important;
  margin: 0 !important;
  border: 0 !important;
}
.infographic-card .media-frame--infographic iframe {
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
}
@media (max-width:760px) {
  .infographic-card .media-frame--infographic {
    height: min(65vh, 560px) !important;
    max-height: min(65vh, 560px) !important;
  }
}

/* Quick navigation from peptide header to moderated experience table and form */
.experience-shortcuts{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:20px 0 23px}
.experience-shortcuts .btn{font-size:.92rem;text-align:center}
#experiences-table,#experience-form,#experiences{scroll-margin-top:110px}
@media(max-width:640px){.experience-shortcuts{flex-direction:column;align-items:stretch}.experience-shortcuts .btn{width:100%}}
