/* ==========================================================================
   page-content.css
   Modern styling for CMS pages (About / Desk pages) rendered inside
   .displayPageContent. Pure CSS - the HTML saved from the admin editor
   is not changed.

   Change the 5 colours below to re-theme everything in one place.
   ========================================================================== */

.displayPageContent {
    --pc-ink: #052143;      /* headings (same navy as the sidebar title) */
    --pc-text: #6b778b;     /* body text */
    --pc-accent: #687eff;   /* periwinkle used by the active menu item */
    --pc-tint: #f4f6ff;     /* very light lavender panels */
    --pc-line: #dfe5ff;     /* soft borders */
}

/* ---------- Page title ---------- */
.displayPageContent section > h2 {
    position: relative;
    margin: 0 0 28px;
    padding-bottom: 18px;
    font-size: clamp(30px, 4vw, 42px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--pc-ink);
}

.displayPageContent section > h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 64px;
    height: 5px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--pc-accent), #a2b0ff);
}

/* ---------- Content card ---------- */
.displayPageContent .page-content {
    padding: clamp(20px, 4vw, 44px);
    background: #fff;
    border: 1px solid var(--pc-line);
    border-radius: 24px;
    box-shadow: 0 24px 60px -34px rgba(104, 126, 255, 0.45);
    color: var(--pc-text);
    font-size: 17px;
    line-height: 1.85;
    overflow-wrap: break-word;
}

.displayPageContent .page-content p {
    margin: 0 0 1.15em;
}

.displayPageContent .page-content p:not([align]) {
    text-align: left;
}

.displayPageContent .page-content p:last-child {
    margin-bottom: 0;
}

.displayPageContent .page-content strong,
.displayPageContent .page-content b {
    font-weight: 600;
    color: var(--pc-ink);
}

/* ---------- Profile header (first paragraph that holds a photo) ---------- */
/* The editor wraps the photo as <p><span class="resizable-wrapper"><img></span></p>,
   followed by an empty <p><br></p> and a <p> with the name. So we match on
   :has(img) (any depth) and treat those three paragraphs as ONE card:
   p1 = top of card (photo), p2 = empty spacer (hidden), p3 = bottom (name pill). */

/* p1: photo block = top half of the card */
.displayPageContent .page-content > p:first-child:has(img) {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 34px 20px 18px;
    background: var(--pc-tint);
    background: linear-gradient(180deg, var(--pc-tint), #fff);
    border: 1px solid var(--pc-line);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    font-size: 0; /* hides stray &nbsp; gaps left by the editor */
    line-height: 0;
}

/* editor's resize wrapper: ignore its inline width:300px and drag handle */
.displayPageContent .page-content > p:first-child:has(img) .resizable-wrapper {
    display: block !important;
    width: min(220px, 70%) !important;
    max-width: 100%;
    height: auto !important;
    position: static;
    border: 0 !important;
    outline: 0 !important;
}

.displayPageContent .page-content .resize-handle {
    display: none !important;
}

.displayPageContent .page-content > p:first-child:has(img) img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center top;
    border: 0;
    border-radius: 28px;
    box-shadow:
        0 0 0 6px #fff,
        0 0 0 8px var(--pc-line),
        0 28px 50px -22px rgba(5, 33, 67, 0.45);
}

/* p2: the empty spacer paragraph the editor leaves behind */
.displayPageContent .page-content > p:first-child:has(img) + p:has(> br:only-child) {
    display: none;
}

/* p3: name line = bottom half of the card, shown as a pill */
.displayPageContent .page-content > p:first-child:has(img) + p:has(> br:only-child) + p:has(> strong),
.displayPageContent .page-content > p:first-child:has(img) + p:has(> strong) {
    display: flex;
    justify-content: center;
    margin: 0 0 32px;
    padding: 0 20px 30px;
    background: #fff;
    border: 1px solid var(--pc-line);
    border-top: 0;
    border-radius: 0 0 24px 24px;
    text-align: center;
    font-size: 0;
    line-height: 0;
}

