/* themes/bootswatch_sketchy/css/style.css — bespoke hand-drawn / notebook-doodle
   polish on top of the Bootswatch "Sketchy" skin. Builds on --bs-* variables so
   it tracks the tenant palette. The skin itself supplies the marker fonts and
   wobbly component borders; here we add graph paper, scribble accents, playful
   rotations and rough shadows. */

/* ---------- Page canvas : faint graph-paper grid ------------------------- */
body {
    background-color: var(--bs-body-bg);
    background-image:
        linear-gradient(rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.045) 1px, transparent 1px);
    background-size: 26px 26px;
    background-position: -1px -1px;
}

/* ---------- Section rhythm ---------------------------------------------- */
.bsw-section,
main > section {
    padding-top: clamp(3rem, 7vw, 5.5rem);
    padding-bottom: clamp(3rem, 7vw, 5.5rem);
    scroll-margin-top: 5rem;
}

/* Alternating "torn page" tint so sections read as separate sketchbook leaves */
main > section:nth-of-type(even) {
    background-color: rgba(var(--bs-primary-rgb), 0.04);
}

/* ---------- Hero : a torn, hand-drawn NOTEBOOK PAGE --------------------- */
.bsw-hero {
    position: relative;
    padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(3rem, 8vw, 6rem);
    overflow: hidden;
    /* the desk under the page: a soft tinted wash */
    background:
        radial-gradient(ellipse at 50% -10%, rgba(var(--bs-primary-rgb), 0.12), transparent 60%);
}

/* the page itself : ruled lines + a red margin rule + a punched-holes column */
.bsw-page {
    position: relative;
    margin-inline: auto;
    padding: clamp(2rem, 5vw, 3rem) clamp(1.4rem, 5vw, 3rem)
             clamp(2.5rem, 6vw, 3.5rem) clamp(3rem, 8vw, 5rem);
    background-color: var(--bs-body-bg);
    /* horizontal ruled lines + one vertical red margin line */
    background-image:
        linear-gradient(90deg, transparent 0 calc(2.4rem - 2px),
            rgba(220, 53, 69, 0.55) calc(2.4rem - 2px) 2.4rem, transparent 2.4rem),
        repeating-linear-gradient(
            to bottom,
            transparent 0 31px,
            rgba(var(--bs-primary-rgb), 0.18) 31px 32px
        );
    background-position: left top, left clamp(2rem, 5vw, 3rem);
    background-repeat: no-repeat, repeat;
    border: 2px solid var(--bs-body-color);
    /* slightly torn / drawn box */
    border-radius: 6px 255px 8px 225px / 225px 7px 255px 7px;
    box-shadow: 7px 9px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.18);
    transform: rotate(-0.6deg);
}

/* punched holes down the margin */
.bsw-page-rings {
    position: absolute;
    left: clamp(0.9rem, 2.8vw, 1.7rem);
    top: 12%;
    bottom: 12%;
    width: 14px;
    background-image: radial-gradient(circle,
        rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.28) 0 5px, transparent 6px);
    background-size: 14px 60px;
    background-repeat: repeat-y;
    background-position: center top;
}

/* little tilted "hand-made" sticky tag, pinned to the corner of the page */
.bsw-page-tag {
    position: absolute;
    top: -0.9rem;
    right: clamp(0.5rem, 4vw, 2.5rem);
    padding: 0.3rem 0.95rem;
    font-size: clamp(0.8rem, 1.8vw, 1rem);
    color: var(--bs-body-bg);
    background: var(--bs-primary);
    border: 2px solid var(--bs-body-color);
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    transform: rotate(4deg);
    box-shadow: 3px 3px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.25);
}

/* big hand-drawn marker title */
.bsw-page-title {
    margin: 0 0 1rem;
    font-weight: 700;
    font-size: clamp(2.2rem, 7vw, 4.4rem);
    line-height: 1.05;
}

/* the name gets a scribbled circle highlight */
.bsw-page-name {
    position: relative;
    display: inline-block;
    color: var(--bs-primary);
    padding: 0.05em 0.3em;
    white-space: nowrap;
}
.bsw-page-name::after {
    content: "";
    position: absolute;
    inset: -0.18em -0.1em -0.12em;
    /* hand-drawn ellipse scribbled around the word */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 70' preserveAspectRatio='none'%3E%3Cpath d='M40 8 C 120 -2 196 6 192 34 C 196 60 110 70 60 64 C 10 58 2 36 14 22 C 26 10 90 6 150 12' fill='none' stroke='%23000' stroke-opacity='0.45' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    z-index: -1;
    pointer-events: none;
}

