/* ==============================================================
   DOKIDO TRADUCCIONES · BASE.CSS
   Reset + layout + botones + badges + footer + utilidades.
   Estética moderna suave: colores planos, bordes finos (1px),
   esquinas redondeadas y sombras difusas discretas.
   ============================================================== */

/* ==============================================================
   RESET
   ============================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.6;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

input, button, textarea, select {
    font: inherit;
    color: inherit;
}

/* ---------- Controles nativos legibles en ambos temas ----------
   Los desplegables nativos no heredan la caja del select: se pintan
   con el esquema de color (variables.css) y los tokens del tema activo. */
select option, select optgroup {
    background-color: var(--surface);
    color: var(--text);
}

button {
    background: none;
    border: none;
    cursor: pointer;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    line-height: 1.2;
}

/* ==============================================================
   SELECCIÓN · SCROLLBAR · FOCO
   ============================================================== */
::selection {
    background: var(--accent);
    color: #fff;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
    background: var(--border-3);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-2);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* ==============================================================
   ESTRUCTURA DE PÁGINA
   ============================================================== */
.page-content {
    position: relative;
    z-index: var(--z-content);
    padding-top: calc(var(--ticker-height, 34px) + var(--navbar-height, 68px) + 28px);
}

.main-content-mobile {
    position: relative;
    z-index: var(--z-content);
    min-height: 100vh;
    padding-top: calc(var(--ticker-height, 34px) + var(--navbar-height, 68px) + 24px);
}

@media (max-width: 1023px) {
    .page-content { display: none !important; }
}
@media (min-width: 1024px) {
    .main-content-mobile { display: none !important; }
}

body.force-pc .page-content { display: block !important; }
body.force-pc .main-content-mobile { display: none !important; }
body.force-mobile .page-content { display: none !important; }
body.force-mobile .main-content-mobile { display: block !important; }

.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--sp-5);
}
.container-sm {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--sp-5);
}

/* ==============================================================
   BOTONES
   ============================================================== */
.dk-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 13px 26px;
    border-radius: var(--ui-radius);
    font-family: var(--font-body);
    font-size: var(--fs-base);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
    transition:
        transform var(--transition-fast),
        box-shadow var(--transition-fast),
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
    user-select: none;
}
.dk-btn i { font-size: 0.95em; }
.dk-btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-sm);
}
.dk-btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.dk-btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}
.dk-btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border-2);
    box-shadow: var(--shadow-sm);
}
.dk-btn-secondary:hover {
    background: var(--surface-2);
    border-color: var(--border-3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.dk-btn-secondary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}
.dk-btn-sm { padding: 9px 18px; font-size: var(--fs-sm); }
.dk-btn-lg { padding: 16px 32px; font-size: var(--fs-md); }

/* ==============================================================
   BADGES DE ESTADO + PILLS
   ============================================================== */
.estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    border: 1px solid currentColor;
}
.estado-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.estado-finalizado {
    background: rgba(16, 185, 129, 0.13);
    color: var(--estado-finalizado);
}
.estado-traduccion {
    background: rgba(245, 158, 11, 0.13);
    color: var(--estado-traduccion);
}
.estado-retraduccion {
    background: rgba(168, 85, 247, 0.13);
    color: var(--estado-retraduccion);
}

.dk-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-2);
    transition: all var(--transition-fast);
    cursor: pointer;
}
.dk-pill:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* ==============================================================
   PLACEHOLDER DE IMAGEN
   ============================================================== */
.dk-img-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    background: var(--surface-2);
    border: 1px dashed var(--border-3);
    border-radius: var(--card-radius);
    color: var(--text-3);
    font-family: var(--font-body);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
}
.dk-img-placeholder i {
    font-size: 40px;
    color: var(--accent);
}
.dk-img-placeholder small,
.dk-img-placeholder em {
    font-style: normal;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: none;
    color: var(--text-2);
    word-break: break-all;
    max-width: 92%;
    text-align: center;
    line-height: 1.45;
}
.dk-img-placeholder--min {
    gap: 6px;
    padding: 8px;
    font-size: 8.5px;
    letter-spacing: 0.08em;
}
.dk-img-placeholder--min i { font-size: 18px; }
.dk-img-placeholder--min small { font-size: 8px; }

