:where(.gallery-wrap *) {
    box-sizing: border-box;
}

.gallery-wrap {
    --bg: #FFFFFF;
    --surface: #FFFFFF;
    --ink: #23303A;
    --accent: #FF7A50;
    --support: #1F8A70;
    --radius-sm: 10px;
    --radius-md: 20px;
    --radius-pill: 999px;
    --space-sm: 8px;
    --space-md: 20px;
    --space-lg: 48px;
    --font-heading: ui-rounded, 'Segoe UI Rounded', 'SF Pro Rounded', system-ui, sans-serif;
    --font-body: system-ui, -apple-system, 'Segoe UI', sans-serif;

    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md) 80px;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
}

.gallery-breadcrumb {
    font-size: 0.85rem;
    color: #6b7680;
    margin-bottom: var(--space-md);
    display: flex;
    gap: 8px;
    align-items: center;
}
.gallery-breadcrumb a { color: #6b7680; text-decoration: none; }
.gallery-breadcrumb a:hover { color: var(--accent); }
.gallery-breadcrumb .current { color: var(--ink); font-weight: 600; }

.gallery-header h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    line-height: 1.1;
    margin: 0 0 6px;
    color: var(--ink);
}
.gallery-header h1 .accent-word { color: var(--accent); }
.gallery-header p {
    margin: 0 0 var(--space-md);
    color: #5a6570;
    font-size: 0.95rem;
    max-width: 560px;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: var(--space-lg);
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: #FAF6EE;
    border: 1px solid #EFE7DA;
    color: #5a6570;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: transform .15s ease, background .15s ease, color .15s ease;
}
.filter-chip:hover { transform: translateY(-1px); }
.filter-chip.is-active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}
@media (max-width: 980px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr; } }

.gallery-card {
    position: relative;
    background: var(--surface);
    border: 1px solid #ECECEA;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 6px 16px -12px rgba(35, 48, 58, 0.18);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.gallery-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 26px -14px rgba(35, 48, 58, 0.22);
    border-color: #E5D9C6;
}

.gallery-card-media {
    overflow: hidden;
    background: #f2ece1;
    display: flex;
    margin: 10px;
    border-radius: 14px;
}
.gallery-card-media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 14px;
    transition: transform .25s ease;
}
.gallery-card:hover .gallery-card-media img { transform: scale(1.03); }

.gallery-card-body { padding: 14px 16px 16px; }
.gallery-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    margin: 0 0 10px;
    line-height: 1.25;
    color: var(--ink);
}

.gallery-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.gallery-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #FBF3E7;
    border: none;
    border-radius: var(--radius-pill);
    width: 38px;
    height: 38px;
    justify-content: center;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, transform .1s ease;
}
.gallery-action:hover { transform: scale(1.06); }
.like-btn { width: auto; padding: 0 14px; }
.like-btn .like-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--support);
}
.like-btn.is-liked {
    background: var(--accent);
    color: #fff;
}
.like-btn.is-liked .like-count { color: #fff; }
.like-btn.is-liked svg { fill: #fff; }
.like-btn svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.like-btn.is-liked svg { fill: currentColor; }

.gallery-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: var(--space-lg);
    flex-wrap: wrap;
}
.gallery-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid #ece3d5;
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
.gallery-pagination .page-numbers.current {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.gallery-empty { color: #5a6570; padding: 40px 0; }

.gallery-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(12px);
    background: var(--ink);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    z-index: 999;
}
.gallery-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .gallery-card, .gallery-card-media img, .gallery-action, .filter-chip, .gallery-toast {
        transition: none !important;
    }
}


/* Category landing cards (/animal/) */
.category-card {
    display: block;
    text-decoration: none;
    color: inherit;
}
.category-card .gallery-card-body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.category-card .gallery-card-title { margin: 0; }
.category-card-placeholder,
.gallery-card-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FFE3D2 0%, #FBF3E7 100%);
}
.category-count-badge {
    flex: none;
    background: #EAF6F1;
    color: var(--support);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    white-space: nowrap;
}