.bsw-page-lead {
    max-width: 46ch;
    margin: 0 0 1.6rem;
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    color: var(--bs-secondary-color);
}

/* CTA row : holds the wobbly button + the sticky note + a doodle arrow */
.bsw-page-cta {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.4rem;
}

/* primary CTA drawn as a wobbly hand-drawn button */
.bsw-page-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    font-weight: 700;
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--bs-body-bg);
    text-decoration: none;
    background: var(--bs-primary);
    border: 2.5px solid var(--bs-body-color);
    border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
    box-shadow: 4px 4px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.bsw-page-btn:hover,
.bsw-page-btn:focus-visible {
    color: var(--bs-body-bg);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.35);
}

/* secondary CTA as a pinned sticky note */
.bsw-page-sticky {
    position: relative;
    display: inline-block;
    padding: 0.7rem 1.2rem 0.6rem;
    font-weight: 600;
    color: var(--bs-body-color);
    text-decoration: none;
    background: rgba(var(--bs-primary-rgb), 0.14);
    border: 1px solid rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.25);
    box-shadow: 3px 4px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.18);
    transform: rotate(-2.5deg);
    transition: transform 0.12s ease;
}
.bsw-page-sticky:hover,
.bsw-page-sticky:focus-visible {
    color: var(--bs-primary);
    transform: rotate(0deg) translateY(-2px);
}
.bsw-page-sticky-pin {
    position: absolute;
    top: -7px;
    left: 50%;
    width: 13px;
    height: 13px;
    margin-left: -6px;
    border-radius: 50%;
    background: var(--bs-primary);
    border: 2px solid var(--bs-body-color);
    box-shadow: 1px 2px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.35);
}

/* doodled arrows + their margin notes */
.bsw-doodle {
    position: absolute;
    color: var(--bs-primary);
    pointer-events: none;
}
.bsw-doodle svg {
    display: block;
    opacity: 0.7;
}
.bsw-doodle-note {
    font-size: clamp(0.95rem, 1.7vw, 1.2rem);
    color: var(--bs-secondary-color);
    white-space: nowrap;
}
/* top doodle: hand-points at the title from the right */
.bsw-doodle-top {
    top: clamp(-0.5rem, 2vw, 0.5rem);
    right: clamp(1rem, 5vw, 4rem);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}
.bsw-doodle-top svg { width: 64px; height: 48px; }
.bsw-doodle-top .bsw-doodle-note { transform: rotate(-6deg); }
/* bottom doodle: arrow scribbled toward the buttons */
.bsw-doodle-bottom {
    position: static;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.bsw-doodle-bottom svg { width: 64px; height: 44px; }
.bsw-doodle-bottom .bsw-doodle-note { transform: rotate(4deg); }

/* a scribbled note down in the page margin */
.bsw-page-margin-note {
    position: absolute;
    left: clamp(2.6rem, 7vw, 4.4rem);
    bottom: 0.7rem;
    font-size: clamp(0.85rem, 1.5vw, 1.05rem);
    color: var(--bs-secondary-color);
    opacity: 0.75;
    transform: rotate(-2deg);
}

/* ---------- Cards : sketchbook stickers, lightly rotated ----------------- */
.card {
    border-width: 2px;
    box-shadow: 4px 5px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
/* give a touch of variety so the grid feels hand-pinned */
.row > [class*="col"]:nth-child(3n + 1) .card { transform: rotate(-1deg); }
.row > [class*="col"]:nth-child(3n + 2) .card { transform: rotate(0.6deg); }
.row > [class*="col"]:nth-child(3n + 3) .card { transform: rotate(-0.4deg); }
.card:hover,
.card:focus-within {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 6px 8px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.22);
}

/* ---------- Section titles : scribble underline accent ------------------ */
.section-title h2,
.bsw-section > .container > .row h2,
#contact h2 {
    position: relative;
    display: inline-block;
}
.section-title h2::after,
#contact h2::after {
    content: "";
    display: block;
    height: 10px;
    margin: 0.35rem auto 0;
    width: 70%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 2 70 11 100 6 S 170 2 198 8' fill='none' stroke='%23000' stroke-opacity='0.6' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    filter: invert(0);
    color: var(--bs-primary);
}

