/* ==========================================================================
   Guide pages (CMS content whose article starts with <div class="ce-guide">).
   First user: /purim-lenses-guide. Loaded only by content.blade.php on such
   pages. Identity: every costume group gets a CSS-drawn "eye" in the colour of
   its lenses (cat slit, spiral, glitter...), reusing the site's iris motif.
   One motion moment: on load the hero eyes blink in turn while confetti in
   the iris colours falls once. Nothing moves with prefers-reduced-motion.
   ========================================================================== */

.ce-guide-page {
    --g-ink: #1b1b1e;
    --g-muted: #5b5e60;
    --g-surface: #fbf8f6;
    --g-blush-50: #fdece4;
    --g-blush-100: #f9d5c7;
    --g-blush-300: #f4a28c;
    --g-accent: #ff7e67;
    --g-accent-text: #c4492f;
    --g-purple: #8b6fd6;
    --g-gold: #d9a441;
    --g-teal: #5fc4c9;
    --g-blue: #3e8ede;
    --g-font-head: 'Varela Round', 'Assistant', sans-serif;
    --g-font-body: 'Assistant', system-ui, sans-serif;

    direction: rtl;
    text-align: right;
    color: var(--g-ink);
    font-family: var(--g-font-body);
    max-width: 880px;
    margin: 1.5rem auto 4rem;
    padding: 0 1rem;
}

/* ---------- Hero ---------------------------------------------------------- */
.ce-guide-hero {
    position: relative;
    overflow: hidden;
    background: var(--g-blush-50);
    border-radius: 1.75rem;
    padding: 2.75rem 1.5rem 2.5rem;
    text-align: center;
    margin-bottom: 2.25rem;
}
.ce-guide-title {
    position: relative;
    font-family: var(--g-font-head);
    font-weight: 400;
    font-size: clamp(1.9rem, 5vw, 3.1rem);
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 1.6rem auto 0;
    max-width: 16em;
    color: var(--g-ink);
}

/* The row of eyes: a "masquerade" of the lenses the guide covers */
.ce-guide-eyes {
    position: relative;
    display: flex;
    justify-content: center;
    gap: clamp(0.6rem, 2.5vw, 1.4rem);
}
.ce-guide-eyes .ce-eye {
    width: clamp(48px, 11vw, 78px);
    height: clamp(48px, 11vw, 78px);
    box-shadow: 0 0 0 4px #fff, 0 10px 24px -10px rgba(27, 27, 30, 0.45);
    animation: ce-blink 0.42s ease-in-out both;
    animation-delay: calc(0.5s + var(--i, 0) * 0.16s);
    transform-origin: 50% 50%;
}