/* ---- Full-width hero (breaks out of any parent max-width container) ---- */
.gallery-hero-full {
    position: relative;
    display: block;
    width: 100%;
    padding: 56px 0 40px;
    box-sizing: border-box;
}
/* Visual-only full-bleed background: an absolutely positioned layer, so the
   section itself never leaves normal document flow and can never push or
   overlap the grid below it, regardless of any parent container/grid. */
.gallery-hero-full::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 100vw;
    transform: translateX(-50%);
    background: #F6F6F5;
    z-index: -1;
}
.gallery-wrap { position: relative; }
.gallery-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.gallery-hero-inner h1 {
    font-family: var(--font-heading, ui-rounded, system-ui, sans-serif);
    font-size: clamp(2.1rem, 4.5vw, 3.4rem);
    line-height: 1.05;
    margin: 0 0 14px;
    color: #1E2328;
}
.gallery-hero-inner h1 .hero-bold { font-weight: 800; }
.gallery-hero-inner h1 .hero-thin { font-weight: 400; color: #1E2328; }
.hero-desc {
    margin: 0 0 26px;
    color: #5a6570;
    font-size: 1rem;
    max-width: 640px;
    line-height: 1.55;
}
.hero-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}
.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    background: #FFFFFF;
    border: 1px solid #E3E1DC;
    color: #4A5157;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    transition: transform .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