/* ---------- Contact + footer links ------------------------------------- */
#contact a { text-decoration: underline wavy; text-underline-offset: 4px; }

.bsw-footer a { text-decoration: none; }
.bsw-footer a:hover { color: var(--bs-primary) !important; }

/* ---------- Responsive trims ------------------------------------------- */
@media (max-width: 767.98px) {
    /* keep the page tidy on phones: drop the pointing doodles */
    .bsw-doodle-top { display: none; }
    .bsw-doodle-bottom { display: none; }
    .bsw-page { transform: none; }
    .bsw-page-margin-note { display: none; }
    .card,
    .row > [class*="col"]:nth-child(n) .card { transform: none; }
}

/* ---------- Respect reduced motion ------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .bsw-page-btn,
    .bsw-page-sticky,
    .card { transition: none; }
}

/* ======================================================================= */
/*  Phase 3 — bespoke home sections (projects / team / testimonials / faq)  */
/*  Hand-drawn "sticker" cards, doodle pins, scribble accents.             */
/* ======================================================================= */

/* ---------- Sticker cards (projects + team) ----------------------------- */
.bsw-sticker {
    position: relative;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-body-color);
    border-radius: 255px 12px 225px 14px / 14px 225px 12px 255px; /* drawn box */
    overflow: visible;
}
.bsw-sticker .card-body { position: relative; z-index: 1; }

/* push-pin doodle holding the sticker to the page */
.bsw-pin {
    position: absolute;
    top: -10px;
    left: 50%;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    z-index: 2;
    border-radius: 50%;
    background: var(--bs-primary);
    border: 2px solid var(--bs-body-color);
    box-shadow: 1px 2px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.35);
}
.bsw-pin::after { /* little highlight glint */
    content: "";
    position: absolute;
    top: 2px;
    left: 3px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--bs-body-bg);
    opacity: 0.7;
}

/* rough cropped image inside the sticker */
.bsw-sticker-img {
    border-bottom: 2px solid var(--bs-body-color);
    border-radius: 250px 8px 8px 8px / 8px 8px 8px 250px;
}

/* hand-scrawled "Featured" tag */
.bsw-badge {
    color: var(--bs-body-bg);
    background: var(--bs-primary);
    border: 2px solid var(--bs-body-color);
    border-radius: 255px 8px 225px 8px / 8px 225px 8px 255px;
    transform: rotate(-3deg);
    box-shadow: 2px 2px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.3);
    font-weight: 600;
}

/* team member fallback avatar + accents */
.bsw-avatar-fallback {
    background: rgba(var(--bs-primary-rgb), 0.1);
    border-bottom: 2px dashed var(--bs-body-color);
}
.bsw-role {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    background: rgba(var(--bs-primary-rgb), 0.12);
    border-radius: 255px 8px 225px 8px / 8px 225px 8px 255px;
}
.bsw-team-social a { transition: transform 0.12s ease, color 0.12s ease; }
.bsw-team-social a:hover,
.bsw-team-social a:focus-visible {
    color: var(--bs-primary) !important;
    transform: translateY(-2px);
    display: inline-block;
}

/* ---------- Testimonials : quote-bubble stickers ------------------------ */
.bsw-quote-card {
    position: relative;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-body-color);
    border-radius: 18px 255px 16px 225px / 225px 16px 255px 16px;
    box-shadow: 4px 5px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.row > [class*="col"]:nth-child(odd) .bsw-quote-card  { transform: rotate(-0.8deg); }
.row > [class*="col"]:nth-child(even) .bsw-quote-card { transform: rotate(0.7deg); }
.bsw-quote-card:hover,
.bsw-quote-card:focus-within {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 6px 8px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.22);
}
.bsw-quote-mark { opacity: 0.8; }
.bsw-quote-foot { border-top: 2px dashed var(--bs-border-color); padding-top: 0.85rem; }
.bsw-quote-avatar { border: 2px solid var(--bs-body-color); }

