/* Only the independent discovery page; existing galleries keep their layout. */
body.ctejidas-discover-page #page #content { display:block; padding:12px 18px 32px !important; }
body.ctejidas-discover-page #primary { width:100%; }
body.ctejidas-discover-page #main > article > .inside-article { padding:0 !important; }
body.ctejidas-discover-page #main > article > .inside-article > .entry-header,
body.ctejidas-discover-page #main > article > .inside-article > .featured-image,
body.ctejidas-discover-page .page-header-image,
body.ctejidas-discover-page .page-header-image-single { display:none !important; }
body.ctejidas-discover-page .entry-content { margin-top:0 !important; }
.ct-discover { width:100%; max-width:1170px; margin:0 auto; color:#171717; }
.ct-discover *, .ct-discover *::before, .ct-discover *::after { box-sizing:border-box; }
.ct-discover [hidden] { display:none !important; }
.ct-discover button, .ct-discover a { font-family:inherit; -webkit-tap-highlight-color:transparent; }
.ct-discover button { cursor:pointer; }
.ct-discover button:disabled { cursor:default; opacity:.42; }
.ct-discover button:focus-visible, .ct-discover a:focus-visible { outline:3px solid #171717; outline-offset:4px; }
/* Match the compact headers of Aprender a tejer and Tutoriales. */
.ct-discover__header { margin:0; max-width:none; text-align:left; }
.ct-discover .ct-discover__eyebrow { margin:0 0 4px; font-size:11px; letter-spacing:1.4px; font-weight:700; line-height:1.2; color:var(--ct-brand, #ff4f87); }
.ct-discover .ct-discover__header h1 { margin:0; font-size:clamp(28px,3vw,36px); font-weight:700; line-height:1; letter-spacing:-.045em; color:#111; }
.ct-discover .ct-discover__arrow,
.ct-discover .ct-discover__caption button { width:44px; height:44px; padding:0; border:1px solid #f5d6e2; border-radius:50%; background:#fff; color:#171717; font-size:22px; line-height:1; display:grid; place-items:center; }
/* Same right offset and 56px-wide column as the desktop star menu. Keep the
   group outside the animated card so its position does not jump on first load. */
.ct-discover__navigation { position:fixed; top:50%; right:18px; width:56px; display:flex; flex-direction:column; align-items:center; gap:12px; transform:translateY(-50%); z-index:150800; }
.ct-discover .ct-discover__arrow { flex:0 0 44px; }
.ct-discover .ct-discover__arrow:hover:not(:disabled),
.ct-discover .ct-discover__caption button:hover { background:#fff2f7; }
.ct-discover .ct-discover__hint { margin:8px 0 18px; font-size:14px; line-height:1.5; color:#64646a; }
.ct-discover__card { --ct-discover-ratio:.5625; width:100%; max-width:440px; margin:0 auto; background:#fff; }
.ct-discover__stage { position:relative; width:100%; max-width:calc(70vh * var(--ct-discover-ratio)); max-width:calc(70svh * var(--ct-discover-ratio)); margin:0 auto; }
.ct-discover .ct-discover__image-button { position:relative; display:block; padding:0; width:100%; aspect-ratio:var(--ct-discover-ratio); background:#fff8fb; border:0; border-radius:0; overflow:hidden; touch-action:pinch-zoom; user-select:none; }
.ct-discover .ct-discover__image-button img { display:block; width:100%; height:100%; max-width:none; object-fit:contain; margin:0; -webkit-user-drag:none; }
.ct-discover__image-error { position:absolute; inset:0; display:grid; place-items:center; padding:30px; background:#fff2f7; color:#343434; font-size:15px; }
.ct-discover__caption { display:flex; align-items:center; gap:16px; padding:10px 0 4px; }
.ct-discover .ct-discover__caption h2 { flex:1; margin:0; font-size:18px; font-weight:600; line-height:1.3; color:#171717; overflow-wrap:anywhere; }
.ct-discover .ct-discover__caption button { flex:0 0 44px; font-size:20px; }
.ct-discover__metrics { margin:0 0 12px; color:#555; font-size:15px; line-height:1.4; }
.ct-discover .ct-discover__metrics p { margin:0 0 4px; font-size:15px; line-height:1.4; }
.ct-discover__counters { display:flex; align-items:center; flex-wrap:wrap; gap:4px 16px; }
.ct-discover__visual { min-width:0; }
.ct-discover__details { position:relative; min-width:0; border:0; padding:38px 0 0; }
.ct-discover .ct-discover__details-close { position:absolute; top:0; right:0; width:44px; height:44px; margin:0; padding:0; background:transparent; color:#73686e; border:0; border-radius:0; box-shadow:none; font:400 30px/1 Arial,sans-serif; }
.ct-discover .ct-discover__details-eyebrow { margin:0 0 6px; color:#f45a8e; font-size:11px; font-weight:700; letter-spacing:.08em; line-height:1.2; }
.ct-discover .ct-discover__details-title { margin:0 0 6px; color:#171717; font-size:24px; font-weight:600; line-height:1.25; overflow-wrap:anywhere; }
.ct-discover .ct-discover__details-title:focus { outline:none; }
.ct-discover__details .ct-discover__metrics { margin-top:0; margin-bottom:14px; }
/* The empty invitation appears in the card on mobile and in the photo area of the details. */
.ct-discover__details [data-discover-participants].is-empty { display:none !important; }
.ct-discover__details > [data-discover-summary] { margin:0; padding:0; }
.ct-discover__details .ct-discover__photos { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; overflow:visible; }
.ct-discover .ct-discover__details .ct-discover__photos button { width:100%; min-width:0; }
.ct-discover .ct-discover__details .ct-discover__photos img { width:100%; height:auto; aspect-ratio:1; max-height:110px; }
.ct-discover__details .ct-discover__actions { flex-direction:column; }
.ct-discover__options-dialog:not([open]) { display:none !important; }
.ct-discover .ct-discover__options-dialog { position:fixed; inset:auto 0 0; width:100%; max-width:none; max-height:calc(100vh - 20px); max-height:calc(100dvh - 20px); margin:0; padding:0; border:0; border-radius:0; background:#fff; color:#171717; box-shadow:0 22px 70px rgb(31 22 27 / .24); overflow-y:auto; overscroll-behavior:contain; z-index:1000020; font-family:inherit; }
.ct-discover__options-dialog::backdrop, .ct-discover__options-backdrop { background:rgb(34 25 30 / .48); }
.ct-discover__options-backdrop { position:fixed; inset:0; z-index:1000019; }
.ct-discover__options-dialog .ct-discover__details { padding:44px 20px calc(24px + env(safe-area-inset-bottom,0px)); text-align:center; }
.ct-discover .ct-discover__options-dialog .ct-discover__details-close { top:7px; right:9px; }
.ct-discover__options-dialog .ct-discover__counters { justify-content:center; }
.ct-discover .ct-discover__options-dialog .ct-discover__photos { max-width:380px; margin:0 auto; }
.ct-discover__options-dialog .ct-discover__details-title { margin-right:18px; margin-left:18px; }
html.ct-discover-options-open, body.ct-discover-options-open { overflow:hidden !important; }
@media(min-width:761px) {
    .ct-discover__card.is-expanded { max-width:1060px; padding:0 60px; display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); gap:0 76px; align-items:start; }
    .ct-discover__card.is-expanded .ct-discover__caption { display:none; }
    .ct-discover__card.is-expanded .ct-discover__stage { max-width:calc(80vh * var(--ct-discover-ratio)); max-width:calc(80svh * var(--ct-discover-ratio)); }
    .ct-discover__card > .ct-discover__details { padding-top:0; }
    .ct-discover__card > .ct-discover__details .ct-discover__actions { flex-direction:row; flex-wrap:nowrap; gap:10px; }
    .ct-discover__card > .ct-discover__details .ct-discover__actions > * { flex:1; min-width:0; padding-right:10px; padding-left:10px; gap:8px; }
    .ct-discover__hint-mobile { display:none; }
}

.ct-discover .ct-discover__community > p { margin:0 0 8px; font-size:15px; font-weight:600; }
.ct-discover__photos { display:flex; gap:10px; overflow-x:auto; padding:3px 3px 8px; }
.ct-discover .ct-discover__photos button { flex:0 0 64px; padding:0; border:0; background:transparent; border-radius:0; }
.ct-discover .ct-discover__photos img { display:block; width:64px; height:64px; border-radius:0; object-fit:cover; margin:0; }
.ct-discover__actions { display:flex; gap:12px; margin-top:10px; }
.ct-discover .ct-discover__save, .ct-discover .ct-discover__tutorial { display:flex; align-items:center; justify-content:center; min-height:48px; padding:12px 20px; font-size:16px; font-weight:650; line-height:1.4; text-decoration:none; border-radius:0; }
.ct-discover .ct-discover__save { flex:1; border:1px solid #f1c5d5; color:#171717; background:#fff; }
.ct-discover .ct-discover__save.is-saved { background:#fff1f7; border-color:#f45a8e; }
.ct-discover .ct-discover__tutorial { flex:1.3; background:#f45a8e; color:#111; gap:18px; }
.ct-discover .ct-discover__tutorial:hover { background:#f785aa; }
.ct-discover .ct-discover__save-status, .ct-discover .ct-discover__photo-status { margin:8px 0; font-size:14px; line-height:1.5; color:#555; }
.ct-discover .ct-discover__save-status:empty, .ct-discover .ct-discover__photo-status:empty { display:none; }
.ct-discover .ct-discover__photo-status button, .ct-discover .ct-discover__save-status button,
.ct-discover .ct-discover__retry { background:transparent; border:0; padding:5px; color:#171717; text-decoration:underline; font-size:13px; }
.ct-discover .ct-discover__thread { display:inline-block; margin:5px 0; padding:8px 0; color:#171717; font-size:12px; text-decoration:underline; }
.ct-discover__footer { display:flex; align-items:center; flex-wrap:wrap; gap:6px 14px; margin-top:10px; min-height:28px; font-size:11px; color:#666; }
.ct-discover__footer p { margin:0; font-size:12px; line-height:1.5; }
.ct-discover__loading { padding:70px 20px; text-align:center; background:#fff8fb; font-size:14px; }
.ct-discover__lightbox { max-width:min(90vw,800px); width:max-content; max-height:90vh; padding:44px 18px 18px; border:0; background:#fff; color:#171717; }
.ct-discover__lightbox::backdrop { background:rgb(0 0 0 / .75); }
.ct-discover .ct-discover__lightbox > button { position:absolute; top:0; right:0; width:44px; height:44px; background:#fff; color:#111; border:0; font-size:26px; padding:0; }
.ct-discover .ct-discover__lightbox img { display:block; max-width:100%; max-height:65vh; width:auto; height:auto; margin:auto; object-fit:contain; }
.ct-discover .ct-discover__lightbox p { margin:12px 0 0; max-width:650px; font-size:13px; line-height:1.5; }
@media(max-width:760px) {
    /* Card swaps must not make the browser reposition the page around a new anchor. */
    body.ctejidas-discover-page { overflow-anchor:none; }
    .ct-discover .ct-discover__save, .ct-discover .ct-discover__tutorial { font-size:18px; }
    .ct-discover.has-viewport-fit .ct-discover__visual { padding-bottom:calc(12px + env(safe-area-inset-bottom, 0px)); }
    .ct-discover.has-viewport-fit .ct-discover__stage { max-width:calc(var(--ct-discover-image-height, 60svh) * var(--ct-discover-ratio)); }
    /* Stable mobile text slots: two title lines, one participant line and one counter row.
       Hidden data keeps its space without displaying a false count. The mobile title uses two lines. */
    .ct-discover.has-viewport-fit .ct-discover__caption h2 { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; min-height:2.6em; max-height:2.6em; overflow:hidden; text-overflow:ellipsis; }
    .ct-discover.has-viewport-fit .ct-discover__visual > .ct-discover__metrics { margin-bottom:0; }
    .ct-discover.has-viewport-fit .ct-discover__visual > .ct-discover__metrics[hidden] { display:block !important; visibility:hidden; }
    .ct-discover.has-viewport-fit .ct-discover__visual > .ct-discover__metrics > p { min-height:1.4em; }
    .ct-discover.has-viewport-fit .ct-discover__visual > .ct-discover__metrics > p[hidden] { display:block !important; visibility:hidden; }
    .ct-discover.has-viewport-fit .ct-discover__visual > .ct-discover__metrics > .ct-discover__counters { min-height:1.4em; }
    .ct-discover__navigation { display:none !important; }
    .ct-discover .ct-discover__arrow { display:none !important; }
    .ct-discover .ct-discover__details-title { font-size:22px; }
}
@media(max-width:600px) {
    body.ctejidas-discover-page #page #content { padding:12px 14px 24px !important; }
    .ct-discover .ct-discover__caption h2 { font-size:18px; }
    .ct-discover__caption { padding-top:9px; }
    .ct-discover__actions { gap:8px; }
    .ct-discover .ct-discover__save, .ct-discover .ct-discover__tutorial { padding:12px 10px; }
}

/* First mobile visit: decorative guidance never intercepts taps or swipes. */
.ct-discover__swipe-hint { display:none; position:absolute; inset:0; z-index:2; pointer-events:none; user-select:none; align-items:center; justify-content:center; flex-direction:column; gap:12px; background:linear-gradient(transparent 25%, rgb(0 0 0 / .16) 65%, transparent); }
.ct-discover__swipe-track { display:block; position:relative; width:88px; height:132px; }
.ct-discover__swipe-arrow { position:absolute; left:31px; top:0; color:#fff; font-size:42px; line-height:1; text-shadow:0 1px 5px rgb(0 0 0 / .6); }
.ct-discover__swipe-finger { display:block; position:absolute; left:8px; bottom:0; width:72px; height:72px; font-size:58px; line-height:72px; text-align:center; font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; filter:drop-shadow(0 2px 4px rgb(0 0 0 / .35)); }
.ct-discover__swipe-label { display:block; padding:9px 14px; max-width:90%; border-radius:24px; background:rgb(255 255 255 / .96); color:#171717; font-family:inherit; font-size:13px; line-height:1.4; font-weight:600; text-align:center; box-shadow:0 2px 12px rgb(0 0 0 / .12); }
@media(max-width:760px) and (any-pointer:coarse) {
    .ct-discover__swipe-hint:not([hidden]) { display:flex; }
    .ct-discover__swipe-finger { animation:ct-discover-swipe-up 1.7s ease-in-out 2 both; }
}
@keyframes ct-discover-swipe-up {
    0% { opacity:0; transform:translateY(12px); }
    15%,25% { opacity:1; transform:translateY(0); }
    75% { opacity:1; transform:translateY(-62px); }
    100% { opacity:0; transform:translateY(-70px); }
}
@media(prefers-reduced-motion:reduce) {
    .ct-discover .ct-discover__swipe-finger { animation:none; opacity:1; transform:none; }
}

/* Same star and heart colors used by the homepage tutorial cards. */
.ct-discover__stat { display:inline-flex; align-items:baseline; gap:6px; }
.ct-discover__stat-icon { flex:0 0 auto; font-size:17px; line-height:1; }
.ct-discover__stat-icon--rating { color:#e5a400; }
.ct-discover__stat-icon--saved { color:var(--ctejidas-brand, #F45A8E); }

/* Keep image transitions inside the frame; the surrounding interface stays still. */
.ct-discover__image-frame { position:relative; width:100%; overflow:hidden; background:#fff8fb; }

.ct-discover .ct-discover__transition-image { position:absolute; inset:0; z-index:1; display:block; width:100%; height:100%; max-width:none; margin:0; object-fit:contain; pointer-events:none; user-select:none; }
.ct-discover .ct-discover__all-photos { display:inline-block; margin:3px 0 12px; padding:6px 0; color:#171717; font-size:13px; line-height:1.5; text-decoration:underline; text-underline-offset:3px; }
.ct-discover .ct-discover__all-photos:hover { color:#d83270; }
.ct-discover__tap-hint { display:none; position:absolute; inset:0; z-index:2; pointer-events:none; user-select:none; align-items:center; justify-content:center; flex-direction:column; gap:8px; background:linear-gradient(transparent 25%, rgb(0 0 0 / .16) 65%, transparent); }
.ct-discover__tap-gesture { position:relative; display:block; width:88px; height:92px; }
.ct-discover__tap-finger { position:absolute; left:8px; bottom:0; width:72px; height:72px; font-size:58px; line-height:72px; text-align:center; font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif; filter:drop-shadow(0 2px 4px rgb(0 0 0 / .35)); }
.ct-discover__tap-ring { position:absolute; top:7px; left:31px; width:30px; height:30px; border:3px solid #f45a8e; border-radius:50%; background:rgb(255 255 255 / .6); }
@media(max-width:760px) and (any-pointer:coarse) {
    .ct-discover__tap-hint:not([hidden]) { display:flex; }
    .ct-discover__tap-finger { animation:ct-discover-tap 1.3s ease-in-out 3; }
    .ct-discover__tap-ring { animation:ct-discover-tap-ring 1.3s ease-out 3; }
}
@keyframes ct-discover-tap { 0%,100% { transform:translateY(0) scale(1); } 35% { transform:translateY(-7px) scale(.9); } 60% { transform:translateY(0) scale(1); } }
@keyframes ct-discover-tap-ring { 0%,30% { opacity:0; transform:scale(.55); } 40% { opacity:1; transform:scale(.7); } 100% { opacity:0; transform:scale(1.8); } }
@media(prefers-reduced-motion:reduce) {
    .ct-discover .ct-discover__tap-finger, .ct-discover .ct-discover__tap-ring { animation:none; transform:none; }
}