.hero-pill:hover { transform: translateY(-1px); border-color: #cfcabf; }
.hero-pill .pill-icon { font-size: 0.85em; }
.hero-pill.is-active {
    background: #1E2328;
    border-color: #1E2328;
    color: #fff;
}
.hero-pill-grid {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 1px solid #E3E1DC;
    color: #4A5157;
    flex: none;
    transition: transform .15s ease, border-color .15s ease;
}
.hero-pill-grid:hover { transform: translateY(-1px); border-color: #cfcabf; }

@media (max-width: 640px) {
    .gallery-hero-full { padding: 40px 0 28px; }
    .hero-pill { padding: 8px 14px; font-size: 0.85rem; }
}

/* ---- LAYOUT SAFETY: GeneratePress sets .site-content{display:flex}, which turned
   our hero and grid into two side-by-side flex items on desktop. Our own single
   #primary wrapper fixes the structure; this forces block flow as a belt-and-braces. ---- */
.gallery-primary {
    display: block;
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
    min-width: 0;
}
.gallery-primary > * { float: none; clear: both; }

/* Page background matches the reference: white body, soft grey hero band */
body.tax-animal,
body.post-type-archive-gallery_image {
    background: #FFFFFF;
}
body.tax-animal .site-content,
body.post-type-archive-gallery_image .site-content {
    display: block;
}
.gallery-hero-full::before { background: #F2F2F2; }
.gallery-wrap { background: #FFFFFF; }

/* ===== NOTEBOOK PAGE CARDS - line art, no colour ===== */

.gallery-wrap {
    --accent: #23231F;
    --support: #565653;
    --surface: #FFFFFF;
    --ink: #2B2B29;
    background: #FFFFFF;
}

.gallery-grid { gap: 28px 22px; }

.gallery-card {
    position: relative;
    background-color: #FFFFFF;
    background-image: repeating-linear-gradient(
        to bottom,
        transparent 0 25px,
        #E9E9E6 25px 26px
    );
    background-position: 0 40px;
    border: 1px solid #E2E2DF;
    border-radius: 3px;
    overflow: hidden;
    padding-top: 32px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 14px 24px -20px rgba(0,0,0,.45);
    transition: transform .2s ease, box-shadow .2s ease;
}
.gallery-card:hover {
    transform: translateY(-4px) rotate(-0.25deg);
    box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 22px 34px -22px rgba(0,0,0,.5);
    border-color: #D6D6D2;
}

/* punched binding holes along the top edge of the page */
.gallery-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    width: auto;
    border-radius: 0;
    background-color: #FFFFFF;
    background-image: radial-gradient(circle, #DCDBD7 0 4px, transparent 4.5px);
    background-size: 36px 32px;
    background-position: 10px 0;
    background-repeat: repeat-x;
    border-bottom: 1px dashed #E4E4E1;
    box-shadow: none;
    z-index: 1;
}

/* the drawing, pasted onto the page */
.gallery-card-media {
    position: relative;
    z-index: 2;
    display: block;
    margin: 14px 14px 12px;
    padding: 7px;
    background: #FFFFFF;
    border: 1px solid #E4E4E1;
    border-radius: 2px;
    box-shadow: 0 2px 6px -4px rgba(0,0,0,.35);
    overflow: hidden;
}
.gallery-card-media img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    filter: grayscale(100%) contrast(1.04);
    transition: transform .25s ease;
}
.gallery-card:hover .gallery-card-media img { transform: scale(1.02); }

.gallery-card-body {
    position: relative;
    z-index: 2;
    padding: 2px 16px 16px;
    background: transparent;
}
.gallery-card-title {
    font-family: 'Patrick Hand', 'Segoe Print', ui-rounded, system-ui, cursive;
    font-weight: 400;
    font-size: 1.14rem;
    line-height: 26px;
    letter-spacing: .2px;
    margin: 0 0 10px;
    color: #2B2B29;
}

.gallery-card-actions { display: flex; align-items: center; gap: 8px; }
.gallery-action {
    background: #FFFFFF;
    border: 1px solid #E2E2DF;
    color: #3C3C3A;
    border-radius: 999px;
    box-shadow: none;
}
.gallery-action:hover { background: #F5F5F3; border-color: #CFCFCA; transform: none; }
.like-btn .like-count { color: #6C6C69; font-weight: 600; }
.like-btn.is-liked { background: #23231F; border-color: #23231F; color: #fff; }
.like-btn.is-liked .like-count { color: #fff; }

.gallery-pagination .page-numbers {
    background: #FFFFFF;
    border: 1px solid #E2E2DF;
    color: #3C3C3A;
}
.gallery-pagination .page-numbers.current {
    background: #23231F;
    border-color: #23231F;
    color: #fff;
}

.category-count-badge {
    background: #F3F3F1;
    color: #565653;
    border: 1px solid #E6E6E3;
}
.category-card-placeholder,
.gallery-card-placeholder {
    background: repeating-linear-gradient(45deg, #F4F4F2 0 8px, #EDEDEA 8px 16px);
}

.filter-chip { background: #FFFFFF; border: 1px solid #E2E2DF; color: #4A4A47; }
.filter-chip.is-active { background: #23231F; border-color: #23231F; color: #fff; }

/* ===== BREADCRUMB in the hero ===== */
.gallery-hero-inner .gallery-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 0 0 16px;
    font-size: 0.82rem;
    color: #77776F;
    letter-spacing: .2px;
}
.gallery-hero-inner .gallery-breadcrumb a { color: #77776F; text-decoration: none; }
.gallery-hero-inner .gallery-breadcrumb a:hover { color: #23231F; text-decoration: underline; }
.gallery-hero-inner .gallery-breadcrumb .sep { color: #B6B6B0; }
.gallery-hero-inner .gallery-breadcrumb .current { color: #23231F; font-weight: 600; }

/* ===== DOWNLOAD COUNTDOWN POPUP + icon safety ===== */
.gallery-action svg { display: block; }
.gallery-share svg { fill: none; stroke: currentColor; }

.dl-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dl-modal[hidden] { display: none !important; }

.dl-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(28, 28, 26, 0.55);
}

.dl-sheet {
    position: relative;
    width: 100%;
    max-width: 380px;
    padding: 48px 28px 26px;
    text-align: center;
    background-color: #FFFFFF;
    background-image: repeating-linear-gradient(to bottom, transparent 0 25px, #EFEFED 25px 26px);
    background-position: 0 46px;
    border: 1px solid #E2E2DF;
    border-radius: 4px;
    box-shadow: 0 30px 60px -28px rgba(0, 0, 0, 0.65);
}
.dl-sheet::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background-color: #FFFFFF;
    background-image: radial-gradient(circle, #DCDBD7 0 4px, transparent 4.5px);
    background-size: 36px 32px;
    background-position: 10px 0;
    background-repeat: repeat-x;
    border-bottom: 1px dashed #E4E4E1;
}

.dl-close {
    position: absolute;
    top: 40px;
    right: 12px;
    width: 30px;
    height: 30px;
    line-height: 1;
    font-size: 22px;
    background: none;
    border: 0;
    color: #8A8A84;
    cursor: pointer;
    border-radius: 50%;
}
.dl-close:hover { background: #F2F2F0; color: #23231F; }

.dl-heading {
    font-family: 'Patrick Hand', 'Segoe Print', ui-rounded, system-ui, cursive;
    font-weight: 400;
    font-size: 1.35rem;
    line-height: 26px;
    color: #23231F;
    margin: 0 0 4px;
}
.dl-name {
    margin: 0 0 14px;
    font-size: 0.85rem;
    color: #77776F;
}

.dl-count {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 6px 0 16px;
}
.dl-seconds {
    font-family: 'Patrick Hand', 'Segoe Print', ui-rounded, system-ui, cursive;
    font-size: 3.2rem;
    line-height: 1;
    color: #23231F;
}
.dl-unit {
    font-size: 0.85rem;
    color: #77776F;
}

.dl-track {
    height: 6px;
    background: #EFEFED;
    border: 1px solid #E4E4E1;
    border-radius: 999px;
    overflow: hidden;
    margin: 0 0 14px;
}
.dl-bar {
    display: block;
    height: 100%;
    width: 0;
    background: #23231F;
    transition: width 1s linear;
}
.dl-modal.is-done .dl-bar { background: #2F7D5B; }
.dl-modal.is-done .dl-seconds { color: #2F7D5B; }

.dl-note {
    margin: 0;
    font-size: 0.82rem;
    color: #77776F;
    line-height: 1.5;
}

.dl-manual {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 22px;
    background: #23231F;
    color: #fff;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}
.dl-manual:hover { background: #3A3A35; color: #fff; }
.dl-manual[hidden] { display: none !important; }

@media (max-width: 420px) {
    .dl-sheet { padding: 44px 18px 22px; }
    .dl-seconds { font-size: 2.6rem; }
}

/* ===== CARD LINKS ===== */
.gallery-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.gallery-card-title a {
    color: inherit;
    text-decoration: none;
}
.gallery-card-title a:hover { text-decoration: underline; }

/* ===== SINGLE IMAGE PAGE: drawing left, details right ===== */
.single-wrap { padding-top: 28px; }

.single-wrap .gallery-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin: 0 0 22px;
    font-size: 0.82rem;
    color: #77776F;
}
.single-wrap .gallery-breadcrumb a { color: #77776F; text-decoration: none; }
.single-wrap .gallery-breadcrumb a:hover { color: #23231F; text-decoration: underline; }
.single-wrap .gallery-breadcrumb .sep { color: #B6B6B0; }
.single-wrap .gallery-breadcrumb .current { color: #23231F; font-weight: 600; }

.single-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 44px;
    align-items: start;
}

.single-media-col { position: sticky; top: 24px; }
.single-card { padding-top: 34px; }
.single-card .gallery-card-media { margin: 16px; padding: 9px; }
.single-card:hover { transform: none; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 14px 24px -20px rgba(0,0,0,.45); }
.single-card:hover .gallery-card-media img { transform: none; }

.single-info-col { padding-top: 6px; }

.single-actionbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}
.single-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 9px 18px;
    border-radius: 999px;
    background: #FFFFFF;
    border: 1px solid #E2E2DF;
    color: #4A4A47;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}
.single-cat-chip:hover { border-color: #CFCFCA; color: #23231F; }

.single-heading {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.4px;
    color: #1E1E1C;
    margin: 0 0 22px;
}

.single-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    padding: 16px 26px;
    background: #23231F;
    color: #fff;
    border: 1px solid #23231F;
    border-radius: 999px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
    transition: background .15s ease, transform .12s ease;
}
.single-download:hover { background: #3A3A35; color: #fff; transform: translateY(-1px); }
.single-download svg { fill: none; stroke: currentColor; }

.single-desc {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px dashed #DEDEDA;
}
.single-desc-heading {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #8A8A84;
    margin: 0 0 10px;
}
.single-desc p {
    margin: 0 0 12px;
    font-size: 1rem;
    line-height: 1.65;
    color: #4A4A47;
}
.single-desc p:last-child { margin-bottom: 0; }

.single-backlink {
    display: inline-block;
    margin-top: 26px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #77776F;
    text-decoration: none;
}
.single-backlink:hover { color: #23231F; text-decoration: underline; }

.related-block {
    margin-top: 64px;
    padding-top: 8px;
}
.related-heading {
    font-family: 'Patrick Hand', 'Segoe Print', ui-rounded, system-ui, cursive;
    font-weight: 400;
    font-size: clamp(1.4rem, 2.4vw, 1.9rem);
    color: #2B2B29;
    margin: 0 0 22px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #DEDEDA;
}
.related-more { margin-top: 32px; text-align: center; }

@media (max-width: 900px) {
    .single-layout { grid-template-columns: 1fr; gap: 28px; }
    .single-media-col { position: static; max-width: 460px; margin: 0 auto; width: 100%; }
    .single-cat-chip { margin-left: 0; }
    .single-download { max-width: 100%; }
}

/* ===== SINGLE PAGE: details panel + tighter image ===== */
.single-card .gallery-card-media img {
    max-height: 620px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
}
.single-card .gallery-card-media {
    justify-content: center;
    background: #FFFFFF;
}

.single-facts {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px dashed #DEDEDA;
}
.facts-list {
    margin: 0;
    padding: 0;
}
.facts-list .fact {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #F0F0EE;
}
.facts-list .fact:last-child { border-bottom: 0; }
.facts-list dt {
    flex: 0 0 116px;
    margin: 0;
    font-size: 0.86rem;
    color: #8A8A84;
    font-weight: 500;
}
.facts-list dd {
    margin: 0;
    font-size: 0.92rem;
    color: #2B2B29;
    font-weight: 600;
}
.facts-list .fact-likes::after {
    content: " \2764";
    color: #B6B6B0;
    font-size: 0.85em;
}

.single-explore {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px dashed #DEDEDA;
}
.single-explore .hero-pills { margin-top: 12px; }
.single-explore .hero-pill { padding: 8px 16px; font-size: 0.86rem; }

@media (max-width: 900px) {
    .single-card .gallery-card-media img { max-height: none; }
    .facts-list dt { flex-basis: 100px; }
}

/* ===== SEARCH FORM IN THE HERO ===== */
.hero-search {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    padding: 6px 6px 6px 18px;
    max-width: 440px;
    background: #FFFFFF;
    border: 1px solid #E2E2DF;
    border-radius: 999px;
}
.hero-search:focus-within { border-color: #BDBCB6; }
.hero-search input[type="search"] {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: none;
    box-shadow: none;
    font-size: 0.95rem;
    color: #23231F;
    padding: 0;
}
.hero-search input[type="search"]::placeholder { color: #A3A29C; }
.hero-search button {
    flex: none;
    padding: 10px 22px;
    border: 0;
    border-radius: 999px;
    background: #23231F;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}
.hero-search button:hover { background: #3A3A35; }

/* page content (About, Contact, Coloring Pages) in the same paper style */
.ab-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 72px;
}
.ab-page h1 {
    font-size: clamp(1.9rem, 3.4vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #1E1E1C;
    margin: 0 0 18px;
}
.ab-page p { font-size: 1.02rem; line-height: 1.7; color: #4A4A47; }

/* ===== ICON SIZING FIX =====
   The action buttons are flex containers, and an inline SVG is a shrinkable flex
   item. The share icon was collapsing to 0px wide, so the button looked empty.
   Pin every action icon to a fixed box and stop it shrinking. */
.gallery-card-actions svg,
.single-actionbar svg,
.gallery-action svg {
    display: block;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    min-width: 18px;
}
.single-download svg {
    width: 19px;
    height: 19px;
    min-width: 19px;
    flex: 0 0 auto;
}
.gallery-action {
    box-sizing: border-box;
    flex: none;
}

/* ===== CATEGORY PAGE CONTENT ===== */
.hero-intro {
    max-width: 680px;
    margin: -8px 0 24px;
}
.hero-intro p {
    margin: 0 0 10px;
    color: #5a6570;
    font-size: 1rem;
    line-height: 1.6;
}
.hero-intro p:last-child { margin-bottom: 0; }

.cat-content {
    max-width: 780px;
    margin: 64px auto 0;
    padding-top: 40px;
    border-top: 1px dashed #DEDEDA;
}

.cat-article h2 {
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #1E1E1C;
    margin: 38px 0 14px;
    line-height: 1.25;
}
.cat-article h2:first-child { margin-top: 0; }
.cat-article h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2B2B29;
    margin: 26px 0 10px;
}
.cat-article p {
    margin: 0 0 15px;
    font-size: 1.02rem;
    line-height: 1.72;
    color: #45453F;
}
.cat-article ul,
.cat-article ol {
    margin: 0 0 18px;
    padding-left: 22px;
}
.cat-article li {
    margin: 0 0 9px;
    font-size: 1.02rem;
    line-height: 1.7;
    color: #45453F;
}
.cat-article a { color: #23231F; text-decoration: underline; text-underline-offset: 2px; }
.cat-article a:hover { color: #000; }
.cat-article strong { color: #23231F; font-weight: 700; }

/* a step list that looks like notes on the page */
.cat-article ol {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}
.cat-article ol > li {
    counter-increment: step;
    position: relative;
    padding-left: 44px;
    margin-bottom: 14px;
}
.cat-article ol > li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 1px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E2E2DF;
    border-radius: 50%;
    background: #FFFFFF;
    font-family: 'Patrick Hand', 'Segoe Print', ui-rounded, system-ui, cursive;
    font-size: 1rem;
    color: #23231F;
}

/* FAQs */
.cat-faq { margin-top: 44px; }
.cat-faq-heading {
    font-size: clamp(1.4rem, 2.6vw, 1.85rem);
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #1E1E1C;
    margin: 0 0 18px;
}
.cat-faq-item {
    border: 1px solid #E8E8E5;
    border-radius: 4px;
    background: #FFFFFF;
    margin-bottom: 10px;
    overflow: hidden;
}
.cat-faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 16px 48px 16px 18px;
    position: relative;
    font-size: 1rem;
    font-weight: 700;
    color: #23231F;
}
.cat-faq-item summary::-webkit-details-marker { display: none; }
.cat-faq-item summary::after {
    content: "+";
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    font-weight: 400;
    color: #8A8A84;
    line-height: 1;
}
.cat-faq-item[open] summary::after { content: "\2013"; }
.cat-faq-item summary:hover { background: #FAFAF9; }
.cat-faq-answer {
    padding: 0 18px 18px;
    border-top: 1px dashed #EDEDEA;
}
.cat-faq-answer p {
    margin: 14px 0 0;
    font-size: 0.98rem;
    line-height: 1.7;
    color: #45453F;
}

@media (max-width: 640px) {
    .cat-content { margin-top: 44px; padding-top: 30px; }
    .cat-article ol > li { padding-left: 38px; }
    .cat-article ol > li::before { width: 26px; height: 26px; font-size: 0.9rem; }
}

/* ==========================================================================
   HOME PAGE
   ========================================================================== */

.home-hero { padding: 64px 0 56px; }
.home-hero-inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 48px;
    align-items: center;
}
.home-hero-text h1 { margin-bottom: 16px; }
.home-hero-text .hero-desc { margin-bottom: 4px; max-width: 520px; }
.home-hero-text .hero-search { margin-bottom: 20px; }

/* three drawings fanned out like pages on a desk */
.home-hero-stack {
    position: relative;
    height: 380px;
}
.stack-card {
    position: absolute;
    width: 210px;
    padding-top: 26px;
    background-position: 0 34px;
}
.stack-card .gallery-card-media { margin: 10px; padding: 6px; }
.stack-card .gallery-card-media img { max-height: 250px; width: auto; margin: 0 auto; }
.stack-card:hover { transform: none; }
.stack-1 { left: 4%;  top: 34px; transform: rotate(-6deg); z-index: 1; }
.stack-2 { left: 32%; top: 0;    transform: rotate(1.5deg); z-index: 3; }
.stack-3 { left: 60%; top: 46px; transform: rotate(7deg); z-index: 2; }

.home-wrap { padding-top: 56px; }

.home-section { margin-bottom: 64px; }
.home-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #DEDEDA;
}
.home-section-head h2 {
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #1E1E1C;
    margin: 0;
}
.home-section-link {
    font-size: 0.9rem;
    font-weight: 700;
    color: #4A4A47;
    text-decoration: none;
    white-space: nowrap;
}
.home-section-link:hover { color: #23231F; text-decoration: underline; }
.home-section-note { font-size: 0.85rem; color: #8A8A84; }

/* how it works */
.home-steps {
    margin-bottom: 64px;
    padding: 44px 0;
    border-top: 1px dashed #DEDEDA;
    border-bottom: 1px dashed #DEDEDA;
}
.home-steps > h2 {
    font-size: clamp(1.35rem, 2.5vw, 1.8rem);
    font-weight: 800;
    letter-spacing: -0.3px;
    color: #1E1E1C;
    margin: 0 0 28px;
}
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
}
.step-card {
    position: relative;
    padding: 26px 22px 24px;
    background-color: #FFFFFF;
    background-image: repeating-linear-gradient(to bottom, transparent 0 25px, #EFEFED 25px 26px);
    background-position: 0 44px;
    border: 1px solid #E2E2DF;
    border-radius: 3px;
}
.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    border: 1px solid #E2E2DF;
    border-radius: 50%;
    background: #FFFFFF;
    font-family: 'Patrick Hand', 'Segoe Print', ui-rounded, system-ui, cursive;
    font-size: 1.2rem;
    color: #23231F;
}
.step-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #23231F;
    margin: 0 0 8px;
    line-height: 26px;
}
.step-card p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 26px;
    color: #55554F;
}

/* closing call to action */
.home-cta {
    text-align: center;
    padding: 52px 24px 56px;
    background-color: #FFFFFF;
    background-image: repeating-linear-gradient(to bottom, transparent 0 25px, #F0F0EE 25px 26px);
    background-position: 0 40px;
    border: 1px solid #E2E2DF;
    border-radius: 4px;
}
.home-cta h2 {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #1E1E1C;
    margin: 0 0 10px;
}
.home-cta p {
    margin: 0 0 24px;
    color: #55554F;
    font-size: 1rem;
}
.home-cta .single-download { width: auto; max-width: none; display: inline-flex; }

@media (max-width: 980px) {
    .home-hero-inner { grid-template-columns: 1fr; gap: 36px; }
    .home-hero-stack { height: 320px; max-width: 520px; }
    .stack-card { width: 175px; }
    .stack-card .gallery-card-media img { max-height: 205px; }
    .steps-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .home-hero { padding: 44px 0 40px; }
    .home-hero-stack { height: 250px; }
    .stack-card { width: 132px; }
    .stack-card .gallery-card-media img { max-height: 150px; }
    .stack-1 { left: 0; }
    .stack-3 { left: 56%; }
}

/* a quiet tile that fills the category row while the list is still short */
.cat-soon {
    grid-column: span 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px 28px;
    border: 1px dashed #DCDCD8;
    border-radius: 3px;
    background: #FCFCFB;
}
.cat-soon-mark {
    font-size: 1.3rem;
    margin-bottom: 10px;
    opacity: .55;
}
.cat-soon h3 {
    font-family: 'Patrick Hand', 'Segoe Print', ui-rounded, system-ui, cursive;
    font-weight: 400;
    font-size: 1.35rem;
    color: #2B2B29;
    margin: 0 0 8px;
}
.cat-soon p {
    margin: 0 0 14px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #6A6A64;
    max-width: 420px;
}
.cat-soon a {
    align-self: flex-start;
    padding: 9px 18px;
    background: #FFFFFF;
    border: 1px solid #E2E2DF;
    border-radius: 999px;
    color: #4A4A47;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}
.cat-soon a:hover { border-color: #BDBCB6; color: #23231F; }

@media (max-width: 980px) { .cat-soon { grid-column: span 1; } }

/* ===== MOBILE: category pills become a 2-row horizontal scroller ===== */
@media (max-width: 768px) {
    .hero-pills {
        display: grid;
        grid-auto-flow: column;
        grid-template-rows: repeat(2, auto);
        grid-auto-columns: max-content;
        justify-content: start;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }
    /* A column-flow grid reports its full track sum as min-content, which was
       stretching the single-page columns to the width of the whole pill strip.
       Cap it and let the parents shrink. */
    .hero-pills { min-width: 0; max-width: 100%; }
    .single-layout > *,
    .single-info-col,
    .single-media-col { min-width: 0; }
    .hero-pills::-webkit-scrollbar { display: none; }
    .hero-pill { white-space: nowrap; }
    .hero-pill-grid { width: 36px; height: 36px; }
    .gallery-hero-inner .hero-pills {
        max-width: calc(100% + 48px);
        margin-left: -24px;
        margin-right: -24px;
        padding-left: 24px;
        padding-right: 24px;
    }
}

/* 'Browse more categories' now sits at the very bottom of a single drawing page,
   under the related grid, instead of inside the details column. */
.single-explore-bottom {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px dashed #DEDEDA;
}
.single-explore-bottom .single-desc-heading { margin-bottom: 14px; }
@media (max-width: 768px) {
    .single-explore-bottom { margin-top: 36px; padding-top: 24px; }
}


/* art hub pillars on the home page */
.home-hub { margin-bottom: 64px; padding-top: 44px; border-top: 1px dashed #DEDEDA; }
.home-hub-head { margin-bottom: 28px; }
.home-hub-head h2 { font-size: clamp(1.35rem, 2.5vw, 1.8rem); font-weight: 800; letter-spacing: -0.3px; color: #1E1E1C; margin: 0 0 8px; }
.home-hub-head p { margin: 0; color: #6A6A64; font-size: 1rem; max-width: 640px; }
.hub-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.hub-card, .hub-card:link, .hub-card:visited, .hub-card:hover, .hub-card * { text-decoration: none !important; }
.hub-card { display: flex; flex-direction: column; padding: 24px 22px; background: #FFFFFF; border: 1px solid #E2E2DF; border-radius: 10px; color: #23231F; transition: border-color .2s, transform .2s, box-shadow .2s; }
.hub-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.hub-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; background: #F6F6F5; border: 1px solid #ECECE9; color: #23231F; }
.hub-card h3 { font-size: 1.08rem; font-weight: 700; color: #23231F; margin: 0 0 6px; line-height: 1.35; }
.hub-card p { margin: 0; font-size: 0.93rem; line-height: 1.6; color: #6A6A64; }
.hub-tag { padding: 4px 10px; border-radius: 999px; background: #F6F6F5; font-size: 0.72rem; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; color: #8A8A83; }
.hub-card.is-live .hub-icon { background: #23231F; border-color: #23231F; color: #FFFFFF; }
.hub-card.is-live .hub-tag { background: #E9F5EC; color: #2E7D46; }
.hub-more { margin-top: 16px; font-size: 0.9rem; font-weight: 600; color: #23231F; }
a.hub-card:hover { border-color: #BDBCB6; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(35,35,31,.06); }
.hub-card:not(.is-live) h3 { color: #3A3A36; }
@media (max-width: 980px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .hub-grid { grid-template-columns: 1fr; } }