/* ==========================================================================
   Formularios Jurídicos - estilos en pantalla
   Paleta heredada del despacho:
     --fj-ink:    #1B1B1B   (texto principal)
     --fj-paper:  #FFFFFF
     --fj-tint:   #F8F7F3   (accent claro Astra)
     --fj-line:   #D9D6CC   (separadores discretos)
     --fj-focus:  rgba(27,27,27,0.06)
     --fj-mark:   rgba(208,177,98,0.18) (acento dorado muy diluido, solo focus)
   ========================================================================== */

.fj-single-wrap,
.fj-archive-wrap {
    background: #f7f6f3;
    padding: 32px 0 64px;
}

.fj-single,
.fj-archive {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Archive: grid de tarjetas ------------------------------------------- */

.fj-archive__header {
    text-align: center;
    margin-bottom: 32px;
}

.fj-archive__title {
    font-size: 2.25rem;
    margin: 0 0 8px;
    line-height: 1.2;
    color: #1B1B1B;
}

.fj-archive__intro {
    color: #4b5563;
    font-size: 1.05rem;
    max-width: 640px;
    margin: 0 auto 20px;
}

.fj-archive__search {
    max-width: 480px;
    margin: 0 auto;
}

.fj-archive__search-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 1px solid #D9D6CC;
    border-radius: 8px;
    background: #fff;
    color: #1B1B1B;
}

.fj-archive__search-input:focus {
    border-color: #1B1B1B;
    outline: 2px solid rgba(27, 27, 27, 0.12);
}

.fj-archive__grid {
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.fj-card {
    background: #fff;
    border: 1px solid #ece9e0;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fj-card:hover {
    box-shadow: 0 8px 20px rgba(27, 27, 27, 0.06);
    border-color: #d0b162;
}

.fj-card__link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.fj-card__thumb {
    background: #f7f6f3;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fj-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fj-card__thumb--placeholder i {
    font-size: 48px;
    color: #b8b3a2;
}

.fj-card__body {
    padding: 18px 18px 22px;
}

.fj-card__title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    line-height: 1.3;
    color: #1B1B1B;
}

.fj-card__excerpt {
    color: #555;
    font-size: 0.92rem;
    line-height: 1.5;
    margin: 0 0 14px;
}

.fj-card__cta {
    font-weight: 600;
    font-size: 0.9rem;
    color: #1B1B1B;
}

.fj-archive__empty,
.fj-archive__empty-state {
    text-align: center;
    color: #6b7280;
    padding: 32px 0;
}

/* --- Single: documento rellenable ---------------------------------------- */

.fj-document {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(27, 27, 27, 0.05);
    padding: 40px clamp(20px, 4vw, 56px);
}

.fj-document__header {
    border-bottom: 1px solid #ece9e0;
    padding-bottom: 20px;
    margin-bottom: 28px;
}

.fj-breadcrumbs {
    font-size: 0.85rem;
    color: #6b7280;
    margin: 0 0 12px;
}

.fj-breadcrumbs a {
    color: #6b7280;
    text-decoration: none;
}

.fj-breadcrumbs a:hover {
    color: #1B1B1B;
}

.fj-document__title {
    font-size: clamp(1.6rem, 2.6vw, 2.1rem);
    line-height: 1.25;
    margin: 0 0 10px;
    color: #1B1B1B;
}

.fj-document__intro {
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 18px;
}

.fj-help {
    font-size: 0.88rem;
    color: #6b7280;
    margin: 14px 0 0;
    background: #f7f6f3;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid #d0b162;
}

/* --- Acciones (botones) ---------------------------------------------------
   Sin sombras agresivas, sin translateY, paleta neutra.
   ------------------------------------------------------------------------ */

.fj-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 4px 0;
}

.fj-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 9px 16px;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    background: transparent;
    color: #1B1B1B;
    transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
    font-family: inherit;
}

.fj-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.fj-btn--primary {
    background: #1B1B1B;
    color: #fff;
    border-color: #1B1B1B;
}

.fj-btn--primary:hover:not(:disabled),
.fj-btn--primary:focus-visible:not(:disabled) {
    background: #2f2f2f;
    border-color: #2f2f2f;
}

.fj-btn--secondary {
    background: #fff;
    color: #1B1B1B;
    border-color: #1B1B1B;
}

.fj-btn--secondary:hover:not(:disabled),
.fj-btn--secondary:focus-visible:not(:disabled) {
    background: #1B1B1B;
    color: #fff;
}

.fj-btn--ghost {
    background: transparent;
    color: #6b7280;
    border-color: transparent;
}

.fj-btn--ghost:hover:not(:disabled),
.fj-btn--ghost:focus-visible:not(:disabled) {
    color: #1B1B1B;
    background: #f3f1ec;
}

.fj-btn i {
    font-size: 1.1em;
    line-height: 1;
}

.fj-btn:focus-visible {
    outline: 2px solid rgba(208, 177, 98, 0.5);
    outline-offset: 2px;
}

