/* ==========================================================
   Category Grid 10 — Polaroid Categories
   ========================================================== */
.yhcatpol-section {
    --yhcatpol-section-bg: #FAF6F0;
    background-color: var(--yhcatpol-section-bg);
    padding: 1px 16px 72px;
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.yhcatpol-inner { max-width: 1200px; margin: 0 auto; }

.yhcatpol-head { text-align: center; margin-bottom: 48px; }

.yhcatpol-eyebrow {
    display: inline-block;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: #7a7066;
}

.yhcatpol-heading {
    margin: 6px 0 8px;
    font-family: inherit;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    color: #1c1917;
}

.yhcatpol-highlight {
    font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive;
    font-size: 44px;
    font-weight: 700;
    color: #b4533a;
}

.yhcatpol-desc {
    margin: 0 auto;
    max-width: 460px;
    font-size: 15px;
    line-height: 1.6;
    color: #6b635b;
}

.yhcatpol-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 34px;
}

/* one polaroid */
.yhcatpol-card {
    --yhcatpol-photo-bg: #F3EEE7;
    --yhcatpol-ink: #1c1917;
    --yhcatpol-tape: rgba(0, 0, 0, .12);
    --yhcatpol-tilt: 0deg;
    display: block;
    text-decoration: none;
    padding-top: 14px;
}
.yhcatpol-card:hover,
.yhcatpol-card:focus { text-decoration: none; }

.yhcatpol-card:nth-child(4n+1) { --yhcatpol-tilt: -3deg; }
.yhcatpol-card:nth-child(4n+2) { --yhcatpol-tilt: 2deg; }
.yhcatpol-card:nth-child(4n+3) { --yhcatpol-tilt: -2deg; }
.yhcatpol-card:nth-child(4n)   { --yhcatpol-tilt: 3deg; }
.yhcatpol-section--flat .yhcatpol-card { --yhcatpol-tilt: 0deg; }

.yhcatpol-frame {
    position: relative;
    background: #fff;
    border-radius: 4px;
    padding: 12px 12px 16px;
    box-shadow: 0 14px 28px -14px rgba(28, 25, 23, .35), 0 2px 6px rgba(28, 25, 23, .08);
    transform: rotate(var(--yhcatpol-tilt));
    transition: transform .4s cubic-bezier(.2, .8, .2, 1), box-shadow .4s ease;
}

/* washi tape */
.yhcatpol-tape {
    position: absolute;
    top: -13px;
    left: 50%;
    z-index: 2;
    width: 96px;
    height: 28px;
    transform: translateX(-50%) rotate(-4deg);
    background: var(--yhcatpol-tape);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}
.yhcatpol-tape::before,
.yhcatpol-tape::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    background: repeating-linear-gradient(180deg, transparent 0 3px, var(--yhcatpol-section-bg) 3px 5px);
}
.yhcatpol-tape::before { left: -3px; }
.yhcatpol-tape::after  { right: -3px; }

.yhcatpol-photo {
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--yhcatpol-photo-bg);
    outline: 1px solid rgba(0, 0, 0, .05);
    outline-offset: -1px;
}
.yhcatpol-section .yhcatpol-photo img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    border-radius: 0;
    transition: transform .6s ease;
}

.yhcatpol-title {
    margin: 14px 0 6px;
    text-align: center;
    font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    color: var(--yhcatpol-ink);
}

.yhcatpol-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 10px;
    border-top: 1px solid #eee7de;
}

.yhcatpol-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--yhcatpol-ink);
    transition: gap .25s ease;
}

/* hover: straighten and lift */
.yhcatpol-card:hover .yhcatpol-frame {
    transform: rotate(0) translateY(-8px) scale(1.03);
    box-shadow: 0 22px 34px -16px rgba(28, 25, 23, .4), 0 2px 6px rgba(28, 25, 23, .08);
}
.yhcatpol-card:hover .yhcatpol-photo img { transform: scale(1.06); }
.yhcatpol-card:hover .yhcatpol-link { gap: 10px; }
.yhcatpol-card:focus-visible {
    outline: 3px solid #1c1917;
    outline-offset: 8px;
    border-radius: 6px;
}

@media (max-width: 1024px) {
    .yhcatpol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 32px; }
}

@media (max-width: 600px) {
    .yhcatpol-head { margin-bottom: 36px; }
    .yhcatpol-heading { font-size: 26px; }
    .yhcatpol-highlight { font-size: 34px; }
    .yhcatpol-grid { gap: 36px 16px; }
    .yhcatpol-frame { padding: 8px 8px 12px; }
    .yhcatpol-card:nth-child(odd)  { --yhcatpol-tilt: -2deg; }
    .yhcatpol-card:nth-child(even) { --yhcatpol-tilt: 2deg; }
    .yhcatpol-section--flat .yhcatpol-card { --yhcatpol-tilt: 0deg; }
    .yhcatpol-tape { width: 64px; height: 20px; top: -10px; }
    .yhcatpol-title { font-size: 24px; margin: 10px 0 4px; }
    .yhcatpol-meta { padding-top: 8px; }
    .yhcatpol-link { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .yhcatpol-frame,
    .yhcatpol-photo img,
    .yhcatpol-link { transition: none; }
}

/* --- Header alignment helper (set by the Header Alignment control) --- */
.yhcatpol-desc { margin-left: var(--yhcatpol-intro-l, auto); margin-right: var(--yhcatpol-intro-r, auto); }

/* --- Alignment: match plugin containers (Product Card 1–7, Category Grid 1–9): full width, 65px sides, 5px on mobile --- */
.yhcatpol-section { max-width: 100%; padding-left: 65px; padding-right: 65px; }
.yhcatpol-inner { max-width: 100%; }
@media (max-width: 768px) {
    .yhcatpol-section { padding: 1px; }
}
