/* Public design settings. Loaded after style.css. */
/* Colores y reglas propias de cada paleta: themes/palettes/<id>.php (se inyectan antes de este archivo). Aquí solo lo común a todas. */
body[data-palette]:not([data-palette="current"]) .preloader,
body[data-palette]:not([data-palette="current"]) .pwa-install-help,
body[data-palette]:not([data-palette="current"]) .site-footer,
body[data-palette]:not([data-palette="current"]) .pagination__page,
body[data-palette]:not([data-palette="current"]) .pagination__nav {
    background:var(--bg); color:var(--fg);
}
body[data-palette]:not([data-palette="current"]) .hero__gradient {
    background:radial-gradient(ellipse at 50% 30%,var(--accent-soft),transparent 70%);
}
body[data-palette]:not([data-palette="current"]) .mobile-profile { background:var(--bg-soft); }
body[data-palette]:not([data-palette="current"]) .hero,
body[data-palette]:not([data-palette="current"]) .project,
body[data-palette]:not([data-palette="current"]) .contact,
body[data-palette]:not([data-palette="current"]) .legal-page { background:var(--bg); }
body[data-palette]:not([data-palette="current"]) .contact__link { border-color:var(--line); }
body[data-palette]:not([data-palette="current"]) .hero__title-line--accent {
    color:var(--accent); -webkit-text-fill-color:var(--accent); background-image:none;
}
body[data-palette]:not([data-palette="current"]) .hero__glow,
body[data-palette]:not([data-palette="current"]) .contact__glow { background:var(--accent-soft); }
body[data-palette]:not([data-palette="current"]) .mobile-profile__crest-wrap,
body[data-palette]:not([data-palette="current"]) .card__picture { background:var(--bg-card); }
body[data-palette]:not([data-palette="current"]) .pwa-install-button,
body[data-palette]:not([data-palette="current"]) .upload-fab  {
    color:var(--bg); background:var(--accent);
}
/* Insignia de verificación: la marca interior toma el fondo de la paleta */
body[data-palette]:not([data-palette="current"]) .verified-badge { --badge-ink:var(--bg); }

/* El mapa (sección, marco y puntos de localización) usa la paleta elegida, como el resto de la web. */

/* All gallery modes use the selected column count. Masonry uses native columns. */
body[data-grid] #masonry { --gallery-columns:var(--columns-desktop); }
body[data-grid] #masonry .card { min-width:0; width:100%; margin:0; padding:0; }
body[data-grid="masonry"] #masonry,
body[data-grid="adaptive"] #masonry {
    display:block !important; column-count:var(--gallery-columns) !important;
    column-gap:var(--col-gap) !important;
}
body[data-grid="masonry"] #masonry .card,
body[data-grid="adaptive"] #masonry .card { margin-bottom:var(--col-gap) !important; break-inside:avoid; aspect-ratio:auto; }
body[data-grid="masonry"] #masonry .card__btn,
body[data-grid="masonry"] #masonry .card__picture { height:auto !important; aspect-ratio:var(--aspect) !important; }
body[data-grid="masonry"] #masonry .card__img { height:100% !important; aspect-ratio:auto !important; object-fit:cover; }
body[data-grid="square"] #masonry,
body[data-grid="landscape"] #masonry,
body[data-grid="portrait"] #masonry {
    display:grid !important; grid-template-columns:repeat(var(--gallery-columns),minmax(0,1fr)) !important;
    gap:var(--col-gap) !important; column-count:auto !important; align-items:start;
}
body[data-grid="square"] #masonry { --tile-aspect:1; }
body[data-grid="landscape"] #masonry { --tile-aspect:4/3; }
body[data-grid="portrait"] #masonry { --tile-aspect:3/4; }
body[data-grid="square"] #masonry .card,
body[data-grid="landscape"] #masonry .card,
body[data-grid="portrait"] #masonry .card { aspect-ratio:var(--tile-aspect) !important; margin:0 !important; }
body[data-grid="square"] #masonry .card__picture,
body[data-grid="landscape"] #masonry .card__picture,
body[data-grid="portrait"] #masonry .card__picture { aspect-ratio:var(--tile-aspect) !important; height:100% !important; }
body[data-grid="square"] #masonry .card__img,
body[data-grid="landscape"] #masonry .card__img,
body[data-grid="portrait"] #masonry .card__img { width:100%; height:100% !important; aspect-ratio:var(--tile-aspect) !important; object-fit:cover; }
.hero__portrait { display:none; }