/* ---------- FAQ : notebook accordion ----------------------------------- */
.bsw-faq-item {
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-body-color);
    border-radius: 255px 14px 225px 14px / 14px 225px 14px 255px;
    box-shadow: 3px 4px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.16);
    overflow: hidden;
}
.bsw-faq-item .accordion-button {
    background: transparent;
    font-weight: 600;
    gap: 0.5rem;
}
.bsw-faq-item .accordion-button:not(.collapsed) {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.07);
    box-shadow: none;
}
.bsw-faq-item .accordion-button:focus-visible {
    outline: 3px dashed rgba(var(--bs-primary-rgb), 0.6);
    outline-offset: 2px;
    box-shadow: none;
}
.bsw-faq-q-num {
    color: var(--bs-primary);
    font-weight: 700;
    flex: 0 0 auto;
}
.bsw-faq-item .accordion-body {
    border-top: 2px dashed var(--bs-border-color);
}

/* ---------- Responsive trims for the new sections ---------------------- */
@media (max-width: 767.98px) {
    .bsw-badge,
    .row > [class*="col"]:nth-child(n) .bsw-quote-card { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .bsw-quote-card,
    .bsw-team-social a { transition: none; }
}

/* ======================================================================= */
/*  Phase 5 — bespoke home sections (about / skills / stats / resume /      */
/*  services). Hand-drawn frames, doodle progress bars, pinned stat cards,  */
/*  a scribbled CV timeline and sticker service cards.                      */
/* ======================================================================= */

/* ---------- About : pinned, slightly tilted photo frame ----------------- */
.bsw-about-frame {
    position: relative;
    display: inline-block;
    padding: 0.55rem;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-body-color);
    border-radius: 255px 14px 225px 14px / 14px 225px 14px 255px; /* drawn box */
    box-shadow: 5px 6px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.18);
    transform: rotate(-1.5deg);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bsw-about-frame:hover,
.bsw-about-frame:focus-within {
    transform: rotate(0deg) translateY(-3px);
    box-shadow: 7px 9px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.22);
}
.bsw-about-img {
    display: block;
    width: 100%;
    border: 2px solid var(--bs-body-color);
    border-radius: 250px 8px 8px 8px / 8px 8px 8px 250px;
}
/* the lead heading gets the same scribble underline as section titles */
.bsw-about-title {
    position: relative;
    display: inline-block;
}
.bsw-about-title::after {
    content: "";
    display: block;
    height: 9px;
    margin-top: 0.3rem;
    width: 60%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 2 70 11 100 6 S 170 2 198 8' fill='none' stroke='%23000' stroke-opacity='0.6' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
.bsw-about-facts a { text-decoration: underline wavy; text-underline-offset: 3px; }

/* ---------- Skills : doodle cards + rough progress bars ------------------ */
.bsw-skill-card {
    padding: 1rem 1.1rem;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-body-color);
    border-radius: 255px 12px 225px 14px / 14px 225px 12px 255px; /* drawn box */
    box-shadow: 3px 4px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.16);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.bsw-skill-card:hover,
.bsw-skill-card:focus-within {
    transform: translateY(-3px);
    box-shadow: 5px 7px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.2);
}
.bsw-skill-pct { font-weight: 700; color: var(--bs-primary); }
.bsw-skill-progress {
    background: rgba(var(--bs-primary-rgb), 0.1);
    border: 2px solid var(--bs-body-color);
    border-radius: 255px 10px 225px 10px / 10px 225px 10px 255px;
    overflow: hidden;
    padding: 1px;
}
.bsw-skill-progress .progress-bar {
    border-radius: 255px 10px 225px 10px / 10px 225px 10px 255px;
}

/* ---------- Stats : pinned ticket-stub cards ---------------------------- */
.bsw-stat-card {
    position: relative;
    padding: 1.6rem 0.75rem 1.2rem;
    background: var(--bs-body-bg);
    border: 2px solid var(--bs-body-color);
    border-radius: 18px 255px 16px 225px / 225px 16px 255px 16px;
    box-shadow: 4px 5px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.row > [class*="col"]:nth-child(odd) .bsw-stat-card  { transform: rotate(-0.8deg); }
.row > [class*="col"]:nth-child(even) .bsw-stat-card { transform: rotate(0.7deg); }
.bsw-stat-card:hover,
.bsw-stat-card:focus-within {
    transform: rotate(0deg) translateY(-4px);
    box-shadow: 6px 8px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.22);
}
.bsw-stat-value { line-height: 1.05; }