.displayPageContent .page-content > p:first-child:has(img) + p:has(> br:only-child) + p:has(> strong) br,
.displayPageContent .page-content > p:first-child:has(img) + p:has(> strong) br {
    display: none;
}

.displayPageContent .page-content > p:first-child:has(img) + p:has(> br:only-child) + p:has(> strong) strong,
.displayPageContent .page-content > p:first-child:has(img) + p:has(> strong) strong {
    display: inline-block;
    padding: 9px 22px;
    background: #fff;
    border: 1px solid var(--pc-line);
    border-radius: 999px;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--pc-accent);
}

/* ---------- Pull-quotes (centered bold lines + blockquote) ---------- */
.displayPageContent .page-content p[align="center"],
.displayPageContent .page-content blockquote {
    position: relative;
    margin: 28px 0;
    padding: 24px 28px;
    background: linear-gradient(135deg, var(--pc-tint), #fff);
    border: 1px solid var(--pc-line);
    border-left: 5px solid var(--pc-accent);
    border-radius: 16px;
    text-align: center;
    font-family: "Roboto Serif", Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: 19px;
    line-height: 1.55;
    color: var(--pc-ink);
}

.displayPageContent .page-content p[align="center"] strong {
    font-weight: 600;
    color: inherit;
}

.displayPageContent .page-content p[align="center"]::before,
.displayPageContent .page-content blockquote::before {
    content: "\201C";
    position: absolute;
    top: 4px;
    left: 16px;
    font-family: "Roboto Serif", Georgia, serif;
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    font-style: normal;
    color: var(--pc-accent);
    opacity: 0.22;
}

/* consecutive centered lines read as one quote block */
.displayPageContent .page-content p[align="center"] + p[align="center"] {
    margin-top: -16px;
    border-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    padding-top: 0;
}

.displayPageContent .page-content p[align="center"] + p[align="center"]::before {
    display: none;
}

.displayPageContent .page-content p[align="center"]:has(+ p[align="center"]) {
    margin-bottom: 0;
    padding-bottom: 12px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* ---------- Sign-off block ("Regards / Name / Role") ---------- */
.displayPageContent .page-content > p:last-child:has(> strong + br) {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px dashed var(--pc-line);
    font-size: 16px;
    line-height: 1.7;
}

/* ---------- Other things authors may add in the editor ---------- */
.displayPageContent .page-content h3,
.displayPageContent .page-content h4 {
    margin: 1.6em 0 0.6em;
    font-weight: 700;
    line-height: 1.25;
    color: var(--pc-ink);
}

.displayPageContent .page-content a {
    color: var(--pc-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.displayPageContent .page-content a:hover {
    color: var(--pc-ink);
}

.displayPageContent .page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

.displayPageContent .page-content ul {
    margin: 0 0 1.15em;
    padding: 0;
    list-style: none;
}

.displayPageContent .page-content ul li {
    position: relative;
    margin-bottom: 10px;
    padding-left: 28px;
}

.displayPageContent .page-content ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72em;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--pc-accent);
    box-shadow: 0 0 0 4px var(--pc-tint);
}

.displayPageContent .page-content table {
    width: 100%;
    margin: 0 0 1.15em;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--pc-line);
    border-radius: 14px;
    overflow: hidden;
}

.displayPageContent .page-content th,
.displayPageContent .page-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--pc-line);
}

.displayPageContent .page-content th {
    background: var(--pc-tint);
    color: var(--pc-ink);
    text-align: left;
}

/* ==========================================================================
   Principal's / President's Desk layout            (css-version: desk-v4)
   Editor output is either
     <div><p><span.resizable-wrapper><img></span></p><p><b>Name</b></p></div>
   or
     <div><span.resizable-wrapper><img></span><p><b>Name</b></p></div>
   followed by an optional empty <div align="center"><br></div> and
   <div> ...message paragraphs... </div>
   Selectors are deliberately simple (no ">" inside :has()).
   ========================================================================== */