/* ---------- Archivo por cargar: dato y aviso dentro de contenedores ---------- */
.dato-archivo {
    display: block;
    font-family: var(--font-body);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--text-3);
    text-align: center;
    word-break: break-all;
    line-height: 1.45;
}
.dk-archivo-falta { display: none; }
.is-sin-archivo { position: relative; }
.is-sin-archivo > img { display: none; }
.is-sin-archivo > .dk-archivo-falta {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 12px;
    text-align: center;
    background: var(--surface-2);
    color: var(--text-3);
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.5;
    word-break: break-all;
}
.is-sin-archivo > .dk-archivo-falta i { font-size: 20px; color: var(--accent); }

/* ==============================================================
   BARRAS DE PROGRESO · componente compartido
   ============================================================== */
@keyframes dk-prog-crece {
    from { width: 0; }
}

/* Barra continua (bitácora del home, hero de obra y tarjetas del
   catálogo). El relleno crece hasta --p al aparecer su contenedor. */
.dk-prog {
    position: relative;
    display: block;
    height: 9px;
    border-radius: var(--radius-full);
    background: var(--surface-3);
    box-shadow: inset 0 0 0 1px var(--border);
    overflow: hidden;
}
.dk-prog__fill {
    display: block;
    height: 100%;
    width: var(--p, 0%);
    border-radius: inherit;
    background: var(--accent);
}
.revealed .dk-prog__fill,
.dk-prog.is-in .dk-prog__fill {
    animation: dk-prog-crece 1.05s var(--ease-out) 0.18s both;
}

/* ==============================================================
   FOOTER GLOBAL
   ============================================================== */
.site-footer {
    position: relative;
    margin-top: 72px;
    background: var(--bg-2);
    border-top: 1px solid var(--border);
}

.footer-main {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 48px 24px 32px;
    display: grid;
    grid-template-columns: minmax(250px, 1fr) 1.6fr;
    gap: 48px;
}

.footer-brand-logo {
    display: inline-flex;
    align-items: baseline;
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}
.footer-brand-logo em {
    font-style: normal;
    color: var(--accent);
}
.footer-brand-logo small {
    margin-left: 10px;
    font-family: 'Noto Sans JP', var(--font-display);
    font-size: 15px;
    font-weight: 900;
    color: var(--text-3);
    letter-spacing: 0.06em;
}
.footer-brand-sub {
    margin-top: 12px;
    max-width: 330px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--text-3);
}

.footer-redes-grid {
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-redes-grid a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ui-radius);
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 15px;
    transition: all var(--transition-fast);
}
.footer-redes-grid a:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: var(--shadow-sm);
}

.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}
.footer-column h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--text);
}
.footer-column h3::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 3px;
    background: var(--accent);
    flex-shrink: 0;
}
.footer-column a {
    display: block;
    padding: 5px 0;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-2);
    transition: color var(--transition-fast), transform var(--transition-fast);
}
.footer-column a:hover {
    color: var(--accent);
    transform: translateX(4px);
}

.footer-bottom {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 18px 24px 22px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12.5px;
    color: var(--text-3);
}
.footer-links-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-links-row a {
    color: var(--text-3);
    transition: color var(--transition-fast);
}
.footer-links-row a:hover {
    color: var(--accent);
}
.footer-links-row .footer-staff {
    display: inline-flex;
    margin-left: 4px;
    opacity: 0.3;
    font-size: 11px;
    transition: opacity var(--transition-fast), color var(--transition-fast);
}
.footer-links-row .footer-staff:hover {
    opacity: 1;
}

.heart-text i {
    color: var(--accent);
    animation: heart-beat 1.8s ease-in-out infinite;
}
@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.2); }
}

@media (max-width: 1023px) {
    .footer-main {
        grid-template-columns: 1fr;
        gap: 36px;
        padding: 40px 20px 28px;
    }
    .footer-columns { grid-template-columns: repeat(2, 1fr); }
    .footer-bottom { justify-content: center; text-align: center; }
}
@media (max-width: 700px) {
    .footer-columns { grid-template-columns: 1fr; gap: 24px; }
    .site-footer { margin-top: 48px; }
}

/* ==============================================================
   VOLVER ARRIBA + BARRA DE PROGRESO
   ============================================================== */