/* ---------- Resume : scribbled "string" timeline ------------------------ */
.bsw-timeline {
    position: relative;
    padding-left: 1.75rem;
}
.bsw-timeline::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 12px;
    /* hand-drawn vertical squiggle as the timeline spine */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 200' preserveAspectRatio='none'%3E%3Cpath d='M6 2 C 1 30 11 50 6 80 S 1 130 6 160 S 11 190 6 198' fill='none' stroke='%23000' stroke-opacity='0.5' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
    color: var(--bs-primary);
}
.bsw-timeline-item { position: relative; }
.bsw-timeline-dot {
    position: absolute;
    left: -1.75rem;
    top: 0.3rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bs-primary);
    border: 2px solid var(--bs-body-color);
    box-shadow: 1px 2px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.3);
}

/* ---------- Services : sticker cards reuse .bsw-sticker / .bsw-pin ------- */
.bsw-service-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    background: rgba(var(--bs-primary-rgb), 0.12);
    border: 2px dashed var(--bs-body-color);
    border-radius: 255px 12px 225px 14px / 14px 225px 12px 255px;
}
.bsw-service-icon i { line-height: 1; }
.services .card-title a:hover { color: var(--bs-primary); }
.services .card-body .small { text-decoration: underline wavy; text-underline-offset: 3px; }

/* ---------- Responsive trims for Phase 5 sections ----------------------- */
@media (max-width: 767.98px) {
    .bsw-about-frame,
    .row > [class*="col"]:nth-child(n) .bsw-stat-card { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .bsw-about-frame,
    .bsw-skill-card,
    .bsw-stat-card { transition: none; }
}

/* ======================================================================= */
/*  Phase 5 — bespoke LIST sections (publications / events / resources /    */
/*  blog). Publications read as a torn-out bibliography; events, resources  */
/*  and blog reuse the pinned sticker cards with a few extra doodle accents. */
/* ======================================================================= */

/* ---------- Publications : hand-ruled bibliography list ----------------- */
.bsw-cite-list { counter-reset: bsw-cite; }
.bsw-cite-item {
    position: relative;
    padding-left: 2.25rem;
    /* dashed "tear line" under each citation, like a notebook rule */
    border-bottom: 2px dashed var(--bs-border-color);
}
.bsw-cite-item:last-child { border-bottom: 0; }
/* scribbled bullet number in the margin */
.bsw-cite-item::before {
    counter-increment: bsw-cite;
    content: "[" counter(bsw-cite) "]";
    position: absolute;
    left: 0;
    top: 0.95rem;
    font-weight: 700;
    color: var(--bs-primary);
    transform: rotate(-4deg);
}
.bsw-cite-link {
    background-image: linear-gradient(transparent 88%, rgba(var(--bs-primary-rgb), 0.3) 0);
    transition: color 0.12s ease;
}
.bsw-cite-link:hover,
.bsw-cite-link:focus-visible {
    color: var(--bs-primary);
    background-image: linear-gradient(transparent 80%, rgba(var(--bs-primary-rgb), 0.45) 0);
}

/* ---------- Events : scrawled date "ticket" tag ------------------------- */
.bsw-date-tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.1);
    border: 2px dashed var(--bs-body-color);
    border-radius: 255px 8px 225px 8px / 8px 225px 8px 255px;
    transform: rotate(-1.5deg);
}

/* ---------- Resources : doodle download badge --------------------------- */
.bsw-dl-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.4rem;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.12);
    border: 2px dashed var(--bs-body-color);
    border-radius: 255px 12px 225px 14px / 14px 225px 12px 255px;
    transform: rotate(-3deg);
}

/* ---------- Blog : circled "margin note" date stamp -------------------- */
.bsw-date-stamp {
    padding: 0.05rem 0.5rem;
    border: 2px solid var(--bs-border-color);
    border-radius: 255px 10px 225px 10px / 10px 225px 10px 255px;
    transform: rotate(1.5deg);
}

/* ---------- Responsive trims for Phase 5 list sections ------------------ */
@media (max-width: 767.98px) {
    .bsw-date-tag,
    .bsw-dl-icon,
    .bsw-date-stamp { transform: none; }
    .bsw-cite-item::before { transform: none; }
}