@media (min-width:769px) {
    body[data-header-desktop="centered"] .hero { min-height:70vh; height:auto; padding:6rem 2rem; }
    body[data-header-desktop="centered"] .hero__portrait { display:block; width:120px; height:120px; object-fit:cover; border-radius:50%; margin:0 auto 1.5rem; border:2px solid var(--accent); }
    body[data-header-desktop="centered"] .hero__crest { display:none; }
    body[data-header-desktop="centered"] .hero__title { font-size:clamp(3rem,6vw,6rem); }
    body[data-header-desktop="compact"] .hero { min-height:0; height:auto; padding:3rem 2rem; }
    body[data-header-desktop="compact"] .hero__content { display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:1.5rem; }
    body[data-header-desktop="compact"] .hero__title { font-size:clamp(2rem,4vw,4rem); margin:0; }
    body[data-header-desktop="compact"] .hero__title-line { display:inline; }
    body[data-header-desktop="compact"] .hero__crest { margin:0; }
    body[data-header-desktop="compact"] .hero__eyebrow,
    body[data-header-desktop="compact"] .hero__divider,
    body[data-header-desktop="compact"] .hero__scroll,
    body[data-header-desktop="compact"] .hero__ornament { display:none; }
    body[data-header-desktop="editorial"] .hero { min-height:0; height:auto; padding:7rem max(2rem,8vw); border-bottom:1px solid var(--line); }
    body[data-header-desktop="editorial"] .hero__content { width:100%; max-width:1200px; text-align:left; }
    body[data-header-desktop="editorial"] .hero__crest { margin:0 0 2rem; }
    body[data-header-desktop="editorial"] .hero__title { font-size:clamp(3.5rem,8vw,9rem); }
    body[data-header-desktop="editorial"] .hero__title-line { display:inline; }
    body[data-header-desktop="editorial"] .hero__divider { margin:2rem 0; }
    body[data-header-desktop="editorial"] .hero__meta { justify-content:flex-start; }
    body[data-header-desktop="editorial"] .hero__scroll { position:static; transform:none; display:inline-flex; margin-top:2rem; }
}


@media(max-width:768px) {
    body[data-grid] #masonry { --gallery-columns:var(--columns-mobile); --col-gap:6px; }
    body[data-header-mobile="centered"] .mobile-profile { padding:1.5rem; text-align:center; }
    body[data-header-mobile="centered"] .mobile-profile__masthead { flex-direction:column; gap:.6rem; }
    body[data-header-mobile="centered"] .mobile-profile__identity { display:flex; flex-direction:column; gap:1rem; }
    body[data-header-mobile="centered"] .mobile-profile__portraits { justify-content:center; }
    body[data-header-mobile="centered"] .mobile-profile__stats { width:100%; }
    body[data-header-mobile="centered"] .mobile-profile__name { justify-content:center; }
    body[data-header-mobile="compact"] .mobile-profile { padding:.9rem; }
    body[data-header-mobile="compact"] .mobile-profile__masthead { margin:0; padding:0 0 .5rem; }
    body[data-header-mobile="compact"] .mobile-profile__identity { grid-template-columns:56px 1fr; padding:.5rem 0; }
    body[data-header-mobile="compact"] .mobile-profile__portraits { --avatar:48px; }
    body[data-header-mobile="compact"] .mobile-profile__crest-wrap,
    body[data-header-mobile="compact"] .mobile-profile__bio p { display:none; }
    body[data-header-mobile="editorial"] .mobile-profile { padding:2rem 1.2rem; border-top:5px solid var(--accent); }
    body[data-header-mobile="editorial"] .mobile-profile__masthead { align-items:flex-start; flex-direction:column; gap:.7rem; padding-bottom:1.2rem; }
    body[data-header-mobile="editorial"] .mobile-profile__brand { font-size:clamp(2.5rem,10vw,4rem); }
    body[data-header-mobile="editorial"] .mobile-profile__identity { grid-template-columns:1fr auto; }
    body[data-header-mobile="editorial"] .mobile-profile__portraits { grid-column:2; grid-row:1; }
    body[data-header-mobile="editorial"] .mobile-profile__stats { grid-column:1; grid-row:1; }
    body[data-header-mobile="editorial"] .mobile-profile__bio { margin-top:1rem; padding-top:1rem; border-top:1px solid var(--line); font-size:.85rem; }
}