.fj-status {
    margin-left: 4px;
    font-size: 0.82rem;
    color: #6b7280;
    min-height: 1em;
}

/* --- Cuerpo del documento ------------------------------------------------ */

.fj-document__body {
    font-family: 'Times New Roman', Times, Georgia, serif;
    font-size: 16px;
    line-height: 1.6;
    color: #1B1B1B;
    text-align: justify;
}

.fj-document__body h2,
.fj-document__body h3,
.fj-document__body h4 {
    font-family: inherit;
    text-align: center;
    margin: 28px 0 14px;
    font-weight: 700;
    color: #1B1B1B;
}

.fj-document__body h2 {
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.fj-document__body h3 {
    font-size: 1.05rem;
}

.fj-document__body p {
    margin: 0 0 14px;
}

.fj-document__body ol,
.fj-document__body ul {
    margin: 0 0 14px 24px;
}

.fj-document__body li {
    margin-bottom: 6px;
}

/* --- Campos rellenables (estilo inline, casi invisibles en reposo) -------
   IMPORTANTE: el tema base define una regla genérica
       input[type=text] { width:100%; padding:.5rem 1rem }
   con la misma especificidad que `input.fj-field`. Como el CSS del tema se
   carga después que el del plugin, mi regla perdía por orden. Por eso aquí
   todos los selectores cualifican con el contenedor `.fj-document__body`,
   que sube la especificidad y blinda los campos contra estilos del tema.
   ------------------------------------------------------------------------ */

.fj-document__body input.fj-field,
.fj-document__body textarea.fj-field {
    appearance: none;
    -webkit-appearance: none;
    display: inline;
    width: auto;
    max-width: 100%;
    height: auto;
    border: none;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    padding: 0 2px;
    margin: 0;
    vertical-align: baseline;
    border-bottom: 1px dotted rgba(27, 27, 27, 0.22);
    border-radius: 0;
    box-shadow: none;
    min-width: 0;
    transition: background-color 0.12s ease, border-bottom-color 0.12s ease;
}

/* Anchos sugeridos por tipo, en `ch` (≈ ancho de un caracter). */
.fj-document__body input.fj-field--text     { width: 14ch; }
.fj-document__body input.fj-field--date     { width: 14ch; }
.fj-document__body input.fj-field--number   { width: 10ch; }
.fj-document__body input.fj-field--currency { width: 12ch; }
.fj-document__body input.fj-field--tel      { width: 14ch; }
.fj-document__body input.fj-field--email    { width: 22ch; }

.fj-document__body input.fj-field:hover,
.fj-document__body textarea.fj-field:hover {
    border-bottom-style: solid;
    border-bottom-color: rgba(27, 27, 27, 0.45);
    cursor: text;
}

.fj-document__body input.fj-field:focus,
.fj-document__body textarea.fj-field:focus {
    outline: none;
    background-color: rgba(208, 177, 98, 0.12);
    border-bottom-style: solid;
    border-bottom-color: #1B1B1B;
}

/* Con valor: el campo se camufla en el texto */
.fj-document__body input.fj-field:not(:placeholder-shown) {
    border-bottom-color: transparent;
}

.fj-document__body input.fj-field:not(:placeholder-shown):hover,
.fj-document__body input.fj-field:not(:placeholder-shown):focus {
    border-bottom-color: rgba(27, 27, 27, 0.45);
}

.fj-document__body .fj-field::placeholder {
    color: rgba(27, 27, 27, 0.35);
    font-style: italic;
    opacity: 1;
}

.fj-document__body input.fj-field[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.4;
    cursor: pointer;
}

/* Textarea (long): un único campo bloque que ocupa toda la línea */
.fj-document__body textarea.fj-field--long {
    display: block;
    width: 100%;
    min-height: 60px;
    resize: vertical;
    margin: 6px 0;
    padding: 8px 10px;
    border: 1px dashed rgba(27, 27, 27, 0.22);
    border-radius: 4px;
    background: transparent;
    vertical-align: top;
}

.fj-document__body textarea.fj-field--long:hover {
    border-style: solid;
    border-color: rgba(27, 27, 27, 0.45);
}

.fj-document__body textarea.fj-field--long:focus {
    border-style: solid;
    border-color: #1B1B1B;
    background-color: rgba(208, 177, 98, 0.06);
}

/* --- Footer ------------------------------------------------------------- */

.fj-document__footer {
    border-top: 1px solid #ece9e0;
    padding-top: 22px;
    margin-top: 36px;
}

.fj-disclaimer {
    margin-top: 18px;
    color: #6b7280;
    font-size: 0.85rem;
    background: #f7f6f3;
    padding: 10px 14px;
    border-radius: 8px;
    border-left: 3px solid #d0b162;
}

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 600px) {
    .fj-document {
        padding: 24px 18px;
    }
    .fj-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .fj-btn {
        justify-content: center;
    }
}
