/* ============================================
   COMPONENTS - CMS PAGE (page.php)
   ============================================ */

/* ── Card wrapper ── */
.page-card {
    position: relative;
}

.page-card-wrapper {
    position: relative;
}

/* ── Playful icon hanging over the card top edge ── */
.page-title-icon {
    position: absolute;
    top: -1.75rem;
    left: 2rem;
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--btn-blue) 0%, #1d4ed8 100%);
    color: #fff;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(59, 130, 246, .45);
    transform: rotate(-6deg);
    z-index: 10;
}

/* Reduce card top padding when icon is present (no-sidebar only; sidebar case has no card padding) */
.page-card--icon:not(.page-card--has-sidebar) {
    padding-top: 0.75rem !important;
}

/* Column top padding aligns title just below the icon bottom */
.pt-icon {
    padding-top: 0.75rem !important;
}

/* ── Breadcrumb — small, below title ── */
.page-breadcrumb {
    font-size: .75rem;
}

.breadcrumb-link {
    color: #9ca3af;
    text-decoration: none;
    transition: color .2s;
}

.breadcrumb-link:hover {
    color: var(--btn-blue);
    text-decoration: none;
}

.breadcrumb-active-item {
    color: #9ca3af;
}

/* ── Page title area ── */
.page-divider {
    border-bottom: 1px solid #eef1f4;
}

.page-accent-bar {
    display: inline-block;
    width: 32px;
    height: 4px;
    background: var(--btn-green);
    border-radius: 999px;
}

.page-title-h3 {
    font-family: var(--font-chewy);
    font-size: 2.6rem;
    font-weight: 400;
    letter-spacing: .02em;
    line-height: 1.15;
    background: linear-gradient(90deg, #1d4ed8 0%, #3b82f6 55%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    transform: rotate(-2deg);
    transform-origin: left center;
}

.page-subtitle {
    font-size: 1.05rem;
    color: #5b6777;
    display: block;
    width: fit-content;
    transform: rotate(-2deg);
    transform-origin: left center;
}

/* ── Page body content ── */
.page-body {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
}

/* ── Sidebar card: override overflow:hidden so backdrop-filter works in Safari ── */
/* Safari ignores backdrop-filter on any descendant of overflow:hidden. We remove
   the overflow from the card variant that has a sidebar and re-apply border-radius
   directly to the child columns instead. */
.page-card--has-sidebar {
    overflow: visible !important;
}

/* On desktop: content col gets left corners, sidebar col gets right corners */
.page-card--has-sidebar .content-col {
    border-radius: 0.375rem 0 0 0.375rem;
}

.page-card--has-sidebar .sidebar-col {
    border-radius: 0 0.375rem 0.375rem 0;
}

/* On mobile: columns stack — content on top, sidebar below */
@media (max-width: 991.98px) {
    .page-card--has-sidebar .content-col {
        border-radius: 0.375rem 0.375rem 0 0;
    }

    .page-card--has-sidebar .sidebar-col {
        border-radius: 0 0 0.375rem 0.375rem;
    }
}

/* ── Sidebar column — dark translucent, fills full card height ── */
.sidebar-col {
    background: rgba(10, 18, 42, 0.72);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ── Sidebar navigation links ── */
.sidebar-link {
    display: block;
    padding: .875rem 1rem;
    border-radius: .5rem;
    border-left: 4px solid var(--btn-blue);
    background: rgba(255, 255, 255, 0.06);
    transition: background .2s, border-color .2s, transform .15s;
    text-decoration: none;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.13);
    transform: translateX(3px);
    text-decoration: none;
}

/* Cycle through brand colors per link position */
.sidebar-link:nth-child(5n+1) { border-left-color: var(--btn-blue); }
.sidebar-link:nth-child(5n+1) .sidebar-link-icon { background: rgba(59, 130, 246, .2); color: #93c5fd; }
.sidebar-link:nth-child(5n+1) .sidebar-link-title { color: #93c5fd; }

.sidebar-link:nth-child(5n+2) { border-left-color: var(--btn-green); }
.sidebar-link:nth-child(5n+2) .sidebar-link-icon { background: rgba(34, 197, 94, .2); color: #86efac; }
.sidebar-link:nth-child(5n+2) .sidebar-link-title { color: #86efac; }

.sidebar-link:nth-child(5n+3) { border-left-color: var(--btn-orange); }
.sidebar-link:nth-child(5n+3) .sidebar-link-icon { background: rgba(255, 140, 0, .2); color: #fdba74; }
.sidebar-link:nth-child(5n+3) .sidebar-link-title { color: #fdba74; }

.sidebar-link:nth-child(5n+4) { border-left-color: #ff0099; }
.sidebar-link:nth-child(5n+4) .sidebar-link-icon { background: rgba(255, 0, 153, .2); color: #f9a8d4; }
.sidebar-link:nth-child(5n+4) .sidebar-link-title { color: #f9a8d4; }

.sidebar-link:nth-child(5n+5) { border-left-color: var(--btn-yellow); }
.sidebar-link:nth-child(5n+5) .sidebar-link-icon { background: rgba(255, 204, 51, .2); color: #fde68a; }
.sidebar-link:nth-child(5n+5) .sidebar-link-title { color: #fde68a; }

.sidebar-link-title {
    font-size: .95rem;
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: .35rem;
}

.sidebar-link .small.text-muted {
    color: rgba(255, 255, 255, 0.5) !important;
}

.sidebar-link-icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    flex: 0 0 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar-gap {
    gap: .75rem;
}

/* ── Lightbox ── */
.cms-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 12, .82);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    z-index: 5000;
}

.cms-lightbox.is-open {
    display: flex;
}

.cms-lightbox img {
    max-width: min(1100px, 100%);
    max-height: 88vh;
    width: auto;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
    background: #fff;
}

.cms-lightbox button {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: rgba(255, 255, 255, .18);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.cms-lightbox button:hover {
    background: rgba(255, 255, 255, .26);
}

/* ── Updated-at footer ── */
.page-updated {
    border-top: 1px solid #eef1f4;
}

/* ── CMS editor-only elements (hidden on public page) ── */
.cms-card-handles {
    display: none;
}