/* Independent global visibility switches, unaffected by palette/template overrides. */
body[data-show-map="false"] [data-site-section="map"],
body[data-show-project="false"] [data-site-section="project"],
body[data-show-social="false"] [data-site-section="social"],
body[data-show-categories="false"] [data-site-section="categories"] {display:none!important}

.site-section-switches {display:grid;gap:.75rem;margin:1.2rem 0 0;padding:1rem;border:1px solid rgba(212,165,116,.24)}
.site-section-switches legend {padding:0 .35rem;color:var(--accent);font:.72rem var(--sans);letter-spacing:.08em;text-transform:uppercase}
.site-section-switch {display:flex;align-items:center;gap:.7rem;min-height:42px;cursor:pointer;color:var(--fg);font:500 .82rem var(--sans);letter-spacing:0!important;text-transform:none!important}
.site-section-switch input {position:absolute;opacity:0;width:1px;height:1px}
.site-section-switch__track {position:relative;flex:0 0 42px;width:42px;height:24px;border-radius:99px;background:#383633;border:1px solid #ffffff30;transition:background .2s}
.site-section-switch__track::after {content:"";position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:#eee;transition:transform .2s}
.site-section-switch input:checked+.site-section-switch__track {background:var(--accent)}
.site-section-switch input:checked+.site-section-switch__track::after {transform:translateX(18px);background:#17120d}
.site-section-switch input:focus-visible+.site-section-switch__track {outline:2px solid var(--fg);outline-offset:3px}

/* Fix the Perfil/Diseño controls: compact horizontal tabs, never full-height side rails. */
.admin-settings-tabs {display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:.55rem!important;width:100%!important;height:auto!important;min-height:0!important;flex:none!important}
.admin-settings-tabs a {display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 auto!important;width:auto!important;min-width:92px!important;height:42px!important;min-height:42px!important;padding:.55rem 1rem!important;writing-mode:horizontal-tb!important;white-space:nowrap!important}
.site-settings[data-settings-section] {display:grid!important;grid-template-columns:minmax(0,1fr)!important;align-items:start!important}


/* En escritorio todas las cabeceras con hero llenan exactamente el viewport.
   Se declara al final para prevalecer sobre las composiciones compactas/editoriales. */
@media (min-width:769px) {
    .hero {
        box-sizing:border-box;
        width:100%;
        max-width:100vw;
        height:100vh !important;
        min-height:100vh !important;
    }
}

/* Bloques reordenables de la portada */
/* Categorías: título, filtro y un buen respiro antes del siguiente bloque. */
.categories-block { max-width:2200px; margin:0 auto; padding:6rem 2rem 5rem; }
.categories-block + .gallery-section { padding-top:0; }
.categories-block__title {
    margin:0; text-align:center; color:var(--fg);
    font:italic 400 clamp(2rem,4.2vw,3rem)/1.1 var(--serif); letter-spacing:-.01em;
}
.categories-block__title::after {
    content:""; display:block; width:56px; height:2px; margin:1.1rem auto 0; background:var(--accent);
}
.categories-block .categories-filter { padding-top:1.8rem; border-bottom:0; }
@media(max-width:600px) { .categories-block { padding:4rem 1rem 3.5rem; } }
@media(max-width:768px) {
    .categories-block { padding:1.1rem 0 2.4rem; }
    .categories-block__title { padding:0 1rem; text-align:left; font-size:1.5rem; }
    .categories-block__title::after { margin:.6rem 0 0; width:40px; }
    /* Categorías en móvil: una sola fila que se desliza con el dedo, encima de la cuadrícula. */
    .categories-block .categories-filter { padding:.9rem 1rem .4rem; }
    .categories-filter__inner { flex-wrap:nowrap; justify-content:flex-start; gap:.5rem; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
    .categories-filter__inner::-webkit-scrollbar { display:none; }
    .categories-filter__chip { flex:0 0 auto; white-space:nowrap; }
    body[data-show-header-mobile="false"] .mobile-profile { display:none !important; }
}
@media(min-width:769px) {
    body[data-show-header-desktop="false"] .hero { display:none !important; }
}

/* Forma de la paginación (ajuste «Forma de la paginación»): círculos por defecto o cuadrados. */
body[data-pagination-shape="circle"] .pagination__page,
body[data-pagination-shape="circle"] .pagination__nav { border-radius:50%; }
body[data-pagination-shape="square"] .pagination__page,
body[data-pagination-shape="square"] .pagination__nav { border-radius:4px; }
