/* Clipboard 1 & 2: home page cards and the /clipboard/{url} details page. */

:root {
    --clip-brand: #18428E;
    --clip-brand-dark: #0f2d63;
    --clip-text: #2b2f36;
    --clip-muted: #6b7280;
    --clip-surface: #ffffff;
    --clip-border: #e5e9f2;
    --clip-shadow: 0 18px 40px rgba(10, 25, 60, 0.28);
}

/* ---------- Home page section ---------- */

.clip-section-overlay {
    background: linear-gradient(180deg, rgba(8, 20, 48, 0.55) 0%, rgba(8, 20, 48, 0.72) 100%);
}

.clip-section {
    max-width: 1180px;
    margin: 0 auto;
    padding: 80px 16px 90px;
}

.clip-section__head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 56px;
}

.clip-eyebrow {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.clip-section__title {
    color: #fff !important;
    font-size: clamp(1.8rem, 3.6vw, 2.6rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 16px 0 10px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.clip-section__lead {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    margin: 0;
}

.clip-grid {
    row-gap: 56px;
}

.clip-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--clip-surface);
    border-radius: 22px;
    box-shadow: var(--clip-shadow);
    padding: 52px 34px 26px;
    overflow: visible;
    transition: transform 0.35s cubic-bezier(.2, .7, .2, 1), box-shadow 0.35s ease, opacity 0.6s ease;
}

/* Brand accent strip along the top edge. */
.clip-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    border-radius: 22px 22px 0 0;
    background: linear-gradient(90deg, var(--clip-brand) 0%, #3a78d8 55%, #5fb3f5 100%);
}

.clip-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 60px rgba(10, 25, 60, 0.42);
}

/* Floating icon badge, centred on the top edge. */
.clip-card__icon {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #fff;
    background: linear-gradient(135deg, var(--clip-brand) 0%, #3a78d8 100%);
    box-shadow: 0 10px 24px rgba(24, 66, 142, 0.45), 0 0 0 6px #fff;
}

.clip-card__body {
    position: relative;
    flex: 1;
    max-height: 330px;
    overflow: hidden;
}

/* Cards centre their heading; body text stays left-aligned for easy reading. */
.clip-card .clip-content h1,
.clip-card .clip-content h2,
.clip-card .clip-content h3,
.clip-card .clip-content h4 {
    text-align: center !important;
    margin-bottom: 16px;
}

/* Fade shown only when the text is cut off (set by script on the home page). */
.clip-card__body.is-clipped::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, var(--clip-surface) 88%);
    pointer-events: none;
}

.clip-card__footer {
    margin-top: 20px;
    text-align: center;
}

.clip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--clip-brand) 0%, #2a5fbf 100%);
    color: #fff !important;
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
    text-decoration: none !important;
    border: 0;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(24, 66, 142, 0.35);
    transition: box-shadow 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.clip-btn i {
    transition: transform 0.25s ease;
}

.clip-btn:hover,
.clip-btn:focus-visible {
    background: linear-gradient(135deg, var(--clip-brand-dark) 0%, var(--clip-brand) 100%);
    box-shadow: 0 12px 26px rgba(24, 66, 142, 0.45);
    transform: translateY(-1px);
}

.clip-btn:hover i,
.clip-btn:focus-visible i {
    transform: translateX(4px);
}

.clip-btn:focus-visible {
    outline: 3px solid #5fb3f5;
    outline-offset: 3px;
}

.clip-btn--ghost {
    background: transparent;
    color: var(--clip-brand) !important;
    border: 1.5px solid var(--clip-brand);
    box-shadow: none;
}

.clip-btn--ghost:hover,
.clip-btn--ghost:focus-visible {
    background: var(--clip-brand);
    color: #fff !important;
    box-shadow: none;
}

.clip-btn--ghost:hover i,
.clip-btn--ghost:focus-visible i {
    transform: translateX(-4px);
}

/* Scroll-in animation (classes added by script, so cards stay visible without JS). */
.clip-card.clip-reveal {
    opacity: 0;
    transform: translateY(28px);
}

.clip-card.clip-reveal.is-visible {
    opacity: 1;
    transform: none;
}

.clip-card.clip-reveal.is-visible:hover {
    transform: translateY(-6px);
}

/* ---------- Content typography (admin-entered HTML) ---------- */

.clip-content {
    color: var(--clip-text);
    font-size: 0.98rem;
    line-height: 1.65;
    text-align: left;
    overflow-wrap: anywhere;
}

.clip-content h1,
.clip-content h2,
.clip-content h3,
.clip-content h4 {
    color: var(--clip-brand) !important;
    font-weight: 700;
    line-height: 1.3 !important;
    text-align: left !important;
    margin: 0 0 12px;
}

.clip-content h1,
.clip-content h2,
.clip-content h3 {
    font-size: 1.4rem;
}

.clip-content h4 {
    font-size: 1.15rem;
}

.clip-content p,
.clip-content li {
    line-height: 1.65 !important;
    text-align: left !important;
}

.clip-content p {
    margin: 0 0 10px;
}

.clip-content ul,
.clip-content ol {
    padding-left: 1.3em;
    margin: 0 0 12px;
}

.clip-content a {
    color: var(--clip-brand);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.clip-content img,
.clip-content iframe,
.clip-content video {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.clip-content table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
}

.clip-content td,
.clip-content th {
    padding: 6px 10px;
    border: 1px solid var(--clip-border);
}

/* ---------- Details page ---------- */

.clip-hero {
    background: linear-gradient(135deg, var(--clip-brand) 0%, var(--clip-brand-dark) 100%);
    color: #fff;
    padding: 48px 16px 90px;
}

.clip-hero__inner,
.clip-page__inner {
    max-width: 860px;
    margin: 0 auto;
}

.clip-crumbs {
    font-size: 0.9rem;
    opacity: 0.85;
    margin-bottom: 14px;
}

.clip-crumbs a {
    color: #fff !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.clip-hero__title {
    color: #fff !important;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 10px;
}

.clip-hero__meta {
    font-size: 0.95rem;
    opacity: 0.85;
}

.clip-page {
    padding: 0 16px 70px;
    margin-top: -60px;
}

.clip-article {
    background: var(--clip-surface);
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(10, 25, 60, 0.12);
    padding: 40px 44px;
}

.clip-article .clip-content {
    font-size: 1.05rem;
}

.clip-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    margin-top: 28px;
}

.clip-copied {
    color: var(--clip-muted);
    font-size: 0.9rem;
    margin-left: 8px;
}

.clip-empty {
    text-align: center;
    padding: 20px 0;
}

.clip-empty p {
    color: var(--clip-muted);
    margin-bottom: 22px;
}

@media (max-width: 767px) {
    .clip-section {
        padding: 56px 16px 64px;
    }

    .clip-section__head {
        margin-bottom: 48px;
    }

    .clip-card {
        padding: 48px 22px 22px;
    }

    .clip-card__body {
        max-height: 280px;
    }

    .clip-article {
        padding: 26px 20px;
        border-radius: 14px;
    }

    .clip-actions {
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .clip-card,
    .clip-btn {
        transition: none;
    }

    .clip-card:hover,
    .clip-card.clip-reveal.is-visible:hover,
    .clip-btn:hover,
    .clip-btn:hover i {
        transform: none;
    }
}
