@charset "utf-8";

/* =========================================================
   VARIABLES
   ========================================================= */
:root {
    --color-primario: #025197;
    --color-secundario: #046ac4;
    --color-texto: #333;
    --color-fondo-gris: #f9f9f9;
    --color-acento-muy-claro: #e0f7fa;
    --color-azul-claro: #e9f2fc;
    --color-verde: #6D8901;
    --color-texto-suave: #767676;
    --fuente-titulos: "Trebuchet MS", Arial, Helvetica, sans-serif;
    --fuente-base: Arial, sans-serif;
    --espacio-blanco: 60px;
}

/* =========================================================
   FUENTES
   ========================================================= */
@font-face {
    font-family: "Oswald";
    src: url("Oswald.woff") format("woff"), url("Oswald.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* =========================================================
   BASE
   ========================================================= */
html {
    font-family: Arial, sans-serif;
    color: var(--color-texto-suave);
    font-size: 100%;
}

body {
    margin: 0;
    min-width: 0;
    background: url(../imagenes-de-esquelas/bg.jpg) repeat;
}

/* El foco de teclado debe ser visible y no depender del ratón. */
:focus-visible {
    outline: 3px solid var(--color-secundario);
    outline-offset: 3px;
}
a:focus-visible { outline-offset: 2px; }
.phone-number-link:focus-visible { outline-color: #ffffff; }

/* Los enlaces de contenido conservan una señal visual independiente del color. */
main a:not(.phone-number-link),
.enlaces-interes-section a,
.ediciones-disponibles-section a,
#footer a {
    text-decoration-thickness: 0.12em;
    text-underline-offset: 0.15em;
}

a { color: var(--color-primario); text-decoration: none; }

/* =========================================================
   TITULARES
   ========================================================= */
h1 {
    font-family: 'Oswald', Arial, sans-serif;
    color: var(--color-primario);
    font-size: 2.5em;
    margin-bottom: 0.75em;
    line-height: 1.5;
    font-weight: 300;
    text-shadow: 1px 1px 0 var(--color-verde);
}
h2, h3, h4 {
    color: var(--color-primario);
    text-shadow: 1px 1px 0 var(--color-verde);
}
h2, h3 {
    font-family: 'Oswald', sans-serif !important;
    font-weight: 300 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
h2 { font-size: 2.3em; margin-bottom: 1em;   line-height: 1.4; }
h3 { font-size: 2em;   margin-bottom: 1em;   line-height: 1.3; }
h4 { font-family: 'Oswald', Arial, sans-serif; font-size: 1.5em; margin-bottom: 0.8em; font-weight: bold; }

/* =========================================================
   LAYOUT
   ========================================================= */
.wrapper {
    margin: 0 auto;
    padding: 1.5em 1em;
    max-width: 1380px;
    width: 96%;
}
.wrapper-full { width: 100%; box-sizing: border-box; }
.grid-5  { width: 28.571%; }
.grid-10 { width: 59.821%; }

/* =========================================================
   CABECERA
   ========================================================= */
.header-image-container {
    display: block;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: var(--espacio-blanco);
}
.header-image-container img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 90px;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.header-image-container:hover img { transform: scale(1.03); }

.header-bottom-row {
    display: flex;
    width: 100%;
    margin-top: 15px;
    box-sizing: border-box;
    justify-content: center;
    align-items: stretch;
}
.header-tercio-left,
.header-tercios-right {
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Caja del teléfono */
.phone-box-wrapper {
    background-color: var(--color-primario);
    padding: 14px 50px;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(2, 81, 151, 0.15);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    box-sizing: border-box;
    text-align: center;
}
.phone-box-wrapper:hover {
    background-color: var(--color-secundario);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(2, 81, 151, 0.3);
}
.phone-box-title {
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    color: #ffffff;
    opacity: 0.95;
    letter-spacing: 0.5px;
    font-family: var(--fuente-base);
}
.phone-number-link {
    margin: 2px 0 0 0;
    font-size: 35px;
    font-weight: 900;
    color: #ffffff;
    text-decoration: none;
    display: block;
    font-family: var(--fuente-base);
    white-space: nowrap;
}
.phone-icon {
    display: inline-block;
    transition: transform 0.5s ease;
    font-size: 0.8em;
    vertical-align: middle;
    margin-right: 5px;
}
.phone-box-wrapper:hover .phone-icon { transform: rotate(-15deg) scale(1.1); }

/* =========================================================
   NAVEGACIÓN PRINCIPAL
   ========================================================= */
nav.main-nav { width: 100%; }

#nav.main {
    float: right;
    text-align: center;
    font-family: 'Oswald', Arial, sans-serif;
}
ul#nav.main {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}
ul#nav.main li {
    margin: 0;
    flex: 0 1 auto;
    text-align: center;
}
ul#nav.main li a {
    display: block;
    padding: 12px 15px;
    margin: 0 0 0.6em;
    background-color: #EFEFEF;
    color: #444;
    font-family: var(--fuente-titulos);
    font-size: 15px;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    text-shadow: 1px 1px 1px #fff;
    border: 1px solid #ccc;
    border-radius: 7px;
    box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    min-height: 44px;
    align-content: center;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
ul#nav.main li a:hover:not(.active) {
    background-color: var(--color-acento-muy-claro);
    color: #006064;
    border-color: #b2ebf2;
}
ul#nav.main li a.active {
    font-size: 16px;
    color: #ffffff;
    background-color: var(--color-primario);
    border-color: var(--color-primario);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1);
    text-shadow: 1px 1px 1px #333;
    letter-spacing: 1px;
}