/* Profile card = the <div> that holds the photo */
.displayPageContent .page-content div:has(.resizable-wrapper) {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin: 0 0 32px;
    padding: 34px 20px 30px;
    background: linear-gradient(180deg, var(--pc-tint), #fff);
    border: 1px solid var(--pc-line);
    border-radius: 24px;
    text-align: center;
}

.displayPageContent .page-content div:has(.resizable-wrapper) p {
    margin: 0;
    font-size: 0;     /* hides stray &nbsp; / whitespace from the editor */
    line-height: 0;
}

/* photo: ignore the editor's inline width:300px and drag handle */
.displayPageContent .page-content div .resizable-wrapper {
    display: block !important;
    width: min(220px, 70vw) !important;
    max-width: 100%;
    height: auto !important;
    position: static;
    border: 0 !important;
    outline: 0 !important;
}

.displayPageContent .page-content div .resizable-wrapper img {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center top;
    border: 0;
    border-radius: 28px;
    box-shadow:
        0 0 0 6px #fff,
        0 0 0 8px var(--pc-line),
        0 28px 50px -22px rgba(5, 33, 67, 0.45);
}

/* name pill */
.displayPageContent .page-content div:has(.resizable-wrapper) p b,
.displayPageContent .page-content div:has(.resizable-wrapper) p strong {
    display: inline-block;
    padding: 9px 22px;
    background: #fff;
    border: 1px solid var(--pc-line);
    border-radius: 999px;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--pc-accent);
}

/* empty spacer div, stray <br>s and empty bold paragraphs left by the editor */
.displayPageContent .page-content > div[align]:has(> br:only-child),
.displayPageContent .page-content > div > br,
.displayPageContent .page-content p:has(> b:only-child > br:only-child) {
    display: none;
}

/* sign-off block ("Regards, / Name / Role / School") */
.displayPageContent .page-content p:has(> b:first-child + br) {
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px dashed var(--pc-line);
    font-size: 16px;
    line-height: 1.7;
}

/* ==========================================================================
   President's / Principal's Desk - FLAT markup  (css-version: flat-v1)
   Used when the page's wrapper divs are not present, i.e.
     <div.page-content>
       <span.resizable-wrapper><img></span>
       <p><b>Name</b></p>
       <p>message ...</p>
   The photo = top half of the card, the name line = bottom half (same idea
   as the Secretary's Desk). Pages with a list (Our Management) are excluded.
   ========================================================================== */
.displayPageContent .page-content:not(:has(> ol)) > .resizable-wrapper {
    display: flex !important;
    justify-content: center;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    position: static;
    margin: 0;
    padding: 34px 20px 18px;
    background: linear-gradient(180deg, var(--pc-tint), #fff);
    border: 1px solid var(--pc-line) !important;
    border-bottom: 0 !important;
    border-radius: 24px 24px 0 0;
    outline: 0 !important;
    font-size: 0;
    line-height: 0;
}

.displayPageContent .page-content:not(:has(> ol)) > .resizable-wrapper img {
    display: block;
    flex: none;
    width: min(220px, 70%) !important;
    height: auto !important;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center top;
    border: 0;
    border-radius: 28px;
    box-shadow:
        0 0 0 6px #fff,
        0 0 0 8px var(--pc-line),
        0 28px 50px -22px rgba(5, 33, 67, 0.45);
}

.displayPageContent .page-content:not(:has(> ol)) > .resizable-wrapper + p:has(> b, > strong) {
    display: flex;
    justify-content: center;
    margin: 0 0 32px;
    padding: 0 20px 30px;
    background: #fff;
    border: 1px solid var(--pc-line);
    border-top: 0;
    border-radius: 0 0 24px 24px;
    text-align: center;
    font-size: 0;
    line-height: 0;
}

.displayPageContent .page-content:not(:has(> ol)) > .resizable-wrapper + p:has(> b, > strong) :is(b, strong) {
    display: inline-block;
    padding: 9px 22px;
    background: #fff;
    border: 1px solid var(--pc-line);
    border-radius: 999px;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--pc-accent);
}

/* stray <br> / empty bold paragraphs left by the editor */
.displayPageContent .page-content:has(> .resizable-wrapper) > br {
    display: none;
}