/* ---------- The eyes themselves (shared by hero + sections) --------------- */
.ce-eye,
.ce-gsec::before {
    --pupil: radial-gradient(circle at 50% 50%, #111 0 17%, transparent 18%);
    --shine: radial-gradient(circle at 36% 34%, rgba(255, 255, 255, 0.95) 0 6%, transparent 7%);
    --limbus: radial-gradient(circle at 50% 50%, transparent 0 60%, rgba(17, 17, 17, 0.55) 70%, #111 72%);
    display: block;
    border-radius: 50%;
    background-color: var(--c1);
    background-image: var(--shine), var(--pupil), var(--limbus),
        repeating-conic-gradient(from 0deg, var(--c1) 0deg 5deg, var(--c2) 5deg 9deg);
}

.ce-eye--white,  .ce-gsec--white::before  { --c1: #ffffff; --c2: #e6e1dd; }
.ce-eye--red,    .ce-gsec--red::before    { --c1: #e0352f; --c2: #9e1418; }
.ce-eye--cat,    .ce-gsec--cat::before    {
    --c1: #f2c230; --c2: #d68f12;
    --pupil: radial-gradient(ellipse 8% 40% at 50% 50%, #111 0 92%, transparent 100%);
}
.ce-eye--anime,  .ce-gsec--anime::before  {
    --c1: #ff7fb8; --c2: #e0448c;
    --shine: radial-gradient(circle at 36% 34%, #fff 0 9%, transparent 10%),
             radial-gradient(circle at 62% 64%, rgba(255, 255, 255, 0.9) 0 4%, transparent 5%);
}
.ce-eye--glitter, .ce-gsec--glitter::before {
    --c1: #9a7ee6; --c2: #6d50c4;
    --shine: radial-gradient(circle at 30% 30%, #fff 0 3%, transparent 4%),
             radial-gradient(circle at 70% 38%, #fff 0 2.5%, transparent 3.5%),
             radial-gradient(circle at 62% 74%, #fff 0 3%, transparent 4%),
             radial-gradient(circle at 34% 68%, #fff 0 2%, transparent 3%);
}
.ce-eye--spiral, .ce-gsec--spiral::before {
    --c1: #111; --c2: #fff;
    --pupil: radial-gradient(circle at 50% 50%, #111 0 9%, transparent 10%);
    background-image: var(--pupil),
        repeating-conic-gradient(from 0deg, #111 0deg 15deg, #fff 15deg 30deg);
}

/* ---------- Confetti (hero, plays once) ----------------------------------- */
.ce-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.ce-confetti i {
    position: absolute;
    top: -8%;
    left: calc(var(--x) * 1%);
    width: 8px;
    height: 13px;
    border-radius: 2px;
    background: var(--c);
    opacity: 0;
    animation: ce-confetti-fall var(--d, 2.8s) cubic-bezier(0.25, 0.6, 0.45, 1) forwards;
    animation-delay: var(--w, 0s);
}
.ce-confetti i:nth-child(3n)   { width: 7px; height: 7px; border-radius: 50%; }
.ce-confetti i:nth-child(4n+1) { width: 12px; height: 5px; }

@keyframes ce-confetti-fall {
    0%   { opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg); }
    85%  { opacity: 1; }
    100% { opacity: 0; transform: translate3d(var(--drift, 20px), 430px, 0) rotate(var(--r, 540deg)); }
}
@keyframes ce-blink {
    0%, 100% { transform: scaleY(1); }
    50%      { transform: scaleY(0.08); }
}

/* ---------- Body ---------------------------------------------------------- */
.ce-guide {
    font-size: 1.12rem;
    line-height: 1.75;
}
.ce-guide p { margin: 0 0 1rem; max-width: 64ch; }
.ce-guide a { color: var(--g-accent-text); text-decoration: underline; text-underline-offset: 3px; }
.ce-guide a:hover { color: var(--g-ink); }
.ce-guide a:focus-visible,
.ce-guide-cta:focus-visible { outline: 3px solid var(--g-accent); outline-offset: 3px; border-radius: 6px; }

.ce-guide-lead p:first-child {
    font-size: 1.3rem;
    line-height: 1.6;
    color: var(--g-ink);
}
.ce-guide-lead p { color: var(--g-muted); }

.ce-guide h2 {
    font-family: var(--g-font-head);
    font-weight: 400;
    font-size: clamp(1.45rem, 3.2vw, 1.9rem);
    line-height: 1.25;
    margin: 3rem 0 1.25rem;
}

/* One costume group: its eye beside the text */
.ce-gsec {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 1.5rem;
    align-items: start;
    padding: 1.6rem 0;
    border-top: 1px solid var(--g-blush-100);
}

.ce-gsec::before {
    content: "";
    width: 92px;
    height: 92px;
    box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--g-blush-100);
    transition: transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.ce-gsec:hover::before { transform: rotate(-24deg) scale(1.04); }
.ce-gsec h3 {
    font-family: var(--g-font-head);
    font-weight: 400;
    font-size: 1.3rem;
    line-height: 1.3;
    margin: 0.25rem 0 0.5rem;
}
.ce-gsec p { margin-bottom: 0.85rem; }

/* Product links as chips */
.ce-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}
.ce-guide .ce-chips a {
    display: inline-block;
    padding: 0.38rem 0.95rem;
    border: 1px solid var(--g-blush-300);
    border-radius: 9999px;
    background: #fff;
    color: var(--g-ink);
    font-size: 0.98rem;
    line-height: 1.4;
    text-decoration: none;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}
.ce-guide .ce-chips a:hover {
    background: var(--g-blush-50);
    border-color: var(--g-accent);
    color: var(--g-accent-text);
}

/* Before-you-order facts */
.ce-facts {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 2rem;
}
.ce-facts li { margin: 0; color: var(--g-muted); line-height: 1.65; }
.ce-facts strong {
    display: block;
    font-family: var(--g-font-head);
    font-weight: 400;
    font-size: 1.12rem;
    color: var(--g-ink);
    margin-bottom: 0.2rem;
}

/* When to order: the one call to action */
.ce-order {
    margin: 3rem 0;
    padding: 2rem 1.75rem;
    border-radius: 1.75rem;
    background: var(--g-ink);
    color: #fff;
}
.ce-order h2 { color: #fff; margin-top: 0; }
.ce-order p { color: rgba(255, 255, 255, 0.82); }
.ce-guide .ce-order a { color: #fff; }
.ce-guide .ce-order .ce-guide-cta {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: 9999px;
    background: var(--g-accent);
    color: var(--g-ink);
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s, transform 0.2s;
}
.ce-guide .ce-order .ce-guide-cta:hover { background: #fff; transform: translateY(-1px); }

.ce-guide-note p { color: var(--g-muted); }

/* ---------- Small screens ------------------------------------------------- */
@media (max-width: 640px) {
    .ce-guide-hero { padding: 2rem 1rem 1.75rem; border-radius: 1.25rem; }
    .ce-gsec { grid-template-columns: 60px 1fr; gap: 1rem; }
    .ce-gsec::before { width: 60px; height: 60px; }
    .ce-facts { grid-template-columns: 1fr; }
    .ce-order { padding: 1.6rem 1.25rem; border-radius: 1.25rem; }
    .ce-guide { font-size: 1.05rem; }
}

/* ---------- Reduced motion ------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    .ce-guide-eyes .ce-eye,
    .ce-confetti i { animation: none; }
    .ce-confetti { display: none; }
    .ce-gsec::before { transition: none; }
    .ce-gsec:hover::before { transform: none; }
}

/* ==========================================================================
   Natural-lenses theme (.ce-guide-page--natural, article <div class="ce-guide
   ce-guide--natural">). Quieter than Purim: one large iris in the hero slowly
   moves through the four shades the guide compares while the legend beside
   the title lights the shade on show; on scroll the iris drifts and turns a
   little slower than the page (parallax, scroll-driven, where supported).
   Everything below the hero stays still.
   ========================================================================== */

@property --iris   { syntax: '<color>'; inherits: true; initial-value: #5b8fc9; }
@property --iris-d { syntax: '<color>'; inherits: true; initial-value: #2f5f96; }
@property --iris-l { syntax: '<color>'; inherits: true; initial-value: #9cc0e6; }

.ce-guide-page--natural {
    --n-hair: #ece3de;
    --n-blue:  #5b8fc9; --n-blue-d:  #2f5f96; --n-blue-l:  #9cc0e6;
    --n-green: #6d9f6a; --n-green-d: #3e6e44; --n-green-l: #a9cf9b;
    --n-grey:  #8f9aa3; --n-grey-d:  #5d6870; --n-grey-l:  #c4ccd2;
    --n-honey: #b9853f; --n-honey-d: #7d5222; --n-honey-l: #e0b26c;
    --g-font-head: 'Assistant', system-ui, sans-serif;
    max-width: 960px;
}

/* ---------- The iris drawing (hero + shade markers) ---------------------- */
.ce-iris,
.ce-shade::before {
    display: block;
    border-radius: 50%;
    background-color: var(--iris);
    background-image:
        radial-gradient(circle at 38% 34%, rgba(255, 255, 255, 0.92) 0 3.5%, transparent 4.5%),
        radial-gradient(circle at 50% 50%, #141416 0 19%, transparent 19.6%),
        /* warm glow round the pupil, then the collarette ring */
        radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--iris-l) 75%, transparent) 18%, transparent 36%),
        radial-gradient(circle at 50% 50%, transparent 0 24%, color-mix(in srgb, var(--iris-d) 55%, transparent) 27%, transparent 33%),
        /* darker outer band and the limbal ring */
        radial-gradient(circle at 50% 50%, transparent 0 42%, color-mix(in srgb, var(--iris-d) 50%, transparent) 60%, rgba(27, 27, 30, 0.55) 68%, #1b1b1e 70.5%, transparent 71.5%),
        /* two fibre layers at different rhythms so the pattern is not mechanical */
        repeating-conic-gradient(from 7deg, transparent 0deg 9deg, color-mix(in srgb, var(--iris-d) 45%, transparent) 9deg 10.5deg, transparent 10.5deg 17deg),
        repeating-conic-gradient(from 0deg, var(--iris) 0deg 1.6deg, color-mix(in srgb, var(--iris-l) 70%, var(--iris)) 1.6deg 2.6deg, var(--iris) 2.6deg 3.4deg, color-mix(in srgb, var(--iris-d) 60%, var(--iris)) 3.4deg 4deg);
}

/* ---------- Hero ---------------------------------------------------------- */
.ce-guide-page--natural .ce-nhero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    grid-template-areas: "text iris";
    align-items: center;
    gap: clamp(1.5rem, 5vw, 4rem);
    background: none;
    border-radius: 0;
    overflow: visible;
    text-align: right;
    padding: clamp(1.5rem, 4vw, 3rem) 0 clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--n-hair);
}
.ce-nhero-text { grid-area: text; }
.ce-nhero-iris { grid-area: iris; justify-self: center; }

.ce-guide-page--natural .ce-guide-title {
    font-family: var(--g-font-head);
    font-weight: 300;
    font-size: clamp(2.2rem, 5.4vw, 3.7rem);
    line-height: 1.08;
    letter-spacing: -0.015em;
    margin: 0;
    max-width: 12em;
}

.ce-nhero-iris .ce-iris {
    width: clamp(190px, 30vw, 330px);
    height: clamp(190px, 30vw, 330px);
    box-shadow: 0 0 0 10px #fff, 0 0 0 11px var(--n-hair), 0 30px 60px -30px rgba(27, 27, 30, 0.35);
    animation: ce-shades 16s ease-in-out infinite;
}

@keyframes ce-shades {
    0%, 20%   { --iris: var(--n-blue);  --iris-d: var(--n-blue-d);  --iris-l: var(--n-blue-l); }
    25%, 45%  { --iris: var(--n-green); --iris-d: var(--n-green-d); --iris-l: var(--n-green-l); }
    50%, 70%  { --iris: var(--n-grey);  --iris-d: var(--n-grey-d);  --iris-l: var(--n-grey-l); }
    75%, 95%  { --iris: var(--n-honey); --iris-d: var(--n-honey-d); --iris-l: var(--n-honey-l); }
    100%      { --iris: var(--n-blue);  --iris-d: var(--n-blue-d);  --iris-l: var(--n-blue-l); }
}

/* Legend: the shade on show is lit, the rest wait */
.ce-nhero-shades {
    list-style: none;
    margin: 1.75rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.4rem;
    font-size: 1rem;
    color: var(--g-ink);
}
.ce-nhero-shade {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.38;
    animation: ce-shade-on 16s ease-in-out infinite;
    animation-delay: calc(var(--i, 0) * 4s);
}
.ce-nhero-shade::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--dot);
}
.ce-nhero-shade--blue  { --dot: var(--n-blue); }
.ce-nhero-shade--green { --dot: var(--n-green); }
.ce-nhero-shade--grey  { --dot: var(--n-grey); }
.ce-nhero-shade--honey { --dot: var(--n-honey); }

@keyframes ce-shade-on {
    0%, 22%   { opacity: 1; }
    26%, 100% { opacity: 0.38; }
}

/* Parallax: the iris drifts down and turns slightly as the page scrolls */
@supports (animation-timeline: scroll()) {
    .ce-nhero-iris {
        animation: ce-iris-drift linear both;
        animation-timeline: scroll(root);
        animation-range: 0 75vh;
    }
    @keyframes ce-iris-drift {
        from { transform: translateY(0) rotate(0deg); }
        to   { transform: translateY(22%) rotate(-28deg); }
    }
}

/* ---------- Body ---------------------------------------------------------- */
.ce-guide-page--natural .ce-guide h2 {
    font-weight: 300;
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    letter-spacing: -0.01em;
    margin: 3.25rem 0 1.25rem;
}
.ce-guide-page--natural .ce-guide-lead p:first-child { font-size: 1.32rem; font-weight: 300; }

/* Two looks side by side */
.ce-looks {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 2.5rem;
}
.ce-looks > div { border-top: 1px solid var(--g-ink); padding-top: 1rem; }
.ce-looks h3 {
    font-family: var(--g-font-head);
    font-weight: 600;
    font-size: 1.15rem;
    margin: 0 0 0.4rem;
}
.ce-looks p { color: var(--g-muted); margin: 0; }

/* One shade: a small iris in that shade beside the text */
.ce-shade {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 1.5rem;
    align-items: start;
    padding: 1.75rem 0;
    border-top: 1px solid var(--n-hair);
}
.ce-shade::before {
    content: "";
    width: 64px;
    height: 64px;
    box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--n-hair);
}
.ce-shade--blue  { --iris: var(--n-blue);  --iris-d: var(--n-blue-d);  --iris-l: var(--n-blue-l); }
.ce-shade--green { --iris: var(--n-green); --iris-d: var(--n-green-d); --iris-l: var(--n-green-l); }
.ce-shade--grey  { --iris: var(--n-grey);  --iris-d: var(--n-grey-d);  --iris-l: var(--n-grey-l); }
.ce-shade--honey { --iris: var(--n-honey); --iris-d: var(--n-honey-d); --iris-l: var(--n-honey-l); }
.ce-shade h3 {
    font-family: var(--g-font-head);
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0.35rem 0 0.4rem;
}
.ce-shade p { margin-bottom: 0.85rem; }

.ce-guide-page--natural .ce-guide .ce-chips a {
    border-color: var(--n-hair);
    background: #fff;
    font-size: 0.95rem;
}
.ce-guide-page--natural .ce-guide .ce-chips a:hover {
    border-color: var(--iris, var(--g-ink));
    background: #fff;
    color: var(--g-ink);
}
.ce-guide .ce-shade-more { font-size: 0.98rem; }

/* Call to action: light panel instead of the Purim dark one */
.ce-guide-page--natural .ce-order {
    background: var(--g-blush-50);
    color: var(--g-ink);
}
.ce-guide-page--natural .ce-order h2 { color: var(--g-ink); }
.ce-guide-page--natural .ce-order p { color: var(--g-muted); }
.ce-guide-page--natural .ce-guide .ce-order a { color: var(--g-accent-text); }
.ce-guide-page--natural .ce-guide .ce-order .ce-guide-cta {
    background: var(--g-ink);
    color: #fff;
    font-weight: 600;
}
.ce-guide-page--natural .ce-guide .ce-order .ce-guide-cta:hover { background: var(--g-accent-text); color: #fff; }

@media (max-width: 640px) {
    .ce-guide-page--natural .ce-nhero {
        grid-template-columns: 1fr;
        grid-template-areas: "iris" "text";
        gap: 1.75rem;
    }
    .ce-nhero-iris .ce-iris { width: 180px; height: 180px; }
    .ce-looks { grid-template-columns: 1fr; }
    .ce-shade { grid-template-columns: 48px 1fr; gap: 1rem; }
    .ce-shade::before { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
    .ce-nhero-iris,
    .ce-nhero-iris .ce-iris,
    .ce-nhero-shade { animation: none; }
    .ce-nhero-shade { opacity: 1; }
}