/* ======================================================================= */
/*  Phase 6 — bespoke PAGES (blog list/detail, project list/detail).        */
/*  Restyle of the _shared page templates: pinned sticker cards (reused),    */
/*  scribble underlines, hand-drawn filter pills, tear-line prose, doodle    */
/*  breadcrumb + pagination. Builds on --bs-* so it tracks the palette.      */
/* ======================================================================= */

/* ---------- Filter pills : wobbly, hand-pinned toggles ------------------ */
.bsw-filter .btn {
    border-width: 2px;
    border-radius: 255px 12px 225px 12px / 12px 225px 12px 255px;
}
.bsw-filter .btn:nth-child(odd)  { transform: rotate(-1.2deg); }
.bsw-filter .btn:nth-child(even) { transform: rotate(1deg); }
.bsw-filter .btn:hover,
.bsw-filter .btn:focus-visible { transform: rotate(0deg) translateY(-1px); }

/* ---------- Tags : scrawled sticker chips (blog + project) -------------- */
.bsw-tag {
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.12);
    border: 2px solid var(--bs-body-color);
    border-radius: 255px 8px 225px 8px / 8px 225px 8px 255px;
    font-weight: 600;
    transition: transform 0.12s ease, color 0.12s ease;
}
a.bsw-tag:hover,
a.bsw-tag:focus-visible {
    color: var(--bs-body-bg);
    background: var(--bs-primary);
    transform: translateY(-2px) rotate(-2deg);
}

/* ---------- Breadcrumb : pencil trail ---------------------------------- */
.bsw-breadcrumb .breadcrumb { margin-bottom: 0; }
.bsw-breadcrumb .breadcrumb-item + .breadcrumb-item::before { content: "\203A"; }
.bsw-breadcrumb a {
    text-decoration: underline wavy;
    text-underline-offset: 3px;
    text-decoration-color: rgba(var(--bs-primary-rgb), 0.5);
}
.bsw-breadcrumb a:hover,
.bsw-breadcrumb a:focus-visible { color: var(--bs-primary); }

/* ---------- Article header : marker title + scribble underline ---------- */
.bsw-article-title {
    position: relative;
    display: inline-block;
    font-weight: 700;
    line-height: 1.1;
}
.bsw-article-title::after {
    content: "";
    display: block;
    height: 10px;
    margin-top: 0.35rem;
    width: 65%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8 C 40 2 70 11 100 6 S 170 2 198 8' fill='none' stroke='%23000' stroke-opacity='0.6' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 100% 100%;
}
.bsw-article-meta .bsw-date-stamp { display: inline-block; }

/* ---------- Lead + prose : ruled-paper rhythm, drawn accents ------------ */
.bsw-lead {
    font-weight: 600;
    color: var(--bs-secondary-color);
    border-left: 4px solid var(--bs-primary);
    padding-left: 1rem;
}
.bsw-prose-head {
    position: relative;
    display: inline-block;
    font-weight: 700;
}
.bsw-prose img { max-width: 100%; height: auto; }
.bsw-prose a {
    text-decoration: underline wavy;
    text-underline-offset: 3px;
    text-decoration-color: rgba(var(--bs-primary-rgb), 0.55);
}
.bsw-prose blockquote {
    margin: 1.25rem 0;
    padding: 0.75rem 1.1rem;
    background: rgba(var(--bs-primary-rgb), 0.06);
    border: 2px dashed var(--bs-border-color);
    border-radius: 255px 14px 225px 14px / 14px 225px 14px 255px;
}
.bsw-prose pre,
.bsw-prose code {
    border-radius: 6px;
    border: 2px solid var(--bs-border-color);
}
.bsw-prose pre { padding: 0.9rem 1.1rem; background: rgba(var(--bs-primary-rgb), 0.05); }

/* ---------- Timeline items : dot sits beside the scribble spine --------- */
.bsw-timeline-item { padding-left: 0.25rem; }

/* ---------- Empty-state note : pinned index card ----------------------- */
.bsw-note {
    background: rgba(var(--bs-primary-rgb), 0.07);
    border: 2px dashed var(--bs-body-color);
    border-radius: 255px 14px 225px 14px / 14px 225px 14px 255px;
    color: var(--bs-body-color);
}