.dk-pagetop {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: var(--ui-radius);
    background: var(--surface-solid);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 700;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition:
        opacity 0.25s ease,
        transform 0.25s ease,
        visibility 0.25s,
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease;
}
.dk-pagetop i { color: var(--accent); transition: color 0.2s ease; }
.dk-pagetop.visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.dk-pagetop:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.dk-pagetop:hover i { color: #fff; }

.dk-progress {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(var(--ticker-height, 34px) + var(--navbar-height, 68px));
    height: 2px;
    z-index: 940;
    pointer-events: none;
    background: transparent;
}
.dk-progress i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    transition: width 0.12s linear;
}

/* ==============================================================
   MODALES (base; la animación fina y Apariencia viven en modales.css)
   ============================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    background: rgba(10, 10, 16, 0.5);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.modal-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 36px;
    max-width: 540px;
    width: 100%;
    position: relative;
    transform: none;
    transition: transform 0.28s var(--ease-spring);
    box-shadow: var(--shadow-hard-lg);
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    border-radius: var(--radius-md);
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
    cursor: pointer;
}
.modal-close:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.modal-box h2 {
    font-size: var(--fs-xl);
    font-weight: 800;
    margin-bottom: var(--sp-4);
    letter-spacing: -0.02em;
}
.modal-box p {
    font-size: var(--fs-base);
    line-height: 1.75;
    color: var(--text-2);
}

/* ==============================================================
   ESTADO DEL SITIO · mantenimiento y secciones apagadas
   ============================================================== */
body.dk-bloqueo-activo {
    overflow: hidden;
}

.dk-bloqueo {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: grid;
    place-items: center;
    padding: clamp(18px, 4vw, 40px);
    background: var(--bg);
    color: var(--text);
}

.dk-bloqueo__caja {
    width: min(560px, 100%);
    padding: clamp(28px, 5vw, 52px);
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-md);
}

.dk-bloqueo__icono {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    border-radius: var(--radius-full);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.5rem;
}

.dk-bloqueo__eyebrow {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: var(--fs-xs);
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-3);
}

.dk-bloqueo__titulo {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    line-height: 1.15;
    color: var(--text);
}

.dk-bloqueo__texto {
    margin: 0 auto 24px;
    max-width: 42ch;
    color: var(--text-2);
    font-size: var(--fs-base);
    line-height: 1.7;
}

.dk-bloqueo__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 22px;
    border-radius: var(--radius-full);
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.dk-bloqueo__btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.dk-bloqueo__pie {
    margin: 20px 0 0;
    color: var(--text-3);
    font-size: var(--fs-xs);
    line-height: 1.6;
}

.dk-contenido-apagado {
    pointer-events: none;
    user-select: none;
}

@media (max-width: 700px) {
    .dk-bloqueo__caja {
        padding: 32px 22px;
    }

    .dk-bloqueo__icono {
        width: 54px;
        height: 54px;
        font-size: 1.25rem;
    }
}

/* ==============================================================
   UTILIDADES
   ============================================================== */
.hidden { display: none !important; }
.gradient-text { color: var(--accent); }

/* Reveal on scroll (los observers viven en scroll-reveal.js) */
[data-reveal],
[data-reveal-item],
.reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}
[data-reveal].revealed,
[data-reveal-item].revealed,
.reveal.revealed {
    opacity: 1;
    transform: none;
}
[data-reveal-delay="1"] { transition-delay: 0.08s; }
[data-reveal-delay="2"] { transition-delay: 0.16s; }
[data-reveal-delay="3"] { transition-delay: 0.24s; }
[data-reveal-delay="4"] { transition-delay: 0.32s; }

/* ==============================================================
   RESPONSIVE + MOVIMIENTO REDUCIDO
   ============================================================== */
@media (max-width: 700px) {
    .modal-box { padding: 28px 22px; }
    .dk-btn { padding: 12px 22px; font-size: var(--fs-sm); }
    .dk-btn-lg { padding: 15px 28px; font-size: var(--fs-base); }
    .dk-pagetop { right: 14px; bottom: 14px; padding: 11px 12px; }
    .dk-pagetop span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-reveal], [data-reveal-item], .reveal {
        opacity: 1;
        transform: none;
    }
}