/* ==========================================================================
   Our Management  (css-version: mgmt-v1)
   Editor output:
     <div.page-content>
       <span.resizable-wrapper><img></span>      (group photo, direct child)
       <p><br></p>                               (empty spacer)
       <p>Intro line</p>
       <ol><li>Name : Role</li> ...</ol>
       <p></p>
     </div>
   Scoped with :has(> ol) so other pages are not affected.
   ========================================================================== */

/* group photo = wide banner */
.displayPageContent .page-content:has(> ol) > .resizable-wrapper {
    display: block !important;
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    position: static;
    margin: 0 0 8px;
    border: 0 !important;
    outline: 0 !important;
}

.displayPageContent .page-content:has(> ol) > .resizable-wrapper img {
    display: block;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: center 40%;
    border: 0;
    border-radius: 20px;
    box-shadow:
        0 0 0 6px #fff,
        0 0 0 8px var(--pc-line),
        0 28px 50px -24px rgba(5, 33, 67, 0.45);
}

/* empty spacer / trailing empty paragraphs */
.displayPageContent .page-content:has(> ol) > p:has(> br:only-child),
.displayPageContent .page-content:has(> ol) > p:empty {
    display: none;
}

/* intro line ("... Executive Members are:") becomes a section label */
.displayPageContent .page-content:has(> ol) > p {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 40px 0 22px;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--pc-ink);
}

.displayPageContent .page-content:has(> ol) > p::before {
    content: "";
    flex: none;
    width: 5px;
    height: 26px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--pc-accent), #a2b0ff);
}

/* member list -> responsive grid of numbered cards */
.displayPageContent .page-content > ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: member;
}

.displayPageContent .page-content > ol > li {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 68px;
    margin: 0;
    padding: 14px 18px 14px 68px;
    background: #fff;
    border: 1px solid var(--pc-line);
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    color: var(--pc-ink);
    counter-increment: member;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.displayPageContent .page-content > ol > li::before {
    content: counter(member);
    position: absolute;
    left: 16px;
    top: 50%;
    width: 38px;
    height: 38px;
    margin: 0;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--pc-tint);
    box-shadow: none;
    font-size: 15px;
    font-weight: 700;
    color: var(--pc-accent);
}

.displayPageContent .page-content > ol > li:hover {
    transform: translateY(-2px);
    border-color: var(--pc-accent);
    box-shadow: 0 16px 30px -18px rgba(104, 126, 255, 0.6);
}

/* office bearers = first 7 entries (President ... Co-Treasurer).
   Delete this block if the list order ever changes. */
.displayPageContent .page-content > ol > li:nth-child(-n+33) {
    background: linear-gradient(135deg, var(--pc-tint), #fff);
    border-color: #c9d3ff;
}

.displayPageContent .page-content > ol > li:nth-child(-n+33)::before {
    background: var(--pc-accent);
    color: #fff;
}

@media (max-width: 640px) {
    .displayPageContent .page-content > ol {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .displayPageContent .page-content:has(> ol) > .resizable-wrapper img {
        aspect-ratio: 4 / 3;
    }
}

/* ---------- Gentle entrance animation ---------- */
@keyframes pcFadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
    .displayPageContent section > h2,
    .displayPageContent .page-content > * {
        animation: pcFadeUp 0.6s ease both;
    }
    .displayPageContent .page-content > *:nth-child(2) { animation-delay: 0.08s; }
    .displayPageContent .page-content > *:nth-child(3) { animation-delay: 0.16s; }
    .displayPageContent .page-content > *:nth-child(4) { animation-delay: 0.24s; }
    .displayPageContent .page-content > *:nth-child(n+5) { animation-delay: 0.32s; }
}

/* ---------- Small screens ---------- */
@media (max-width: 575px) {
    .displayPageContent .page-content {
        font-size: 16px;
        line-height: 1.75;
    }
    .displayPageContent .page-content p[align="center"],
    .displayPageContent .page-content blockquote {
        padding: 34px 18px 20px;
        font-size: 17px;
    }
    .displayPageContent .page-content p[align="center"] + p[align="center"] {
        padding-top: 0;
    }
}