/* ---------- Pagination : hand-drawn ticket buttons --------------------- */
.bsw-pagination .page-link {
    margin: 0 3px;
    border: 2px solid var(--bs-body-color);
    border-radius: 255px 10px 225px 10px / 10px 225px 10px 255px;
    color: var(--bs-body-color);
    transition: transform 0.12s ease;
}
.bsw-pagination .page-link:hover,
.bsw-pagination .page-link:focus-visible {
    color: var(--bs-primary);
    transform: translateY(-2px);
}
.bsw-pagination .page-item.active .page-link {
    color: var(--bs-body-bg);
    background: var(--bs-primary);
    border-color: var(--bs-body-color);
    box-shadow: 2px 2px 0 rgba(var(--bs-body-color-rgb, 33, 37, 41), 0.3);
}

/* ---------- Responsive + reduced-motion trims for pages ----------------- */
@media (max-width: 767.98px) {
    .bsw-filter .btn:nth-child(n) { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .bsw-filter .btn,
    .bsw-tag,
    .bsw-pagination .page-link { transition: none; }
}

/* ===== Phase 7 — content pages ===== */
/*  Bespoke restyle of the 12 _shared content pages (events, jobs, FAQ,      */
/*  publications, resources, services, team). Almost everything reuses the    */
/*  existing hand-drawn vocabulary (sticker cards, pins, doodle badges,       */
/*  tear-line citations, scribble prose). Only the few classes below are new. */

/* ---------- Urgent badge : a scrawled red sticky over .bsw-badge --------- */
.bsw-badge-urgent {
    color: #fff;
    background: var(--bs-danger, #dc3545);
    transform: rotate(2deg);
}

/* ---------- Publication detail : hand-ruled definition list -------------- */
.bsw-meta-list dt {
    font-weight: 700;
    color: var(--bs-primary);
}
.bsw-meta-list dd {
    margin-bottom: 0.4rem;
    border-bottom: 2px dashed var(--bs-border-color);
    padding-bottom: 0.4rem;
}
.bsw-meta-list dd:last-of-type { border-bottom: 0; }

/* ---------- Service detail : "what's included" doodle checklist ---------- */
.bsw-include-item {
    gap: 0.85rem;
    padding: 0.7rem 0;
    border-bottom: 2px dashed var(--bs-border-color);
}
.bsw-include-item:last-child { border-bottom: 0; }
.bsw-include-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    font-size: 1.05rem;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.12);
    border: 2px dashed var(--bs-body-color);
    border-radius: 255px 10px 225px 12px / 12px 225px 10px 255px;
    transform: rotate(-3deg);
}

/* ---------- FAQ wrapper : keep the squiggly accordion items breathing ---- */
.bsw-faq .accordion-item { border-radius: inherit; }

/* ---------- Responsive + reduced-motion trims for Phase 7 --------------- */
@media (max-width: 767.98px) {
    .bsw-badge-urgent,
    .bsw-include-icon { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .bsw-include-icon { transition: none; }
}


/* ---- Mode nuit : accent lisible (audit contraste) ------------------------- */
/* sketchy : --bs-primary=#333 (accent pensé pour le fond clair) n'est pas redéfini
   par le skin en mode nuit -> accents/titres/icônes bsw-* illisibles sur fond
   sombre. On adapte l'accent (teinte préservée), mode clair inchangé, + texte
   sombre sur les fonds .bg-primary devenus clairs. */
[data-bs-theme="dark"] {
    --bs-primary: #9c9c9c;
    --bs-primary-rgb: 155, 155, 155;
}
[data-bs-theme="dark"] .bg-primary,
[data-bs-theme="dark"] .text-bg-primary {
    color: #1a1a1a;
}


/* ---- Mode nuit : texte muté lisible (audit contraste) ---- */
/* --bs-secondary-color n'est pas adapté au mode nuit -> texte muté sombre sur
   fond sombre. On le passe à un muté-clair lisible (~ratio 6). */
[data-bs-theme="dark"] {
    --bs-secondary-color: rgba(255, 255, 255, .55);
}

/* AUDIT AA : pagination active (blanc sur accent clair) -> texte sombre. */
.page-link.active, .active > .page-link { color: #14202e !important; }