/* =========================================================
   ENLACES DE INTERÉS
   ========================================================= */
.enlaces-interes-section {
    background-color: #f4f7fa;
    padding: 60px 20px;
    border-top: 1px solid #eaeaea;
    margin-top: 80px;
    text-align: center;
}
.enlaces-interes-title {
    font-family: var(--fuente-titulos);
    font-size: 20px;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 30px;
    font-weight: bold;
}
.enlaces-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px 30px;
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
}
.enlaces-menu li a {
    display: inline-block;
    color: var(--color-primario);
    font-family: var(--fuente-base);
    font-size: 15px;
    text-decoration: none;
    font-weight: normal;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.2s;
}
.enlaces-menu li a:hover {
    background-color: #edf7ff;
    text-decoration: none;
}

/* =========================================================
   EDICIONES DISPONIBLES
   ========================================================= */
.ediciones-disponibles-section {
    padding: 60px 20px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    text-align: center;
}
.ediciones-container { max-width: 1100px; margin: 0 auto; }
.ediciones-title {
    font-family: var(--fuente-titulos);
    font-size: 24px;
    color: var(--color-primario);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 40px;
    font-weight: bold;
}
.ediciones-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0 30px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.ediciones-menu li { margin-bottom: 10px; }
.ediciones-menu li a {
    color: var(--color-primario);
    font-size: 16px;
    text-decoration: none;
}
.ediciones-menu li a:hover {
    color: var(--color-secundario);
    text-decoration: underline;
}

/* =========================================================
   PIE DE PÁGINA
   ========================================================= */
#footer {
    --marca-agua: clamp(36px, 8.5vw, 150px); /* tamaño de la marca de agua */
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    margin-top: 0;
    padding: 55px 20px 25px;
    border-radius: 10px;
    border-top: none;
    background-color: var(--color-primario);
    color: #ffffff;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    text-align: center;
}

/* Marca de agua: centrada en el pie (horizontal y verticalmente), por debajo del contenido */
#footer::before {
    content: "anunciosjuridicos.es" / "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Oswald', Arial, sans-serif;
    font-size: var(--marca-agua);
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.10);
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

#footer .footer-content {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
#footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
    width: 100%;
}
#footer p {
    margin: 0;
    padding: 10px 0;
    color: #f0f0f0;
    font-size: small;
}
#footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s ease;
    font-weight: bold;
}
#footer a:hover {
    color: #b2ebf2;
    text-decoration: underline;
}
#footer a:focus-visible { outline-color: #ffffff; } /* el azul del foco no se ve sobre el fondo azul del pie */

/* Copyright: separado de la marca de agua */
#footer .footer-company-info {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-top: calc(var(--marca-agua) + 40px); /* hueco para que quepa la marca de agua entera */
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: #f0f0f0;
    font-size: 14px;
    text-align: center;
}
#footer .footer-company-info p {
    position: relative;
    z-index: 3;
    margin: 0;
    color: #d6e0e5; /* Contraste suficiente sobre el fondo azul del pie. */
}

/* Enlace activo (pastilla gris) */
#footer .footer-links a.active,
.enlaces-menu a.active,
.ediciones-container a.active {
    background-color: #546e7a; /* contraste 5,4:1 con el texto blanco */
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    display: inline-block;
}
#footer .footer-links a.active:hover,
.enlaces-menu a.active:hover,
.ediciones-container a.active:hover {
    background-color: #455a64;
    color: #ffffff;
}

/* =========================================================
   RESPONSIVE (de mayor a menor ancho)
   ========================================================= */
@media (max-width: 1200px) {
    .header-bottom-row { flex-direction: column; gap: 25px; }
    .header-tercio-left, .header-tercios-right { width: 100%; }
    ul#nav.main { gap: 15px; }
}
@media (min-width: 1200px) {
    .header-bottom-row { gap: 30px; }
}
@media (max-width: 1199px) {
    header.wrapper { width: 100% !important; padding: 0 10px; }
    .header-bottom-row { align-items: center; }
    .header-tercio-left, .header-tercios-right { padding: 0; }
}
@media (max-width: 960px) {
    #nav.main { float: none; }
}
@media (max-width: 768px) {
    .wrapper { width: 100% !important; padding: 0 10px; box-sizing: border-box; }
    #footer .footer-links { gap: 15px; }
    .ediciones-title { font-size: 20px; margin-bottom: 30px; }
    .ediciones-menu { gap: 10px 20px; }
    .ediciones-menu li a { font-size: 14px; }
    .enlaces-interes-title { font-size: 18px; }
    .enlaces-menu li a { font-size: 14px; }
}
@media (max-width: 720px) {
    body { -webkit-text-size-adjust: 100%; }
    .wrapper { padding: 10px !important; }
    #nav.main a { letter-spacing: 2px; }
}

/* =========================================================
   ACCESIBILIDAD
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .header-image-container:hover img,
    .phone-box-wrapper:hover,
    .phone-box-wrapper:hover .phone-icon {
        transform: none;
    }
}

/* Modos de alto contraste del sistema. */
@media (forced-colors: active) {
    :focus-visible {
        outline: 3px solid CanvasText;
        outline-offset: 3px;
    }
}